CreateSystemTag

API Request

URLs
POST zstack/v1/system-tags
Headers
Authorization: OAuth the-session-uuid
Body
{   "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 Sample
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
Request Parameters
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:
  • When you create a system tag in ZStack Cloud, you can specify whether to automatically uninstall the physical PCI device allocated from the device specifications when the VM instance is shut down. You can also delete or change the configurations of existing VM instances. Note that you can add the autoReleaseSpecReleatedPhysicalPciDevice option to SystemTags.
    • Format of the autoReleaseSpecReleatedPhysicalPciDevice option: autoReleaseSpecReleatedPhysicalPciDevice
    • Example: autoReleaseSpecReleatedPhysicalPciDevice
  • When you create a system tag in ZStack Cloud, you can specify whether to automatically uninstall the virtual PCI device allocated from the device specifications when the VM instance is shut down. You can also delete or change the configurations of existing VM instances. Note that you can add the autoReleaseSpecReleatedVirtualPciDevice option to SystemTags.
    • Format of the autoReleaseSpecReleatedVirtualPciDevice option: autoReleaseSpecReleatedVirtualPciDevice
    • Example: autoReleaseSpecReleatedVirtualPciDevice
  • You create system tags in ZStack Cloud to identify VM instances or VPC vRouters for which high availability policy is enabled or disabled. You can specify the resourceBindings option when you create SystemTags.
    • Format: resourceBindings::Cluster:clusterUuid
    • Example: resourceBindings::Cluster:2sdasf231jvznsdak
  • You create system tags in ZStack Cloud to identify and filter the images of HA load balancers or VPC vRouters. You can specify the applianceType option when you create SystemTags.
    • Format: applianceType::type
    • Example: applianceType::slb
  • You create system tags in ZStack Cloud to identify HA load balancers. You can specify the SlbGroupUuid option when you create SystemTags.
    • Format: SlbGroupUuid::uuid
    • Example: SlbGroupUuid::12345678
  • When you add a system tag on ZStack Cloud, you can specify a custom parameter to the boot.ipxe file by adding extraBootParams to the SystemTags option.
    • Format: extraBootParams::{custom parameter}
    • Example: extraBootParams::{acpi=noirq noapic}

API Response

Sample Response
{   "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
#error
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
#inventory
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

SDK Sample

Java SDK
CreateSystemTagAction action = new CreateSystemTagAction(); action.resourceType = "HostVO"; action.resourceUuid = "c63dfecc5c3f4f24bdab3eda92036eef"; action.tag = "reservedMemory::1G"; action.sessionId = "494209d421304d1cb9b8aaab7cac3a45"; CreateSystemTagAction.Result res = action.call();
Python SDK
CreateSystemTagAction action = CreateSystemTagAction() action.resourceType = "HostVO" action.resourceUuid = "d8f0bf84c4bc41c99ff7129a369515c1" action.tag = "reservedMemory::1G" action.sessionId = "f84ee562742b4aaab791842d71f5d472" CreateSystemTagAction.Result res = action.call()

QuerySystemTag

API Request

URLs
GET zstack/v1/system-tags GET zstack/v1/system-tags/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
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=HostVO
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth c798e7031aaa430386636f9ff8d6bb17" \ -X GET http://localhost:8080/zstack/v1/system-tags/7c8162efed2840c08a43e0afdcebf01b

Queryable 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.

API Response

Sample Response
{   "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
#error
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
#inventories
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

SDK Sample

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()

UpdateSystemTag

API Request

URLs
PUT zstack/v1/system-tags/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{   "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 Sample
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
Request Parameters
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

API Response

Sample Response
{   "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
#error
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
#inventory
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

SDK Sample

Java SDK
UpdateSystemTagAction action = new UpdateSystemTagAction(); action.uuid = "1ba32bc1af0446b29bd969029a6052a5"; action.tag = "for-large-DB"; action.sessionId = "367f6162107a47d58c471c9164139fab"; UpdateSystemTagAction.Result res = action.call();
Python SDK
UpdateSystemTagAction action = UpdateSystemTagAction() action.uuid = "be98b2f4e342485486cfa612eeabcaa5" action.tag = "for-large-DB" action.sessionId = "6b7af956a9a9477eba02753417380070" UpdateSystemTagAction.Result res = action.call()








Archives

Download Document Archives

Back to Top

Download

Already filled the basic info?Click here.

Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

An email with a verification code will be sent to you. Make sure the address you provided is valid and correct.

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.
同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
ZStack Training and Certification
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
Request Trial
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder.
Or click on the URL below. (For Internet Explorer, right-click the URL and save it.)

Thank you for using ZStack products and services.

Submit successfully.

We'll connect soon.

Thank you for using ZStack products and services.