Creates an image synchronization rule for a 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 that 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 for synchronization in the source repository.

TargetInstanceId String Yes cri-ibxs3piklys3sraa

The ID of the target instance.

TargetNamespaceName String Yes ns1

The name of the target namespace.

TargetRegionId String Yes cn-shanghai

The ID of the region where the target instance resides.

TargetRepoName String Yes repo1

The name of the target repository.

Response parameters

Parameter Type Example Description
IsSuccess Boolean true

Indicates whether the operation is successful.

Code String success

The code returned for the request.

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

JSON format

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

XML format

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

Error codes

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