#NEWLINE# @ property #NEWLINE# def service( self ) : #NEWLINE# #INDENT# ' Returns a Splunk service object for this command invocation or None.\n\n        The service object is created from the Splunkd URI and authentication\n        token passed to the command invocation in the search results info file.\n        This data is not passed to a command invocation by default. You must\n        request it by specifying this pair of configuration settings in\n        commands.conf:\n\n           .. code-block:: python\n               enableheader=true\n               requires_srinfo=true\n\n        The :code:`enableheader` setting is :code:`true` by default. Hence, you\n        need not set it. The :code:`requires_srinfo` setting is false by\n        default. Hence, you must set it.\n\n        :return: :class:`splunklib.client.Service`, if :code:`enableheader` and\n            :code:`requires_srinfo` are both :code:`true`. Otherwise, if either\n            :code:`enableheader` or :code:`requires_srinfo` are :code:`false`,\n            a value of :code:`None` is returned.\n\n        ' #NEWLINE# if ( self . _service is not None ) : #NEWLINE# #INDENT# return self . _service #NEWLINE# #UNINDENT# info = self . search_results_info #NEWLINE# if ( info is None ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# splunkd = urlsplit ( info . splunkd_uri , info . splunkd_protocol , allow_fragments = False ) #NEWLINE# self . _service = Service ( scheme = splunkd . scheme , host = splunkd . hostname , port = splunkd . port , token = info . auth_token , app = info . ppc_app ) #NEWLINE# return self . _service