Creates an artifact subscription rule.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| cr:CreateArtifactSubscriptionRule | create | *Instance acs:cr:{#regionId}:{#accountId}:instance/{#InstanceId} |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| InstanceId | string | Yes | The instance ID. | cri-c0o11woew0k**** |
| SourceProvider | string | Yes | The source of the artifact. Valid values:
| DOCKER_HUB |
| SourceNamespaceName | string | No | The source namespace. | library |
| SourceRepoName | string | No | The source repository. | nginx |
| NamespaceName | string | Yes | The name of the Container Registry namespace. | test-ns |
| RepoName | string | No | The name of the Container Registry repository. | test-repo |
| TagRegexp | string | No | The image tag in the subscription source repository. Regular expressions are supported. | release-v.* |
| TagCount | long | No | The number of subscribed images. | 1 |
| Override | boolean | No | Indicates whether the original image is overwritten. | true |
| Accelerate | boolean | No | Indicates whether an acceleration link is enabled for image subscription. The subscription acceleration feature is in public preview. The feature is optimized based on scheduling policies and network links to accelerate image subscription. | true |
| Platform | array | No | The operating system and architecture. If the source repository contains a multi-arch image, only the specified operating system and architecture are subscribed to the destination repository of the Enterprise Edition instance. Subscribe to the destination repository of an Enterprise Edition instance | |
| string | No | The operating system and architecture. Valid values:
Enumeration Value:
| */* |
Response parameters
Examples
Sample success responses
JSONformat
{
"Code": "success",
"IsSuccess": true,
"RequestId": "02B27D80-FD32-5155-931A-93700779BB9E",
"RuleId": "crasr-lxdfele7dg4****"
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 403 | NoPrivilege | Access is denied for the user. | The user is not authorized. |
| 500 | SystemError | A system error occurred. | An unknown error occurred. |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|
