hub_contents
Creates, updates, deletes, gets or lists a hub_contents resource.
Overview
| Name | hub_contents |
| Type | Resource |
| Id | aws.sagemaker.hub_contents |
Fields
The following fields are returned by SELECT queries:
- describe_hub_content
- list_hub_contents
| Name | Datatype | Description |
|---|---|---|
creation_time | string (date-time) | The date and time that hub content was created. |
document_schema_version | string | The document schema version for the hub content. (pattern: <code>\d{1,4}.\d{1,4}.\d{1,4}</code>) |
failure_reason | string | The failure reason if importing hub content failed. |
hub_arn | string | The Amazon Resource Name (ARN) of the hub that contains the content. (pattern: <code>.*</code>) |
hub_content_arn | string | The Amazon Resource Name (ARN) of the hub content. (pattern: <code>.*</code>) |
hub_content_dependencies | array | The location of any dependencies that the hub content has, such as scripts, model artifacts, datasets, or notebooks. |
hub_content_description | string | A description of the hub content. (pattern: <code>.*</code>) |
hub_content_display_name | string | The display name of the hub content. (pattern: <code>.*</code>) |
hub_content_document | string | The hub content document that describes information about the hub content such as type, associated containers, scripts, and more. (pattern: <code>.*</code>) |
hub_content_markdown | string | A string that provides a description of the hub content. This string can include links, tables, and standard markdown formating. |
hub_content_name | string | The name of the hub content. (pattern: <code>[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}</code>) |
hub_content_search_keywords | array | The searchable keywords for the hub content. |
hub_content_status | string | The status of the hub content. (Available, Importing, Deleting, ImportFailed, DeleteFailed, PendingImport, PendingDelete) |
hub_content_type | string | The type of hub content. (Model, Notebook, ModelReference, DataSet, JsonDoc) |
hub_content_version | string | The version of the hub content. (pattern: <code>\d{1,4}.\d{1,4}.\d{1,4}</code>) |
hub_name | string | The name of the hub that contains the content. (pattern: <code>[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}</code>) |
last_modified_time | string (date-time) | The last modified time of the hub content. |
reference_min_version | string | The minimum version of the hub content. (pattern: <code>\d{1,4}.\d{1,4}.\d{1,4}</code>) |
sage_maker_public_hub_content_arn | string | The ARN of the public hub content. (pattern: <code>arn:[a-z0-9-.]{1,63}:sagemaker:\w+(?:-\w+)+:aws:hub-content/[a-zA-Z0-9](-[a-zA-Z0-9]){0,62}/Model/[a-zA-Z0-9](-[a-zA-Z0-9]){0,63}</code>) |
support_status | string | The support status of the hub content. (Supported, Deprecated, Restricted) |
| Name | Datatype | Description |
|---|---|---|
hub_content_summaries | array | The summaries of the listed hub content. |
next_token | string | If the response is truncated, SageMaker returns this token. To retrieve the next set of hub content, use it in the subsequent request. (pattern: <code>.*</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_hub_content | select | region | Describe the content of a hub. | |
list_hub_contents | select | region | List the contents of a hub. | |
create_hub_content_presigned_urls | insert | region, HubName, HubContentType, HubContentName | Creates presigned URLs for accessing hub content artifacts. This operation generates time-limited, secure URLs that allow direct download of model artifacts and associated files from Amazon SageMaker hub content, including gated models that require end-user license agreement acceptance. | |
create_hub_content_reference | insert | region, HubName, SageMakerPublicHubContentArn | Create a hub content reference in order to add a model in the JumpStart public hub to a private hub. | |
update_hub_content | update | region, HubName, HubContentName, HubContentType, HubContentVersion | 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. | |
update_hub_content_reference | update | region, HubName, HubContentName, HubContentType | 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. | |
delete_hub_content | delete | region | Delete the contents of a hub. | |
delete_hub_content_reference | delete | region | Delete a hub content reference in order to remove a model from a private hub. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_hub_content
- list_hub_contents
Describe the content of a hub.
SELECT
creation_time,
document_schema_version,
failure_reason,
hub_arn,
hub_content_arn,
hub_content_dependencies,
hub_content_description,
hub_content_display_name,
hub_content_document,
hub_content_markdown,
hub_content_name,
hub_content_search_keywords,
hub_content_status,
hub_content_type,
hub_content_version,
hub_name,
last_modified_time,
reference_min_version,
sage_maker_public_hub_content_arn,
support_status
FROM aws.sagemaker.hub_contents
WHERE region = '{{ region }}' -- required
;
List the contents of a hub.
SELECT
hub_content_summaries,
next_token
FROM aws.sagemaker.hub_contents
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_hub_content_presigned_urls
- create_hub_content_reference
- Manifest
Creates presigned URLs for accessing hub content artifacts. This operation generates time-limited, secure URLs that allow direct download of model artifacts and associated files from Amazon SageMaker hub content, including gated models that require end-user license agreement acceptance.
INSERT INTO aws.sagemaker.hub_contents (
HubName,
HubContentType,
HubContentName,
HubContentVersion,
AccessConfig,
MaxResults,
NextToken,
region
)
SELECT
'{{ HubName }}' /* required */,
'{{ HubContentType }}' /* required */,
'{{ HubContentName }}' /* required */,
'{{ HubContentVersion }}',
'{{ AccessConfig }}',
{{ MaxResults }},
'{{ NextToken }}',
'{{ region }}'
RETURNING
authorized_url_configs,
next_token
;
Create a hub content reference in order to add a model in the JumpStart public hub to a private hub.
INSERT INTO aws.sagemaker.hub_contents (
HubName,
SageMakerPublicHubContentArn,
HubContentName,
MinVersion,
Tags,
region
)
SELECT
'{{ HubName }}' /* required */,
'{{ SageMakerPublicHubContentArn }}' /* required */,
'{{ HubContentName }}',
'{{ MinVersion }}',
'{{ Tags }}',
'{{ region }}'
RETURNING
hub_arn,
hub_content_arn
;
# Description fields are for documentation purposes
- name: hub_contents
props:
- name: region
value: "{{ region }}"
description: Required parameter for the hub_contents resource.
- name: HubName
value: "{{ HubName }}"
description: |
The name of the hub to add the hub content reference to.
- name: HubContentType
value: "{{ HubContentType }}"
description: |
The type of hub content to access. Valid values include Model, Notebook, and ModelReference.
valid_values: ['Model', 'Notebook', 'ModelReference', 'DataSet', 'JsonDoc']
- name: HubContentName
value: "{{ HubContentName }}"
description: |
The name of the hub content to reference.
- name: HubContentVersion
value: "{{ HubContentVersion }}"
description: |
The version of the hub content. If not specified, the latest version is used.
- name: AccessConfig
description: |
Configuration settings for accessing the hub content, including end-user license agreement acceptance for gated models and expected S3 URL validation.
value:
AcceptEula: {{ AcceptEula }}
ExpectedS3Url: "{{ ExpectedS3Url }}"
- name: MaxResults
value: {{ MaxResults }}
description: |
The maximum number of presigned URLs to return in the response. Default value is 100. Large models may contain hundreds of files, requiring pagination to retrieve all URLs.
- name: NextToken
value: "{{ NextToken }}"
description: |
A token for pagination. Use this token to retrieve the next set of presigned URLs when the response is truncated.
- name: SageMakerPublicHubContentArn
value: "{{ SageMakerPublicHubContentArn }}"
description: |
The ARN of the public hub content to reference.
- name: MinVersion
value: "{{ MinVersion }}"
description: |
The minimum version of the hub content to reference.
- name: Tags
description: |
Any tags associated with the hub content to reference.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_hub_content
- update_hub_content_reference
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.
UPDATE aws.sagemaker.hub_contents
SET
HubName = '{{ HubName }}',
HubContentName = '{{ HubContentName }}',
HubContentType = '{{ HubContentType }}',
HubContentVersion = '{{ HubContentVersion }}',
HubContentDisplayName = '{{ HubContentDisplayName }}',
HubContentDescription = '{{ HubContentDescription }}',
HubContentMarkdown = '{{ HubContentMarkdown }}',
HubContentSearchKeywords = '{{ HubContentSearchKeywords }}',
SupportStatus = '{{ SupportStatus }}'
WHERE
region = '{{ region }}' --required
AND HubName = '{{ HubName }}' --required
AND HubContentName = '{{ HubContentName }}' --required
AND HubContentType = '{{ HubContentType }}' --required
AND HubContentVersion = '{{ HubContentVersion }}' --required
RETURNING
hub_arn,
hub_content_arn;
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.
UPDATE aws.sagemaker.hub_contents
SET
HubName = '{{ HubName }}',
HubContentName = '{{ HubContentName }}',
HubContentType = '{{ HubContentType }}',
MinVersion = '{{ MinVersion }}'
WHERE
region = '{{ region }}' --required
AND HubName = '{{ HubName }}' --required
AND HubContentName = '{{ HubContentName }}' --required
AND HubContentType = '{{ HubContentType }}' --required
RETURNING
hub_arn,
hub_content_arn;
DELETE examples
- delete_hub_content
- delete_hub_content_reference
Delete the contents of a hub.
DELETE FROM aws.sagemaker.hub_contents
WHERE region = '{{ region }}' --required
;
Delete a hub content reference in order to remove a model from a private hub.
DELETE FROM aws.sagemaker.hub_contents
WHERE region = '{{ region }}' --required
;