Query Tags

GET/zstack/v1/tags
GET zstack/v1/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/tags
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/tags/6f81ada534e3363f9e8a00caa2f48564

Queryable Fields

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

API Response

Response example

{
  "inventories": [
    {
      "uuid": "f7ac675964d0386b89d8df713f68aee0",
      "name": "SSD",
      "value": "SSD",
      "description": "SSD volume",
      "color": "#FFFFFF",
      "type": "simple",
      "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 error3.2.0
inventoriesListFor details, see inventories3.2.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number, a globally unique identifier for the error, e.g., SYS.1000, HOST.10013.2.0
descriptionStringA brief description of the error3.2.0
detailsStringThe detailed error information3.2.0
elaborationStringReserved field. Defaults to null3.2.0
opaqueLinkedHashMapReserved field. Defaults to null3.2.0
causeErrorCodeThe root error, the cause of the current error. This field is null if there is no root error3.2.0

inventories

NameTypeDescriptionStarting Version
uuidStringThe resource UUID, uniquely identifying this resource3.2.0
nameStringResource name3.2.0
valueString 3.2.0
descriptionStringDetailed description of the resource3.2.0
colorString 3.2.0
createDateTimestampCreation time3.2.0
lastOpDateTimestampLast modification time3.2.0
typeTagPatternTypeFor details, see type3.2.0

type

NameTypeDescriptionStarting Version
nameStringResource name3.2.0
ordinalint 3.2.0

SDK Examples

Java SDK

QueryTagAction action = new QueryTagAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryTagAction.Result res = action.call();

Python SDK

QueryTagAction action = QueryTagAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryTagAction.Result res = action.call()