updateCluster method

Future<UpdateClusterResponse> updateCluster({
  1. required String cluster,
  2. ClusterConfiguration? configuration,
  3. ClusterServiceConnectDefaultsRequest? serviceConnectDefaults,
  4. List<ClusterSetting>? settings,
})

Updates the cluster.

May throw AccessDeniedException. May throw ClientException. May throw ClusterNotFoundException. May throw InvalidParameterException. May throw NamespaceNotFoundException. May throw ServerException.

Parameter cluster : The name of the cluster to modify the settings for.

Parameter configuration : The execute command configuration for the cluster.

Parameter serviceConnectDefaults : Use this parameter to set a default Service Connect namespace. After you set a default Service Connect namespace, any new services with Service Connect turned on that are created in the cluster are added as client services in the namespace. This setting only applies to new services that set the enabled parameter to true in the ServiceConnectConfiguration. You can set the namespace of each service individually in the ServiceConnectConfiguration to override this default parameter.

Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide.

Parameter settings : The cluster settings for your cluster.

Implementation

Future<UpdateClusterResponse> updateCluster({
  required String cluster,
  ClusterConfiguration? configuration,
  ClusterServiceConnectDefaultsRequest? serviceConnectDefaults,
  List<ClusterSetting>? settings,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonEC2ContainerServiceV20141113.UpdateCluster'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'cluster': cluster,
      if (configuration != null) 'configuration': configuration,
      if (serviceConnectDefaults != null)
        'serviceConnectDefaults': serviceConnectDefaults,
      if (settings != null) 'settings': settings,
    },
  );

  return UpdateClusterResponse.fromJson(jsonResponse.body);
}