I have "500 internal server error" when I do POST command for controllers. Would you explain why it happened?
1. I retrieved the controller ID (controller-1) by using below command meaning that my authorization is correct (nsx-mgr can communicate with postman)
Retrieve available controller IDs with GET /api/2.0/vdn/controller
2. I am able to run GET to get the status of controller, for example
GET /api/2.0/vdn/controller/controller-1/syslog
The return value said that "Syslog serer is not configured for controller.."
3. Then I tried to run POST commands with below syntax, I got 500 error.
<controllerSyslogServer>
<syslogServer>1.2.3.4</syslogServer>
<port>12345</port>
<protocol>tcp</protocol>
<level></level>
</controllerSyslogServer>
Does anyone know why I am getting this? I test it from HOL and my homelab, the results were same. By the way, return value said "400 Bad Request"
FYI I added "Content-type with application/xml"
You are missing logging level in the Post Body call
<controllerSyslogServer>
<syslogServer>1.2.3.4</syslogServer>
<port>12345</port>
<protocol>tcp</protocol>
<level></level>
</controllerSyslogServer>
Correct Format is
<controllerSyslogServer>
<syslogServer>1.2.3.4</syslogServer>
<port>12345</port>
<protocol>tcp</protocol>
<level>info</level>
</controllerSyslogServer>
You are missing logging level in the Post Body call
<controllerSyslogServer>
<syslogServer>1.2.3.4</syslogServer>
<port>12345</port>
<protocol>tcp</protocol>
<level></level>
</controllerSyslogServer>
Correct Format is
<controllerSyslogServer>
<syslogServer>1.2.3.4</syslogServer>
<port>12345</port>
<protocol>tcp</protocol>
<level>info</level>
</controllerSyslogServer>
Adding "INFO" in the level did not solve the problem. I am still getting an 404 error. I don't know what I am missing.
Most likely there is something wrong that you did in the past. Do a DELETE call and ensure when you perform GET call , you are getting status as syslog not configured and after that issue the POST call with the correct body.
I don't know what I did wrong. I deleted it and tried, but still not working. Let me try in HOL and will update the status. Thanks
Hi Sreec,
You are correct. When I add a level, it worked. I learned the difference between POST and PUT. I guess it was not working properly until I delete the API command and do it again with a level value. Thanks.
Glad to hear that