Get Resource Names

GET/zstack/v1/resources/names

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/names?uuids=393ce06589043e33b397bc21043e8cd4&uuids=b62bdb31280a30a69c2f110bac8cb682

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidsListqueryResource UUID list 0.6
systemTags (Optional)Listquery  0.6
userTags (Optional)Listquery  0.6

API Response

Response example

{
  "inventories": [
    {
      "uuid": "9da599e443ec3d21bb4c766ad51784d3",
      "resourceName": "zone",
      "resourceType": "ZoneVO"
    },
    {
      "uuid": "a6e1b35c657835c5972e94773e52949b",
      "resourceName": "vm",
      "resourceType": "VmInstanceVO"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. This field is null on success. For details, see error2.0
inventoriesListFor details, see inventories2.0

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 resource, uniquely identifying this resource4.0.0
resourceNameStringResource name4.0.0
resourceTypeStringResource type, e.g., VmInstanceVO for virtual machines4.0.0

SDK Examples

Java SDK

GetResourceNamesAction action = new GetResourceNamesAction();
action.uuids = asList("393ce06589043e33b397bc21043e8cd4","b62bdb31280a30a69c2f110bac8cb682");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetResourceNamesAction.Result res = action.call();

Python SDK

GetResourceNamesAction action = GetResourceNamesAction()
action.uuids = [393ce06589043e33b397bc21043e8cd4, b62bdb31280a30a69c2f110bac8cb682]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetResourceNamesAction.Result res = action.call()