Skip to content

list_gateway_routes async

list_gateway_routes(
    *,
    config_overrides: Optional[AsyncECSClientConfig] = None,
    gateway: Optional[String] = None,
    cluster: Optional[String] = None,
    service: Optional[String] = None,
    service_container_port_name: Optional[String] = None,
    status: Optional[GatewayRouteStatusList] = None,
    max_results: Optional[BoxedInteger] = None,
    next_token: Optional[String] = None,
) -> ListGatewayRoutesResponse

Returns a list of gateway routes. A gateway route represents the association between a service and a gateway and the service-specific infrastructure the gateway manages for it. You can filter the results by gateway, cluster, service, container port name, 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.

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

    The name or Amazon Resource Name (ARN) of a service to filter the results by. Because services can span clusters, a service name isn't necessarily unique and can match multiple services.

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

    The name of a task definition container port to filter the results by.

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

    The gateway route 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.

  • GatewayNotFoundException –

    The specified gateway wasn't found. Check that the gateway name or ARN is correct and that the gateway exists in your account and Region.

  • 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 gateway routes for a gateway This example lists the gateway routes for the gateway named my-gateway in the cluster named my-cluster.

>>> await client.list_gateway_routes(gateway='my-gateway', cluster='my-cluster')
Source code in docs_src/capo_ecs/_services/async_ecs.py
async def list_gateway_routes(
    self,
    *,
    config_overrides: Optional[AsyncECSClientConfig] = None,
    gateway: Optional["capo_ecs.types.string.String"] = None,
    cluster: Optional["capo_ecs.types.string.String"] = None,
    service: Optional["capo_ecs.types.string.String"] = None,
    service_container_port_name: Optional["capo_ecs.types.string.String"] = None,
    status: Optional[
        "capo_ecs.types.gateway_route_status_list.GatewayRouteStatusList"
    ] = 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_routes_response.ListGatewayRoutesResponse":
    """<p>Returns a list of gateway routes. A gateway route represents the association between a service and a gateway and the service-specific infrastructure the gateway manages for it. You can filter the results by gateway, cluster, service, container port name, 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>
        service: <p>The name or Amazon Resource Name (ARN) of a service to filter the results by. Because services can span clusters, a service name isn't necessarily unique and can match multiple services.</p>
        service_container_port_name: <p>The name of a task definition container port to filter the results by.</p>
        status: <p>The gateway route 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.gateway_not_found_exception.GatewayNotFoundException: <p>The specified gateway wasn't found. Check that the gateway name or ARN is correct and that the gateway exists in your account and Region.</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 gateway routes for a gateway
        This example lists the gateway routes for the gateway named my-gateway in the cluster named my-cluster.

        >>> await client.list_gateway_routes(gateway='my-gateway', cluster='my-cluster')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ecs.types.list_gateway_routes_request.ListGatewayRoutesRequest]",
    ) -> AsyncOperationResponse[
        "capo_ecs.types.list_gateway_routes_response.ListGatewayRoutesResponse"
    ]:
        import capo_ecs._operations.amazon_ec2_container_service_v20141113.list_gateway_routes

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListGatewayRoutes")
    )
    input_: capo_ecs.types.list_gateway_routes_request.ListGatewayRoutesRequest = {}
    if gateway is not None:
        input_["gateway"] = gateway
    if cluster is not None:
        input_["cluster"] = cluster
    if service is not None:
        input_["service"] = service
    if service_container_port_name is not None:
        input_["service_container_port_name"] = service_container_port_name
    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