Skip to content

create_app_image_config async

create_app_image_config(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    app_image_config_name: Optional[AppImageConfigName] = None,
    tags: Optional[TagList] = None,
    kernel_gateway_image_config: Optional[KernelGatewayImageConfig] = None,
    jupyter_lab_app_image_config: Optional[JupyterLabAppImageConfig] = None,
    code_editor_app_image_config: Optional[CodeEditorAppImageConfig] = None,
) -> CreateAppImageConfigResponse

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.

Parameters:

  • app_image_config_name (Optional[AppImageConfigName], default: None ) –

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

  • tags (Optional[TagList], default: None ) –

    A list of tags to apply to the AppImageConfig.

  • kernel_gateway_image_config (Optional[KernelGatewayImageConfig], default: None ) –

    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.

  • jupyter_lab_app_image_config (Optional[JupyterLabAppImageConfig], default: None ) –

    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.

  • code_editor_app_image_config (Optional[CodeEditorAppImageConfig], default: None ) –

    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.

Raises:

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def create_app_image_config(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    app_image_config_name: Optional[
        "capo_sagemaker.types.app_image_config_name.AppImageConfigName"
    ] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
    kernel_gateway_image_config: Optional[
        "capo_sagemaker.types.kernel_gateway_image_config.KernelGatewayImageConfig"
    ] = None,
    jupyter_lab_app_image_config: Optional[
        "capo_sagemaker.types.jupyter_lab_app_image_config.JupyterLabAppImageConfig"
    ] = None,
    code_editor_app_image_config: Optional[
        "capo_sagemaker.types.code_editor_app_image_config.CodeEditorAppImageConfig"
    ] = None,
) -> "capo_sagemaker.types.create_app_image_config_response.CreateAppImageConfigResponse":
    """<p>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.</p>

    Args:
        app_image_config_name: <p>The name of the AppImageConfig. Must be unique to your account.</p>
        tags: <p>A list of tags to apply to the AppImageConfig.</p>
        kernel_gateway_image_config: <p>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.</p>
        jupyter_lab_app_image_config: <p>The <code>JupyterLabAppImageConfig</code>. You can only specify one image kernel in the <code>AppImageConfig</code> API. This kernel is shown to users before the image starts. After the image runs, all kernels are visible in JupyterLab.</p>
        code_editor_app_image_config: <p>The <code>CodeEditorAppImageConfig</code>. 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.</p>

    Raises:
        capo_sagemaker.errors.resource_in_use.ResourceInUse: <p>Resource being accessed is in use.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.create_app_image_config_request.CreateAppImageConfigRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.create_app_image_config_response.CreateAppImageConfigResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.create_app_image_config

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.create_app_image_config.async_create_app_image_config(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAppImageConfig")
    )
    input_: capo_sagemaker.types.create_app_image_config_request.CreateAppImageConfigRequest = {}
    if app_image_config_name is not None:
        input_["app_image_config_name"] = app_image_config_name
    if tags is not None:
        input_["tags"] = tags
    if kernel_gateway_image_config is not None:
        input_["kernel_gateway_image_config"] = kernel_gateway_image_config
    if jupyter_lab_app_image_config is not None:
        input_["jupyter_lab_app_image_config"] = jupyter_lab_app_image_config
    if code_editor_app_image_config is not None:
        input_["code_editor_app_image_config"] = code_editor_app_image_config

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output