Skip to content

update_hub_content_reference

update_hub_content_reference(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    hub_name: Optional[HubNameOrArn] = None,
    hub_content_name: Optional[HubContentName] = None,
    hub_content_type: Optional[HubContentType] = None,
    min_version: Optional[HubContentVersion] = None,
) -> UpdateHubContentReferenceResponse

Updates the contents of a SageMaker hub for a ModelReference resource. A ModelReference allows you to access public SageMaker JumpStart models from within your private hub.

When using this API, you can update the MinVersion field for additional flexibility in the model version. You shouldn't update any additional fields when using this API, because the metadata in your private hub should match the public JumpStart model's metadata.

If you want to update a Model or Notebook resource in your hub, use the UpdateHubContent API instead.

For more information about adding model references to your hub, see Add models to a private hub.

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 ModelReference resource for this API. To update a Model or Notebook resource, use the UpdateHubContent API instead.

  • min_version (Optional[HubContentVersion], default: None ) –

    The minimum hub content version of the referenced model that you want to use. The minimum version must be older than the latest available version of the referenced model. To support all versions of a model, set the value to 1.0.0.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def update_hub_content_reference(
    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,
    min_version: Optional[
        "capo_sagemaker.types.hub_content_version.HubContentVersion"
    ] = None,
) -> "capo_sagemaker.types.update_hub_content_reference_response.UpdateHubContentReferenceResponse":
    """<p>Updates the contents of a SageMaker hub for a <code>ModelReference</code> resource. A <code>ModelReference</code> allows you to access public SageMaker JumpStart models from within your private hub.</p> <p>When using this API, you can update the <code>MinVersion</code> field for additional flexibility in the model version. You shouldn't update any additional fields when using this API, because the metadata in your private hub should match the public JumpStart model's metadata.</p> <note> <p>If you want to update a <code>Model</code> or <code>Notebook</code> resource in your hub, use the <code>UpdateHubContent</code> API instead.</p> </note> <p>For more information about adding model references to your hub, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/jumpstart-curated-hubs-admin-guide-add-models.html"> Add models to a private hub</a>.</p>

    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>ModelReference</code> resource for this API. To update a <code>Model</code> or <code>Notebook</code> resource, use the <code>UpdateHubContent</code> API instead.</p>
        min_version: <p>The minimum hub content version of the referenced model that you want to use. The minimum version must be older than the latest available version of the referenced model. To support all versions of a model, set the value to <code>1.0.0</code>.</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_reference_request.UpdateHubContentReferenceRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.update_hub_content_reference_response.UpdateHubContentReferenceResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_hub_content_reference

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateHubContentReference")
    )
    input_: capo_sagemaker.types.update_hub_content_reference_request.UpdateHubContentReferenceRequest = {}
    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 min_version is not None:
        input_["min_version"] = min_version

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