Query User Tags

GET/zstack/v1/user-tags
GET/zstack/v1/user-tags/{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/user-tags?q=resourceType=DiskOfferingVO&q=tag=for-large-DB
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/user-tags/e2a3aa3463dd382fb9e434304167f331

Queryable Fields

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

API Response

Response example

{
  "inventories": [
    {
      "uuid": "ae4f2dd05a513e1e8d350d448c2071a9",
      "resourceType": "DiskOfferingVO",
      "tag": "for-large-DB",
      "type": "User",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. 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
detailsStringThe detailed error information0.6
elaborationStringReserved field. Defaults to null0.6
opaqueLinkedHashMapReserved field. Defaults to null0.6
causeErrorCodeThe root error, the cause of the current error. This field is null if there is no root error0.6

inventories

NameTypeDescriptionStarting Version
uuidStringThe resource UUID, uniquely identifying this resource0.6
resourceUuidStringUser-specified resource UUID. If specified, the system will not randomly assign a UUID to this resource0.6
resourceTypeStringWhen creating a tag, the user must specify the resource type associated with the tag0.6
tagStringTag string0.6
typeStringReserved field. Do not use it0.6
createDateTimestampCreation time0.6
lastOpDateTimestampLast modification time0.6

SDK Examples

Java SDK

QueryUserTagAction action = new QueryUserTagAction();
action.conditions = asList("resourceType=DiskOfferingVO","tag=for-large-DB");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryUserTagAction.Result res = action.call();

Python SDK

QueryUserTagAction action = QueryUserTagAction()
action.conditions = ["resourceType=DiskOfferingVO","tag=for-large-DB"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryUserTagAction.Result res = action.call()