updateService method

Future<UpdateServiceResponse> updateService({
  1. required String id,
  2. required ServiceChange service,
})

Submits a request to perform the following operations:

  • Update the TTL setting for existing DnsRecords configurations
  • Add, update, or delete HealthCheckConfig for a specified service
For public and private DNS namespaces, note the following:
  • If you omit any existing DnsRecords or HealthCheckConfig configurations from an UpdateService request, the configurations are deleted from the service.
  • If you omit an existing HealthCheckCustomConfig configuration from an UpdateService request, the configuration isn't deleted from the service.
When you update settings for a service, Cloud Map also updates the corresponding settings in all the records and health checks that were created by using the specified service.

May throw DuplicateRequest. May throw InvalidInput. May throw ServiceNotFound.

Parameter id : The ID or Amazon Resource Name (ARN) of the service that you want to update. If the namespace associated with the service is shared with your Amazon Web Services account, specify the service ARN. For more information about shared namespaces, see Cross-account Cloud Map namespace sharing in the Cloud Map Developer Guide

Parameter service : A complex type that contains the new settings for the service. You can specify a maximum of 30 attributes (key-value pairs).

Implementation

Future<UpdateServiceResponse> updateService({
  required String id,
  required ServiceChange service,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Route53AutoNaming_v20170314.UpdateService'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Id': id,
      'Service': service,
    },
  );

  return UpdateServiceResponse.fromJson(jsonResponse.body);
}