discoverPollEndpoint method

Future<DiscoverPollEndpointResponse> discoverPollEndpoint({
  1. String? cluster,
  2. String? containerInstance,
})
Returns an endpoint for the Amazon ECS agent to poll for updates.

May throw ServerException. May throw ClientException.

Parameter cluster : The short name or full Amazon Resource Name (ARN) of the cluster to which the container instance belongs.

Parameter containerInstance : The container instance ID or full ARN of the container instance. The ARN contains the arn:aws:ecs namespace, followed by the Region of the container instance, the AWS account ID of the container instance owner, the container-instance namespace, and then the container instance ID. For example, arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID.

Implementation

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

  return DiscoverPollEndpointResponse.fromJson(jsonResponse.body);
}