Query System Tags
Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 67bf58bea6854e568556b0e9f4bc84f6" \
-X GET http://localhost:8080/zstack/v1/system-tags?q=inherent=true&q=resourceType=HostVOcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth c798e7031aaa430386636f9ff8d6bb17" \
-X GET http://localhost:8080/zstack/v1/system-tags/7c8162efed2840c08a43e0afdcebf01bQueryable Fields
Run the CLI command line tool, type QuerySystemTag and press the Tab key to view all queryable fields and cross-table queryable resource names.
API Response
Response Example
{
"inventories": [
{
"inherent": false,
"uuid": "0bba7cb618314646aea4e70b9be3bfea",
"resourceType": "HostVO",
"tag": "reservedMemory::1G",
"type": "System",
"createDate": "May 11, 2017 1:22:40 PM",
"lastOpDate": "May 11, 2017 1:22:40 PM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 0.6 |
| inventories | List | For details, see inventories | 0.6 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001. | 0.6 |
| description | String | A brief description of the error | 0.6 |
| details | String | Detailed information about the error | 0.6 |
| elaboration | String | Reserved field. Default is null. | 0.6 |
| opaque | LinkedHashMap | Reserved field. Default is null. | 0.6 |
| cause | ErrorCode | The root error. The source error that caused the current error. If there is no root error, this field is null. | 0.6 |
inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| inherent | Boolean | Internal system tag | 0.6 |
| uuid | String | The UUID of the resource. Uniquely identifies the resource. | 0.6 |
| resourceUuid | String | User-specified resource UUID. If specified, the system will not randomly assign a UUID to the resource. | 0.6 |
| resourceType | String | When creating a tag, the user must specify the resource type associated with the tag. | 0.6 |
| tag | String | Tag string | 0.6 |
| type | String | Reserved field. Do not use. | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
SDK Examples
Java SDK
QuerySystemTagAction action = new QuerySystemTagAction();
action.conditions = asList("inherent=true","resourceType=HostVO");
action.sessionId = "05c74fc02e574e678a407f0ccef8ae5f";
QuerySystemTagAction.Result res = action.call();Python SDK
QuerySystemTagAction action = QuerySystemTagAction()
action.conditions = ["inherent=true","resourceType=HostVO"]
action.sessionId = "a1d2f95577514d0a918ce1502dc27e33"
QuerySystemTagAction.Result res = action.call()