Skip to content

update_image

update_image(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    delete_properties: Optional[ImageDeletePropertyList] = None,
    description: Optional[ImageDescription] = None,
    display_name: Optional[ImageDisplayName] = None,
    image_name: Optional[ImageName] = None,
    role_arn: Optional[RoleArn] = None,
) -> UpdateImageResponse

Updates the properties of a SageMaker AI image. To change the image's tags, use the AddTags and DeleteTags APIs.

Parameters:

  • delete_properties (Optional[ImageDeletePropertyList], default: None ) –

    A list of properties to delete. Only the Description and DisplayName properties can be deleted.

  • description (Optional[ImageDescription], default: None ) –

    The new description for the image.

  • display_name (Optional[ImageDisplayName], default: None ) –

    The new display name for the image.

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

    The name of the image to update.

  • role_arn (Optional[RoleArn], default: None ) –

    The new ARN for the IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def update_image(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    delete_properties: Optional[
        "capo_sagemaker.types.image_delete_property_list.ImageDeletePropertyList"
    ] = None,
    description: Optional[
        "capo_sagemaker.types.image_description.ImageDescription"
    ] = None,
    display_name: Optional[
        "capo_sagemaker.types.image_display_name.ImageDisplayName"
    ] = None,
    image_name: Optional["capo_sagemaker.types.image_name.ImageName"] = None,
    role_arn: Optional["capo_sagemaker.types.role_arn.RoleArn"] = None,
) -> "capo_sagemaker.types.update_image_response.UpdateImageResponse":
    """<p>Updates the properties of a SageMaker AI image. To change the image's tags, use the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AddTags.html">AddTags</a> and <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DeleteTags.html">DeleteTags</a> APIs.</p>

    Args:
        delete_properties: <p>A list of properties to delete. Only the <code>Description</code> and <code>DisplayName</code> properties can be deleted.</p>
        description: <p>The new description for the image.</p>
        display_name: <p>The new display name for the image.</p>
        image_name: <p>The name of the image to update.</p>
        role_arn: <p>The new ARN for the IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.</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_request.UpdateImageRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.update_image_response.UpdateImageResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_image

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateImage")
    )
    input_: capo_sagemaker.types.update_image_request.UpdateImageRequest = {}
    if delete_properties is not None:
        input_["delete_properties"] = delete_properties
    if description is not None:
        input_["description"] = description
    if display_name is not None:
        input_["display_name"] = display_name
    if image_name is not None:
        input_["image_name"] = image_name
    if role_arn is not None:
        input_["role_arn"] = role_arn

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