getTaskProtection method

Future<GetTaskProtectionResponse> getTaskProtection({
  1. required String cluster,
  2. List<String>? tasks,
})

Retrieves the protection status of tasks in an Amazon ECS service.

May throw AccessDeniedException. May throw ClientException. May throw ClusterNotFoundException. May throw InvalidParameterException. May throw ResourceNotFoundException. May throw ServerException. May throw UnsupportedFeatureException.

Parameter cluster : The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service that the task sets exist in.

Parameter tasks : A list of up to 100 task IDs or full ARN entries.

Implementation

Future<GetTaskProtectionResponse> getTaskProtection({
  required String cluster,
  List<String>? tasks,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonEC2ContainerServiceV20141113.GetTaskProtection'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'cluster': cluster,
      if (tasks != null) 'tasks': tasks,
    },
  );

  return GetTaskProtectionResponse.fromJson(jsonResponse.body);
}