ZStack Cloud Platform
Single Server, Free Trial for One Year
POST zstack/v1/log/serversAuthorization: OAuth the-session-uuid{ "params": { "name": "log-server", "description": "log server", "category": "ManagementNodeLog", "type": "Log4j2", "level": "ALL", "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":"log-server","description":"log server","category":"ManagementNodeLog","type":"Log4j2","level":"ALL","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/servers| Name | Type | Location | Description | Valid Values | Starting Version |
|---|---|---|---|---|---|
| name | String | body (container in the params structure) | The resource name. | 5.3.28 | |
| description | String | body (container in the params structure) | Optional. The resource description. | 5.3.28 | |
| category | String | body (container in the params structure) | The log category. |
| 5.3.28 |
| type | String | body (container in the params structure) | The log type. |
| 5.3.28 |
| level (可选) | String | body (container in the params structure) | Optional. The log severity level. |
| 5.3.28 |
| configuration | String | body (container in the params structure) | The log configurations. | 5.3.28 | |
| resourceUuid | String | body (container in the params structure) | Optional. The resource UUID. | 5.3.28 | |
| tagUuids | List | body (container in the params structure) | Optional. The tag UUID list. | 5.3.28 | |
| systemTags | List | body | Optional. The system tags. | 5.3.28 | |
| userTags | List | body | Optional. The user tags. | 5.3.28 |
{ "inventory": {} }| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 5.3.28 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error | 5.3.28 |
| inventory | LogServerInventory | See inventory | 5.3.28 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 5.3.28 |
| description | String | The brief description of the error. | 5.3.28 |
| details | String | The details about the error. | 5.3.28 |
| elaboration | String | The reserved field. Default value: null. | 5.3.28 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 5.3.28 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 5.3.28 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 5.3.28 |
| name | String | The resource name. | 5.3.28 |
| description | String | The resource description. | 5.3.28 |
| configuration | String | 5.3.28 | |
| createDate | Timestamp | The creation time. | 5.3.28 |
| lastOpDate | Timestamp | The last operation time. | 5.3.28 |
| category | LogCategory | See category | 5.3.28 |
| type | LogType | See type | 5.3.28 |
| level | LogLevel | See level | 5.3.28 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| ManagementNodeLog | LogCategory | 5.3.28 | |
| PlatformOperationLog | LogCategory | 5.3.28 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Log4j2 | LogType | 5.3.28 | |
| FluentBit | LogType | 5.3.28 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| OFF | LogLevel | 5.3.28 | |
| FATAL | LogLevel | 5.3.28 | |
| ERROR | LogLevel | 5.3.28 | |
| WARN | LogLevel | 5.3.28 | |
| INFO | LogLevel | 5.3.28 | |
| DEBUG | LogLevel | 5.3.28 | |
| TRACE | LogLevel | 5.3.28 | |
| ALL | LogLevel | 5.3.28 |
AddLogServerAction action = new AddLogServerAction(); action.name = "log-server"; action.description = "log server"; action.category = "ManagementNodeLog"; action.type = "Log4j2"; action.level = "ALL"; action.configuration = "{ "appenderType": "Syslog", "configuration": { "hostname": "192.168.0.11", "port": "514", "protocol": "UDP", "facility": "LOCAL5" } }"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; AddLogServerAction.Result res = action.call();AddLogServerAction action = AddLogServerAction() action.name = "log-server" action.description = "log server" action.category = "ManagementNodeLog" action.type = "Log4j2" action.level = "ALL" action.configuration = "{ "appenderType": "Syslog", "configuration": { "hostname": "192.168.0.11", "port": "514", "protocol": "UDP", "facility": "LOCAL5" } }" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" AddLogServerAction.Result res = action.call()DELETE zstack/v1/log/serversAuthorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X DELETE http://localhost:8080/zstack/v1/log/servers| Name | Type | Location | Description | Valid Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | body | The resource UUID. | 5.3.28 | |
| systemTags | List | body | Optional. The system tags. | 5.3.28 | |
| userTags | List | body | Optional. The user tags. | 5.3.28 |
{ "error": { "code": "SYS.1001", "description": "A message or a operation timeout", "details": "Create VM on KVM timeout after 300s" } }DeleteLogServerAction action = new DeleteLogServerAction(); action.uuid = "cdc213d6ba25367ea6c4d201491d900c"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; DeleteLogServerAction.Result res = action.call();DeleteLogServerAction action = DeleteLogServerAction() action.uuid = "cdc213d6ba25367ea6c4d201491d900c" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" DeleteLogServerAction.Result res = action.call()GET zstack/v1/log/serversGET zstack/v1/log/servers/{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/log/servers?q=uuid=xxx&q=name=xxxcurl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X GET http://localhost:8080/zstack/v1/log/servers/9699713cfb583c70b749adca2c01a77bQueryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryLdapServer, and pressing the Tab key.
{ "error": { "code": "SYS.1001", "description": "A message or a operation timeout", "details": "Create VM on KVM timeout after 300s" } }QueryLogServerAction action = new QueryLogServerAction(); action.conditions = asList("uuid=xxx","name=xxx"); action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; QueryLogServerAction.Result res = action.call();QueryLogServerAction action = QueryLogServerAction() action.conditions = ["uuid=xxx","name=xxx"] action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" QueryLogServerAction.Result res = action.call()