ListContainerGroupDefinitions - Amazon GameLift

ListContainerGroupDefinitions

Retrieves container group definitions for the AWS account and AWS 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.

Note

This operation returns the list of container group definitions in no particular order.

Request Syntax

{ "ContainerGroupType": "string", "Limit": number, "NextToken": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Note

In the following list, the required parameters are described first.

ContainerGroupType

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

Type: String

Valid Values: GAME_SERVER | PER_INSTANCE

Required: No

Limit

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

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 100.

Required: No

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.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1024.

Required: No

Response Syntax

{ "ContainerGroupDefinitions": [ { "ContainerGroupDefinitionArn": "string", "ContainerGroupType": "string", "CreationTime": number, "GameServerContainerDefinition": { "ContainerName": "string", "DependsOn": [ { "Condition": "string", "ContainerName": "string" } ], "EnvironmentOverride": [ { "Name": "string", "Value": "string" } ], "ImageUri": "string", "MountPoints": [ { "AccessLevel": "string", "ContainerPath": "string", "InstancePath": "string" } ], "PortConfiguration": { "ContainerPortRanges": [ { "FromPort": number, "Protocol": "string", "ToPort": number } ] }, "ResolvedImageDigest": "string", "ServerSdkVersion": "string" }, "Name": "string", "OperatingSystem": "string", "Status": "string", "StatusReason": "string", "SupportContainerDefinitions": [ { "ContainerName": "string", "DependsOn": [ { "Condition": "string", "ContainerName": "string" } ], "EnvironmentOverride": [ { "Name": "string", "Value": "string" } ], "Essential": boolean, "HealthCheck": { "Command": [ "string" ], "Interval": number, "Retries": number, "StartPeriod": number, "Timeout": number }, "ImageUri": "string", "MemoryHardLimitMebibytes": number, "MountPoints": [ { "AccessLevel": "string", "ContainerPath": "string", "InstancePath": "string" } ], "PortConfiguration": { "ContainerPortRanges": [ { "FromPort": number, "Protocol": "string", "ToPort": number } ] }, "ResolvedImageDigest": "string", "Vcpu": number } ], "TotalMemoryLimitMebibytes": number, "TotalVcpuLimit": number, "VersionDescription": "string", "VersionNumber": number } ], "NextToken": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ContainerGroupDefinitions

A result set of container group definitions that match the request.

Type: Array of ContainerGroupDefinition objects

NextToken

A token that indicates where to resume retrieving results on the next call to this operation. If no token is returned, these results represent the end of the list.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1024.

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServiceException

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

HTTP Status Code: 500

InvalidRequestException

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

HTTP Status Code: 400

UnauthorizedException

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

HTTP Status Code: 400

UnsupportedRegionException

The requested operation is not supported in the Region specified.

HTTP Status Code: 400

Examples

Retrieve all game server container group definitions

This example retrieves all container group definitions of type GAME_SERVER. It uses the pagination parameters to retrieve two definitions at a time. The response includes a NextToken, which indicates that there are still more results to retrieve.

HTTP requests are authenticated using an AWS Signature Version 4 signature in the Authorization header field.

Sample Request

{ "ContainerGroupType": "GAME_SERVER", "Limit": 2 }

Sample Response

{ "ContainerGroupDefinitions": [ { "ContainerGroupDefinitionArn": "arn:aws:gamelift:us-west-2:111122223333:containergroupdefinition/MyAdventureGameContainerGroup:3", "ContainerGroupType": "GAME_SERVER", "CreationTime": 1496365885.44, "GameServerContainerDefinition": { "ContainerName": "MyAdventureGameContainer", "ImageUri": "111122223333.dkr.ecr.us-west-2.amazonaws.com/MyAdventureGameContainerImage", "PortConfiguration": { "ContainerPortRanges": [ { "FromPort": 35000, "Protocol": "TCP", "ToPort": 40000 } ] }, "ResolvedImageDigest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "ServerSdkVersion": "5.2.0" } "Name": "MyAdventureGameContainerGroup", "OperatingSystem": "AMAZON_LINUX_2023", "Status": "READY", "TotalMemoryLimitMebibytes": 1024, "TotalVcpuLimit": 1, "VersionNumber": "3" }, { "ContainerGroupDefinitionArn": "arn:aws:gamelift:us-west-2:111122223333:containergroupdefinition/MyRPGGameContainerGroup:1", "ContainerGroupType": "GAME_SERVER", "CreationTime": 1496365892.11, "GameServerContainerDefinition": { "ContainerName": "MyRPGGameContainer", "ImageUri": "111122223333.dkr.ecr.us-west-2.amazonaws.com/MyRPGGameContainerImage", "PortConfiguration": { "ContainerPortRanges": [ { "FromPort": 35000, "Protocol": "TCP", "ToPort": 40000 } ] }, "ResolvedImageDigest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "ServerSdkVersion": "5.2.0" } "Name": "MyRPGGameContainerGroup", "OperatingSystem": "AMAZON_LINUX_2023", "Status": "COPYING", "TotalMemoryLimitMebibytes": 1024, "TotalVcpuLimit": 1, "VersionNumber": "1" }, ], "NextToken": "eyJhd3NBY2NvdW50SWQiOnsicyI6IjMwMjc3NjAxNjM5OCJ9LCJidWlsZElkIjp7InMiOiJidWlsZC01NWYxZTZmMS1jY2FlLTQ3YTctOWI5ZS1iYjFkYTQwMjEXAMPLE1" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: