Update resources in a private hub - Amazon SageMaker AI
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Update resources in a private hub

You can update resources in your private hub to make changes to their metadata. The resources that you can update include model references to Amazon SageMaker JumpStart models, custom models, and notebooks.

When updating model or notebook resources, you can update the content description, display name, keywords, and support status. When updating model references to JumpStart models, you can only update the field specifying the minimum model version that you'd like to use.

Follow the section specific to the resource that you want to update.

Update model or notebook resources

To update a model or a notebook resource, use the UpdateHubContent API.

The valid metadata fields that you can update with this API are the following:

  • HubContentDescription – The description of the resource.

  • HubContentDisplayName – The display name of the resource.

  • HubContentMarkdown – The description of the resource, in Markdown formatting.

  • HubContentSearchKeywords – The searchable keywords of the resource.

  • SupportStatus – The current status of the resource.

In your request, include a change for one or more of the preceding fields. If you attempt to update any other fields, such as the hub content type, you receive an error.

Amazon SDK for Python (Boto3)

The following example shows how you can use the Amazon SDK for Python (Boto3) to submit an UpdateHubContent request.

Note

The HubContentVersion you specify in the request means that the specific version's metadata is updated. To find all of the available versions of your hub content, you can use the ListHubContentVersions API.

import boto3 sagemaker_client = boto3.Session(region_name=<Amazon-region>).client("sagemaker") sagemaker_client.update_hub_contents( HubName=<hub-name>, HubContentName=<resource-content-name>, HubContentType=<"Model"|"Notebook">, HubContentVersion='1.0.0', # specify the correct version that you want to update HubContentDescription=<updated-description-string> )
Amazon CLI

The following example shows how you can use the Amazon CLI to submit an update-hub-content request.

aws sagemaker update-hub-content \ --hub-name <hub-name> \ --hub-content-name <resource-content-name> \ --hub-content-type <"Model"|"Notebook"> \ --hub-content-version "1.0.0" \ --hub-content-description <updated-description-string>

Update model references

To update a model reference to a JumpStart model, use the UpdateHubContentReference API.

You can only update the MinVersion field for model references.

Amazon SDK for Python (Boto3)

The following example shows how you can use the Amazon SDK for Python (Boto3) to submit an UpdateHubContentReference request.

import boto3 sagemaker_client = boto3.Session(region_name=<Amazon-region>).client("sagemaker") update_response = sagemaker_client.update_hub_content_reference( HubName=<hub-name>, HubContentName=<model-reference-content-name>, HubContentType='ModelReference', MinVersion='1.0.0' )
Amazon CLI

The following example shows how you can use the Amazon CLI to submit an update-hub-content-reference request.

aws sagemaker update-hub-content-reference \ --hub-name <hub-name> \ --hub-content-name <model-reference-content-name> \ --hub-content-type "ModelReference" \ --min-version "1.0.0"