

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# プライベートハブのリソースを更新する
<a name="jumpstart-curated-hubs-update"></a>

プライベートハブのリソースを更新して、メタデータを変更できます。更新できるリソースには、Amazon SageMaker JumpStart モデル、カスタムモデル、ノートブック、データセット、JsonDoc へのモデル参照が含まれます。

モデル、ノートブック、データセット、または JsonDoc リソースを更新するときは、コンテンツの説明、表示名、キーワード、サポートステータスを更新できます。JumpStart モデルへのモデル参照を更新する際は、使用する最小モデルバージョンを指定するフィールドのみを更新できます。
+ 「モデルまたはノートブックリソースを更新」して DataSet/JsonDoc を含めます。CLI コマンドでは、DataSets/JsonDocs を hub-content-type 引数に追加する必要があります。

更新するリソースに固有のセクションに従います。

## モデルまたはノートブックリソースを更新する
<a name="jumpstart-curated-hubs-update-model-notebook"></a>

モデルまたはノートブックリソースを更新するには、[UpdateHubContent](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateHubContent.html) API を使用します。

この API で更新できる有効なメタデータフィールドは次のとおりです。
+ `HubContentDescription` - リソースの説明。
+ `HubContentDisplayName` - リソースの表示名。
+ `HubContentMarkdown` – Markdown 形式のリソースの説明。
+ `HubContentSearchKeywords` – リソースの検索可能なキーワード。
+ `SupportStatus` - リソースの現在のステータス。

リクエストには、前述の 1 つ以上のフィールドの変更を含めます。ハブコンテンツタイプなど、他のフィールドを更新しようとすると、エラーが発生します。

------
#### [ AWS SDK for Python (Boto3) ]

次の例は、 を使用して [ UpdateHubContent](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateHubContent.html) リクエスト AWS SDK for Python (Boto3) を送信する方法を示しています。

**注記**  
リクエストで指定した `HubContentVersion` は、特定のバージョンのメタデータが更新されることを意味しています。ハブコンテンツの利用可能なすべてのバージョンを確認するには、[ListHubContentVersions](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ListHubContentVersions.html) API を使用できます。

```
import boto3
sagemaker_client = boto3.Session(region_name=<AWS-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>}}
)
```

------
#### [ AWS CLI ]

次の例は、 を使用して [ update-hub-content](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sagemaker/update-hub-content.html) リクエスト AWS CLI を送信する方法を示しています。

```
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>}}
```

------

## モデル参照を更新する
<a name="jumpstart-curated-hubs-update-model-reference"></a>

JumpStart モデルへのモデル参照を更新するには、[UpdateHubContentReference](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateHubContentReference.html) API を使用します。

更新できるのはモデル参照の `MinVersion` フィールドだけです。

------
#### [ AWS SDK for Python (Boto3) ]

次の例は、 を使用して [ UpdateHubContentReference](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateHubContentReference.html) リクエスト AWS SDK for Python (Boto3) を送信する方法を示しています。

```
import boto3
sagemaker_client = boto3.Session(region_name=<AWS-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'
)
```

------
#### [ AWS CLI ]

次の例は、 を使用して [ update-hub-content-reference ](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sagemaker/update-hub-content-reference.html)リクエスト AWS CLI を送信する方法を示しています。

```
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"
```

------