System Settings
Log Server
AddLogConfiguration
Add Log Configuration
API Request
POST zstack/v1/log/configurations
Authorization: OAuth the-session-uuid
{
"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 -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
| 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
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();
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
DELETE zstack/v1/log/configurations/log4j2Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/log/configurations/log4j2?deleteMode=Permissive| 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 |
|
3.10.0 |
| systemTags (optional) | List | body | System tags | 3.10.0 | |
| userTags (optional) | List | body | User tags | 3.10.0 |
API Response
{}. 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
DeleteLogConfigurationAction action = new DeleteLogConfigurationAction();
action.configId = 0.0;
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteLogConfigurationAction.Result res = action.call();DeleteLogConfigurationAction action = DeleteLogConfigurationAction()
action.configId = 0.0
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteLogConfigurationAction.Result res = action.call()GetLogConfiguration
API Request
GET zstack/v1/log/configurationsAuthorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X GET http://localhost:8080/zstack/v1/log/configurations| 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
{
"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 |
| 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 |
| 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
GetLogConfigurationAction action = new GetLogConfigurationAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetLogConfigurationAction.Result res = action.call();GetLogConfigurationAction action = GetLogConfigurationAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetLogConfigurationAction.Result res = action.call()UpdateLogConfiguration
API Request
PUT zstack/v1/log/configurationsAuthorization: OAuth the-session-uuid{
"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 -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| 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
{
"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 |
| 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 |
| 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
UpdateLogConfigurationAction action = new UpdateLogConfigurationAction();
action.configId = 1.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateLogConfigurationAction.Result res = action.call();UpdateLogConfigurationAction action = UpdateLogConfigurationAction()
action.configId = 1.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateLogConfigurationAction.Result res = action.call()AddLogServer
Add Log Server
API Request
POST zstack/v1/log/servers
Authorization: OAuth the-session-uuid
{
"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 -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
| 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) |
|
5.1.0 |
| type | String | body (included in the params structure) |
Log type |
|
5.1.0 |
| level (Optional) | String | body (included in the params structure) |
Level |
|
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
{
"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 |
| 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 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| ManagementNodeLog | LogCategory | The ManagementNodeLog value. | 5.1.0 |
| PlatformOperationLog | LogCategory | The PlatformOperationLog value. | 5.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Log4j2 | LogType | The Log4j2 value. | 5.1.0 |
| FluentBit | LogType | The FluentBit value. | 5.1.0 |
| 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 |
| 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
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();
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
DELETE zstack/v1/log/servers
Authorization: OAuth the-session-uuid
curl -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X DELETE http://localhost:8080/zstack/v1/log/servers?uuid=cdc213d6ba25367ea6c4d201491d900c
| 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
DeleteLogServerAction action = new DeleteLogServerAction();
action.uuid = "cdc213d6ba25367ea6c4d201491d900c";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteLogServerAction.Result res = action.call();
action = DeleteLogServerAction()
action.uuid = "cdc213d6ba25367ea6c4d201491d900c"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
QueryLogServer
Query Log Server
API Request
GET zstack/v1/log/servers
GET zstack/v1/log/servers/{uuid}
Authorization: OAuth the-session-uuid
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
QueryLogServerAction action = new QueryLogServerAction();
action.conditions = asList("uuid=xxx","name=xxx");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryLogServerAction.Result res = action.call();
action = QueryLogServerAction()
action.conditions = ["uuid=xxx","name=xxx"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
UpdateLogServer
Update Log Server
API Request
PUT zstack/v1/log/servers
Authorization: OAuth the-session-uuid
{
"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 -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
| 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
UpdateLogServerAction action = new UpdateLogServerAction();
action.uuid = "10bf3f837edf37a0be99a84d1edafb6b";
action.name = "example";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateLogServerAction.Result res = action.call();
action = UpdateLogServerAction()
action.uuid = "10bf3f837edf37a0be99a84d1edafb6b"
action.name = "example"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
SNMP
CreateSnmpAgent
API Request
POST zstack/v1/snmp/agentAuthorization: OAuth the-session-uuid{
"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 -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| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| version | String | body (contained in the params structure) | SNMP agent protocol version |
|
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 |
|
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 |
|
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
{
"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 |
|---|---|---|---|
| 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 |
| 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
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();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
GET zstack/v1/snmp/agent
GET zstack/v1/snmp/agent/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/snmp/agentcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/snmp/agent/18c89b48e653385f83db6ecffb48763fQueryable Fields
Run the CLI tool, enter QueryLdapServer and press Tab to view all queryable fields and cross-table queryable resource names.
API Response
{
"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 |
| 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 |
| 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
QuerySnmpAgentAction action = new QuerySnmpAgentAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySnmpAgentAction.Result res = action.call();QuerySnmpAgentAction action = QuerySnmpAgentAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySnmpAgentAction.Result res = action.call()StartSnmpAgent
API Request
PUT zstack/v1/snmp/agent/actionsAuthorization: OAuth the-session-uuid{
"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 -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| 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
{
"inventory": {
"uuid": "eef797ff89d84305b51cc3edcb597909",
"version": "v3",
"userName": "zstack",
"authAlgorithm": "SHA",
"authPassword": "authPassword",
"privacyAlgorithm": "AES128",
"privacyPassword": "privPassword",
"port": 162
}
}| 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 |
| 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
StartSnmpAgentAction action = new StartSnmpAgentAction();
action.uuid = "a74555a81a4244bb9ce0f8f2b5691ac5";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
StartSnmpAgentAction.Result res = action.call();StartSnmpAgentAction action = StartSnmpAgentAction()
action.uuid = "56f7b7cc6f764c55bf4016cc2257f456"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
StartSnmpAgentAction.Result res = action.call()StopSnmpAgent
API Request
PUT zstack/v1/snmp/agent/actionsAuthorization: OAuth the-session-uuid{
"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 -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| 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
{
"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 |
|---|---|---|---|
| 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 |
| 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
StopSnmpAgentAction action = new StopSnmpAgentAction();
action.uuid = "5b470e397e794dff84efa29375d9cef8";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
StopSnmpAgentAction.Result res = action.call();StopSnmpAgentAction action = StopSnmpAgentAction()
action.uuid = "e48db055707445d3b70e8e52f7ee0ca3"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
StopSnmpAgentAction.Result res = action.call()UpdateSnmpAgent
API Request
PUT zstack/v1/snmp/agent/actionsAuthorization: OAuth the-session-uuid{
"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 -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| 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 |
|
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 |
|
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 |
|
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
{
"inventory": {
"uuid": "cad9965ebedd495aa1f5718f31da1aa8",
"version": "v3",
"userName": "zstack",
"authAlgorithm": "SHA",
"authPassword": "authPassword",
"privacyAlgorithm": "AES128",
"privacyPassword": "privPassword",
"port": 162
}
}| 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 |
| 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
UpdateSnmpAgentAction action = new UpdateSnmpAgentAction();
action.version = "v2c";
action.readCommunity = "zstack";
action.port = 1161;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateSnmpAgentAction.Result res = action.call();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
GET zstack/v1/zops/check/networkAuthorization: OAuth the-session-uuidcurl -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| 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
{
"results": [
{
"sourceHostname": "172.0.0.1",
"targetHostname": "test2.com",
"status": "Disconnected"
},
{}
]
}| 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 |
| 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 |
| 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
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();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
GET zstack/v1/zops/chrony/serversAuthorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zops/chrony/servers| 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
{
"servers": [
{
"internal": {
"hostname": "172.0.0.1",
"status": "Connected"
},
"external": {
"hostname": "ntp.test.com",
"status": "Connected"
}
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| hostname | String | Address | 4.7.21 |
| status | HostConnectedStatus | See status for details | 4.7.21 |
| 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 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| hostname | String | Address | 4.7.21 |
| status | HostConnectedStatus | See status for details | 4.7.21 |
| 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 |
| 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
GetChronyServersAction action = new GetChronyServersAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetChronyServersAction.Result res = action.call();GetChronyServersAction action = GetChronyServersAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetChronyServersAction.Result res = action.call()SyncChronyServers
API Request
PUT zstack/v1/zops/chrony/actionsAuthorization: OAuth the-session-uuid{
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"syncChronyServers":{}}' \
http://localhost:8080/zstack/v1/zops/chrony/actions| 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 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
SyncChronyServersAction action = new SyncChronyServersAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SyncChronyServersAction.Result res = action.call();SyncChronyServersAction action = SyncChronyServersAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SyncChronyServersAction.Result res = action.call()ssUpdateChronyServers
API Request
PUT zstack/v1/zops/chrony/actionsAuthorization: OAuth the-session-uuid{
"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 -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| 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 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
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();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
GET zstack/v1/global-configurationsAuthorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 036d9a68cd8243e99e8d740eaf8b4baf" \
-X GET http://localhost:8080/zstack/v1/global-configurationsQueryable 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
{
"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 |
| 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 |
| 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
QueryGlobalConfigAction action = new QueryGlobalConfigAction();
action.conditions = asList();
action.sessionId = "8509eaa6301b4935a4b100a05f1fe2ba";
QueryGlobalConfigAction.Result res = action.call();QueryGlobalConfigAction action = QueryGlobalConfigAction()
action.conditions = []
action.sessionId = "e085fdf6aa354291b71ae8dc5fa880fe"
QueryGlobalConfigAction.Result res = action.call()UpdateGlobalConfig
API Request
PUT zstack/v1/global-configurations/{category}/{name}/actionsAuthorization: OAuth the-session-uuid{
"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 -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| 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
{
"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 |
| 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 |
| 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
UpdateGlobalConfigAction action = new UpdateGlobalConfigAction();
action.category = "quota";
action.name = "scheduler.num";
action.value = "90";
action.sessionId = "84a1a9ed2d54449db13e01f7d6face7e";
UpdateGlobalConfigAction.Result res = action.call();UpdateGlobalConfigAction action = UpdateGlobalConfigAction()
action.category = "quota"
action.name = "scheduler.num"
action.value = "90"
action.sessionId = "b077cfa8599a4ff1ac4fd7ba67b20a82"
UpdateGlobalConfigAction.Result res = action.call()ResetGlobalConfig
API Request
PUT zstack/v1/global-configurations/actionsAuthorization: OAuth the-session-uuid{
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"resetGlobalConfig":{}}' http://localhost:8080/zstack/v1/global-configurations/actions| 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 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
ResetGlobalConfigAction action = new ResetGlobalConfigAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ResetGlobalConfigAction.Result res = action.call();ResetGlobalConfigAction action = ResetGlobalConfigAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ResetGlobalConfigAction.Result res = action.call()GetGlobalConfigOptions
API Request
GET zstack/v1/global-configurations/{category}/{name}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/global-configurations/kvm/vm.cpuMode| 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 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
GetGlobalConfigOptionsAction action = new GetGlobalConfigOptionsAction();
action.category = "kvm";
action.name = "vm.cpuMode";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetGlobalConfigOptionsAction.Result res = action.call();GetGlobalConfigOptionsAction action = GetGlobalConfigOptionsAction()
action.category = "kvm"
action.name = "vm.cpuMode"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetGlobalConfigOptionsAction.Result res = action.call()Custom Attribute
GetResourceConfig
API Request
GET zstack/v1/resource-configurations/{resourceUuid}/{category}/{name}Authorization: OAuth the-session-uuidcurl -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| 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
{
"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 |
| 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 |
| 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 |
| 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
GetResourceConfigAction action = new GetResourceConfigAction();
action.category = "host";
action.name = "cpu.overProvisioning.ratio";
action.resourceUuid = "70fdcc564f564c29af98e48e78be56e4";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetResourceConfigAction.Result res = action.call();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
GET zstack/v1/resource-configurations/bindable
GET zstack/v1/resource-configurations/bindable/{category}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/resource-configurations/bindable?category=hostcurl -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| 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
{
"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 |
| 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 |
| 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
GetResourceBindableConfigAction action = new GetResourceBindableConfigAction();
action.category = "host";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetResourceBindableConfigAction.Result res = action.call();GetResourceBindableConfigAction action = GetResourceBindableConfigAction()
action.category = "host"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetResourceBindableConfigAction.Result res = action.call()DeleteResourceConfig
API Request
DELETE zstack/v1/resource-configurations/{category}/{name}/{resourceUuid}Authorization: OAuth the-session-uuidcurl -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| 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 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
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();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
GET zstack/v1/resource-configurationsAuthorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/resource-configurationsQueryable 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
{
"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 |
| 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 |
| 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
QueryResourceConfigAction action = new QueryResourceConfigAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryResourceConfigAction.Result res = action.call();QueryResourceConfigAction action = QueryResourceConfigAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryResourceConfigAction.Result res = action.call()UpdateResourceConfig
API Request
PUT zstack/v1/resource-configurations/{category}/{name}/{resourceUuid}/actionsAuthorization: OAuth the-session-uuid{
"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 -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| 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
{
"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 |
| 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 |
| 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
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();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
POST zstack/v1/resource-configurations/{resourceUuid}/resource-configs/actionsAuthorization: OAuth the-session-uuid{
"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 -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| 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
{
"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 |
| 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 |
| 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 |
| 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
UpdateResourceConfigsAction action = new UpdateResourceConfigsAction();
action.resourceUuid = "f4f8970eba3536a69fc2139456f383ae";
action.resourceConfigs = asList([category:vm, name:cleanTraffic, value:true]);
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateResourceConfigsAction.Result res = action.call();UpdateResourceConfigsAction action = UpdateResourceConfigsAction()
action.resourceUuid = "f4f8970eba3536a69fc2139456f383ae"
action.resourceConfigs = [[category:vm, name:cleanTraffic, value:true]]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateResourceConfigsAction.Result res = action.call()