Skip to content

list_gateway_cluster_associations async

list_gateway_cluster_associations(
    *,
    config_overrides: Optional[AsyncECSClientConfig] = None,
    gateway: Optional[String] = None,
    cluster: Optional[String] = None,
    status: Optional[GatewayClusterAssociationStatusList] = None,
    max_results: Optional[BoxedInteger] = None,
    next_token: Optional[String] = None,
) -> ListGatewayClusterAssociationsResponse

Returns a list of the associations between gateways and clusters. You can filter the results by gateway, cluster, and status. The results are paginated. We recommend that you use pagination to ensure that the operation returns quickly and successfully.

Parameters:

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

    The name or Amazon Resource Name (ARN) of a gateway to filter the results by.

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

    The name or Amazon Resource Name (ARN) of a cluster to filter the results by.

  • status (Optional[GatewayClusterAssociationStatusList], default: None ) –

    The association status to filter the results by.

  • max_results (Optional[BoxedInteger], default: None ) –

    The maximum number of results that the operation returns in a single page. The default is 100.

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

    The nextToken value returned from a previous paginated request.

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.

  • 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.

  • UnsupportedFeatureException –

    The specified task isn't supported in this Region.

  • UnknownServiceError –

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

Examples:

To list the clusters associated with a gateway This example lists the clusters that are associated with the gateway named my-gateway.

>>> await client.list_gateway_cluster_associations(gateway='my-gateway')
Source code in docs_src/capo_ecs/_services/async_ecs.py
async def list_gateway_cluster_associations(
    self,
    *,
    config_overrides: Optional[AsyncECSClientConfig] = None,
    gateway: Optional["capo_ecs.types.string.String"] = None,
    cluster: Optional["capo_ecs.types.string.String"] = None,
    status: Optional[
        "capo_ecs.types.gateway_cluster_association_status_list.GatewayClusterAssociationStatusList"
    ] = None,
    max_results: Optional["capo_ecs.types.boxed_integer.BoxedInteger"] = None,
    next_token: Optional["capo_ecs.types.string.String"] = None,
) -> "capo_ecs.types.list_gateway_cluster_associations_response.ListGatewayClusterAssociationsResponse":
    """<p>Returns a list of the associations between gateways and clusters. You can filter the results by gateway, cluster, and status. The results are paginated. We recommend that you use pagination to ensure that the operation returns quickly and successfully.</p>

    Args:
        gateway: <p>The name or Amazon Resource Name (ARN) of a gateway to filter the results by.</p>
        cluster: <p>The name or Amazon Resource Name (ARN) of a cluster to filter the results by.</p>
        status: <p>The association status to filter the results by.</p>
        max_results: <p>The maximum number of results that the operation returns in a single page. The default is 100.</p>
        next_token: <p>The <code>nextToken</code> value returned from a previous paginated request.</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.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.unsupported_feature_exception.UnsupportedFeatureException: <p>The specified task isn't supported in this Region.</p>
        capo_ecs.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To list the clusters associated with a gateway
        This example lists the clusters that are associated with the gateway named my-gateway.

        >>> await client.list_gateway_cluster_associations(gateway='my-gateway')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ecs.types.list_gateway_cluster_associations_request.ListGatewayClusterAssociationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ecs.types.list_gateway_cluster_associations_response.ListGatewayClusterAssociationsResponse"
    ]:
        import capo_ecs._operations.amazon_ec2_container_service_v20141113.list_gateway_cluster_associations

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListGatewayClusterAssociations")
    )
    input_: capo_ecs.types.list_gateway_cluster_associations_request.ListGatewayClusterAssociationsRequest = {}
    if gateway is not None:
        input_["gateway"] = gateway
    if cluster is not None:
        input_["cluster"] = cluster
    if status is not None:
        input_["status"] = status
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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