System Settings

Log Server

AddLogConfiguration

Add Log Configuration

API Request

URLs
POST zstack/v1/log/configurations
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "syslog",
    "type": "log4j2",
    "level": "ERROR",
    "configuration": "{\n\"appenderType\": \"Syslog\",\n\"configuration\": {\n\"hostname\": \"192.168.0.11\",\n\"port\": \"514\",\n\"protocol\": \"UDP\",\n\"facility\": \"LOCAL5\"\n}\n}"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding example, the systemTags and userTags fields can be omitted. They are shown to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X POST -d '{"params":{"name":"syslog","type":"log4j2","level":"ERROR","configuration":"{\n\"appenderType\": \"Syslog\",\n\"configuration\": {\n\"hostname\": \"192.168.0.11\",\n\"port\": \"514\",\n\"protocol\": \"UDP\",\n\"facility\": \"LOCAL5\"\n}\n}"}}' http://localhost:8080/zstack/v1/log/configurations
Parameter List
Name Type Location Description Allowed Values Starting Version
name String body (included in the params structure) Resource name 3.7.0
description (Optional) String body (included in the params structure) Detailed resource description 3.7.0
type String body (included in the params structure) The resource type. 3.7.0
configuration String body (included in the params structure) The configuration. 3.7.0
resourceUuid (Optional) String body (included in the params structure) Resource UUID 3.7.0
level (Optional) String body (included in the params structure) Log level 5.1.0
tagUuids (Optional) List body (included in the params structure) Tag UUID list 3.7.0
systemTags (Optional) List body System tags 3.7.0
userTags (Optional) List body User tags 3.7.0

API Response

SDK Examples

Java SDK
AddLogConfigurationAction action = new AddLogConfigurationAction();
action.name = "syslog";
action.type = "log4j2";
action.level = "ERROR";
action.configuration = "{
"appenderType": "Syslog",
"configuration": {
"hostname": "192.168.0.11",
"port": "514",
"protocol": "UDP",
"facility": "LOCAL5"
}
}";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddLogConfigurationAction.Result res = action.call();
Python SDK
action = AddLogConfigurationAction()
action.name = "syslog"
action.type = "log4j2"
action.level = "ERROR"
action.configuration = "{
"appenderType": "Syslog",
"configuration": {
"hostname": "192.168.0.11",
"port": "514",
"protocol": "UDP",
"facility": "LOCAL5"
}
}"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

DeleteLogConfiguration

API Request

URLs
DELETE zstack/v1/log/configurations/log4j2
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/log/configurations/log4j2?deleteMode=Permissive
Parameter List
Name Type Location Description Allowed Values Starting Version
configId Long body Configuration ID 3.10.0
deleteMode (optional) String body Deletion mode. Defaults to Permissive
  • Enforcing
  • Permissive
3.10.0
systemTags (optional) List body System tags 3.10.0
userTags (optional) List body User tags 3.10.0

API Response

On success, this API returns an empty JSON structure {}. On failure, the returned JSON structure contains an error field, for example:
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Examples

Java SDK
DeleteLogConfigurationAction action = new DeleteLogConfigurationAction();
action.configId = 0.0;
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteLogConfigurationAction.Result res = action.call();
Python SDK
DeleteLogConfigurationAction action = DeleteLogConfigurationAction()
action.configId = 0.0
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteLogConfigurationAction.Result res = action.call()

GetLogConfiguration

API Request

URLs
GET zstack/v1/log/configurations
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X GET http://localhost:8080/zstack/v1/log/configurations
Parameter List
Name Type Location Description Allowed Values Starting Version
systemTags (optional) List query Optional. The system tags. 3.10.0
userTags (optional) List query Optional. The user tags. 3.10.0

API Response

