CreateHubContentPresignedUrls
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.
Request Syntax
{
"AccessConfig": {
"AcceptEula": boolean
,
"ExpectedS3Url": "string
"
},
"HubContentName": "string
",
"HubContentType": "string
",
"HubContentVersion": "string
",
"HubName": "string
",
"MaxResults": number
,
"NextToken": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- AccessConfig
-
Configuration settings for accessing the hub content, including end-user license agreement acceptance for gated models and expected S3 URL validation.
Type: PresignedUrlAccessConfig object
Required: No
- HubContentName
-
The name of the hub content for which to generate presigned URLs. This identifies the specific model or content within the hub.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 63.
Pattern:
[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}
Required: Yes
- HubContentType
-
The type of hub content to access. Valid values include
Model
,Notebook
, andModelReference
.Type: String
Valid Values:
Model | Notebook | ModelReference
Required: Yes
- HubContentVersion
-
The version of the hub content. If not specified, the latest version is used.
Type: String
Length Constraints: Minimum length of 5. Maximum length of 14.
Pattern:
\d{1,4}.\d{1,4}.\d{1,4}
Required: No
- HubName
-
The name or Amazon Resource Name (ARN) of the hub that contains the content. For public content, use
SageMakerPublicHub
.Type: String
Pattern:
(arn:[a-z0-9-\.]{1,63}:sagemaker:\w+(?:-\w+)+:(\d{12}|aws):hub\/)?[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}
Required: Yes
- MaxResults
-
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.
Type: Integer
Valid Range: Minimum value of 1. Maximum value of 100.
Required: No
- NextToken
-
A token for pagination. Use this token to retrieve the next set of presigned URLs when the response is truncated.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 8192.
Pattern:
.*
Required: No
Response Syntax
{
"AuthorizedUrlConfigs": [
{
"LocalPath": "string",
"Url": "string"
}
],
"NextToken": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- AuthorizedUrlConfigs
-
An array of authorized URL configurations, each containing a presigned URL and its corresponding local file path for proper file organization during download.
Type: Array of AuthorizedUrl objects
- NextToken
-
A token for pagination. If present, indicates that more presigned URLs are available. Use this token in a subsequent request to retrieve additional URLs.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 8192.
Pattern:
.*
Errors
For information about the errors that are common to all actions, see Common Errors.
See Also
For more information about using this API in one of the language-specific Amazon SDKs, see the following: