deleteDomain method

Future<void> deleteDomain({
  1. required String domainId,
  2. RetentionPolicy? retentionPolicy,
})

Used to delete a domain. If you onboarded with IAM mode, you will need to delete your domain to onboard again using SSO. Use with caution. All of the members of the domain will lose access to their EFS volume, including data, notebooks, and other artifacts.

May throw ResourceInUse. May throw ResourceNotFound.

Parameter domainId : The domain ID.

Parameter retentionPolicy : The retention policy for this domain, which specifies whether resources will be retained after the Domain is deleted. By default, all resources are retained (not automatically deleted).

Implementation

Future<void> deleteDomain({
  required String domainId,
  RetentionPolicy? retentionPolicy,
}) async {
  ArgumentError.checkNotNull(domainId, 'domainId');
  _s.validateStringLength(
    'domainId',
    domainId,
    0,
    63,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.DeleteDomain'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DomainId': domainId,
      if (retentionPolicy != null) 'RetentionPolicy': retentionPolicy,
    },
  );
}