listContainerGroupDefinitions method

Future<ListContainerGroupDefinitionsOutput> listContainerGroupDefinitions({
  1. ContainerGroupType? containerGroupType,
  2. int? limit,
  3. String? nextToken,
})

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.

May throw InternalServiceException. May throw InvalidRequestException. May throw UnauthorizedException. May throw UnsupportedRegionException.

Parameter containerGroupType : The type of container group to retrieve. Container group type determines how Amazon GameLift Servers deploys the container group on each fleet instance.

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

Parameter nextToken : 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.

Implementation

Future<ListContainerGroupDefinitionsOutput> listContainerGroupDefinitions({
  ContainerGroupType? containerGroupType,
  int? limit,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'limit',
    limit,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GameLift.ListContainerGroupDefinitions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (containerGroupType != null)
        'ContainerGroupType': containerGroupType.value,
      if (limit != null) 'Limit': limit,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListContainerGroupDefinitionsOutput.fromJson(jsonResponse.body);
}