

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 프라이빗 허브의 리소스 업데이트
<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` - 마크다운 형식의 리소스에 대한 설명입니다.
+ `HubContentSearchKeywords` - 리소스의 검색 가능한 키워드입니다.
+ `SupportStatus` - 리소스의 현재 상태입니다.

요청에 이전 필드 중 하나 이상에 대한 변경 사항을 포함합니다. 허브 콘텐츠 유형 등의 다른 필드를 업데이트하려고 하면 오류가 발생합니다.

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

다음 예제에서는 AWS SDK for Python (Boto3) 를 사용하여 [ UpdateHubContent](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateHubContent.html) 요청을 제출하는 방법을 보여줍니다.

**참고**  
요청에서 지정하는 `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 ]

다음 예제에서는 AWS CLI 를 사용하여 [ update-hub-content](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sagemaker/update-hub-content.html) 요청을 제출하는 방법을 보여줍니다.

```
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) ]

다음 예제에서는 AWS SDK for Python (Boto3) 를 사용하여 [ UpdateHubContentReference](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateHubContentReference.html) 요청을 제출하는 방법을 보여줍니다.

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

다음 예제에서는 AWS CLI 를 사용하여 [ update-hub-content-reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sagemaker/update-hub-content-reference.html) 요청을 제출하는 방법을 보여줍니다.

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

------