createAppImageConfig method

Future<CreateAppImageConfigResponse> createAppImageConfig({
  1. required String appImageConfigName,
  2. CodeEditorAppImageConfig? codeEditorAppImageConfig,
  3. JupyterLabAppImageConfig? jupyterLabAppImageConfig,
  4. KernelGatewayImageConfig? kernelGatewayImageConfig,
  5. List<Tag>? tags,
})

Creates a configuration for running a SageMaker AI image as a KernelGateway app. The configuration specifies the Amazon Elastic File System storage volume on the image, and a list of the kernels in the image.

May throw ResourceInUse.

Parameter appImageConfigName : The name of the AppImageConfig. Must be unique to your account.

Parameter codeEditorAppImageConfig : The CodeEditorAppImageConfig. You can only specify one image kernel in the AppImageConfig API. This kernel is shown to users before the image starts. After the image runs, all kernels are visible in Code Editor.

Parameter jupyterLabAppImageConfig : The JupyterLabAppImageConfig. You can only specify one image kernel in the AppImageConfig API. This kernel is shown to users before the image starts. After the image runs, all kernels are visible in JupyterLab.

Parameter kernelGatewayImageConfig : The KernelGatewayImageConfig. You can only specify one image kernel in the AppImageConfig API. This kernel will be shown to users before the image starts. Once the image runs, all kernels are visible in JupyterLab.

Parameter tags : A list of tags to apply to the AppImageConfig.

Implementation

Future<CreateAppImageConfigResponse> createAppImageConfig({
  required String appImageConfigName,
  CodeEditorAppImageConfig? codeEditorAppImageConfig,
  JupyterLabAppImageConfig? jupyterLabAppImageConfig,
  KernelGatewayImageConfig? kernelGatewayImageConfig,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.CreateAppImageConfig'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AppImageConfigName': appImageConfigName,
      if (codeEditorAppImageConfig != null)
        'CodeEditorAppImageConfig': codeEditorAppImageConfig,
      if (jupyterLabAppImageConfig != null)
        'JupyterLabAppImageConfig': jupyterLabAppImageConfig,
      if (kernelGatewayImageConfig != null)
        'KernelGatewayImageConfig': kernelGatewayImageConfig,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateAppImageConfigResponse.fromJson(jsonResponse.body);
}