I. Introduction
In this article, we're going to discuss how to use Newman to configure ACI. Newman is third party REST API tool. Newman is CLI version of Postman.
Basically, it provides the same functionality as Postman, however you run it in CLI. Moreover, you may use Newman as NodeJS module.
Instead of setting the variable in the GUI like Postman, you’ll use the .json file to setup the variable and putting all your configuration parameters.
II. Running Newman To Configure ACI
It’s assume that you’ve install Newman packages.
Assuming that you have npm, you can install using the following command:
$npm install newman –global;
1. Download the environment from Postman
Using the Environment that was configured from the previous article ACI Automation Part 4. you can download this environment.
In this example, this will be downloaded to file name “Fabric-3.postman_environment.json”
In Managed Environments, click on the icon to Download Environment.
2. Export the Postman Collections
Using the Environment that was configured from the previous article ACI Automation Part 4. you can export the collections.
In this example, this will be downloaded to file name “Set-Multiple-Config.postman_collection.json”
3. Run the Newman CLI to Configure ACI
$ newman run Set-Multiple-Config.postman_collection.json -e Fabric-3.postman_environment.json -d set-multiple-config.csv -k
Explanation:
-e is the environment
-d is the data in .csv file
Note: if you have issue with the SSL certificate, you may add the -k at the end of the command to disable SSL. Troubleshooting Newman is beyond the scope of this article.
III. Result
1. The Newman CLI output
In the screenshot taken the last iteration 10, there are previous 9 other iteration generates the similar output as iteration 10.
2. ACI Result
2.1. BD
2.2. EPG
2.3. Static Binding
2.4. Domain