Creates an image synchronization rule for an image repository.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateRepoSyncRule

The operation that you want to perform. Set the value to CreateRepoSyncRule.

InstanceId String Yes cri-hpdfkc6utbaqi5ab

The ID of the source instance.

NamespaceName String Yes ns1

The name of the source namespace.

RegionId String Yes cn-shanghai

The ID of the region where the source instance resides.

RepoName String Yes repo1

The name of the source repository.

SyncRuleName String Yes rule

The name of the synchronization rule.

SyncScope String Yes REPO

The scope to which the synchronization rule applies. Valid values: REPO and NAMESPACE.

SyncTrigger String Yes PASSIVE

The policy configured to trigger the synchronization rule. Valid values: INITIATIVE and PASSIVE.

TagFilter String Yes . *

The regular expression used to filter image tags.

TargetInstanceId String Yes cri-ibxs3piklys3sraa

The ID of the destination instance.

TargetNamespaceName String Yes ns1

The name of the destination namespace.

TargetRegionId String Yes cn-shanghai

The ID of the region where the destination instance resides.

TargetRepoName String Yes repo1

The name of the destination repository.

Response parameters

Parameter Type Example Description
Code String success

The return value.

IsSuccess Boolean true

Indicates whether the operation is successful.

RequestId String 8F8A0BA6-7F06-4BAE-B147-10BD6A258BF4

The ID of the request.

SyncRuleId String crsr-gk5p2ns1kznsqtgk

The ID of the synchronization rule.

Examples

Sample requests

http(s)://[Endpoint]/? Action=CreateRepoSyncRule
&InstanceId=cri-hpdfkc6utbaqi5ab
&NamespaceName=ns1
&RegionId=cn-shanghai
&RepoName=repo1
&SyncRuleName=rule
&SyncScope=REPO
&SyncTrigger=*
&TagFilter=. *
&TargetInstanceId=cri-ibxs3piklys3sraa
&TargetNamespaceName=ns1
&TargetRegionId=cn-shanghai
&TargetRepoName=repo1
&<Common request parameters>

Sample success responses

XML format

<IsSuccess>true</IsSuccess>
<SyncRuleId>crsr-gk5p2ns1kznsqtgk</SyncRuleId>
<RequestId>8F8A0BA6-7F06-4BAE-B147-10BD6A258BF4</RequestId>
<Code>success</Code>

JSON format

{
    "IsSuccess":true,
    "SyncRuleId":"crsr-gk5p2ns1kznsqtgk",
    "RequestId":"8F8A0BA6-7F06-4BAE-B147-10BD6A258BF4",
    "Code":"success"
}

Error codes

For a list of error codes, visit the API Error Center.