Add Log Server Configuration (AddLogConfiguration)

API Request

URLs
POST zstack/v1/log/configurations
Headers
Authorization: OAuth the-session-uuid
Body
{   "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 Example
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
Parameter List
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

API Response

Response Example
{   "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
#error
Name Type Description Starting Version
code String Error code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.1001 3.10.0
description String Brief description of the error 3.10.0
details String Detailed error information 3.10.0
elaboration String Reserved field. Defaults to null 3.10.0
opaque LinkedHashMap Reserved field. Defaults to null 3.10.0
cause ErrorCode Root error. The source error that caused this error. Null if no root cause exists 3.10.0
#inventory
Name Type Description Starting Version
id long 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

SDK Examples

Java SDK
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();
Python SDK
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 Log Server Configuration (DeleteLogConfiguration)

API Request

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

API Response

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

SDK Examples

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





























Archives

Download Document Archives

Download

Already filled the basic info?Click here.

Enter at least 2 characters.
Cannot be empty.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

An email with a verification code will be sent to you. Make sure the address you provided is valid and correct.

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.
同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
ZStack Training and Certification
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
Request Trial
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder.
Or click on the URL below. (For Internet Explorer, right-click the URL and save it.)

Thank you for using ZStack products and services.

Submit successfully.

We'll connect soon.

Thank you for using ZStack products and services.