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.

RegionId String Yes cn-shanghai

The region ID of the source instance.

InstanceId String Yes cri-hpdfkc6utbaq****

The ID of the source instance.

NamespaceName String Yes ns1

The namespace name of the source instance.

RepoName String Yes repo1

The image repository name of the source instance.

TargetRegionId String Yes cn-shanghai

The region ID of the destination instance.

TargetInstanceId String Yes cri-ibxs3piklys3****

The ID of the destination instance.

TargetNamespaceName String Yes ns1

The namespace name of the destination instance.

TargetRepoName String Yes repo1

The image repository name of the destination instance.

TagFilter String Yes .*

The regular expression used to filter image tags.

SyncScope String Yes REPO

The synchronization scope. Valid values:

  • REPO: synchronizes the image tags in an image repository that meet the synchronization rule.
  • NAMESPACE: synchronizes the image tags in a namespace that meet the synchronization rule.
SyncRuleName String Yes rule

The name of the synchronization rule.

SyncTrigger String Yes PASSIVE

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

  • INITIATIVE: manually triggers the synchronization rule.
  • PASSIVE: automatically triggers the synchronization rule.
TargetUserId String No 12645940***

The user ID (UID) of the account to which the destination instance belongs.

Note If you synchronize images across accounts, you need to use the UID.

Response parameters

Parameter Type Example Description
Code String success

The return value of the status code.

SyncRuleId String crsr-gk5p2ns1kzns****

The ID of the synchronization rule.

IsSuccess Boolean true

Indicates whether the API call is successful.

RequestId String 8F8A0BA6-7F06-4BAE-B147-10BD6A25****

The ID of the request.

Examples

Sample requests

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

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<IsSuccess>true</IsSuccess>
<SyncRuleId>crsr-gk5p2ns1kzns****</SyncRuleId>
<RequestId>8F8A0BA6-7F06-4BAE-B147-10BD6A25****</RequestId>
<Code>success</Code>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

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