Query AccessKey

GET/zstack/v1/accesskeys
GET/zstack/v1/accesskeys/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl Example

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

Run the CLI tool, enter QueryAccessKey and press Tab to view all queryable fields and cross-table queryable resource names.

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "12be3dd32afa3cf2afa4c06037f218b7",
      "accountUuid": "324ecf74dd5c3b9a9f2b75edfdbd858f",
      "userUuid": "49c0bc4cfa6d3a67930fe4a4cc32248c",
      "AccessKeyID": "1234567890abcdedfhij",
      "AccessKeySecret": "1234567890abcdedfhij1234567890abcdedfhij",
      "state": "Enabled"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.0.0
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. Seeerror3.2.0
inventoriesListSeeinventories3.2.0

error

NameTypeDescriptionStarting Version
codeStringError code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field. Defaults to null0.6
opaqueLinkedHashMapReserved field. Defaults to null0.6
causeErrorCodeRoot error. The source error that caused this error. Null if no root cause exists0.6

inventories

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource. Uniquely identifies the resource4.0.0
descriptionStringDetailed description of the resource4.0.0
accountUuidStringAccount UUID4.0.0
userUuidStringThis value is deprecated4.0.0
AccessKeyIDString 4.0.0
AccessKeySecretString 4.0.0
createDateTimestampCreation time4.0.0
lastOpDateTimestampLast modification time4.0.0
stateAccessKeyStateSeestate4.0.0

state

NameTypeDescriptionStarting Version
nameStringResource name4.0.0
ordinalint 4.0.0

SDK Examples

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()