Query Account Resource References

GET/zstack/v1/accounts/resources/refs

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/accounts/resources/refs?q=acountUuid=279c136f406e35a6a6874e39b231a2d3

Queryable Fields

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

API Response

Response example

{
  "inventories": [
    {
      "id": 1,
      "accountUuid": "ef9a9b4c5bd338768f18148dbfe42f1c",
      "resourceUuid": "6e06fe5d204f30ac80ffc4c2d6372e46",
      "resourceType": "ImageVO",
      "type": "Own"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. This field is null on success. For details, see error0.6
inventoriesListFor 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
accountUuidStringAccount UUID0.6
resourceUuidStringResource UUID0.6
resourceTypeStringResource type0.6
createDateTimestampCreation time0.6
lastOpDateTimestampLast modification time0.6

SDK Examples

Java SDK

QueryAccountResourceRefAction action = new QueryAccountResourceRefAction();
action.conditions = asList("acountUuid=dec9472c2f9b3f6abaa84ed78094171c");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryAccountResourceRefAction.Result res = action.call();

Python SDK

QueryAccountResourceRefAction action = QueryAccountResourceRefAction()
action.conditions = ["acountUuid=05e51ebc332935769868ecde43b8f8e6"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryAccountResourceRefAction.Result res = action.call()