The Custom API workflow tool allows administrators to define workflows for API calls not yet supported by ReSTNSX. This approach is useful when bulk provisioning is required for other NSX API calls that are supported in the current ReSTNSX release. POST and PUT Methods are supported.
Minimum Release: 3.2 Application: NSX-v, NSX T License: Enterprise Privilege level: Engineer or higher
Template and API Setup
To begin, navigate to the configuration dashboard and select Create Custom API.
Enter a name, description (optional), API method (POST/PUT), URI and JSON attributes required for making the API call. The JSON attributes may be entered in by either clicking the ‘Add Attributes’ button or free form in the ‘Request’ text box. Note: The ‘Add Attributes’ method will format the JSON attribute.
The following example shows the Discovery method option that will attempt a GET against the entered URI. This is to collect attributes that might be useful when building the API PUT/POST attributes.
Once the Collect Attributes button is selected, the sample Request text box is filled with the API response. This is an editable text box where the user can add, edit and delete entries.
The attribute values will be stripped when saved to the template.
To test the proposed PUT/POST URI, enter same data into the attributes in the ‘Request’ text box and then click the ‘Test JSON’ button to execute.
CAUTION: This will attempt to run the API using the attributes provided. An object may be created or edited as a result in the target system (active NSX Manager). This will need to be deleted when finished.
Upon saving a valid JSON structure, the workflow will be placed on the dashboard and a CSV template will be created based upon the JSON fields (attributes). This CSV template can then be used to enter data and executed in a new workflow that will appear upon successfully saving and exiting this screen.
Running the Workflow
To run the new custom API, click the name and the workflow will launch. Similar to other workflows, manual and CSV entry data is supported. Note that presence of all the fields that were defined in the workflow setup attributes as text entry boxes
Selecting the CSV Import radio button will switch to the CSV upload screen where the CSV template can be downloaded. The template includes all the same fields for bulk data entry.