ListContainerGroupDefinitions - Amazon GameLift

ListContainerGroupDefinitions

This operation is used with the Amazon GameLift containers feature, which is currently in public preview.

Retrieves all container group definitions for the AWS account and AWS Region that are currently in use. You can filter the result set by the container groups' scheduling strategy. Use the pagination parameters to retrieve results in a set of sequential pages.

Note

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

Learn more

Request Syntax

{ "Limit": number, "NextToken": "string", "SchedulingStrategy": "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.

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 10.

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.

Required: No

SchedulingStrategy

The type of container group definitions to retrieve.

  • DAEMON -- Daemon container groups run background processes and are deployed once per fleet instance.

  • REPLICA -- Replica container groups run your game server application and supporting software. Replica groups might be deployed multiple times per fleet instance.

Type: String

Valid Values: REPLICA | DAEMON

Required: No

Response Syntax

{ "ContainerGroupDefinitions": [ { "ContainerDefinitions": [ { "Command": [ "string" ], "ContainerName": "string", "Cpu": number, "DependsOn": [ { "Condition": "string", "ContainerName": "string" } ], "EntryPoint": [ "string" ], "Environment": [ { "Name": "string", "Value": "string" } ], "Essential": boolean, "HealthCheck": { "Command": [ "string" ], "Interval": number, "Retries": number, "StartPeriod": number, "Timeout": number }, "ImageUri": "string", "MemoryLimits": { "HardLimit": number, "SoftLimit": number }, "PortConfiguration": { "ContainerPortRanges": [ { "FromPort": number, "Protocol": "string", "ToPort": number } ] }, "ResolvedImageDigest": "string", "WorkingDirectory": "string" } ], "ContainerGroupDefinitionArn": "string", "CreationTime": number, "Name": "string", "OperatingSystem": "string", "SchedulingStrategy": "string", "Status": "string", "StatusReason": "string", "TotalCpuLimit": number, "TotalMemoryLimit": 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.

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

List container group definitions in a Region

This example retrieves all container group definitions with scheduling strategy REPLICA. 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

{ "SchedulingStrategy": "REPLICA", "Limit": 2 }

Sample Response

{ "ContainerGroupDefinitions": [ { "ContainerDefinitions": [ { "ContainerName": "MyAdventureGameContainer", "Essential": TRUE, "ImageUri": "111122223333.dkr.ecr.us-west-2.amazonaws.com/MyAdventureGameContainerImage", "PortConfiguration": { "ContainerPortRanges": [ { "FromPort": 9000, "Protocol": "TCP", "ToPort": 9200 } ] }, "ResolvedImageDigest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" } ], "ContainerGroupDefinitionArn": "arn:aws:gamelift:us-west-2:111122223333:containergroupdefinition/MyAdventureGameContainerGroup", "CreationTime": 1496365885.44, "Name": "MyAdventureGameContainerGroup", "OperatingSystem": "AMAZON_LINUX_2023", "SchedulingStrategy": "REPLICA", "Status": "READY", "TotalCpuLimit": 4096, "TotalMemoryLimit": 1024 }, { "ContainerDefinitions": [ { "ContainerName": "MyPuzzleGameContainer", "Essential": TRUE, "ImageUri": "111122223333.dkr.ecr.us-west-2.amazonaws.com/MyPuzzleGameContainerImage" "PortConfiguration": { "ContainerPortRanges": [ { "FromPort": 1000, "Protocol": "TCP", "ToPort": 2000 } ] }, "ResolvedImageDigest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" } ], "ContainerGroupDefinitionArn": "arn:aws:gamelift:us-west-2:111122223333:containergroupdefinition/MyPuzzleGameContainerGroup", "CreationTime": 1496375088.502, "Name": "MyPuzzleGameContainerGroup", "OperatingSystem": "AMAZON_LINUX_2023", "SchedulingStrategy": "REPLICA", "Status": "COPYING", "TotalCpuLimit": 512, "TotalMemoryLimit": 256 } ], "NextToken": "eyJhd3NBY2NvdW50SWQiOnsicyI6IjMwMjc3NjAxNjM5OCJ9LCJidWlsZElkIjp7InMiOiJidWlsZC01NWYxZTZmMS1jY2FlLTQ3YTctOWI5ZS1iYjFkYTQwMjEXAMPLE1" }

See Also

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