All Products
Search
Document Center

Security Center:AddPrivateRegistry

Last Updated:Nov 14, 2024

Adds a self-managed image repository.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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 keyAssociated operation
yundun-sas:AddPrivateRegistrycreate
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegistryTypestringYes

The type of the private image repository. Valid values:

  • harbor
  • quay
harbor
RegistryVersionstringYes

The version of the image repository. Valid values:

  • V1
  • V2
V2
ProtocolTypelongYes

The type of the protocol. Valid values:

  • 1: HTTP
  • 2: HTTPS
2
NetTypelongYes

The network type. Valid values:

  • 1: Internet
  • 2: virtual private cloud (VPC)
2
VpcIdstringNo

The ID of the VPC.

vpc-wz9hs3e5*******908kd
RegistryHostIpstringYes

The IP address of the image repository.

114.55.**.**
DomainNamestringYes

The domain name of the image repository.

example.com
UserNamestringYes

The username that is used to log on to the image repository.

xxxxx
PasswordstringYes

The password that is used to log on to the image repository.

******
RegistryRegionIdstringYes

The region ID.

Note You can call the ListImageRegistryRegion operation to query the IDs of supported regions.
cn-hangzhou
TransPerHourintegerNo

The number of images that are scanned per hour.

10
ExtraParamstringNo

The additional parameter of the image repository. This parameter is required when you set the RegistryType parameter to quay. Valid values:

  • namespace
  • authToken
[{"namespace":"aa","authToken":"aa"}]
PortintegerNo

The port number.

80

Response parameters

ParameterTypeDescriptionExample
object

The data returned.

RequestIdstring

The ID of the request, which is used to locate and troubleshoot issues.

F8B6F758-BCD4-597A-8A2C-DA5A552C****
Dataobject

The handling result.

VpcIdstring

The ID of the VPC.

vpc-2vchkxmf2j9yjt3x2****
Tokenstring

The value of the token.

3c3c602c-fa1f-4bc0-992f-b4b2cac7****
TransPerHourinteger

The number of scan tasks that are performed per hour.

10
AliUidlong

The ID of the user.

1766185894104***
RegistryTypestring

The type of the image repository. Valid values:

  • harbor
  • quay
harbor
DomainNamestring

The domain name of the image repository.

example.com
RegionIdstring

The region ID of the image repository.

cn-hangzhou
Passwordstring

The password.

***********
NetTypelong

The network type. Valid values:

  • 1: Internet
  • 2: VPC
2
RegistryVersionstring

The version of the image repository. Default value: -. Valid values:

  • -: the default version
  • V1
  • V2
V2
ProtocolTypelong

The type of the protocol. Valid values:

  • 1: HTTP
  • 2: HTTPS
2
RegistryHostIpstring

The IP address of the image repository.

114.55.**.**
UserNamestring

The username.

******
Idlong

The ID of the image repository.

273698***

Examples

Sample success responses

JSONformat

{
  "RequestId": "F8B6F758-BCD4-597A-8A2C-DA5A552C****",
  "Data": {
    "VpcId": "vpc-2vchkxmf2j9yjt3x2****",
    "Token": "3c3c602c-fa1f-4bc0-992f-b4b2cac7****",
    "TransPerHour": 10,
    "AliUid": 0,
    "RegistryType": "harbor",
    "DomainName": "example.com",
    "RegionId": "cn-hangzhou",
    "Password": "***********",
    "NetType": 2,
    "RegistryVersion": "V2",
    "ProtocolType": 2,
    "RegistryHostIp": "114.55.**.**",
    "UserName": "******",
    "Id": 0
  }
}

Error codes

HTTP status codeError codeError messageDescription
403NoPermissioncaller has no permissionYou are not authorized to do this operation.
500ServerErrorServerError-

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

Change history

Change timeSummary of changesOperation
2023-09-07The request parameters of the API has changedView Change Details