Creates a synchronization rule for an image repository.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cr:CreateSyncRule |
create |
*Repository
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the source instance. |
cri-hpdfkc6utbaq**** |
| NamespaceName |
string |
No |
The namespace name of the source instance. |
ns1 |
| RepoName |
string |
No |
The repository name of the source instance. |
repo1 |
| TargetRegionId |
string |
Yes |
The region ID of the target instance. |
cn-shanghai |
| TargetInstanceId |
string |
Yes |
The ID of the target instance. |
cri-ibxs3piklys3**** |
| TargetNamespaceName |
string |
No |
The namespace name of the target instance. |
ns1 |
| TargetRepoName |
string |
No |
The image repository name of the target instance. |
repo1 |
| NamespaceNameFilter |
string |
No |
The instance-level namespace regex filter. Note
This parameter takes effect only when SyncScope is set to |
.* |
| RepoNameFilter |
string |
No |
The repository filter rule. Note
This parameter takes effect only when SyncScope is set to |
.* |
| TagFilter |
string |
Yes |
The tag filter rule. |
.* |
| SyncScope |
string |
Yes |
The synchronization type. Valid values:
|
REPO |
| SyncRuleName |
string |
Yes |
The name of the synchronization rule. |
rule |
| SyncTrigger |
string |
No |
The trigger for the synchronization action. Valid values:
|
PASSIVE |
| TargetUserId |
string |
No |
The UID of the account to which the target instance belongs. Note
This parameter is required for cross-account image synchronization. |
12645940*** |
| LinkId |
string |
No |
The ID of the custom synchronization link. |
stl-72cjfd3fayno8*** |
| Priority |
integer |
No |
The execution priority of the synchronization task. Synchronization tasks are executed in descending order of priority. Tasks with the same priority are executed in random order. Valid values: 1 to 5. Default value: 3. |
3 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The response code. |
success |
| SyncRuleId |
string |
The ID of the synchronization rule. |
crsr-gk5p2ns1kzns**** |
| IsSuccess |
boolean |
Indicates whether the request was successful. |
true |
| RequestId |
string |
The request ID. |
8F8A0BA6-7F06-4BAE-B147-10BD6A25**** |
Examples
Success response
JSON format
{
"Code": "success",
"SyncRuleId": "crsr-gk5p2ns1kzns****",
"IsSuccess": true,
"RequestId": "8F8A0BA6-7F06-4BAE-B147-10BD6A25****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 500 | SystemError | Unknown error. | |
| 403 | NoPrivilege | Access denied for this user. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.