Query Tags
GET zstack/v1/tags/{uuid}Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/tagscurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/tags/6f81ada534e3363f9e8a00caa2f48564Queryable 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"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 3.2.0 |
| inventories | List | For details, see inventories | 3.2.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number, a globally unique identifier for the error, e.g., SYS.1000, HOST.1001 | 3.2.0 |
| description | String | A brief description of the error | 3.2.0 |
| details | String | The detailed error information | 3.2.0 |
| elaboration | String | Reserved field. Defaults to null | 3.2.0 |
| opaque | LinkedHashMap | Reserved field. Defaults to null | 3.2.0 |
| cause | ErrorCode | The root error, the cause of the current error. This field is null if there is no root error | 3.2.0 |
inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID, uniquely identifying this resource | 3.2.0 |
| name | String | Resource name | 3.2.0 |
| value | String | 3.2.0 | |
| description | String | Detailed description of the resource | 3.2.0 |
| color | String | 3.2.0 | |
| createDate | Timestamp | Creation time | 3.2.0 |
| lastOpDate | Timestamp | Last modification time | 3.2.0 |
| type | TagPatternType | For details, see type | 3.2.0 |
type
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | Resource name | 3.2.0 |
| ordinal | int | 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()