update_hub_content(
*,
config_overrides: Optional[SageMakerClientConfig] = None,
hub_name: Optional[HubNameOrArn] = None,
hub_content_name: Optional[HubContentName] = None,
hub_content_type: Optional[HubContentType] = None,
hub_content_version: Optional[HubContentVersion] = None,
hub_content_display_name: Optional[HubContentDisplayName] = None,
hub_content_description: Optional[HubContentDescription] = None,
hub_content_markdown: Optional[HubContentMarkdown] = None,
hub_content_search_keywords: Optional[HubContentSearchKeywordList] = None,
support_status: Optional[HubContentSupportStatus] = None,
) -> UpdateHubContentResponse
Updates SageMaker hub content (either a Model or Notebook resource).
You can update the metadata that describes the resource. In addition to the required request fields, specify at least one of the following fields to update:
-
HubContentDescription
-
HubContentDisplayName
-
HubContentMarkdown
-
HubContentSearchKeywords
-
SupportStatus
For more information about hubs, see Private curated hubs for foundation model access control in JumpStart.
If you want to update a ModelReference resource in your hub, use the UpdateHubContentResource API instead.
Parameters:
-
hub_name
(Optional[HubNameOrArn], default:
None
)
–
The name of the SageMaker hub that contains the hub content you want to update. You can optionally use the hub ARN instead.
-
hub_content_name
(Optional[HubContentName], default:
None
)
–
The name of the hub content resource that you want to update.
-
hub_content_type
(Optional[HubContentType], default:
None
)
–
The content type of the resource that you want to update. Only specify a Model or Notebook resource for this API. To update a ModelReference, use the UpdateHubContentReference API instead.
-
hub_content_version
(Optional[HubContentVersion], default:
None
)
–
The hub content version that you want to update. For example, if you have two versions of a resource in your hub, you can update the second version.
-
hub_content_display_name
(Optional[HubContentDisplayName], default:
None
)
–
The display name of the hub content.
-
hub_content_description
(Optional[HubContentDescription], default:
None
)
–
The description of the hub content.
-
hub_content_markdown
(Optional[HubContentMarkdown], default:
None
)
–
A string that provides a description of the hub content. This string can include links, tables, and standard markdown formatting.
-
hub_content_search_keywords
(Optional[HubContentSearchKeywordList], default:
None
)
–
The searchable keywords of the hub content.
-
support_status
(Optional[HubContentSupportStatus], default:
None
)
–
Indicates the current status of the hub content resource.
Raises:
Source code in docs_src/capo_sagemaker/_services/sage_maker.py
| def update_hub_content(
self,
*,
config_overrides: Optional[SageMakerClientConfig] = None,
hub_name: Optional["capo_sagemaker.types.hub_name_or_arn.HubNameOrArn"] = None,
hub_content_name: Optional[
"capo_sagemaker.types.hub_content_name.HubContentName"
] = None,
hub_content_type: Optional[
"capo_sagemaker.types.hub_content_type.HubContentType"
] = None,
hub_content_version: Optional[
"capo_sagemaker.types.hub_content_version.HubContentVersion"
] = None,
hub_content_display_name: Optional[
"capo_sagemaker.types.hub_content_display_name.HubContentDisplayName"
] = None,
hub_content_description: Optional[
"capo_sagemaker.types.hub_content_description.HubContentDescription"
] = None,
hub_content_markdown: Optional[
"capo_sagemaker.types.hub_content_markdown.HubContentMarkdown"
] = None,
hub_content_search_keywords: Optional[
"capo_sagemaker.types.hub_content_search_keyword_list.HubContentSearchKeywordList"
] = None,
support_status: Optional[
"capo_sagemaker.types.hub_content_support_status.HubContentSupportStatus"
] = None,
) -> "capo_sagemaker.types.update_hub_content_response.UpdateHubContentResponse":
"""<p>Updates SageMaker hub content (either a <code>Model</code> or <code>Notebook</code> resource).</p> <p>You can update the metadata that describes the resource. In addition to the required request fields, specify at least one of the following fields to update:</p> <ul> <li> <p> <code>HubContentDescription</code> </p> </li> <li> <p> <code>HubContentDisplayName</code> </p> </li> <li> <p> <code>HubContentMarkdown</code> </p> </li> <li> <p> <code>HubContentSearchKeywords</code> </p> </li> <li> <p> <code>SupportStatus</code> </p> </li> </ul> <p>For more information about hubs, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/jumpstart-curated-hubs.html">Private curated hubs for foundation model access control in JumpStart</a>.</p> <note> <p>If you want to update a <code>ModelReference</code> resource in your hub, use the <code>UpdateHubContentResource</code> API instead.</p> </note>
Args:
hub_name: <p>The name of the SageMaker hub that contains the hub content you want to update. You can optionally use the hub ARN instead.</p>
hub_content_name: <p>The name of the hub content resource that you want to update.</p>
hub_content_type: <p>The content type of the resource that you want to update. Only specify a <code>Model</code> or <code>Notebook</code> resource for this API. To update a <code>ModelReference</code>, use the <code>UpdateHubContentReference</code> API instead.</p>
hub_content_version: <p>The hub content version that you want to update. For example, if you have two versions of a resource in your hub, you can update the second version.</p>
hub_content_display_name: <p>The display name of the hub content.</p>
hub_content_description: <p>The description of the hub content.</p>
hub_content_markdown: <p>A string that provides a description of the hub content. This string can include links, tables, and standard markdown formatting.</p>
hub_content_search_keywords: <p>The searchable keywords of the hub content.</p>
support_status: <p>Indicates the current status of the hub content resource.</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_hub_content_request.UpdateHubContentRequest]",
) -> OperationResponse[
"capo_sagemaker.types.update_hub_content_response.UpdateHubContentResponse"
]:
import capo_sagemaker._operations.sage_maker.update_hub_content
output, http_response = (
capo_sagemaker._operations.sage_maker.update_hub_content.update_hub_content(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateHubContent")
)
input_: capo_sagemaker.types.update_hub_content_request.UpdateHubContentRequest = {}
if hub_name is not None:
input_["hub_name"] = hub_name
if hub_content_name is not None:
input_["hub_content_name"] = hub_content_name
if hub_content_type is not None:
input_["hub_content_type"] = hub_content_type
if hub_content_version is not None:
input_["hub_content_version"] = hub_content_version
if hub_content_display_name is not None:
input_["hub_content_display_name"] = hub_content_display_name
if hub_content_description is not None:
input_["hub_content_description"] = hub_content_description
if hub_content_markdown is not None:
input_["hub_content_markdown"] = hub_content_markdown
if hub_content_search_keywords is not None:
input_["hub_content_search_keywords"] = hub_content_search_keywords
if support_status is not None:
input_["support_status"] = support_status
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|