Response Example
{
  "inventories": [
    {
      "id": 0.0,
      "labelKey": "log4j2-0201c1784c6e48d2ba26954d4c688fae",
      "labelValue": "{\n\"appenderType\": \"Syslog\",\n\"configuration\": {\n\"hostname\": \"192.168.0.13\",\n\"port\": \"514\",\n\"protocol\": \"UDP\",\n\"facility\": \"LOCAL5\"\n}\n}"
    },
    {
      "id": 0.0,
      "labelKey": "log4j2-ba2cf0a6945d4267bfdc1994776b509d",
      "labelValue": "{\n\"appenderType\": \"Syslog\",\n\"configuration\": {\n\"hostname\": \"192.168.0.11\",\n\"port\": \"514\",\n\"protocol\": \"UDP\",\n\"facility\": \"LOCAL5\"\n}\n}"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 3.10.0
inventories List See inventories 3.10.0
#error
Name Type Description Starting Version
code String Error code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.1001 3.10.0
description String Brief description of the error 3.10.0
details String Detailed error information 3.10.0
elaboration String Reserved field. Defaults to null 3.10.0
opaque LinkedHashMap Reserved field. Defaults to null 3.10.0
cause ErrorCode Root error. The source error that caused this error. Null if no root cause exists 3.10.0
#inventories
Name Type Description Starting Version
id long The resource ID. 3.10.0
labelKey String The label key. 3.10.0
labelValue String The label value. 3.10.0
resourceUuid String Resource UUID 3.10.0
createDate Timestamp Creation time 3.10.0
lastOpDate Timestamp Last modification time 3.10.0

SDK Examples

Java SDK
GetLogConfigurationAction action = new GetLogConfigurationAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetLogConfigurationAction.Result res = action.call();
Python SDK
GetLogConfigurationAction action = GetLogConfigurationAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetLogConfigurationAction.Result res = action.call()

UpdateLogConfiguration

API Request

URLs
PUT zstack/v1/log/configurations
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateLogConfiguration": {
    "configId": 1.0
  },
  "systemTags": [],
  "userTags": []
}
Note: The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateLogConfiguration":{"configId":1.0}}' http://localhost:8080/zstack/v1/log/configurations
Parameter List
Name Type Location Description Allowed Values Starting Version
configId long body (contained in the updateLogConfiguration structure) Configuration ID 3.10.0
name (optional) String body (contained in the updateLogConfiguration structure) Resource name 3.10.0
description (optional) String body (contained in the updateLogConfiguration structure) Detailed description of the resource 3.10.0
systemTags (optional) List body System tags 3.10.0
userTags (optional) List body User tags 3.10.0

API Response

Response Example
{
  "inventory": {
    "id": 0.0,
    "labelKey": "log4j2-848dd6e5712e4227ae40447753871ba8",
    "labelValue": "{\n\"appenderType\": \"Syslog\",\n\"configuration\": {\n\"hostname\": \"192.168.0.11\",\n\"port\": \"514\",\n\"protocol\": \"UDP\",\n\"facility\": \"LOCAL5\"\n}\n}"
  }
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 3.10.0
inventory VmNicInventory See inventory 3.10.0
#error
Name Type Description Starting Version
code String Error code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.1001 3.10.0
description String Brief description of the error 3.10.0
details String Detailed error information 3.10.0
elaboration String Reserved field. Defaults to null 3.10.0
opaque LinkedHashMap Reserved field. Defaults to null 3.10.0
cause ErrorCode Root error. The source error that caused this error. Null if no root cause exists 3.10.0
#inventory
Name Type Description Starting Version
id long The resource ID. 3.10.0
labelKey String The label key. 3.10.0
labelValue String The label value. 3.10.0
resourceUuid String Resource UUID 3.10.0
createDate Timestamp Creation time 3.10.0
lastOpDate Timestamp Last modification time 3.10.0

SDK Examples

Java SDK
UpdateLogConfigurationAction action = new UpdateLogConfigurationAction();
action.configId = 1.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateLogConfigurationAction.Result res = action.call();
Python SDK
UpdateLogConfigurationAction action = UpdateLogConfigurationAction()
action.configId = 1.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateLogConfigurationAction.Result res = action.call()

AddLogServer

Add Log Server

API Request

URLs
POST zstack/v1/log/servers
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "log-server",
    "description": "log server",
    "category": "ManagementNodeLog",
    "type": "Log4j2",
    "level": "ALL",
    "configuration": "{\n\"type\": \"Syslog\",\n\"configuration\": {\n\"hostname\": \"192.168.0.11\",\n\"port\": \"514\",\n\"protocol\": \"UDP\",\n\"facility\": \"LOCAL5\"\n}\n}"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding example, the systemTags and userTags fields can be omitted. They are shown to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X POST -d '{"params":{"name":"log-server","description":"log server","category":"ManagementNodeLog","type":"Log4j2","level":"ALL","configuration":"{\n\"type\": \"Syslog\",\n\"configuration\": {\n\"hostname\": \"192.168.0.11\",\n\"port\": \"514\",\n\"protocol\": \"UDP\",\n\"facility\": \"LOCAL5\"\n}\n}"}}' http://localhost:8080/zstack/v1/log/servers
Parameter List
Name Type Location Description Allowed Values Starting Version
name String body (included in the params structure) Resource name 5.1.0
description (Optional) String body (included in the params structure) Detailed resource description 5.1.0
category String body (included in the params structure) Log category (management node logs or platform operation logs)
  • ManagementNodeLog
  • PlatformOperationLog
5.1.0
type String body (included in the params structure) Log type
  • Log4j2
  • FluentBit
5.1.0
level (Optional) String body (included in the params structure) Level
  • OFF
  • FATAL
  • ERROR
  • WARN
  • INFO
  • DEBUG
  • TRACE
  • ALL
5.1.0
configuration String body (included in the params structure) Detailed log configuration 5.1.0
resourceUuid (Optional) String body (included in the params structure) Resource UUID 5.1.0
tagUuids (Optional) List body (included in the params structure) Tag UUID list 5.1.0
systemTags (Optional) List body System tags 5.1.0
userTags (Optional) List body User tags 5.1.0

API Response

Response Example
{
  "inventory": {}
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 5.1.0
inventory LogServerInventory For details, see inventory 5.1.0
error ErrorCode Error code. If this field is not null, the operation failed. This field is null when the operation succeeds. For details, see error 5.1.0
#inventory
Name Type Description Starting Version
uuid String Resource UUID, which uniquely identifies the resource 5.1.0
name String Resource name 5.1.0
description String Detailed resource description 5.1.0
configuration String The configuration. 5.1.0
createDate Timestamp Creation time 5.1.0
lastOpDate Timestamp Last modification time 5.1.0
category LogCategory For details, see category 5.1.0
type LogType For details, see type 5.1.0
level LogLevel For details, see level 5.1.0
#category
Name Type Description Starting Version
ManagementNodeLog LogCategory The ManagementNodeLog value. 5.1.0
PlatformOperationLog LogCategory The PlatformOperationLog value. 5.1.0
#type
Name Type Description Starting Version
Log4j2 LogType The Log4j2 value. 5.1.0
FluentBit LogType The FluentBit value. 5.1.0
#level
Name Type Description Starting Version
OFF LogLevel The OFF value. 5.1.0
FATAL LogLevel The FATAL value. 5.1.0
ERROR LogLevel The ERROR value. 5.1.0
WARN LogLevel The WARN value. 5.1.0
INFO LogLevel The INFO value. 5.1.0
DEBUG LogLevel The DEBUG value. 5.1.0
TRACE LogLevel The TRACE value. 5.1.0
ALL LogLevel The ALL value. 5.1.0
#error
Name Type Description Starting Version
code String Error code, which globally and uniquely identifies the error, for example, SYS.1000 or HOST.1001 0.6
description String Summary description of the error 0.6
details String Details of the error 0.6
elaboration String Reserved field. The default value is null 0.6
opaque LinkedHashMap Reserved field. The default value is null 0.6
cause ErrorCode Root error that caused the current error. This field is null if there is no source error 0.6

SDK Examples

Java SDK
AddLogServerAction action = new AddLogServerAction();
action.name = "log-server";
action.description = "log server";
action.category = "ManagementNodeLog";
action.type = "Log4j2";
action.level = "ALL";
action.configuration = "{
"type": "Syslog",
"configuration": {
"hostname": "192.168.0.11",
"port": "514",
"protocol": "UDP",
"facility": "LOCAL5"
}
}";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddLogServerAction.Result res = action.call();
Python SDK
action = AddLogServerAction()
action.name = "log-server"
action.description = "log server"
action.category = "ManagementNodeLog"
action.type = "Log4j2"
action.level = "ALL"
action.configuration = "{
"type": "Syslog",
"configuration": {
"hostname": "192.168.0.11",
"port": "514",
"protocol": "UDP",
"facility": "LOCAL5"
}
}"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

DeleteLogServer

Delete Log Server

API Request

URLs
DELETE zstack/v1/log/servers
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X DELETE http://localhost:8080/zstack/v1/log/servers?uuid=cdc213d6ba25367ea6c4d201491d900c
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String query Resource UUID, which uniquely identifies the resource 5.1.0
systemTags (Optional) List query System tags 5.1.0
userTags (Optional) List query User tags 5.1.0

API Response

When the API succeeds, it returns an empty JSON structure{}. If an error occurs, the returned JSON structure contains an error field, for example:

{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
DeleteLogServerAction action = new DeleteLogServerAction();
action.uuid = "cdc213d6ba25367ea6c4d201491d900c";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteLogServerAction.Result res = action.call();
Python SDK
action = DeleteLogServerAction()
action.uuid = "cdc213d6ba25367ea6c4d201491d900c"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

QueryLogServer

Query Log Server

API Request

URLs
GET zstack/v1/log/servers
GET zstack/v1/log/servers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X GET http://localhost:8080/zstack/v1/log/servers?q=uuid=xxx&q=name=xxx
curl -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X GET http://localhost:8080/zstack/v1/log/servers/9699713cfb583c70b749adca2c01a77b

Queryable Fields

Run the CLI tool and enter QueryLogServer, and press Tab to view all queryable fields and the names of resources available for cross-table queries.

API Response

When the API succeeds, it returns an empty JSON structure{}. If an error occurs, the returned JSON structure contains an error field, for example:

{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
QueryLogServerAction action = new QueryLogServerAction();
action.conditions = asList("uuid=xxx","name=xxx");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryLogServerAction.Result res = action.call();
Python SDK
action = QueryLogServerAction()
action.conditions = ["uuid=xxx","name=xxx"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

UpdateLogServer

Update Log Server

API Request

URLs
PUT zstack/v1/log/servers
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateLogServer": {
    "uuid": "10bf3f837edf37a0be99a84d1edafb6b",
    "name": "example"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding example, the systemTags and userTags fields can be omitted. They are shown to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X PUT -d '{"updateLogServer":{"uuid":"10bf3f837edf37a0be99a84d1edafb6b","name":"example"}}' http://localhost:8080/zstack/v1/log/servers
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String body (included in the updateLogServer structure) Resource UUID, which uniquely identifies the resource 5.1.0
name (Optional) String body (included in the updateLogServer structure) Resource name 5.1.0
description (Optional) String body (included in the updateLogServer structure) Detailed resource description 5.1.0
systemTags (Optional) List body System tags 5.1.0
userTags (Optional) List body User tags 5.1.0

API Response

When the API succeeds, it returns an empty JSON structure{}. If an error occurs, the returned JSON structure contains an error field, for example:

{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
UpdateLogServerAction action = new UpdateLogServerAction();
action.uuid = "10bf3f837edf37a0be99a84d1edafb6b";
action.name = "example";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateLogServerAction.Result res = action.call();
Python SDK
action = UpdateLogServerAction()
action.uuid = "10bf3f837edf37a0be99a84d1edafb6b"
action.name = "example"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

SNMP

CreateSnmpAgent

API Request

URLs
POST zstack/v1/snmp/agent
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "version": "v3",
    "userName": "zstack",
    "authAlgorithm": "SHA512",
    "authPassword": "auth_password",
    "privacyAlgorithm": "DES",
    "privacyPassword": "priv_password",
    "port": 161
  },
  "systemTags": [],
  "userTags": []
}
Note: The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"version":"v3","userName":"zstack","authAlgorithm":"SHA512","authPassword":"auth_password","privacyAlgorithm":"DES","privacyPassword":"priv_password","port":161}}' \
http://localhost:8080/zstack/v1/snmp/agent
Parameter List
Name Type Location Description Allowed Values Starting Version
version String body (contained in the params structure) SNMP agent protocol version
  • v2c
  • v3
4.10.0
readCommunity (optional) String body (contained in the params structure) Read community string (used when version is v2c) 4.10.0
userName (optional) String body (contained in the params structure) Username (used when version is v3) 4.10.0
authAlgorithm (optional) String body (contained in the params structure) Authentication algorithm
  • MD5
  • SHA
  • SHA224
  • SHA256
  • SHA384
  • SHA512
4.10.0
authPassword (optional) String body (contained in the params structure) Authentication password 4.10.0
privacyAlgorithm (optional) String body (contained in the params structure) Privacy algorithm
  • DES
  • AES128
  • AES192
  • AES256
  • 3DES
4.10.0
privacyPassword (optional) String body (contained in the params structure) Privacy password 4.10.0
port int body (contained in the params structure) Port 4.10.0
resourceUuid (optional) String body (contained in the params structure) Resource UUID 4.10.0
tagUuids (optional) List body (contained in the params structure) Tag UUID list 4.10.0
systemTags (optional) List body System tags 4.10.0
userTags (optional) List body User tags 4.10.0

API Response

Response Example
{
  "inventory": {
    "uuid": "6dac2a94d44c3216acc13286a50416aa",
    "version": "v3",
    "userName": "zstack",
    "authAlgorithm": "SHA512",
    "authPassword": "auth_password",
    "privacyAlgorithm": "DES",
    "privacyPassword": "priv_password",
    "port": 161,
    "status": "Enable",
    "securityLevel": "authPriv"
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.10.0
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 4.10.0
inventory SnmpAgentInventory See inventory 4.10.0
#error
Name Type Description Starting Version
code String Error code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.1001 4.10.0
description String Brief description of the error 4.10.0
details String Detailed error information 4.10.0
elaboration String Reserved field. Defaults to null 4.10.0
opaque LinkedHashMap Reserved field. Defaults to null 4.10.0
cause ErrorCode Root error. The source error that caused this error. Null if no root cause exists 4.10.0
#inventory
Name Type Description Starting Version
uuid String Resource UUID. Uniquely identifies the resource 4.10.0
version String SNMP agent protocol version 4.10.0
readCommunity String Read community string (used when version is v2c) 4.10.0
userName String Username (used when version is v3) 4.10.0
authAlgorithm String Authentication algorithm 4.10.0
authPassword String Authentication password 4.10.0
privacyAlgorithm String Privacy algorithm 4.10.0
privacyPassword String Privacy password 4.10.0
port int Port 4.10.0
status String Whether the SNMP agent is enabled 4.10.0
securityLevel String Security level 4.10.0
createDate Timestamp Creation time 4.10.0
lastOpDate Timestamp Last modification time 4.10.0

SDK Examples

Java SDK
CreateSnmpAgentAction action = new CreateSnmpAgentAction();
action.version = "v3";
action.userName = "zstack";
action.authAlgorithm = "SHA512";
action.authPassword = "auth_password";
action.privacyAlgorithm = "DES";
action.privacyPassword = "priv_password";
action.port = 161;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSnmpAgentAction.Result res = action.call();
Python SDK
CreateSnmpAgentAction action = CreateSnmpAgentAction()
action.version = "v3"
action.userName = "zstack"
action.authAlgorithm = "SHA512"
action.authPassword = "auth_password"
action.privacyAlgorithm = "DES"
action.privacyPassword = "priv_password"
action.port = 161
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSnmpAgentAction.Result res = action.call()

QuerySnmpAgent

API Request

URLs
GET zstack/v1/snmp/agent
GET zstack/v1/snmp/agent/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/snmp/agent
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/snmp/agent/18c89b48e653385f83db6ecffb48763f

Queryable Fields

Run the CLI tool, enter QueryLdapServer and press Tab to view all queryable fields and cross-table queryable resource names.

API Response

Response Example
{
  "inventories": [
    {
      "uuid": "f0ef8d847b573c6b86565e1d9111723b",
      "version": "v3",
      "userName": "zstack",
      "authAlgorithm": "SHA512",
      "authPassword": "auth_password",
      "privacyAlgorithm": "DES",
      "privacyPassword": "priv_password",
      "port": 161,
      "status": "Enable",
      "securityLevel": "authPriv"
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.10.0
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 4.10.0
inventories List See inventories 4.10.0
#error
Name Type Description Starting Version
code String Error code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.1001 4.10.0
description String Brief description of the error 4.10.0
details String Detailed error information 4.10.0
elaboration String Reserved field. Defaults to null 4.10.0
opaque LinkedHashMap Reserved field. Defaults to null 4.10.0
cause ErrorCode Root error. The source error that caused this error. Null if no root cause exists 4.10.0
#inventories
Name Type Description Starting Version
uuid String Resource UUID. Uniquely identifies the resource 4.10.0
version String SNMP agent protocol version 4.10.0
readCommunity String Read community string (used when version is v2c) 4.10.0
userName String Username (used when version is v3) 4.10.0
authAlgorithm String Authentication algorithm 4.10.0
authPassword String Authentication password 4.10.0
privacyAlgorithm String Privacy algorithm 4.10.0
privacyPassword String Privacy password 4.10.0
port int Port 4.10.0
status String Whether the SNMP agent is enabled 4.10.0
securityLevel String Security level 4.10.0
createDate Timestamp Creation time 4.10.0
lastOpDate Timestamp Last modification time 4.10.0

SDK Examples

Java SDK
QuerySnmpAgentAction action = new QuerySnmpAgentAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySnmpAgentAction.Result res = action.call();
Python SDK
QuerySnmpAgentAction action = QuerySnmpAgentAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySnmpAgentAction.Result res = action.call()

StartSnmpAgent

API Request

URLs
PUT zstack/v1/snmp/agent/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "startSnmpAgent": {
    "uuid": "2e5ce17390a843da991411d27b67d775"
  },
  "systemTags": [],
  "userTags": []
}
Note: The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"startSnmpAgent":{"uuid":"955799e296a94e4aa2ce063a5b1ea4b8"}}' \
http://localhost:8080/zstack/v1/snmp/agent/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String body (contained in the startSnmpAgent structure) Resource UUID. Uniquely identifies the resource 4.10.0
systemTags (optional) List body System tags 4.10.0
userTags (optional) List body User tags 4.10.0

API Response

Response Example
{
  "inventory": {
    "uuid": "eef797ff89d84305b51cc3edcb597909",
    "version": "v3",
    "userName": "zstack",
    "authAlgorithm": "SHA",
    "authPassword": "authPassword",
    "privacyAlgorithm": "AES128",
    "privacyPassword": "privPassword",
    "port": 162
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.10.0
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 4.10.0
inventory SnmpAgentInventory See inventory 4.10.0
#error
Name Type Description Starting Version
code String Error code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.1001 4.10.0
description String Brief description of the error 4.10.0
details String Detailed error information 4.10.0
elaboration String Reserved field. Defaults to null 4.10.0
opaque LinkedHashMap Reserved field. Defaults to null 4.10.0
cause ErrorCode Root error. The source error that caused this error. Null if no root cause exists 4.10.0
#inventory
Name Type Description Starting Version
uuid String Resource UUID. Uniquely identifies the resource 4.10.0
version String SNMP agent protocol version 4.10.0
readCommunity String Read community string (used when version is v2c) 4.10.0
userName String Username (used when version is v3) 4.10.0
authAlgorithm String Authentication algorithm 4.10.0
authPassword String Authentication password 4.10.0
privacyAlgorithm String Privacy algorithm 4.10.0
privacyPassword String Privacy password 4.10.0
port int Port 4.10.0
status String Whether the SNMP agent is enabled 4.10.0
securityLevel String Security level 4.10.0
createDate Timestamp Creation time 4.10.0
lastOpDate Timestamp Last modification time 4.10.0

SDK Examples

Java SDK
StartSnmpAgentAction action = new StartSnmpAgentAction();
action.uuid = "a74555a81a4244bb9ce0f8f2b5691ac5";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
StartSnmpAgentAction.Result res = action.call();
Python SDK
StartSnmpAgentAction action = StartSnmpAgentAction()
action.uuid = "56f7b7cc6f764c55bf4016cc2257f456"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
StartSnmpAgentAction.Result res = action.call()

StopSnmpAgent

API Request

URLs
PUT zstack/v1/snmp/agent/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "stopSnmpAgent": {
    "uuid": "253c4449901c49f9928d2d7fd2119715"
  },
  "systemTags": [],
  "userTags": []
}
Note: The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"stopSnmpAgent":{"uuid":"d3dcbba6129e497480af319ee4e42749"}}' \
http://localhost:8080/zstack/v1/snmp/agent/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String body (contained in the stopSnmpAgent structure) Resource UUID. Uniquely identifies the resource 4.10.0
systemTags (optional) List body System tags 4.10.0
userTags (optional) List body User tags 4.10.0

API Response

Response Example
{
  "inventory": {
    "uuid": "b32ac27ffdd03e7ea7857d318d5cfdd8",
    "version": "v3",
    "userName": "zstack",
    "authAlgorithm": "SHA512",
    "authPassword": "auth_password",
    "privacyAlgorithm": "DES",
    "privacyPassword": "priv_password",
    "port": 161,
    "status": "Enable",
    "securityLevel": "authPriv"
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.10.0
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 4.10.0
inventory SnmpAgentInventory See inventory 4.10.0
#error
Name Type Description Starting Version
code String Error code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.1001 4.10.0
description String Brief description of the error 4.10.0
details String Detailed error information 4.10.0
elaboration String Reserved field. Defaults to null 4.10.0
opaque LinkedHashMap Reserved field. Defaults to null 4.10.0
cause ErrorCode Root error. The source error that caused this error. Null if no root cause exists 4.10.0
#inventory
Name Type Description Starting Version
uuid String Resource UUID. Uniquely identifies the resource 4.10.0
version String SNMP agent protocol version 4.10.0
readCommunity String Read community string (used when version is v2c) 4.10.0
userName String Username (used when version is v3) 4.10.0
authAlgorithm String Authentication algorithm 4.10.0
authPassword String Authentication password 4.10.0
privacyAlgorithm String Privacy algorithm 4.10.0
privacyPassword String Privacy password 4.10.0
port int Port 4.10.0
status String Whether the SNMP agent is enabled 4.10.0
securityLevel String Security level 4.10.0
createDate Timestamp Creation time 4.10.0
lastOpDate Timestamp Last modification time 4.10.0

SDK Examples

Java SDK
StopSnmpAgentAction action = new StopSnmpAgentAction();
action.uuid = "5b470e397e794dff84efa29375d9cef8";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
StopSnmpAgentAction.Result res = action.call();
Python SDK
StopSnmpAgentAction action = StopSnmpAgentAction()
action.uuid = "e48db055707445d3b70e8e52f7ee0ca3"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
StopSnmpAgentAction.Result res = action.call()

UpdateSnmpAgent

API Request

URLs
PUT zstack/v1/snmp/agent/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateSnmpAgent": {
    "version": "v2c",
    "readCommunity": "zstack",
    "port": 1161
  },
  "systemTags": [],
  "userTags": []
}
Note: The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateSnmpAgent":{"version":"v2c","readCommunity":"zstack","port":1161}}' \
http://localhost:8080/zstack/v1/snmp/agent/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String body (contained in the updateSnmpAgent structure) Resource UUID. Uniquely identifies the resource 4.10.0
version String body (contained in the updateSnmpAgent structure) SNMP agent protocol version
  • v2c
  • v3
4.10.0
readCommunity (optional) String body (contained in the updateSnmpAgent structure) Read community string (used when version is v2c) 4.10.0
userName (optional) String body (contained in the updateSnmpAgent structure) Username (used when version is v3) 4.10.0
authAlgorithm (optional) String body (contained in the updateSnmpAgent structure) Authentication algorithm
  • MD5
  • SHA
  • SHA224
  • SHA256
  • SHA384
  • SHA512
4.10.0
authPassword (optional) String body (contained in the updateSnmpAgent structure) Authentication password 4.10.0
privacyAlgorithm (optional) String body (contained in the updateSnmpAgent structure) Privacy algorithm
  • DES
  • AES128
  • AES192
  • AES256
  • 3DES
4.10.0
privacyPassword (optional) String body (contained in the updateSnmpAgent structure) Privacy password 4.10.0
port int body (contained in the updateSnmpAgent structure) Port 4.10.0
systemTags (optional) List body System tags 4.10.0
userTags (optional) List body User tags 4.10.0

API Response

Response Example
{
  "inventory": {
    "uuid": "cad9965ebedd495aa1f5718f31da1aa8",
    "version": "v3",
    "userName": "zstack",
    "authAlgorithm": "SHA",
    "authPassword": "authPassword",
    "privacyAlgorithm": "AES128",
    "privacyPassword": "privPassword",
    "port": 162
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.10.0
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 4.10.0
inventory SnmpAgentInventory See inventory 4.10.0
#error
Name Type Description Starting Version
code String Error code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.1001 4.10.0
description String Brief description of the error 4.10.0
details String Detailed error information 4.10.0
elaboration String Reserved field. Defaults to null 4.10.0
opaque LinkedHashMap Reserved field. Defaults to null 4.10.0
cause ErrorCode Root error. The source error that caused this error. Null if no root cause exists 4.10.0
#inventory
Name Type Description Starting Version
uuid String Resource UUID. Uniquely identifies the resource 4.10.0
version String SNMP agent protocol version 4.10.0
readCommunity String Read community string (used when version is v2c) 4.10.0
userName String Username (used when version is v3) 4.10.0
authAlgorithm String Authentication algorithm 4.10.0
authPassword String Authentication password 4.10.0
privacyAlgorithm String Privacy algorithm 4.10.0
privacyPassword String Privacy password 4.10.0
port int Port 4.10.0
status String Whether the SNMP agent is enabled 4.10.0
securityLevel String Security level 4.10.0
createDate Timestamp Creation time 4.10.0
lastOpDate Timestamp Last modification time 4.10.0

SDK Examples

Java SDK
UpdateSnmpAgentAction action = new UpdateSnmpAgentAction();
action.version = "v2c";
action.readCommunity = "zstack";
action.port = 1161;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateSnmpAgentAction.Result res = action.call();
Python SDK
UpdateSnmpAgentAction action = UpdateSnmpAgentAction()
action.version = "v2c"
action.readCommunity = "zstack"
action.port = 1161
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateSnmpAgentAction.Result res = action.call()

Time Management

CheckNetworkReachable

API Request

URLs
GET zstack/v1/zops/check/network
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zops/check/network?sourceHostnames=172.0.0.1&targetHostnames=test1.com&targetHostnames=test2.com
Parameter List
Name Type Location Description Allowed Values Starting Version
sourceHostnames (Optional) List query Collection of source IP addresses or domain names 4.7.21
targetHostnames List query Collection of target IP addresses or domain names 4.7.21
systemTags (Optional) List query System tags 4.7.21
userTags (Optional) List query User tags 4.7.21

API Response

Response Example
{
  "results": [
    {
      "sourceHostname": "172.0.0.1",
      "targetHostname": "test2.com",
      "status": "Disconnected"
    },
    {}
  ]
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.7.21
results List See results for details 4.7.21
error ErrorCode The error code. If not null, the operation failed. This field is null when the operation succeeds. See error for details 4.7.21
#results
Name Type Description Starting Version
sourceHostname String Source address 4.7.21
targetHostname String Target address 4.7.21
status HostConnectedStatus See status for details 4.7.21
#status
Name Type Description Starting Version
Connected HostConnectedStatus Network reachable 4.7.21
Disconnected HostConnectedStatus Network unreachable 4.7.21
Unknown HostConnectedStatus Network connection status unknown 4.7.21
#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 The detailed error information 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 that caused the current error. If no root error exists, this field is null 0.6

SDK Examples

Java SDK
CheckNetworkReachableAction action = new CheckNetworkReachableAction();
action.sourceHostnames = asList("172.0.0.1");
action.targetHostnames = asList("test1.com","test2.com");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CheckNetworkReachableAction.Result res = action.call();
Python SDK
CheckNetworkReachableAction action = CheckNetworkReachableAction()
action.sourceHostnames = [172.0.0.1]
action.targetHostnames = [test1.com, test2.com]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CheckNetworkReachableAction.Result res = action.call()

GetChronyServers

API Request

URLs
GET zstack/v1/zops/chrony/servers
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zops/chrony/servers
Parameter List
Name Type Location Description Allowed Values Starting Version
systemTags (Optional) List query System tags 4.7.21
userTags (Optional) List query User tags 4.7.21

API Response

Response Example
{
  "servers": [
    {
      "internal": {
        "hostname": "172.0.0.1",
        "status": "Connected"
      },
      "external": {
        "hostname": "ntp.test.com",
        "status": "Connected"
      }
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.7.21
servers List See servers for details 4.7.21
error ErrorCode The error code. If not null, the operation failed. This field is null when the operation succeeds. See error for details 4.7.21
#servers
Name Type Description Starting Version
internal ChronyServerInfo See internal for details 4.7.21
external ChronyServerInfo See external for details 4.7.21
#internal
Name Type Description Starting Version
hostname String Address 4.7.21
status HostConnectedStatus See status for details 4.7.21
#status
Name Type Description Starting Version
Connected HostConnectedStatus Network reachable 4.7.21
Disconnected HostConnectedStatus Network unreachable 4.7.21
Unknown HostConnectedStatus Network connection status unknown 4.7.21
#external
Name Type Description Starting Version
hostname String Address 4.7.21
status HostConnectedStatus See status for details 4.7.21
#status
Name Type Description Starting Version
Connected HostConnectedStatus Network reachable 4.7.21
Disconnected HostConnectedStatus Network unreachable 4.7.21
Unknown HostConnectedStatus Network connection status unknown 4.7.21
#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 The detailed error information 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 that caused the current error. If no root error exists, this field is null 0.6

SDK Examples

Java SDK
GetChronyServersAction action = new GetChronyServersAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetChronyServersAction.Result res = action.call();
Python SDK
GetChronyServersAction action = GetChronyServersAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetChronyServersAction.Result res = action.call()

SyncChronyServers

API Request

URLs
PUT zstack/v1/zops/chrony/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "syncChronyServers": {},
  "systemTags": [],
  "userTags": []
}
Note: In the above example, 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 '{"syncChronyServers":{}}' \
http://localhost:8080/zstack/v1/zops/chrony/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
systemTags (Optional) List body System tags 4.7.21
userTags (Optional) List body User tags 4.7.21

API Response

On success, this API returns an empty JSON structure {}. On failure, the returned JSON structure contains an error field, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
SyncChronyServersAction action = new SyncChronyServersAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SyncChronyServersAction.Result res = action.call();
Python SDK
SyncChronyServersAction action = SyncChronyServersAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SyncChronyServersAction.Result res = action.call()ss

UpdateChronyServers

API Request

URLs
PUT zstack/v1/zops/chrony/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateChronyServers": {
    "internalHostnames": [
      "172.0.0.1",
      "172.0.0.2"
    ],
    "externalHostnames": [
      "test1.ntp.com"
    ]
  },
  "systemTags": [],
  "userTags": []
}
Note: In the above example, 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 '{"updateChronyServers":{"internalHostnames":["172.0.0.1","172.0.0.2"],"externalHostnames":["test1.ntp.com"]}}' \
http://localhost:8080/zstack/v1/zops/chrony/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
internalHostnames (Optional) List body (Included in the updateChronyServers structure) Collection of internal time sources 4.7.21
externalHostnames (Optional) List body (Included in the updateChronyServers structure) Collection of external time sources 4.7.21
systemTags (Optional) List body System tags 0.6
userTags (Optional) List body User tags 0.6

API Response

On success, this API returns an empty JSON structure {}. On failure, the returned JSON structure contains an error field, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
UpdateChronyServersAction action = new UpdateChronyServersAction();
action.internalHostnames = asList("172.0.0.1","172.0.0.2");
action.externalHostnames = asList("test1.ntp.com");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateChronyServersAction.Result res = action.call();
Python SDK
UpdateChronyServersAction action = UpdateChronyServersAction()
action.internalHostnames = [172.0.0.1, 172.0.0.2]
action.externalHostnames = [test1.ntp.com]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateChronyServersAction.Result res = action.call()

Global Setting

QueryGlobalConfig

API Request

URLs
GET zstack/v1/global-configurations
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 036d9a68cd8243e99e8d740eaf8b4baf" \
-X GET http://localhost:8080/zstack/v1/global-configurations

Queryable Fields

Run the CLI command line tool, enter QueryGlobalConfig and press the Tab key to view all queryable fields and cross-table queryable resource names.

API Response

Response Example
{
  "inventories": [
    {
      "name": "reservedCapacity",
      "category": "backupStorage",
      "description": "Reserved capcacity on every backup storage",
      "defaultValue": "1G",
      "value": "2G"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation failed. This field is null when the operation succeeds. See error for details 0.6
inventories List See inventories for details 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 The detailed error information 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 that caused the current error. If no root error exists, this field is null 0.6
#inventories
Name Type Description Starting Version
name String Resource name 0.6
category String The category. 0.6
description String The detailed description of the resource 0.6
defaultValue String The default value. 0.6
value String The field value. 0.6

SDK Examples

Java SDK
QueryGlobalConfigAction action = new QueryGlobalConfigAction();
action.conditions = asList();
action.sessionId = "8509eaa6301b4935a4b100a05f1fe2ba";
QueryGlobalConfigAction.Result res = action.call();
Python SDK
QueryGlobalConfigAction action = QueryGlobalConfigAction()
action.conditions = []
action.sessionId = "e085fdf6aa354291b71ae8dc5fa880fe"
QueryGlobalConfigAction.Result res = action.call()

UpdateGlobalConfig

API Request

URLs
PUT zstack/v1/global-configurations/{category}/{name}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
"updateGlobalConfig": {
"value": "90"
  },
"systemTags": [],
"userTags": []
}
Note: In the above example, 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 '{"updateGlobalConfig":{"value":"90"}}' \
http://localhost:8080/zstack/v1/global-configurations/quota/scheduler.num/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
category String url Category 0.6
name String url Resource name 0.6
value (Optional) String body (Included in the updateGlobalConfig structure) Value 0.6
systemTags (Optional) List body System tags 0.6
userTags (Optional) List body User tags 0.6

API Response

Response Example
{
  "inventory": {
    "name": "scheduler.num",
    "category": "quota",
    "description": "default quota for scheduler.num",
    "defaultValue": "80",
    "value": "90"
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation failed. This field is null when the operation succeeds. See error for details 0.6
inventory GlobalConfigInventory See inventory for details 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 The detailed error information 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 that caused the current error. If no root error exists, this field is null 0.6
#inventory
Name Type Description Starting Version
name String Resource name 0.6
category String The category. 0.6
description String The detailed description of the resource 0.6
defaultValue String The default value. 0.6
value String The field value. 0.6

SDK Examples

Java SDK
UpdateGlobalConfigAction action = new UpdateGlobalConfigAction();
action.category = "quota";
action.name = "scheduler.num";
action.value = "90";
action.sessionId = "84a1a9ed2d54449db13e01f7d6face7e";
UpdateGlobalConfigAction.Result res = action.call();
Python SDK
UpdateGlobalConfigAction action = UpdateGlobalConfigAction()
action.category = "quota"
action.name = "scheduler.num"
action.value = "90"
action.sessionId = "b077cfa8599a4ff1ac4fd7ba67b20a82"
UpdateGlobalConfigAction.Result res = action.call()

ResetGlobalConfig

API Request

URLs
PUT zstack/v1/global-configurations/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "resetGlobalConfig": {},
  "systemTags": [],
  "userTags": []
}
Note: In the above example, 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 '{"resetGlobalConfig":{}}' http://localhost:8080/zstack/v1/global-configurations/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
systemTags (Optional) List body System tags 3.1.0
userTags (Optional) List body User tags 3.1.0

API Response

On success, this API returns an empty JSON structure {}. On failure, the returned JSON structure contains an error field, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
ResetGlobalConfigAction action = new ResetGlobalConfigAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ResetGlobalConfigAction.Result res = action.call();
Python SDK
ResetGlobalConfigAction action = ResetGlobalConfigAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ResetGlobalConfigAction.Result res = action.call()

GetGlobalConfigOptions

API Request

URLs
GET zstack/v1/global-configurations/{category}/{name}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/global-configurations/kvm/vm.cpuMode
Parameter List
Name Type Location Description Allowed Values Starting Version
category String url The category. 4.4.0
name String url Resource name 4.4.0
systemTags (Optional) List query System tags 4.4.0
userTags (Optional) List query User tags 4.4.0

API Response

On success, this API returns an empty JSON structure {}. On failure, the returned JSON structure contains an error field, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
GetGlobalConfigOptionsAction action = new GetGlobalConfigOptionsAction();
action.category = "kvm";
action.name = "vm.cpuMode";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetGlobalConfigOptionsAction.Result res = action.call();
Python SDK
GetGlobalConfigOptionsAction action = GetGlobalConfigOptionsAction()
action.category = "kvm"
action.name = "vm.cpuMode"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetGlobalConfigOptionsAction.Result res = action.call()

Custom Attribute

GetResourceConfig

API Request

URLs
GET zstack/v1/resource-configurations/{resourceUuid}/{category}/{name}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/resource-configurations/77663dd5ff84460bbf1817aa3c59d125/host/cpu.overProvisioning.ratio
Parameter List
Name Type Location Description Allowed Values Starting Version
category String url Configuration category 3.4.0
name String url Configuration name 3.4.0
resourceUuid String url Resource UUID 3.4.0
systemTags (Optional) List query Optional. The system tags. 3.4.0
userTags (Optional) List query Optional. The user tags. 3.4.0

API Response

Response Example
{
  "value": "5",
  "effectiveConfigs": [
    {
      "uuid": "dae9aeb6d74e4f44823f2e0c4f1cc79f",
      "resourceUuid": "46597de31eac41539c4e6eda52885769",
      "resourceType": "HostVO",
      "name": "cpu.overProvisioning.ratio",
      "category": "host",
      "value": "5",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    },
    {
      "uuid": "5c3c94a73d7b4a95a1818241f2e427ae",
      "resourceUuid": "371519310f344695854de27bb9743121",
      "resourceType": "ClusterVO",
      "name": "cpu.overProvisioning.ratio",
      "category": "host",
      "value": "10",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
Name Type Description Starting Version
value String The configuration value 3.4.0
success boolean Whether the operation succeeded. 3.4.0
error ErrorCode The error code. If not null, the operation failed. This field is null when the operation succeeds. See error for details 3.4.0
effectiveConfigs List The list of effective configurations, sorted by priority from high to low. See effectiveConfigs for details 3.4.0
error ErrorCode See error for details 3.4.0
#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 3.4.0
description String A brief description of the error 3.4.0
details String The detailed error information 3.4.0
elaboration String Reserved field. Default is null 3.4.0
opaque LinkedHashMap Reserved field. Default is null 3.4.0
cause ErrorCode The root error that caused the current error. If no root error exists, this field is null 3.4.0
#effectiveConfigs
Name Type Description Starting Version
uuid String The UUID of the resource, uniquely identifying the resource 3.4.0
resourceUuid String The resource UUID associated with the configuration 3.4.0
resourceType String The resource type associated with the configuration 3.4.0
name String Configuration name 3.4.0
description String The detailed description of the configuration 3.4.0
category String Configuration category 3.4.0
value String The configuration value 3.4.0
createDate Timestamp Creation time 3.4.0
lastOpDate Timestamp Last modification time 3.4.0
#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 3.4.0
description String A brief description of the error 3.4.0
details String The detailed error information 3.4.0
elaboration String Reserved field. Default is null 3.4.0
opaque LinkedHashMap Reserved field. Default is null 3.4.0
cause ErrorCode The root error that caused the current error. If no root error exists, this field is null 3.4.0

SDK Examples

Java SDK
GetResourceConfigAction action = new GetResourceConfigAction();
action.category = "host";
action.name = "cpu.overProvisioning.ratio";
action.resourceUuid = "70fdcc564f564c29af98e48e78be56e4";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetResourceConfigAction.Result res = action.call();
Python SDK
GetResourceConfigAction action = GetResourceConfigAction()
action.category = "host"
action.name = "cpu.overProvisioning.ratio"
action.resourceUuid = "b1ea1d424bf04a50b15b33bcd0f8a80d"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetResourceConfigAction.Result res = action.call()

GetResourceBindableConfig

API Request

URLs
GET zstack/v1/resource-configurations/bindable
GET zstack/v1/resource-configurations/bindable/{category}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/resource-configurations/bindable?category=host
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/resource-configurations/bindable/host?category=host
Parameter List
Name Type Location Description Allowed Values Starting Version
category (Optional) String query Configuration category 3.4.0
systemTags (Optional) List query Optional. The system tags. 3.4.0
userTags (Optional) List query Optional. The user tags. 3.4.0

API Response

Response Example
{
  "bindableConfigs": [
    {
      "name": "cpu.overProvisioning.ratio",
      "category": "host",
      "bindResourceTypes": [
        "HostVO",
        "ClusterVO",
        "ZoneVO"
      ]
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation failed. This field is null when the operation succeeds. See error for details 3.4.0
bindableConfigs List See bindableConfigs for details 3.4.0
#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 3.4.0
description String A brief description of the error 3.4.0
details String The detailed error information 3.4.0
elaboration String Reserved field. Default is null 3.4.0
opaque LinkedHashMap Reserved field. Default is null 3.4.0
cause ErrorCode The root error that caused the current error. If no root error exists, this field is null 3.4.0
#bindableConfigs
Name Type Description Starting Version
name String Configuration name 3.4.0
category String Configuration category 3.4.0
description String The detailed description of the configuration 3.4.0
bindResourceTypes List The resource types that can be bound with the configuration 3.4.0

SDK Examples

Java SDK
GetResourceBindableConfigAction action = new GetResourceBindableConfigAction();
action.category = "host";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetResourceBindableConfigAction.Result res = action.call();
Python SDK
GetResourceBindableConfigAction action = GetResourceBindableConfigAction()
action.category = "host"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetResourceBindableConfigAction.Result res = action.call()

DeleteResourceConfig

API Request

URLs
DELETE zstack/v1/resource-configurations/{category}/{name}/{resourceUuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/resource-configurations/host/cpu.overProvisioning.ratio/02bcf0b045e247e59bfd51630064443f
Parameter List
Name Type Location Description Allowed Values Starting Version
category String url Configuration category 3.4.0
name String url Configuration name 3.4.0
resourceUuid String url Resource UUID 3.4.0
deleteMode (Optional) String body Optional. The delete mode. 3.4.0
systemTags (Optional) List body Optional. The system tags. 3.4.0
userTags (Optional) List body Optional. The user tags. 3.4.0

API Response

On success, this API returns an empty JSON structure {}. On failure, the returned JSON structure contains an error field, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
DeleteResourceConfigAction action = new DeleteResourceConfigAction();
action.category = "host";
action.name = "cpu.overProvisioning.ratio";
action.resourceUuid = "763612d48d514b35a7df506cf1a23f57";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteResourceConfigAction.Result res = action.call();
Python SDK
DeleteResourceConfigAction action = DeleteResourceConfigAction()
action.category = "host"
action.name = "cpu.overProvisioning.ratio"
action.resourceUuid = "4ac85edbee2c489ea58e3f26b53182de"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteResourceConfigAction.Result res = action.call()

QueryResourceConfig

API Request

URLs
GET zstack/v1/resource-configurations
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/resource-configurations

Queryable Fields

Run the CLI command line tool, enter QueryResourceConfig and press the Tab key to view all queryable fields and cross-table queryable resource names.

API Response

Response Example
{
  "inventories": [
    {
      "uuid": "4944c2599c394bd5be5ccc1099dfdb4b",
      "resourceUuid": "45a511dfef1b474dbef3c1ff88275465",
      "resourceType": "ClusterVO",
      "name": "cpu.overProvisioning.ratio",
      "category": "host",
      "value": "10",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 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. See error for details 3.4.0
inventories List See inventories for details 3.4.0
#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 3.4.0
description String A brief description of the error 3.4.0
details String The detailed error information 3.4.0
elaboration String Reserved field. Default is null 3.4.0
opaque LinkedHashMap Reserved field. Default is null 3.4.0
cause ErrorCode The root error that caused the current error. If no root error exists, this field is null 3.4.0
#inventories
Name Type Description Starting Version
uuid String The UUID of the resource, uniquely identifying the resource 3.4.0
resourceUuid String The resource UUID associated with the configuration 3.4.0
resourceType String The resource type associated with the configuration 3.4.0
name String Configuration name 3.4.0
description String The detailed description of the configuration 3.4.0
category String Configuration category 3.4.0
value String The configuration value 3.4.0
createDate Timestamp Creation time 3.4.0
lastOpDate Timestamp Last modification time 3.4.0

SDK Examples

Java SDK
QueryResourceConfigAction action = new QueryResourceConfigAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryResourceConfigAction.Result res = action.call();
Python SDK
QueryResourceConfigAction action = QueryResourceConfigAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryResourceConfigAction.Result res = action.call()

UpdateResourceConfig

API Request

URLs
PUT zstack/v1/resource-configurations/{category}/{name}/{resourceUuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateResourceConfig": {
    "value": "10"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the above example, 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 '{"updateResourceConfig":{"value":"10"}}' http://localhost:8080/zstack/v1/resource-configurations/host/cpu.overProvisioning.ratio/afd5f67a253b4990b9e8160672357eed/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
category String url Configuration category 3.4.0
name String url Configuration name 3.4.0
resourceUuid String url Resource UUID of the configuration 3.4.0
value String body (Included in the updateResourceConfig structure) The configuration value 3.4.0
systemTags (Optional) List body Optional. The system tags. 3.4.0
userTags (Optional) List body Optional. The user tags. 3.4.0

API Response

Response Example
{
  "inventory": {
    "uuid": "ce61962673574ff689e2e6cb6f8cf558",
    "resourceUuid": "435a7c71c82b4b0b971f4674ab346822",
    "resourceType": "ClusterVO",
    "name": "cpu.overProvisioning.ratio",
    "category": "host",
    "value": "10",
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 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. See error for details 3.4.0
inventory ResourceConfigInventory See inventory for details 3.4.0
#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 3.4.0
description String A brief description of the error 3.4.0
details String The detailed error information 3.4.0
elaboration String Reserved field. Default is null 3.4.0
opaque LinkedHashMap Reserved field. Default is null 3.4.0
cause ErrorCode The root error that caused the current error. If no root error exists, this field is null 3.4.0
#inventory
Name Type Description Starting Version
uuid String The UUID of the resource, uniquely identifying the resource 3.4.0
resourceUuid String The resource UUID associated with the configuration 3.4.0
resourceType String The resource type associated with the configuration 3.4.0
name String Configuration name 3.4.0
description String The detailed description of the configuration 3.4.0
category String Configuration category 3.4.0
value String The configuration value 3.4.0
createDate Timestamp Creation time 3.4.0
lastOpDate Timestamp Last modification time 3.4.0

SDK Examples

Java SDK
UpdateResourceConfigAction action = new UpdateResourceConfigAction();
action.category = "host";
action.name = "cpu.overProvisioning.ratio";
action.resourceUuid = "5fa296dff4f04c96b29f38bef93e9e15";
action.value = "10";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateResourceConfigAction.Result res = action.call();
Python SDK
UpdateResourceConfigAction action = UpdateResourceConfigAction()
action.category = "host"
action.name = "cpu.overProvisioning.ratio"
action.resourceUuid = "1e0f389aca364a1f94929bb4f39597b3"
action.value = "10"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateResourceConfigAction.Result res = action.call()

UpdateResourceConfigs

API Request

URLs
POST zstack/v1/resource-configurations/{resourceUuid}/resource-configs/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "resourceConfigs": [
      {
        "category": "vm",
        "name": "cleanTraffic",
        "value": "true"
      }
    ]
  },
  "systemTags": [],
  "userTags": []
}
Note: In the above example, 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":{"resourceConfigs":[{"category":"vm","name":"cleanTraffic","value":"true"}]}}' \
http://localhost:8080/zstack/v1/resource-configurations/f4f8970eba3536a69fc2139456f383ae/resource-configs/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
resourceUuid String url Resource UUID of the configuration The resource name. 4.7.0
resourceConfigs List body (Included in the params structure) The list of resource custom attributes 4.7.0
systemTags (Optional) List body System tags 4.7.0
userTags (Optional) List body User tags 4.7.0

API Response

Response Example
{
  "inventories": [
    {
      "value": "10",
      "effectiveConfigs": [
        {
          "uuid": "9d7aeba3ff604f46b419475c0ade1538",
          "resourceUuid": "378c6a50c9ee415baa4688fcd19f023a",
          "resourceType": "ClusterVO",
          "name": "cpu.overProvisioning.ratio",
          "category": "host",
          "value": "10",
          "createDate": "Nov 14, 2017 2:20:57 PM",
          "lastOpDate": "Nov 14, 2017 2:20:57 PM"
        }
      ],
      "name": "cpu.overProvisioning.ratio"
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.7.0
inventories List See inventories for details 4.7.0
error ErrorCode The error code. If not null, the operation failed. This field is null when the operation succeeds. See error for details 4.7.0
#inventories
Name Type Description Starting Version
value String The field value. 4.7.0
name String The resource name. 4.7.0
effectiveConfigs List See effectiveConfigs for details 4.7.0
#effectiveConfigs
Name Type Description Starting Version
uuid String The UUID of the resource, uniquely identifying the resource 3.4.0
resourceUuid String The resource UUID associated with the configuration 3.4.0
resourceType String The resource type associated with the configuration 3.4.0
name String Configuration name 3.4.0
description String The detailed description of the configuration 3.4.0
category String Configuration category 3.4.0
value String The configuration value 3.4.0
createDate Timestamp Creation time 3.4.0
lastOpDate Timestamp Last modification time 3.4.0
#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 3.4.0
description String A brief description of the error 3.4.0
details String The detailed error information 3.4.0
elaboration String Reserved field. Default is null 3.4.0
opaque LinkedHashMap Reserved field. Default is null 3.4.0
cause ErrorCode The root error that caused the current error. If no root error exists, this field is null 3.4.0

SDK Examples

Java SDK
UpdateResourceConfigsAction action = new UpdateResourceConfigsAction();
action.resourceUuid = "f4f8970eba3536a69fc2139456f383ae";
action.resourceConfigs = asList([category:vm, name:cleanTraffic, value:true]);
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateResourceConfigsAction.Result res = action.call();
Python SDK
UpdateResourceConfigsAction action = UpdateResourceConfigsAction()
action.resourceUuid = "f4f8970eba3536a69fc2139456f383ae"
action.resourceConfigs = [[category:vm, name:cleanTraffic, value:true]]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateResourceConfigsAction.Result res = action.call()
API Reference | ZStack ZSphere · ZVF | ZStack Resource Center