This API works with the following fleet types: Container
Retrieves container group definitions for the Amazon Web Services account and Amazon Web Services Region. Use the pagination parameters to retrieve results in a set of sequential pages.
This operation returns only the latest version of each definition. To retrieve all versions of a container group definition, use ListContainerGroupDefinitionVersions.
Request options:
-
Retrieve the most recent versions of all container group definitions.
-
Retrieve the most recent versions of all container group definitions, filtered by type. Specify the container group type to filter on.
Results:
If successful, this operation returns the complete properties of a set of container group definition versions that match the request.
This operation returns the list of container group definitions in no particular order.
Parameters:
-
container_group_type
(Optional[ContainerGroupType], default:
None
)
–
The type of container group to retrieve. Container group type determines how Amazon GameLift Servers deploys the container group on each fleet instance.
-
limit
(Optional[ListContainerGroupDefinitionsLimit], 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/game_lift.py
| def list_container_group_definitions(
self,
*,
config_overrides: Optional[GameLiftClientConfig] = None,
container_group_type: Optional[
"capo_gamelift.types.container_group_type.ContainerGroupType"
] = None,
limit: Optional[
"capo_gamelift.types.list_container_group_definitions_limit.ListContainerGroupDefinitionsLimit"
] = None,
next_token: Optional[
"capo_gamelift.types.non_zero_and_max_string.NonZeroAndMaxString"
] = None,
) -> "capo_gamelift.types.list_container_group_definitions_output.ListContainerGroupDefinitionsOutput":
"""<p> <b>This API works with the following fleet types:</b> Container</p> <p>Retrieves container group definitions for the Amazon Web Services account and Amazon Web Services Region. Use the pagination parameters to retrieve results in a set of sequential pages.</p> <p>This operation returns only the latest version of each definition. To retrieve all versions of a container group definition, use <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListContainerGroupDefinitionVersions.html">ListContainerGroupDefinitionVersions</a>.</p> <p> <b>Request options:</b> </p> <ul> <li> <p>Retrieve the most recent versions of all container group definitions. </p> </li> <li> <p>Retrieve the most recent versions of all container group definitions, filtered by type. Specify the container group type to filter on. </p> </li> </ul> <p> <b>Results:</b> </p> <p>If successful, this operation returns the complete properties of a set of container group definition versions that match the request.</p> <note> <p>This operation returns the list of container group definitions in no particular order. </p> </note>
Args:
container_group_type: <p>The type of container group to retrieve. Container group type determines how Amazon GameLift Servers deploys the container group on each fleet instance.</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.
"""
def _handler(
req: "OperationRequest[capo_gamelift.types.list_container_group_definitions_input.ListContainerGroupDefinitionsInput]",
) -> OperationResponse[
"capo_gamelift.types.list_container_group_definitions_output.ListContainerGroupDefinitionsOutput"
]:
import capo_gamelift._operations.game_lift.list_container_group_definitions
output, http_response = (
capo_gamelift._operations.game_lift.list_container_group_definitions.list_container_group_definitions(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_gamelift.types.list_container_group_definitions_output.ListContainerGroupDefinitionsOutput",
) -> dict[str, Any]:
import capo_gamelift.types.list_container_group_definitions_output
return capo_gamelift.types.list_container_group_definitions_output.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging(
"ListContainerGroupDefinitions", redact_output=_redact_output
),
)
input_: capo_gamelift.types.list_container_group_definitions_input.ListContainerGroupDefinitionsInput = {}
if container_group_type is not None:
input_["container_group_type"] = container_group_type
if limit is not None:
input_["limit"] = limit
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
|