The previous article described the vRealize Automation phpIPAM integration plugin. To organize efficient work with phpIPAM, you will need a package for vRealize Orchestrator, this will allow you to use IPAM in automation processes. The package includes a set of processes for calling the most requested phpIPAM functions.
The official documentation for the phpIPAM API contains a description of all available functions. The description of the functions is not complete enough, often there is not enough list of required parameters and their descriptions.
phpIPAM integration package
v3.0.1
In the new version of the package, the set of processes (the list of processes) has expanded. All major processes have also been redesigned.
Request execution process
All parameters for connecting to the server are stored in the phpipam_api configuration element. The main process that makes all requests to the phpIPAM API is called “Invoke a REST operation (phpIPAM)”. As input, the process accepts request parameters: param_0 .. param_3, the content request body, if necessary, and the name of the REST operation.
To work with the API in phpIPAM, you need to create an “API key” (menu item Administration -> API) with the App security parameter equal to “SSL with App code token”. The configuration element stores the App ID in the appId attribute and the App Code in token.
An additional optional process parameter restHostVariable allows you to set the variable name of the phpipam_api configuration element, which stores a link to the REST host. This parameter is needed when working with multiple phpIPAM servers (you need to create the same App ID and App Code on each server).
Process “Invoke a REST operation (phpIPAM)”:
- finds a REST:RESTOperation object on a REST host by its name;
- the search can be performed on all hosts specified in the variables of the configuration element (parameters of type REST:RESTHost, you can specify several REST hosts in the configuration element, parameter names with hosts do not matter);
- if restHostVariable is not set, then the first found REST:RESTOperation object with the specified name is used;
- receives a token from the configuration element and sends a request to the REST server;
- returns the server response;
- in case of an error, it generates a json string with the server response.
Preparing the package for work
1. Install the package in vRealize Orchestrator
- download vRO package phpipam.package;
- import the package into the orchestrator via the Packages tab;
- check that the processes and configuration item have been successfully imported;
2. Register a phpIPAM REST host
- use the standard “Add a REST host” process;
- select the authentication type: “Host’s authentication type” = “NONE”;
3. Customization
Start the “Initialize (phpIPAM)” process. Preparing the package for work includes:
- Selecting the main REST host (add additional hosts to the configuration element yourself);
- Starting the process of registering used REST operations: “Add REST operations (phpIPAM)”;
- Storing the phpIPAM token in the phpipam_api config element.
Download plugin
Write questions and suggestions for improvement.