updateClusterSoftware method

Future<UpdateClusterSoftwareResponse> updateClusterSoftware({
  1. required String clusterName,
  2. DeploymentConfiguration? deploymentConfig,
  3. String? imageId,
  4. List<UpdateClusterSoftwareInstanceGroupSpecification>? instanceGroups,
})

Updates the platform software of a SageMaker HyperPod cluster for security patching. To learn how to use this API, see Update the SageMaker HyperPod platform software of a cluster.

May throw ConflictException. May throw ResourceNotFound.

Parameter clusterName : Specify the name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster you want to update for security patching.

Parameter deploymentConfig : The configuration to use when updating the AMI versions.

Parameter imageId : When configuring your HyperPod cluster, you can specify an image ID using one of the following options:

  • HyperPodPublicAmiId: Use a HyperPod public AMI
  • CustomAmiId: Use your custom AMI
  • default: Use the default latest system image
If you choose to use a custom AMI (CustomAmiId), ensure it meets the following requirements:
  • Encryption: The custom AMI must be unencrypted.
  • Ownership: The custom AMI must be owned by the same Amazon Web Services account that is creating the HyperPod cluster.
  • Volume support: Only the primary AMI snapshot volume is supported; additional AMI volumes are not supported.
When updating the instance group's AMI through the UpdateClusterSoftware operation, if an instance group uses a custom AMI, you must provide an ImageId or use the default as input. Note that if you don't specify an instance group in your UpdateClusterSoftware request, then all of the instance groups are patched with the specified image.

Parameter instanceGroups : The array of instance groups for which to update AMI versions.

Implementation

Future<UpdateClusterSoftwareResponse> updateClusterSoftware({
  required String clusterName,
  DeploymentConfiguration? deploymentConfig,
  String? imageId,
  List<UpdateClusterSoftwareInstanceGroupSpecification>? instanceGroups,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.UpdateClusterSoftware'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ClusterName': clusterName,
      if (deploymentConfig != null) 'DeploymentConfig': deploymentConfig,
      if (imageId != null) 'ImageId': imageId,
      if (instanceGroups != null) 'InstanceGroups': instanceGroups,
    },
  );

  return UpdateClusterSoftwareResponse.fromJson(jsonResponse.body);
}