Create a System Tag (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 example above, the systemTags and userTags fields are optional. They are listed to indicate that these two fields can be included in the body.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
resourceType String body (contained in the params structure) When creating a tag, the user must specify the resource type associated with the tag. 0.6
resourceUuid String body (contained in the params structure) User-specified resource UUID. If specified, the system will not randomly assign a UUID to the resource. 0.6
tag String body (contained in the params structure) Tag string 0.6
systemTags (optional) List body System tags 0.6
userTags (optional) List body User tags 0.6
Note:
  • ZStack ZSphere supports configuring whether to automatically release physical PCI devices allocated from device specifications when a VM is stopped. This can also be deleted or changed for existing VMs. The SystemTags option autoReleaseSpecReleatedPhysicalPciDevice is added.
    • Option format: autoReleaseSpecReleatedPhysicalPciDevice
    • Example: autoReleaseSpecReleatedPhysicalPciDevice
  • ZStack ZSphere supports configuring whether to automatically release virtual PCI devices allocated from device specifications when a VM is stopped. This can also be deleted or changed for existing VMs. The SystemTags option autoReleaseSpecReleatedVirtualPciDevice is added.
    • Option format: autoReleaseSpecReleatedVirtualPciDevice
    • Example: autoReleaseSpecReleatedVirtualPciDevice
  • ZStack ZSphere supports setting cross-cluster HA policies for VMs when creating system tags. The SystemTags option resourceBindings is added.
    • Option format: resourceBindings::Cluster:clusterUuid, where clusterUuid is the UUID of the corresponding cluster.
    • Example: resourceBindings::Cluster:2sdasf231jvznsdak
  • ZStack ZSphere supports adding custom parameters to the boot.ipxe file when creating system tags. The SystemTags option extraBootParams is added.
    • Option format: extraBootParams::{custom parameters}
    • Example: extraBootParams::{acpi=noirq noapic}

API Response

Response Example
{   "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 failed. This field is null when the operation succeeds. For details, see error 0.6
inventory SystemTagInventory For details, see inventory 0.6
#error
Name Type Description Starting Version
ode 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
#inventory
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
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()

Query System Tags (QuerySystemTag)

API Request

URLs
GET zstack/v1/system-tags GET zstack/v1/system-tags/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl 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=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

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

Update a System Tag (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 example above, the systemTags and userTags fields are optional. They are listed to indicate that these two fields can be included in the body.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url The UUID of the resource. Uniquely identifies the resource. 0.6
tag String body (contained in the updateSystemTag structure) Tag string 0.6
systemTags (optional) List body System tags 0.6
userTags (optional) List body User tags 0.6

API Response

Response Example
{   "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 failed. This field is null when the operation succeeds. For details, see error 0.6
inventory SystemTagInventory For details, see inventory 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
#inventory
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
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

Download

Already filled the basic info?Click here.

Enter at least 2 characters.
Cannot be empty.
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.