Skip to content

update_image_version

update_image_version(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    image_name: Optional[ImageName] = None,
    alias: Optional[SageMakerImageVersionAlias] = None,
    version: Optional[ImageVersionNumber] = None,
    aliases_to_add: Optional[SageMakerImageVersionAliases] = None,
    aliases_to_delete: Optional[SageMakerImageVersionAliases] = None,
    vendor_guidance: Optional[VendorGuidance] = None,
    job_type: Optional[JobType] = None,
    ml_framework: Optional[MLFramework] = None,
    programming_lang: Optional[ProgrammingLang] = None,
    processor: Optional[Processor] = None,
    horovod: Optional[Horovod] = None,
    release_notes: Optional[ReleaseNotes] = None,
) -> UpdateImageVersionResponse

Updates the properties of a SageMaker AI image version.

Parameters:

  • image_name (Optional[ImageName], default: None ) –

    The name of the image.

  • alias (Optional[SageMakerImageVersionAlias], default: None ) –

    The alias of the image version.

  • version (Optional[ImageVersionNumber], default: None ) –

    The version of the image.

  • aliases_to_add (Optional[SageMakerImageVersionAliases], default: None ) –

    A list of aliases to add.

  • aliases_to_delete (Optional[SageMakerImageVersionAliases], default: None ) –

    A list of aliases to delete.

  • vendor_guidance (Optional[VendorGuidance], default: None ) –

    The availability of the image version specified by the maintainer.

    • NOT_PROVIDED: The maintainers did not provide a status for image version stability.

    • STABLE: The image version is stable.

    • TO_BE_ARCHIVED: The image version is set to be archived. Custom image versions that are set to be archived are automatically archived after three months.

    • ARCHIVED: The image version is archived. Archived image versions are not searchable and are no longer actively supported.

  • job_type (Optional[JobType], default: None ) –

    Indicates SageMaker AI job type compatibility.

    • TRAINING: The image version is compatible with SageMaker AI training jobs.

    • INFERENCE: The image version is compatible with SageMaker AI inference jobs.

    • NOTEBOOK_KERNEL: The image version is compatible with SageMaker AI notebook kernels.

  • ml_framework (Optional[MLFramework], default: None ) –

    The machine learning framework vended in the image version.

  • programming_lang (Optional[ProgrammingLang], default: None ) –

    The supported programming language and its version.

  • processor (Optional[Processor], default: None ) –

    Indicates CPU or GPU compatibility.

    • CPU: The image version is compatible with CPU.

    • GPU: The image version is compatible with GPU.

  • horovod (Optional[Horovod], default: None ) –

    Indicates Horovod compatibility.

  • release_notes (Optional[ReleaseNotes], default: None ) –

    The maintainer description of the image version.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def update_image_version(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    image_name: Optional["capo_sagemaker.types.image_name.ImageName"] = None,
    alias: Optional[
        "capo_sagemaker.types.sage_maker_image_version_alias.SageMakerImageVersionAlias"
    ] = None,
    version: Optional[
        "capo_sagemaker.types.image_version_number.ImageVersionNumber"
    ] = None,
    aliases_to_add: Optional[
        "capo_sagemaker.types.sage_maker_image_version_aliases.SageMakerImageVersionAliases"
    ] = None,
    aliases_to_delete: Optional[
        "capo_sagemaker.types.sage_maker_image_version_aliases.SageMakerImageVersionAliases"
    ] = None,
    vendor_guidance: Optional[
        "capo_sagemaker.types.vendor_guidance.VendorGuidance"
    ] = None,
    job_type: Optional["capo_sagemaker.types.job_type.JobType"] = None,
    ml_framework: Optional["capo_sagemaker.types.ml_framework.MLFramework"] = None,
    programming_lang: Optional[
        "capo_sagemaker.types.programming_lang.ProgrammingLang"
    ] = None,
    processor: Optional["capo_sagemaker.types.processor.Processor"] = None,
    horovod: Optional["capo_sagemaker.types.horovod.Horovod"] = None,
    release_notes: Optional[
        "capo_sagemaker.types.release_notes.ReleaseNotes"
    ] = None,
) -> (
    "capo_sagemaker.types.update_image_version_response.UpdateImageVersionResponse"
):
    """<p>Updates the properties of a SageMaker AI image version.</p>

    Args:
        image_name: <p>The name of the image.</p>
        alias: <p>The alias of the image version.</p>
        version: <p>The version of the image.</p>
        aliases_to_add: <p>A list of aliases to add.</p>
        aliases_to_delete: <p>A list of aliases to delete.</p>
        vendor_guidance: <p>The availability of the image version specified by the maintainer.</p> <ul> <li> <p> <code>NOT_PROVIDED</code>: The maintainers did not provide a status for image version stability.</p> </li> <li> <p> <code>STABLE</code>: The image version is stable.</p> </li> <li> <p> <code>TO_BE_ARCHIVED</code>: The image version is set to be archived. Custom image versions that are set to be archived are automatically archived after three months.</p> </li> <li> <p> <code>ARCHIVED</code>: The image version is archived. Archived image versions are not searchable and are no longer actively supported. </p> </li> </ul>
        job_type: <p>Indicates SageMaker AI job type compatibility.</p> <ul> <li> <p> <code>TRAINING</code>: The image version is compatible with SageMaker AI training jobs.</p> </li> <li> <p> <code>INFERENCE</code>: The image version is compatible with SageMaker AI inference jobs.</p> </li> <li> <p> <code>NOTEBOOK_KERNEL</code>: The image version is compatible with SageMaker AI notebook kernels.</p> </li> </ul>
        ml_framework: <p>The machine learning framework vended in the image version.</p>
        programming_lang: <p>The supported programming language and its version.</p>
        processor: <p>Indicates CPU or GPU compatibility.</p> <ul> <li> <p> <code>CPU</code>: The image version is compatible with CPU.</p> </li> <li> <p> <code>GPU</code>: The image version is compatible with GPU.</p> </li> </ul>
        horovod: <p>Indicates Horovod compatibility.</p>
        release_notes: <p>The maintainer description of the image version.</p>

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

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.update_image_version_request.UpdateImageVersionRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.update_image_version_response.UpdateImageVersionResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_image_version

        output, http_response = (
            capo_sagemaker._operations.sage_maker.update_image_version.update_image_version(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateImageVersion")
    )
    input_: capo_sagemaker.types.update_image_version_request.UpdateImageVersionRequest = {}
    if image_name is not None:
        input_["image_name"] = image_name
    if alias is not None:
        input_["alias"] = alias
    if version is not None:
        input_["version"] = version
    if aliases_to_add is not None:
        input_["aliases_to_add"] = aliases_to_add
    if aliases_to_delete is not None:
        input_["aliases_to_delete"] = aliases_to_delete
    if vendor_guidance is not None:
        input_["vendor_guidance"] = vendor_guidance
    if job_type is not None:
        input_["job_type"] = job_type
    if ml_framework is not None:
        input_["ml_framework"] = ml_framework
    if programming_lang is not None:
        input_["programming_lang"] = programming_lang
    if processor is not None:
        input_["processor"] = processor
    if horovod is not None:
        input_["horovod"] = horovod
    if release_notes is not None:
        input_["release_notes"] = release_notes

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output