submitContainerStateChange method

Future<SubmitContainerStateChangeResponse> submitContainerStateChange({
  1. String? cluster,
  2. String? containerName,
  3. int? exitCode,
  4. List<NetworkBinding>? networkBindings,
  5. String? reason,
  6. String? runtimeId,
  7. String? status,
  8. String? task,
})
Sent to acknowledge that a container changed states.

May throw ServerException. May throw ClientException. May throw AccessDeniedException.

Parameter cluster : The short name or full ARN of the cluster that hosts the container.

Parameter containerName : The name of the container.

Parameter exitCode : The exit code returned for the state change request.

Parameter networkBindings : The network bindings of the container.

Parameter reason : The reason for the state change request.

Parameter runtimeId : The ID of the Docker container.

Parameter status : The status of the state change request.

Parameter task : The task ID or full Amazon Resource Name (ARN) of the task that hosts the container.

Implementation

Future<SubmitContainerStateChangeResponse> submitContainerStateChange({
  String? cluster,
  String? containerName,
  int? exitCode,
  List<NetworkBinding>? networkBindings,
  String? reason,
  String? runtimeId,
  String? status,
  String? task,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AmazonEC2ContainerServiceV20141113.SubmitContainerStateChange'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (cluster != null) 'cluster': cluster,
      if (containerName != null) 'containerName': containerName,
      if (exitCode != null) 'exitCode': exitCode,
      if (networkBindings != null) 'networkBindings': networkBindings,
      if (reason != null) 'reason': reason,
      if (runtimeId != null) 'runtimeId': runtimeId,
      if (status != null) 'status': status,
      if (task != null) 'task': task,
    },
  );

  return SubmitContainerStateChangeResponse.fromJson(jsonResponse.body);
}