ListContainerFleets - Amazon GameLift

ListContainerFleets

Retrieves a collection of container fleet resources in an AWS 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 Realtime Servers 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.

Note

Fleet IDs are returned in no particular order.

Request Syntax

{ "ContainerGroupDefinitionName": "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.

ContainerGroupDefinitionName

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.

Type: String

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

Pattern: ^[a-zA-Z0-9\-]+$|^arn:.*:containergroupdefinition\/[a-zA-Z0-9\-]+(:[0-9]+)?$

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.

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

{ "ContainerFleets": [ { "BillingType": "string", "CreationTime": number, "DeploymentDetails": { "LatestDeploymentId": "string" }, "Description": "string", "FleetArn": "string", "FleetId": "string", "FleetRoleArn": "string", "GameServerContainerGroupDefinitionArn": "string", "GameServerContainerGroupDefinitionName": "string", "GameServerContainerGroupsPerInstance": number, "GameSessionCreationLimitPolicy": { "NewGameSessionsPerCreator": number, "PolicyPeriodInMinutes": number }, "InstanceConnectionPortRange": { "FromPort": number, "ToPort": number }, "InstanceInboundPermissions": [ { "FromPort": number, "IpRange": "string", "Protocol": "string", "ToPort": number } ], "InstanceType": "string", "LocationAttributes": [ { "Location": "string", "Status": "string" } ], "LogConfiguration": { "LogDestination": "string", "LogGroupArn": "string", "S3BucketName": "string" }, "MaximumGameServerContainerGroupsPerInstance": number, "MetricGroups": [ "string" ], "NewGameSessionProtectionPolicy": "string", "PerInstanceContainerGroupDefinitionArn": "string", "PerInstanceContainerGroupDefinitionName": "string", "Status": "string" } ], "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.

ContainerFleets

A collection of container fleet objects for all fleets that match the request criteria.

Type: Array of ContainerFleet objects

Array Members: Minimum number of 1 item.

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

List container fleets with a container group definition

This example retrieves the properties of all fleets with a specified container group definition. Because the request uses the definition name, it returns fleets that are deployed with the latest version of the container group definition. The request uses the pagination parameters to retrieve one fleet at a time. The example 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

{ "ContainerGroupDefinitionName": "MyAdventureGameContainerGroup", "Limit": 1, "NextToken": "eyJhd3NBY2NvdW50SWQiOnsicyI6IjMwMjc3NjAxNjM5OCJ9LCJidWlsZElkIjp7InMiOiJidWlsZC01NWYxZTZmMS1jY2FlLTQ3YTctOWI5ZS1iYjFkYTQwMjEXAMPLE1" }

Sample Response

{ "ContainerFleets": [ { "BillingType": ON_DEMAND, "CreationTime": 1736365885.22, "DeploymentDetails": { "LatestDeploymentId": "deployment-2222bbbb-33cc-44dd-55ee-6666ffff77aa" }, "FleetArn": "arn:aws:gamelift:us-west-2::containerfleet/containerfleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa", "FleetId": "containerfleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa", "FleetRoleArn": "arn:aws:iam::MyAccount:role/MyRole", "GameServerContainerGroupDefinitionArn": "arn:aws:gamelift:us-west-2:111122223333:containergroupdefinition/MyAdventureGameContainerGroup:2", "GameServerContainerGroupDefinitionName": "MyAdventureGameContainerGroup", "GameServerContainerGroupsPerInstance": number, "InstanceConnectionPortRange": { "FromPort": 4192, "ToPort": 4242 }, "InstanceInboundPermissions": [ { "FromPort": 4192, "IpRange": "string", "Protocol": "UDP", "ToPort": 4242, } ], "InstanceType": "c5.large", "LogConfiguration": { "LogGroupArn": "arn:aws:logs:us-west-2:111222333444:log-group:customerLogs", "LogDestination": "CLOUDWATCH" }, "MaximumGameServerContainerGroupsPerInstance": 10, "NewGameSessionProtectionPolicy": "NoProtection", "Status": "PENDING" } ], "NextToken": "eyJhd3NBY2NvdW50SWQiOnsicyI6IjMwMjc3NjAxNjM5OCJ9LCJidWlsZElkIjp7InMiOiJidWlsZC01NWYxZTZmMS1jY2FlLTQ3YTctOWI5ZS1iYjFkYTQwMjEXAMPLE2" }

See Also

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