describeServices method

Future<DescribeServicesResponse> describeServices({
  1. required List<String> services,
  2. String? cluster,
  3. List<ServiceField>? include,
})

Describes the specified services running in your cluster.

May throw ServerException. May throw ClientException. May throw InvalidParameterException. May throw ClusterNotFoundException.

Parameter services : A list of services to describe. You may specify up to 10 services to describe in a single operation.

Parameter cluster : The short name or full Amazon Resource Name (ARN)the cluster that hosts the service to describe. If you do not specify a cluster, the default cluster is assumed. This parameter is required if the service or services you are describing were launched in any cluster other than the default cluster.

Parameter include : Specifies whether you want to see the resource tags for the service. If TAGS is specified, the tags are included in the response. If this field is omitted, tags are not included in the response.

Implementation

Future<DescribeServicesResponse> describeServices({
  required List<String> services,
  String? cluster,
  List<ServiceField>? include,
}) async {
  ArgumentError.checkNotNull(services, 'services');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonEC2ContainerServiceV20141113.DescribeServices'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'services': services,
      if (cluster != null) 'cluster': cluster,
      if (include != null)
        'include': include.map((e) => e.toValue()).toList(),
    },
  );

  return DescribeServicesResponse.fromJson(jsonResponse.body);
}