Skip to content

list_container_fleets async

list_container_fleets(
    *,
    config_overrides: Optional[AsyncGameLiftClientConfig] = None,
    container_group_definition_name: Optional[ContainerGroupDefinitionNameOrArn] = None,
    limit: Optional[PositiveInteger] = None,
    next_token: Optional[NonZeroAndMaxString] = None,
) -> ListContainerFleetsOutput

This API works with the following fleet types: Container

Retrieves a collection of container fleet resources in an Amazon Web Services Region. For fleets that have multiple locations, this operation retrieves fleets based on their home Region only.

Request options

  • Get a list of all fleets. Call this operation without specifying a container group definition.

  • Get a list of fleets filtered by container group definition. Provide the container group definition name or ARN value.

  • To get a list of all Amazon GameLift Servers Realtime fleets with a specific configuration script, provide the script ID.

Use the pagination parameters to retrieve results as a set of sequential pages.

If successful, this operation returns a collection of container fleets that match the request parameters. A NextToken value is also returned if there are more result pages to retrieve.

Fleet IDs are returned in no particular order.

Parameters:

  • container_group_definition_name (Optional[ContainerGroupDefinitionNameOrArn], default: None ) –

    The container group definition to filter the list on. Use this parameter to retrieve only those fleets that use the specified container group definition. You can specify the container group definition's name to get fleets with the latest versions. Alternatively, provide an ARN value to get fleets with a specific version number.

  • limit (Optional[PositiveInteger], default: None ) –

    The maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.

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

    A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.

Raises:

  • InternalServiceException –

    The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.

  • InvalidRequestException –

    One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.

  • UnauthorizedException –

    The client failed authentication. Clients should not retry such requests.

  • UnsupportedRegionException –

    The requested operation is not supported in the Region specified.

  • UnknownServiceError –

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

Source code in docs_src/capo_gamelift/_services/async_game_lift.py
async def list_container_fleets(
    self,
    *,
    config_overrides: Optional[AsyncGameLiftClientConfig] = None,
    container_group_definition_name: Optional[
        "capo_gamelift.types.container_group_definition_name_or_arn.ContainerGroupDefinitionNameOrArn"
    ] = None,
    limit: Optional["capo_gamelift.types.positive_integer.PositiveInteger"] = None,
    next_token: Optional[
        "capo_gamelift.types.non_zero_and_max_string.NonZeroAndMaxString"
    ] = None,
) -> "capo_gamelift.types.list_container_fleets_output.ListContainerFleetsOutput":
    """<p> <b>This API works with the following fleet types:</b> Container</p> <p>Retrieves a collection of container fleet resources in an Amazon Web Services Region. For fleets that have multiple locations, this operation retrieves fleets based on their home Region only.</p> <p> <b>Request options</b> </p> <ul> <li> <p>Get a list of all fleets. Call this operation without specifying a container group definition. </p> </li> <li> <p>Get a list of fleets filtered by container group definition. Provide the container group definition name or ARN value.</p> </li> <li> <p>To get a list of all Amazon GameLift Servers Realtime fleets with a specific configuration script, provide the script ID. </p> </li> </ul> <p>Use the pagination parameters to retrieve results as a set of sequential pages. </p> <p>If successful, this operation returns a collection of container fleets that match the request parameters. A NextToken value is also returned if there are more result pages to retrieve.</p> <note> <p>Fleet IDs are returned in no particular order.</p> </note>

    Args:
        container_group_definition_name: <p>The container group definition to filter the list on. Use this parameter to retrieve only those fleets that use the specified container group definition. You can specify the container group definition's name to get fleets with the latest versions. Alternatively, provide an ARN value to get fleets with a specific version number.</p>
        limit: <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages.</p>
        next_token: <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.</p>

    Raises:
        capo_gamelift.errors.internal_service_exception.InternalServiceException: <p>The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.</p>
        capo_gamelift.errors.invalid_request_exception.InvalidRequestException: <p>One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.</p>
        capo_gamelift.errors.unauthorized_exception.UnauthorizedException: <p>The client failed authentication. Clients should not retry such requests.</p>
        capo_gamelift.errors.unsupported_region_exception.UnsupportedRegionException: <p>The requested operation is not supported in the Region specified.</p>
        capo_gamelift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_gamelift.types.list_container_fleets_input.ListContainerFleetsInput]",
    ) -> AsyncOperationResponse[
        "capo_gamelift.types.list_container_fleets_output.ListContainerFleetsOutput"
    ]:
        import capo_gamelift._operations.game_lift.list_container_fleets

        (
            output,
            http_response,
        ) = await capo_gamelift._operations.game_lift.list_container_fleets.async_list_container_fleets(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_gamelift.types.list_container_fleets_output.ListContainerFleetsOutput",
    ) -> dict[str, Any]:
        import capo_gamelift.types.list_container_fleets_output

        return capo_gamelift.types.list_container_fleets_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListContainerFleets", redact_output=_redact_output),
    )
    input_: capo_gamelift.types.list_container_fleets_input.ListContainerFleetsInput = {}
    if container_group_definition_name is not None:
        input_["container_group_definition_name"] = container_group_definition_name
    if limit is not None:
        input_["limit"] = limit
    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