Skip to content

get_service async

get_service(
    start_time: datetime,
    end_time: datetime,
    key_attributes: Attributes,
    *,
    config_overrides: Optional[AsyncApplicationSignalsClientConfig] = None,
) -> GetServiceOutput

Returns information about a service discovered by Application Signals.

Parameters:

  • start_time (datetime) –

    The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: 1698778057

    Your requested start time will be rounded to the nearest hour.

  • end_time (datetime) –

    The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: 1698778057

    Your requested start time will be rounded to the nearest hour.

  • key_attributes (Attributes) –

    Use this field to specify which service you want to retrieve information for. You must specify at least the Type, Name, and Environment attributes.

    This is a string-to-string map. It can include the following fields.

    • Type designates the type of object this is.

    • ResourceType specifies the type of the resource. This field is used only when the value of the Type field is Resource or AWS::Resource.

    • Name specifies the name of the object. This is used only if the value of the Type field is Service, RemoteService, or AWS::Service.

    • Identifier identifies the resource objects of this resource. This is used only if the value of the Type field is Resource or AWS::Resource.

    • Environment specifies the location where this object is hosted, or what it belongs to.

Raises:

Source code in docs_src/capo_application_signals/_services/async_application_signals.py
async def get_service(
    self,
    start_time: datetime.datetime,
    end_time: datetime.datetime,
    key_attributes: "capo_application_signals.types.attributes.Attributes",
    *,
    config_overrides: Optional[AsyncApplicationSignalsClientConfig] = None,
) -> "capo_application_signals.types.get_service_output.GetServiceOutput":
    """<p>Returns information about a service discovered by Application Signals.</p>

    Args:
        start_time: <p>The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code> </p> <p>Your requested start time will be rounded to the nearest hour.</p>
        end_time: <p>The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code> </p> <p>Your requested start time will be rounded to the nearest hour.</p>
        key_attributes: <p>Use this field to specify which service you want to retrieve information for. You must specify at least the <code>Type</code>, <code>Name</code>, and <code>Environment</code> attributes.</p> <p>This is a string-to-string map. It can include the following fields.</p> <ul> <li> <p> <code>Type</code> designates the type of object this is.</p> </li> <li> <p> <code>ResourceType</code> specifies the type of the resource. This field is used only when the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p> </li> <li> <p> <code>Name</code> specifies the name of the object. This is used only if the value of the <code>Type</code> field is <code>Service</code>, <code>RemoteService</code>, or <code>AWS::Service</code>.</p> </li> <li> <p> <code>Identifier</code> identifies the resource objects of this resource. This is used only if the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p> </li> <li> <p> <code>Environment</code> specifies the location where this object is hosted, or what it belongs to.</p> </li> </ul>

    Raises:
        capo_application_signals.errors.throttling_exception.ThrottlingException: <p>The request was throttled because of quota limits.</p>
        capo_application_signals.errors.validation_exception.ValidationException: <p>The resource is not valid.</p>
        capo_application_signals.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_application_signals.types.get_service_input.GetServiceInput]",
    ) -> AsyncOperationResponse[
        "capo_application_signals.types.get_service_output.GetServiceOutput"
    ]:
        import capo_application_signals._operations.application_signals.get_service

        (
            output,
            http_response,
        ) = await capo_application_signals._operations.application_signals.get_service.async_get_service(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetService")
    )
    input_: capo_application_signals.types.get_service_input.GetServiceInput = {
        "start_time": start_time,
        "end_time": end_time,
        "key_attributes": key_attributes,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output