Skip to content

list_gateways

list_gateways(
    *,
    config_overrides: Optional[ECSClientConfig] = None,
    names: Optional[StringList] = None,
    status: Optional[GatewayStatusList] = None,
    max_results: Optional[BoxedInteger] = None,
    next_token: Optional[String] = None,
) -> ListGatewaysResponse

Returns a list of gateways in your account. You can filter the results by gateway name and status. The results are paginated. We recommend that you use pagination to ensure that the operation returns quickly and successfully.

Parameters:

  • names (Optional[StringList], default: None ) –

    The gateway names to filter the results by. You can specify up to 10 names.

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

    The gateway statuses to filter the results by.

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

    The maximum number of gateway results that ListGateways returns in a single page. The default is 100.

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

    The nextToken value returned from a previous paginated ListGateways request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results.

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 active gateways This example lists the gateways in your account that have a status of ACTIVE.

>>> client.list_gateways(status=['ACTIVE'])
Source code in docs_src/capo_ecs/_services/ecs.py
def list_gateways(
    self,
    *,
    config_overrides: Optional[ECSClientConfig] = None,
    names: Optional["capo_ecs.types.string_list.StringList"] = None,
    status: Optional["capo_ecs.types.gateway_status_list.GatewayStatusList"] = None,
    max_results: Optional["capo_ecs.types.boxed_integer.BoxedInteger"] = None,
    next_token: Optional["capo_ecs.types.string.String"] = None,
) -> "capo_ecs.types.list_gateways_response.ListGatewaysResponse":
    """<p>Returns a list of gateways in your account. You can filter the results by gateway name and status. The results are paginated. We recommend that you use pagination to ensure that the operation returns quickly and successfully.</p>

    Args:
        names: <p>The gateway names to filter the results by. You can specify up to 10 names.</p>
        status: <p>The gateway statuses to filter the results by.</p>
        max_results: <p>The maximum number of gateway results that <code>ListGateways</code> returns in a single page. The default is 100.</p>
        next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>ListGateways</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results.</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 active gateways
        This example lists the gateways in your account that have a status of ACTIVE.

        >>> client.list_gateways(status=['ACTIVE'])
    """

    def _handler(
        req: "OperationRequest[capo_ecs.types.list_gateways_request.ListGatewaysRequest]",
    ) -> OperationResponse[
        "capo_ecs.types.list_gateways_response.ListGatewaysResponse"
    ]:
        import capo_ecs._operations.amazon_ec2_container_service_v20141113.list_gateways

        output, http_response = (
            capo_ecs._operations.amazon_ec2_container_service_v20141113.list_gateways.list_gateways(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListGateways")
    )
    input_: capo_ecs.types.list_gateways_request.ListGatewaysRequest = {}
    if names is not None:
        input_["names"] = names
    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 = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output