Skip to content

describe_services async

describe_services(
    services: StringList,
    *,
    config_overrides: Optional[AsyncECSClientConfig] = None,
    cluster: Optional[String] = None,
    include: Optional[ServiceFieldList] = None,
) -> DescribeServicesResponse

Describes the specified services running in your cluster.

Parameters:

  • cluster (Optional[String], default: None ) –

    The short name or full Amazon Resource Name (ARN)the cluster that hosts the service to describe. If you do not specify a cluster, the default cluster is assumed. This parameter is required if the service or services you are describing were launched in any cluster other than the default cluster.

  • services (StringList) –

    A list of services to describe. You may specify up to 10 services to describe in a single operation.

  • include (Optional[ServiceFieldList], default: None ) –

    Determines whether you want to see the resource tags for the service. If TAGS is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.

Raises:

  • AccessDeniedException –

    You don't have authorization to perform the requested action.

  • ClientException –

    These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.

  • ClusterNotFoundException –

    The specified cluster wasn't found. You can view your available clusters with ListClusters. Amazon ECS clusters are Region specific.

  • InvalidParameterException –

    The specified parameter isn't valid. Review the available parameters for the API request.

    For more information about service event errors, see Amazon ECS service event messages.

  • ServerException –

    These errors are usually caused by a server issue.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To describe a service This example provides descriptive information about the service named ecs-simple-service.

>>> await client.describe_services(services=['ecs-simple-service'])
To describe a service with a pause lifecycle hook
This example provides descriptive information about the service ``ecs-service-with-pause-hook``, which is configured with a pause lifecycle hook in its deployment configuration.
>>> await client.describe_services(services=['ecs-service-with-pause-hook'])
Source code in docs_src/capo_ecs/_services/async_ecs.py
async def describe_services(
    self,
    services: "capo_ecs.types.string_list.StringList",
    *,
    config_overrides: Optional[AsyncECSClientConfig] = None,
    cluster: Optional["capo_ecs.types.string.String"] = None,
    include: Optional["capo_ecs.types.service_field_list.ServiceFieldList"] = None,
) -> "capo_ecs.types.describe_services_response.DescribeServicesResponse":
    """<p>Describes the specified services running in your cluster.</p>

    Args:
        cluster: <p>The short name or full Amazon Resource Name (ARN)the cluster that hosts the service to describe. If you do not specify a cluster, the default cluster is assumed. This parameter is required if the service or services you are describing were launched in any cluster other than the default cluster.</p>
        services: <p>A list of services to describe. You may specify up to 10 services to describe in a single operation.</p>
        include: <p>Determines whether you want to see the resource tags for the service. If <code>TAGS</code> is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.</p>

    Raises:
        capo_ecs.errors.access_denied_exception.AccessDeniedException: <p>You don't have authorization to perform the requested action.</p>
        capo_ecs.errors.client_exception.ClientException: <p>These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.</p>
        capo_ecs.errors.cluster_not_found_exception.ClusterNotFoundException: <p>The specified cluster wasn't found. You can view your available clusters with <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListClusters.html">ListClusters</a>. Amazon ECS clusters are Region specific.</p>
        capo_ecs.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter isn't valid. Review the available parameters for the API request.</p> <p>For more information about service event errors, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-event-messages-list.html">Amazon ECS service event messages</a>. </p>
        capo_ecs.errors.server_exception.ServerException: <p>These errors are usually caused by a server issue.</p>
        capo_ecs.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe a service
        This example provides descriptive information about the service named ``ecs-simple-service``.

        >>> await client.describe_services(services=['ecs-simple-service'])
        To describe a service with a pause lifecycle hook
        This example provides descriptive information about the service ``ecs-service-with-pause-hook``, which is configured with a pause lifecycle hook in its deployment configuration.

        >>> await client.describe_services(services=['ecs-service-with-pause-hook'])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ecs.types.describe_services_request.DescribeServicesRequest]",
    ) -> AsyncOperationResponse[
        "capo_ecs.types.describe_services_response.DescribeServicesResponse"
    ]:
        import capo_ecs._operations.amazon_ec2_container_service_v20141113.describe_services

        (
            output,
            http_response,
        ) = await capo_ecs._operations.amazon_ec2_container_service_v20141113.describe_services.async_describe_services(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeServices")
    )
    input_: capo_ecs.types.describe_services_request.DescribeServicesRequest = {
        "services": services
    }
    if cluster is not None:
        input_["cluster"] = cluster
    if include is not None:
        input_["include"] = include

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