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: 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":{"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 | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| name | String | body (contained in the params structure) | Resource name | 3.10.0 | |
| description (optional) | String | body (contained in the params structure) | 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 (optional) | String | body (contained in the params structure) | Resource UUID | 3.10.0 | |
| tagUuids (optional) | List | body (contained in the params structure) | Tag UUID list | 3.10.0 | |
| systemTags (optional) | List | body | System tags | 3.10.0 | |
| userTags (optional) | List | body | 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 | Error code. If not null, the operation failed. This field is null when the operation succeeds. See error | 3.10.0 |
| inventory | ResourceStackInventory | 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 | 3.10.0 | |
| labelKey | String | 3.10.0 | |
| labelValue | String | 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 |
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 | 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 |
{}. 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" } }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()