createNotebook method

Future<CreateNotebookOutput> createNotebook({
  1. required String domainIdentifier,
  2. required String name,
  3. required String owningProjectIdentifier,
  4. String? clientToken,
  5. String? description,
  6. Map<String, String>? metadata,
  7. Map<String, String>? parameters,
})

Creates a notebook in Amazon SageMaker Unified Studio. A notebook is a collaborative document within a project that contains code cells for interactive computing.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter domainIdentifier : The identifier of the Amazon SageMaker Unified Studio domain in which to create the notebook.

Parameter name : The name of the notebook. The name must be between 1 and 256 characters.

Parameter owningProjectIdentifier : The identifier of the project that owns the notebook.

Parameter clientToken : A unique, case-sensitive identifier to ensure idempotency of the request. This field is automatically populated if not provided.

Parameter description : The description of the notebook.

Parameter metadata : The metadata for the notebook, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.

Parameter parameters : The sensitive parameters for the notebook, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.

Implementation

Future<CreateNotebookOutput> createNotebook({
  required String domainIdentifier,
  required String name,
  required String owningProjectIdentifier,
  String? clientToken,
  String? description,
  Map<String, String>? metadata,
  Map<String, String>? parameters,
}) async {
  final $payload = <String, dynamic>{
    'name': name,
    'owningProjectIdentifier': owningProjectIdentifier,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (metadata != null) 'metadata': metadata,
    if (parameters != null) 'parameters': parameters,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/notebooks',
    exceptionFnMap: _exceptionFns,
  );
  return CreateNotebookOutput.fromJson(response);
}