CreateAccessKey

API Request

URLs
POST zstack/v1/accesskeys
Headers
Authorization: OAuth the-session-uuid
Body
{   "params": {     "accountUuid": "db517023502d34ef9309e49674af88d0",     "userUuid": "019f0d7b414b31d98a8de6cab4a8b999"   },   "systemTags": [],   "userTags": [] }
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X POST -d '{"params":{"accountUuid":"db517023502d34ef9309e49674af88d0","userUuid":"019f0d7b414b31d98a8de6cab4a8b999"}}' http://localhost:8080/zstack/v1/accesskeys
Request Parameters
Name Type Location Description Optional Value Starting Version
accountUuid String body (contained in the params structure) The account UUID. 3.2.0
userUuid String body (contained in the params structure) The user UUID. 3.2.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 3.2.0
AccessKeyID String body (contained in the params structure) Optional. The generated AccessKey ID. 3.7.0
AccessKeySecret String body (contained in the params structure) Optional. The generated AccessKey Secret. 3.7.0
resourceUuid String body (contained in the params structure) Optional. 3.2.0
systemTags List body Optional. 3.2.0
userTags List body Optional. 3.2.0

API Response

Sample Response
{   "inventory": {     "uuid": "01f82a92a3f83136b3a5fa13b0f1dde6",     "accountUuid": "bc81e5aad7363ebaa904ee81edbfdd1f",     "userUuid": "20e90349268736d7950284d122f64213",     "AccessKeyID": "1234567890abcdedfhij",     "AccessKeySecret": "1234567890abcdedfhij1234567890abcdedfhij",     "state": "Enabled"   } }
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.2.0
inventory AccessKeyInventory See inventory. 3.2.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.2.0
description String The brief description of the error. 3.2.0
details String The details about the error. 3.2.0
elaboration String The reserved field. Default value: null. 3.2.0
opaque LinkedHashMap The reserved field. Default value: null. 3.2.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.2.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.2.0
description String The detailed description of the resource. 3.2.0
accountUuid String The account UUID. 3.2.0
userUuid String The user UUID. 3.2.0
AccessKeyID String 3.2.0
AccessKeySecret String 3.2.0
createDate Timestamp The creation date. 3.2.0
lastOpDate Timestamp The last operation date. 3.2.0
state AccessKeyState See state. 3.2.0
#state
Name Type Description Starting Version
name String The resource name. 3.2.0
ordinal int 3.2.0

SDK Sample

Java SDK
CreateAccessKeyAction action = new CreateAccessKeyAction(); action.accountUuid = "db517023502d34ef9309e49674af88d0"; action.userUuid = "019f0d7b414b31d98a8de6cab4a8b999"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; CreateAccessKeyAction.Result res = action.call();
Python SDK
CreateAccessKeyAction action = CreateAccessKeyAction() action.accountUuid = "db517023502d34ef9309e49674af88d0" action.userUuid = "019f0d7b414b31d98a8de6cab4a8b999" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" CreateAccessKeyAction.Result res = action.call()

DeleteAccessKey

API Request

URLs
DELETE zstack/v1/accesskeys/{uuid}?deleteMode={deleteMode}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X DELETE http://localhost:8080/zstack/v1/accesskeys/7fcbb0096e3d3e2a8dd4f83610d3dac9?deleteMode=Permissive
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The AccessKey UUID. 3.2.0
deleteMode String url Optional. 3.2.0
systemTags List body Optional. 3.2.0
userTags List body Optional. 3.2.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{ 	"error": { 		"code": "SYS.1001", 		"description": "A message or a operation timeout", 		"details": "Create VM on KVM timeout after 300s" 	} }

SDK Sample

Java SDK
DeleteAccessKeyAction action = new DeleteAccessKeyAction(); action.uuid = "7fcbb0096e3d3e2a8dd4f83610d3dac9"; action.deleteMode = "Permissive"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; DeleteAccessKeyAction.Result res = action.call();
Python SDK
DeleteAccessKeyAction action = DeleteAccessKeyAction() action.uuid = "7fcbb0096e3d3e2a8dd4f83610d3dac9" action.deleteMode = "Permissive" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" DeleteAccessKeyAction.Result res = action.call()

QueryAccessKey

API Request

URLs
GET zstack/v1/accesskeys GET zstack/v1/accesskeys/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X GET http://localhost:8080/zstack/v1/accesskeys?q=uuid=fc008e53779632989bf9393ecf074e25
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X GET http://localhost:8080/zstack/v1/accesskeys/f99c1aea4a6e35e4a88c6abfe11cce8d

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryAccessKey, and pressing the Tab key.

API Response

Sample Response
{   "inventories": [     {       "uuid": "12be3dd32afa3cf2afa4c06037f218b7",       "accountUuid": "324ecf74dd5c3b9a9f2b75edfdbd858f",       "userUuid": "49c0bc4cfa6d3a67930fe4a4cc32248c",       "AccessKeyID": "1234567890abcdedfhij",       "AccessKeySecret": "1234567890abcdedfhij1234567890abcdedfhij",       "state": "Enabled"     }   ] }
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.2.0
inventories List See inventories. 3.2.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.2.0
description String The brief description of the error. 3.2.0
details String The details about the error. 3.2.0
elaboration String The reserved field. Default value: null. 3.2.0
opaque LinkedHashMap The reserved field. Default value: null. 3.2.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.2.0
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 3.2.0
description String The detailed description of the resource. 3.2.0
accountUuid String The account UUID. 3.2.0
userUuid String The user UUID. 3.2.0
AccessKeyID String 3.2.0
AccessKeySecret String 3.2.0
createDate Timestamp The creation date. 3.2.0
lastOpDate Timestamp The last operation date. 3.2.0
state AccessKeyState See state. 3.2.0
#state
Name Type Description Starting Version
name String The resource name. 3.2.0
ordinal int 3.2.0

SDK Sample

Java SDK
QueryAccessKeyAction action = new QueryAccessKeyAction(); action.conditions = asList("uuid=f0c530f17978349faa8c4736accd0375"); action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; QueryAccessKeyAction.Result res = action.call();
Python SDK
QueryAccessKeyAction action = QueryAccessKeyAction() action.conditions = ["uuid=ee3c98b8528e3fe2aa9d817cd48b1358"] action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" QueryAccessKeyAction.Result res = action.call()

Back to Top

Download

Already filled the basic info?Click here.

Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

An email with a verification code will be sent to you. Make sure the address you provided is valid and correct.

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.

Email Us

contact@zstack.io
ZStack Training and Certification
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

Email Us

contact@zstack.io
Request Trial
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

Email Us

contact@zstack.io

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder.
Or click on the URL below. (For Internet Explorer, right-click the URL and save it.)

Thank you for using ZStack products and services.

Submit successfully.

We'll connect soon.

Thank you for using ZStack products and services.