All Products
Search
Document Center

Container Registry:CreateRepoSyncRule

Last Updated:Apr 18, 2023

Creates an image synchronization rule for an image repository.

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:
    • The required resource types are displayed in bold characters.
    • 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.
OperationAccess levelResource typeCondition keyAssociation operation
cr:CreateRepoSyncRuleRead
  • CR
    acs:cr:{#regionId}:{#accountId}:repository/{#instanceid}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the source instance.

cri-hpdfkc6utbaq****
NamespaceNamestringYes

The namespace name of the source instance.

ns1
RepoNamestringYes

The image repository name of the source instance.

repo1
TargetRegionIdstringYes

The region ID of the destination instance.

cn-shanghai
TargetInstanceIdstringYes

The ID of the destination instance.

cri-ibxs3piklys3****
TargetNamespaceNamestringYes

The namespace name of the destination instance.

ns1
TargetRepoNamestringYes

The image repository name of the destination instance.

repo1
TagFilterstringYes

The regular expression used to filter image tags.

.*
SyncScopestringYes

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.
REPO
SyncRuleNamestringYes

The name of the synchronization rule.

rule
SyncTriggerstringYes

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

  • INITIATIVE: manually triggers the synchronization rule.
  • PASSIVE: automatically triggers the synchronization rule.
PASSIVE
TargetUserIdstringNo

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

NoteIf you synchronize images across Alibaba Cloud accounts, you must use the UID.
12645940***

Response parameters

ParameterTypeDescriptionExample
object
Codestring

The return value.

success
SyncRuleIdstring

The ID of the synchronization rule.

crsr-gk5p2ns1kzns****
IsSuccessboolean

Indicates whether the request is successful.

true
RequestIdstring

The ID of the request.

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

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError message
403NoPrivilegeAccess denied for this user.
500SystemErrorUnknown error.

For a list of error codes, visit the Service error codes.