ZStack Cloud Platform
Single Server, Free Trial for One Year
POST zstack/v1/log/configurationsAuthorization: OAuth the-session-uuid{ "params": { "name": "syslog", "type": "log4j2", "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 sample, both systemTags and userTags are optional. These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X POST -d '{"params":{"name":"syslog","type":"log4j2","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 | Optional Value | Starting Version |
|---|---|---|---|---|---|
| name | String | body (contained in the params structure) | The resource name. | 3.10.0 | |
| description | String | body (contained in the params structure) | Optional. The detailed description of the resource. | 3.10.0 | |
| type | String | body (contained in the params structure) | 3.10.0 | ||
| configuration | String | body (contained in the params structure) | 3.10.0 | ||
| resourceUuid | String | body (contained in the params structure) | Optional. The resource UUID. | 3.10.0 | |
| tagUuids | List | body (contained in the params structure) | Optional. The tag UUID list. | 3.10.0 | |
| systemTags | List | body | Optional. The system tags. | 3.10.0 | |
| userTags | List | body | Optional. The user tags. | 3.10.0 |
{ "inventory": { "id": 0.0, "labelKey": "log4j2-f2828a4c39af4605a86a94a36b8f7865", "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 | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.10.0 |
| inventory | ResourceStackInventory | See inventory. | 3.10.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 3.10.0 |
| description | String | The brief description of the error. | 3.10.0 |
| details | String | The details about the error. | 3.10.0 |
| elaboration | String | The reserved field. Default value: null. | 3.10.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.10.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 3.10.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| id | long | 3.10.0 | |
| labelKey | String | 3.10.0 | |
| labelValue | String | 3.10.0 | |
| resourceUuid | String | The resource UUID. | 3.10.0 |
| createDate | Timestamp | The creation date. | 3.10.0 |
| lastOpDate | Timestamp | The last operation date. | 3.10.0 |
AddLogConfigurationAction action = new AddLogConfigurationAction(); action.name = "syslog"; action.type = "log4j2"; action.configuration = "{ "appenderType": "Syslog", "configuration": { "hostname": "192.168.0.11", "port": "514", "protocol": "UDP", "facility": "LOCAL5" } }"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; AddLogConfigurationAction.Result res = action.call();AddLogConfigurationAction action = AddLogConfigurationAction() action.name = "syslog" action.type = "log4j2" action.configuration = "{ "appenderType": "Syslog", "configuration": { "hostname": "192.168.0.11", "port": "514", "protocol": "UDP", "facility": "LOCAL5" } }" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" AddLogConfigurationAction.Result res = action.call()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 | Optional Value | Starting Version |
|---|---|---|---|---|---|
| configId | Long | body | The configuration ID. | 3.10.0 | |
| deleteMode | String | body | Optional. The delete mode. Options: Enforcing | Permissive. Default value: Permissive. |
| 3.10.0 |
| systemTags | List | body | Optional. The system tags. | 3.10.0 | |
| userTags | List | body | Optional. The user tags. | 3.10.0 |
{ "error": { "code": "SYS.1001", "description": "A message or a operation timeout", "details": "Create VM on KVM timeout after 300s" } }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()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 | Optional Value | Starting Version |
|---|---|---|---|---|---|
| systemTags | List | query | Optional. The system tags. | 3.10.0 | |
| userTags | List | query | Optional. The user tags. | 3.10.0 |
{ "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 | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.10.0 |
| inventories | List | See inventories. | 3.10.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 3.10.0 |
| description | String | The brief description of the error. | 3.10.0 |
| details | String | The details about the error. | 3.10.0 |
| elaboration | String | The reserved field. Default value: null. | 3.10.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.10.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 3.10.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| id | long | 3.10.0 | |
| labelKey | String | 3.10.0 | |
| labelValue | String | 3.10.0 | |
| resourceUuid | String | The resource UUID. | 3.10.0 |
| createDate | Timestamp | The creation date. | 3.10.0 |
| lastOpDate | Timestamp | The last operation date. | 3.10.0 |
GetLogConfigurationAction action = new GetLogConfigurationAction(); action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; GetLogConfigurationAction.Result res = action.call();GetLogConfigurationAction action = GetLogConfigurationAction() action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" GetLogConfigurationAction.Result res = action.call()