Queries a pair of temporary username and password that you use to log on to a Container Registry instance.
Operation Description
The temporary password returned after you call this API operation is a Security Token Service (STS) token whose validity period is 1 hour. Take note of the following items when you log on to Container Registry instances by using an STS token:
- If the STS token belongs to an Alibaba Cloud account, you can use the STS token to log on to all Container Registry instances that belong to the Alibaba Cloud account.
- If the STS token belongs to a Resource Access Management (RAM) user, you can use the STS token to log on to all Container Registry instances that belong to the RAM user.
- You can use an STS token to access only Container Registry instances to which the STS token is scoped.
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.
Operation | Access level | Resource type | Condition key | Association operation |
---|---|---|---|---|
cr:GetAuthorizationToken | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | Yes | The ID of the Container Registry instance. | cri-kmsiwlxxdcvaduwb |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "E069EB86-E6AD-4A98-ADDE-0E993390239A",
"ExpireTime": 1571242083000,
"Code": "success",
"IsSuccess": true,
"TempUsername": "temp_user_cr",
"AuthorizationToken": "shaunadadakks:uuczxnjcyeyhdjadkkajsjdjadhyucb"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
403 | NoPrivilege | Access denied for this user. |
500 | SystemError | Unknown error. |
For a list of error codes, visit the Service error codes.