Creates an image synchronization rule for an image repository.
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 Resources
is 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:CreateSyncRule | create | *Repository acs:cr:{#regionId}:{#accountId}:repository/{#instanceid} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | Yes | The source instance ID. | cri-hpdfkc6utbaq**** |
NamespaceName | string | Yes | The namespace name of the source instance. | ns1 |
RepoName | string | No | The name of the image repository in the source instance. | repo1 |
TargetRegionId | string | Yes | The region ID of the destination instance. | cn-shanghai |
TargetInstanceId | string | Yes | The destination instance ID. | cri-ibxs3piklys3**** |
TargetNamespaceName | string | Yes | The namespace name of the destination instance. | ns1 |
TargetRepoName | string | No | The name of the image repository in the destination instance. | repo1 |
RepoNameFilter | string | No | The regular expression that is used to filter repositories. Note
This parameter is valid only when SyncScope is set to NAMESPACE .
| .* |
TagFilter | string | Yes | The regular expression that is used to filter image tags. | .* |
SyncScope | string | Yes | The synchronization scope. Valid values:
| REPO |
SyncRuleName | string | Yes | The name of the image synchronization rule. | rule |
SyncTrigger | string | Yes | The mode of triggering the synchronization rule. Valid values:
| PASSIVE |
TargetUserId | string | No | The user ID (UID) of the account to which the destination instance belongs. Note
If you synchronize images across accounts, you must use the UID.
| 12645940*** |
Response parameters
Examples
Sample success responses
JSON
format
{
"Code": "success",
"SyncRuleId": "crsr-gk5p2ns1kzns****",
"IsSuccess": true,
"RequestId": "8F8A0BA6-7F06-4BAE-B147-10BD6A25****"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
403 | NoPrivilege | Access denied for this user. |
500 | SystemError | Unknown error. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-12-24 | The Error code has changed. The request parameters of the API has changed | View Change Details |