Get Resource Account

GET/zstack/v1/resources/accounts

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/resources/accounts?resourceUuids=59fc59531b6639b3b0bd6263b021df4c&resourceUuids=77115316d36839e9b1a4f832f38de8ba

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
resourceUuidsListquery  0.6
systemTags (Optional)Listquery  0.6
userTags (Optional)Listquery  0.6

API Response

Response example

{
  "inventories": {
    "db4e395223813bafa838ce4285a78757": {
      "uuid": "ef68adaf368335ab8d15a4c2195749a7",
      "name": "test",
      "type": "Normal"
    },
    "736ee9f80a2230658e999c17e5be1835": {
      "uuid": "ef68adaf368335ab8d15a4c2195749a7",
      "name": "test",
      "type": "Normal"
    }
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. This field is null on success. For details, see error0.6
inventoriesMapFor details, see inventories0.6

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.10010.6
descriptionStringA brief description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. Default is null0.6
opaqueLinkedHashMapReserved field. Default is null0.6
causeErrorCodeThe root error that caused the current error. This field is null if there is no root cause0.6

inventories

NameTypeDescriptionStarting Version
uuidStringThe UUID of the account, uniquely identifying this resource4.0.0
nameStringAccount name4.0.0
descriptionStringDetailed description of the account4.0.0
typeStringAccount type4.0.0
stateStringAccount state4.0.0
createDateTimestampCreation time4.0.0
lastOpDateTimestampLast modification time4.0.0

SDK Examples

Java SDK

GetResourceAccountAction action = new GetResourceAccountAction();
action.resourceUuids = asList("59fc59531b6639b3b0bd6263b021df4c","77115316d36839e9b1a4f832f38de8ba");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetResourceAccountAction.Result res = action.call();

Python SDK

GetResourceAccountAction action = GetResourceAccountAction()
action.resourceUuids = [59fc59531b6639b3b0bd6263b021df4c, 77115316d36839e9b1a4f832f38de8ba]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetResourceAccountAction.Result res = action.call()