ZStack Cloud Platform
Single Server, Free Trial for One Year
POST zstack/v1/system-tagsAuthorization: OAuth the-session-uuid{ "params": { "resourceType": "HostVO", "resourceUuid": "c31d63c6d40d489e87fa7e1ee5707d47", "tag": "reservedMemory::1G" }, "systemTags": [], "userTags": [] }
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X POST -d '{"params":{"resourceType":"HostVO","resourceUuid":"47609e353c6f331f93ac114d06379f8d","tag":"reservedMemory::1G"}}' \ http://localhost:8080/zstack/v1/system-tags| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| resourceType | String | body (contained in the params structure) | The resource type, which must be specified when you create a tag. | 0.6 | |
| resourceUuid | String | body (contained in the params structure) | The resource UUID. If specified, the system will not allocate randomly a UUID to the resource. | 0.6 | |
| tag | String | body (contained in the params structure) | The tag string. | 0.6 | |
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
Note: autoReleaseSpecReleatedPhysicalPciDeviceautoReleaseSpecReleatedPhysicalPciDeviceautoReleaseSpecReleatedVirtualPciDeviceautoReleaseSpecReleatedVirtualPciDeviceresourceBindings::Cluster:clusterUuidresourceBindings::Cluster:2sdasf231jvznsdakapplianceType::typeapplianceType::slbSlbGroupUuid::uuidSlbGroupUuid::12345678 extraBootParams::{custom parameter}extraBootParams::{acpi=noirq noapic}{ "inventory": { "inherent": false, "uuid": "55d86810cb564ecc934fa79d498b9dc3", "resourceType": "HostVO", "tag": "reservedMemory::1G", "type": "System", "createDate": "Apr 24, 2017 7:10:55 PM", "lastOpDate": "Apr 24, 2017 7:10:55 PM" } }| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see Error. | 0.6 |
| inventory | SystemTagInventory | See inventory. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| inherent | Boolean | The inherent system tag. | 0.6 |
| uuid | String | The resource UUID. | 0.6 |
| resourceUuid | String | The resource UUID. If specified, the system will not allocate randomly a UUID to the resource. | 0.6 |
| resourceType | String | The resource type, which must be specified when you create a tag. | 0.6 |
| tag | String | The tag string. | 0.6 |
| type | String | The reserved field for internal use. | 0.6 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
CreateSystemTagAction action = new CreateSystemTagAction(); action.resourceType = "HostVO"; action.resourceUuid = "c63dfecc5c3f4f24bdab3eda92036eef"; action.tag = "reservedMemory::1G"; action.sessionId = "494209d421304d1cb9b8aaab7cac3a45"; CreateSystemTagAction.Result res = action.call();CreateSystemTagAction action = CreateSystemTagAction() action.resourceType = "HostVO" action.resourceUuid = "d8f0bf84c4bc41c99ff7129a369515c1" action.tag = "reservedMemory::1G" action.sessionId = "f84ee562742b4aaab791842d71f5d472" CreateSystemTagAction.Result res = action.call()GET zstack/v1/system-tags GET zstack/v1/system-tags/{uuid}Authorization: OAuth the-session-uuidcurl -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
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QuerySystemTag, and pressing the Tab key.
{ "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 fails, or vice versa. For more information, see error. | 0.6 |
| inventories | List | See inventories. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| inherent | Boolean | The inherent system tag. | 0.6 |
| uuid | String | The resource UUID. | 0.6 |
| resourceUuid | String | The resource UUID. If specified, the system will not allocate randomly a UUID to the resource. | 0.6 |
| resourceType | String | The resource type, which must be specified when you create a tag. | 0.6 |
| tag | String | The tag string. | 0.6 |
| type | String | The reserved field for internal use. | 0.6 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
QuerySystemTagAction action = new QuerySystemTagAction(); action.conditions = asList("inherent=true","resourceType=HostVO"); action.sessionId = "05c74fc02e574e678a407f0ccef8ae5f"; QuerySystemTagAction.Result res = action.call();QuerySystemTagAction action = QuerySystemTagAction() action.conditions = ["inherent=true","resourceType=HostVO"] action.sessionId = "a1d2f95577514d0a918ce1502dc27e33" QuerySystemTagAction.Result res = action.call()PUT zstack/v1/system-tags/{uuid}/actionsAuthorization: OAuth the-session-uuid{ "updateSystemTag": { "tag": "for-large-DB" }, "systemTags": [], "userTags": [] }
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X PUT -d '{"updateSystemTag":{"tag":"for-large-DB"}}' \ http://localhost:8080/zstack/v1/system-tags/2cb4ac52794535c3ae61f9612c1579e7/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 0.6 | |
| tag | String | body (contained in the updateSystemTag structure) | The tag string. | 0.6 | |
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
{ "inventory": { "inherent": false, "uuid": "c17377dfd0794521a4fe02b6eb16cc5a", "resourceType": "HostVO", "tag": "reservedMemory::1G", "type": "System", "createDate": "May 11, 2017 1:22:30 PM", "lastOpDate": "May 11, 2017 1:22:30 PM" } }| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
| inventory | SystemTagInventory | See inventory. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| inherent | Boolean | The inherent system tag. | 0.6 |
| uuid | String | The resource UUID. | 0.6 |
| resourceUuid | String | The resource UUID. If specified, the system will not allocate randomly a UUID to the resource. | 0.6 |
| resourceType | String | The resource type, which must be specified when you create a tag. | 0.6 |
| tag | String | The tag string. | 0.6 |
| type | String | The reserved field for internal use. | 0.6 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
UpdateSystemTagAction action = new UpdateSystemTagAction(); action.uuid = "1ba32bc1af0446b29bd969029a6052a5"; action.tag = "for-large-DB"; action.sessionId = "367f6162107a47d58c471c9164139fab"; UpdateSystemTagAction.Result res = action.call();UpdateSystemTagAction action = UpdateSystemTagAction() action.uuid = "be98b2f4e342485486cfa612eeabcaa5" action.tag = "for-large-DB" action.sessionId = "6b7af956a9a9477eba02753417380070" UpdateSystemTagAction.Result res = action.call()