All Products
Search
Document Center

Container Registry:GetAuthorizationToken

更新時間:Nov 20, 2024

Queries a temporary username and a token that you can use to log on to a Container Registry instance.

Operation description

The ID of the Container Registry instance.

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
cr:GetAuthorizationTokenget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the request.

cri-kmsiwlxxdcvaduwb

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The timestamp when the temporary password expires. Unit: milliseconds.

E069EB86-E6AD-4A98-ADDE-0E993390239A
ExpireTimelong

The return value.

1571242083000
Codestring

Indicates whether the API call is successful.

  • true: successful
  • false: failed
success
IsSuccessboolean

The username that is used to log on to the Container Registry instance.

true
TempUsernamestring

The password that is used to log on to the Container Registry instance.

temp_user_cr
AuthorizationTokenstring

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.
shaunadadakks:uuczxnjcyeyhdjadkkajsjdjadhyucb

Examples

Sample success responses

JSONformat

{
  "RequestId": "E069EB86-E6AD-4A98-ADDE-0E993390239A",
  "ExpireTime": 1571242083000,
  "Code": "success",
  "IsSuccess": true,
  "TempUsername": "temp_user_cr",
  "AuthorizationToken": "shaunadadakks:uuczxnjcyeyhdjadkkajsjdjadhyucb"
}

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.

Change history

Change timeSummary of changesOperation
No change history