Update Token - UpdateUFileToken
Overview
Update the operation permissions of the token, can operate the prefix of the key, can operate the bucket and the token expiration time point.
Definition
Public Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Action | string | Corresponding API command name, the current API is UpdateUFileToken . | Yes |
PublicKey | string | The user's public key can be obtained from Console (opens in a new tab) | Yes |
Signature | string | User signature generated based on public key and API command, see Signature Algorithm | Yes |
Request Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Region | string | Region. See List of Regions and Availability Zones | No |
ProjectId | string | Project ID. If not filled in, the default project is used, and the sub-account must be filled in. Please refer to the GetProjectList interface. | Yes |
TokenId | string | Token ID | Yes |
TokenName | string | Token Name | No |
AllowedOps.N | string | The operations that the token allows to perform, [ TOKEN_ALLOW_NONE , TOKEN_ALLOW_READ , TOKEN_ALLOW_WRITE , TOKEN_ALLOW_DELETE , TOKEN_ALLOW_LIST, TOKEN_ALLOW_IOP , TOKEN_ALLOW_DP ] | No |
AllowedPrefixes.N | string | The key prefix that the token allows to operate | No |
AllowedBuckets.N | string | The token allows operation of the bucket | No |
ExpireTime | int | Expiration time of the token (timestamp); Note: The expiration time cannot exceed 4102416000 | No |
Response Field
Field Name | Type | Description Information | Required |
---|---|---|---|
RetCode | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. | Yes |
Action | string | Operation command name. | Yes |
Message | string | Returns an error message, providing detailed description when RetCode is non-zero. | No |
Example
Request Example
https://api.surfercloud.com/?Action=UpdateUFileToken
&ProjectId=org-xxx
&Region=cn-bj
&TokenId=679c7e5e-74b8-4048-b622-33dd4e8634db
&TokenName=testname
&AllowedOps.0=TOKEN_ALLOW_READ
&AllowedOps.1=TOKEN_ALLOW_WRITE
&AllowedPrefixes.0=test/test
&AllowedPrefixes.1=test1/test1
&AllowedPrefixes.2=test2/test2
&AllowedBuckets.0=bucket0
&AllowedBuckets.1=bucket1
&ExpireTime=1520411979
Response Example
{
"Action": "UpdateUFileTokenResponse",
"RetCode": 0
}