CreatePullThroughCacheRule
Creates a pull through cache rule. A pull through cache rule provides a way to cache images from an external public registry in your Amazon ECR private registry.
Request Syntax
{
"ecrRepositoryPrefix": "string
",
"registryId": "string
",
"upstreamRegistryUrl": "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.
- ecrRepositoryPrefix
-
The repository name prefix to use when caching images from the source registry.
Type: String
Length Constraints: Minimum length of 2. Maximum length of 20.
Pattern:
[a-z0-9]+(?:[._-][a-z0-9]+)*
Required: Yes
- registryId
-
The AWS account ID associated with the registry to create the pull through cache rule for. If you do not specify a registry, the default registry is assumed.
Type: String
Pattern:
[0-9]{12}
Required: No
- upstreamRegistryUrl
-
The registry URL of the upstream public registry to use as the source for the pull through cache rule.
Type: String
Required: Yes
Response Syntax
{
"createdAt": number,
"ecrRepositoryPrefix": "string",
"registryId": "string",
"upstreamRegistryUrl": "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.
- createdAt
-
The date and time, in JavaScript date format, when the pull through cache rule was created.
Type: Timestamp
- ecrRepositoryPrefix
-
The Amazon ECR repository prefix associated with the pull through cache rule.
Type: String
Length Constraints: Minimum length of 2. Maximum length of 20.
Pattern:
[a-z0-9]+(?:[._-][a-z0-9]+)*
- registryId
-
The registry ID associated with the request.
Type: String
Pattern:
[0-9]{12}
- upstreamRegistryUrl
-
The upstream registry URL associated with the pull through cache rule.
Type: String
Errors
For information about the errors that are common to all actions, see Common Errors.
- InvalidParameterException
-
The specified parameter is invalid. Review the available parameters for the API request.
HTTP Status Code: 400
- LimitExceededException
-
The operation did not succeed because it would have exceeded a service limit for your account. For more information, see Amazon ECR service quotas in the Amazon Elastic Container Registry User Guide.
HTTP Status Code: 400
- PullThroughCacheRuleAlreadyExistsException
-
A pull through cache rule with these settings already exists for the private registry.
HTTP Status Code: 400
- ServerException
-
These errors are usually caused by a server-side issue.
HTTP Status Code: 500
- UnsupportedUpstreamRegistryException
-
The specified upstream registry isn't supported.
HTTP Status Code: 400
- ValidationException
-
There was an exception validating this request.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: