Objective 8.1 – Administer and Execute calls using the VMware NSX vSphere API

Section 8 - Utilize API Commands to Manage a VMware NSX Deployment

Objective 8.1 - Administer and Execute calls using the VMware NSX vSphere API
  • Construct and execute an API call using correct syntax and formatting
  • Programmatically configure system parameters including:
    • NSX controller syslog
    • Modify DLR declared dead time
  • Analyze, modify, and successfully retrieve configuration data using an existing API call
Using PostMan:

- Select Basic Authentication

NSX controller syslog:

GET request:

- https://nsxserver.lab.local/api/2.0/vdn/controller/controllerId/syslog
Identify ControllerID:
- https://nsxserver.lab.local/api/2.0/vdn/controller

<?xml version="1.0" encoding="UTF-8"?>
<error>    
<details>Syslog server is not configured for controller controller-5.</details>    
<errorCode>1255402</errorCode>    
<moduleName>core-services</moduleName>
</error>

 

POST request:

Use RAW and XML settings.

Template:

<controllerSyslogServer>
<syslogServer></syslogServer>
<port></port>
<protocol></protocol>
<level></level>
</controllerSyslogServer>

 Example:

<controllerSyslogServer>
<syslogServer>10.3.58.177</syslogServer>
<port>514</port>
<protocol>UDP</protocol>
<level>INFO</level>
</controllerSyslogServer>

Modify DLR declared dead time:

Identify Edge:
- GET https://nsxserver.lab.local/api/4.0/edge
- GET https://nsxserver.lab.local/api/4.0/edges/edge-42/highavailability/config

Result:

<?xml version="1.0" encoding="UTF-8"?>
<highAvailability>    
<version>12</version>    
<enabled>true</enabled>    
<declareDeadTime>14</declareDeadTime>    
<logging>        
<enable>false</enable>        
<logLevel>info</logLevel>  
</logging>    
<security>        
<enabled>false</enabled>    
</security>
</highAvailability>

PUT request:  (Make sure you are using PUT this time)

<highAvailability>    
<declareDeadTime>15</declareDeadTime>
</highAvailability>