updateNotebookInstanceLifecycleConfig method

Future<void> updateNotebookInstanceLifecycleConfig({
  1. required String notebookInstanceLifecycleConfigName,
  2. List<NotebookInstanceLifecycleHook>? onCreate,
  3. List<NotebookInstanceLifecycleHook>? onStart,
})

Updates a notebook instance lifecycle configuration created with the CreateNotebookInstanceLifecycleConfig API.

May throw ResourceLimitExceeded.

Parameter notebookInstanceLifecycleConfigName : The name of the lifecycle configuration.

Parameter onCreate : The shell script that runs only once, when you create a notebook instance. The shell script must be a base64-encoded string.

Parameter onStart : The shell script that runs every time you start a notebook instance, including when you create the notebook instance. The shell script must be a base64-encoded string.

Implementation

Future<void> updateNotebookInstanceLifecycleConfig({
  required String notebookInstanceLifecycleConfigName,
  List<NotebookInstanceLifecycleHook>? onCreate,
  List<NotebookInstanceLifecycleHook>? onStart,
}) async {
  ArgumentError.checkNotNull(notebookInstanceLifecycleConfigName,
      'notebookInstanceLifecycleConfigName');
  _s.validateStringLength(
    'notebookInstanceLifecycleConfigName',
    notebookInstanceLifecycleConfigName,
    0,
    63,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.UpdateNotebookInstanceLifecycleConfig'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'NotebookInstanceLifecycleConfigName':
          notebookInstanceLifecycleConfigName,
      if (onCreate != null) 'OnCreate': onCreate,
      if (onStart != null) 'OnStart': onStart,
    },
  );
}