updateContainerGroupDefinition method
- required String name,
- GameServerContainerDefinitionInput? gameServerContainerDefinition,
- ContainerOperatingSystem? operatingSystem,
- int? sourceVersionNumber,
- List<
SupportContainerDefinitionInput> ? supportContainerDefinitions, - int? totalMemoryLimitMebibytes,
- double? totalVcpuLimit,
- String? versionDescription,
This API works with the following fleet types: Container
Updates properties in an existing container group definition. This operation doesn't replace the definition. Instead, it creates a new version of the definition and saves it separately. You can access all versions that you choose to retain.
The only property you can't update is the container group type.
Request options:
- Update based on the latest version of the container group definition. Specify the container group definition name only, or use an ARN value without a version number. Provide updated values for the properties that you want to change only. All other values remain the same as the latest version.
- Update based on a specific version of the container group definition. Specify the container group definition name and a source version number, or use an ARN value with a version number. Provide updated values for the properties that you want to change only. All other values remain the same as the source version.
- Change a game server container definition. Provide the updated container definition.
- Add or change a support container definition. Provide a complete set of container definitions, including the updated definition.
- Remove a support container definition. Provide a complete set of container definitions, excluding the definition to remove. If the container group has only one support container definition, provide an empty set.
If successful, this operation returns the complete properties of the new container group definition version.
If the container group definition version is used in an active fleets, the update automatically initiates a new fleet deployment of the new version. You can track a fleet's deployments using ListFleetDeployments.
May throw InternalServiceException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw NotFoundException.
May throw UnauthorizedException.
May throw UnsupportedRegionException.
Parameter name :
A descriptive identifier for the container group definition. The name
value must be unique in an Amazon Web Services Region.
Parameter gameServerContainerDefinition :
An updated definition for the game server container in this group. Define
a game server container only when the container group type is
GAME_SERVER. You can pass in your container definitions as a
JSON file.
Parameter operatingSystem :
The platform that all containers in the group use. Containers in a group
must run on the same operating system.
Parameter sourceVersionNumber :
The container group definition version to update. The new version starts
with values from the source version, and then updates values included in
this request.
Parameter supportContainerDefinitions :
One or more definitions for support containers in this group. You can
define a support container in any type of container group. You can pass in
your container definitions as a JSON file.
Parameter totalMemoryLimitMebibytes :
The maximum amount of memory (in MiB) to allocate to the container group.
All containers in the group share this memory. If you specify memory
limits for an individual container, the total value must be greater than
any individual container's memory limit.
Parameter totalVcpuLimit :
The maximum amount of vCPU units to allocate to the container group (1
vCPU is equal to 1024 CPU units). All containers in the group share this
memory. If you specify vCPU limits for individual containers, the total
value must be equal to or greater than the sum of the CPU limits for all
containers in the group.
Parameter versionDescription :
A description for this update to the container group definition.
Implementation
Future<UpdateContainerGroupDefinitionOutput> updateContainerGroupDefinition({
required String name,
GameServerContainerDefinitionInput? gameServerContainerDefinition,
ContainerOperatingSystem? operatingSystem,
int? sourceVersionNumber,
List<SupportContainerDefinitionInput>? supportContainerDefinitions,
int? totalMemoryLimitMebibytes,
double? totalVcpuLimit,
String? versionDescription,
}) async {
_s.validateNumRange(
'sourceVersionNumber',
sourceVersionNumber,
1,
1152921504606846976,
);
_s.validateNumRange(
'totalMemoryLimitMebibytes',
totalMemoryLimitMebibytes,
4,
1024000,
);
_s.validateNumRange(
'totalVcpuLimit',
totalVcpuLimit,
0.125,
10,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'GameLift.UpdateContainerGroupDefinition'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Name': name,
if (gameServerContainerDefinition != null)
'GameServerContainerDefinition': gameServerContainerDefinition,
if (operatingSystem != null) 'OperatingSystem': operatingSystem.value,
if (sourceVersionNumber != null)
'SourceVersionNumber': sourceVersionNumber,
if (supportContainerDefinitions != null)
'SupportContainerDefinitions': supportContainerDefinitions,
if (totalMemoryLimitMebibytes != null)
'TotalMemoryLimitMebibytes': totalMemoryLimitMebibytes,
if (totalVcpuLimit != null) 'TotalVcpuLimit': totalVcpuLimit,
if (versionDescription != null)
'VersionDescription': versionDescription,
},
);
return UpdateContainerGroupDefinitionOutput.fromJson(jsonResponse.body);
}