Create US3 Token - CreateUFileToken
Overview
Create US3 Token
Definition
Public Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Action | string | Corresponding API command name, the current API is CreateUFileToken . | 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, sub-accounts must be filled in. Please refer to the GetProjectList interface. | No |
TokenName | string | Token Name | Yes |
AllowedOps.N | string | Actions allowed by the token [TOKEN_ALLOW_NONE No permission, TOKEN_ALLOW_READ Download permission, TOKEN_ALLOW_WRITE Upload permission, TOKEN_ALLOW_DELETE Deletion permission, TOKEN_ALLOW_LIST List permission, TOKEN_ALLOW_IOP Image processing permission, TOKEN_DENY_UPDATE Prohibit overwrite permission]. Default is TOKEN_ALLOW_NONE | No |
AllowedPrefixes.N | string | The token allows the operation of key prefixes, default * represents all. | No |
AllowedBuckets.N | string | The token allows operations on the bucket, default * means all. | No |
ExpireTime | int | Unix timestamp, accurate to the second, is the expiration time of the token. The default expiration time is one day (i.e., the current Unix timestamp + 86400); Note: The expiration time cannot exceed 4102416000. | No |
BlackIPList.N | string | Token Blacklist, supports ipv4, ipv6 formats. | No |
WhiteIPList.N | string | Token whitelist, supports ipv4, ipv6 formats. | 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 |
TokenId | string | Token Unique ID | No |
UFileTokenSet | UFileTokenSet | Details of Creating Token | No |
Data Model
UFileTokenSet
Field Name | Type | Description Information | Required |
---|---|---|---|
Region | string | Region | Yes |
TokenId | string | Token ID | Yes |
TokenName | string | Token Name | Yes |
PublicKey | string | Token Public Key | Yes |
PrivateKey | string | Token Private Key | Yes |
AllowedOps | array[string] | The actions that the token allows to perform, [TOKEN_ALLOW_NONE No permissions, TOKEN_ALLOW_READ Download permissions, TOKEN_ALLOW_WRITE Upload permissions, TOKEN_ALLOW_DELETE Delete permissions, TOKEN_ALLOW_LIST List permissions, TOKEN_ALLOW_IOP Image processing permissions] | Yes |
AllowedPrefixes | array[string] | The key prefix that the token allows to operate | Yes |
AllowedBuckets | array[string] | The token allows operation of the bucket | Yes |
ExpireTime | int | Expiration time of the token | Yes |
CreateTime | int | Creation Time | Yes |
ModifyTime | int | Modification Time | Yes |
BlackIPList | array[string] | Token Blacklist | No |
WhiteIPList | array[string] | Token Whitelist | No |
Example
Request Example
https://api.ucloud-global.com/?Action=CreateUFileToken
&Region=ZidvwRDV
&ProjectId=ykZiYbvH
&TokenName=ZwctpTkP
&AllowedOps.n=yes
&AllowedPrefixes.n=BxWpXPuh
&AllowedBuckets.n=tPAdQHnf
&ExpireTime=3
&BlackIPList.n=WGGVYtQm
&WhiteIPList.n=kBRhXipR
Response Example
{
"Action": "CreateUFileTokenResponse",
"RetCode": 0,
"TokenId": "ygqCyolZ",
"UFileTokenSet": {}
}