I am looking at creating a workflow to request an available IP address from an InfoBlox / IPAM environment. Essentially, the user would select the network (as an Input param), and the workflow would supply and reserve the available IP address. What would be the process in accomplishing this. We currently have the Infoblox appliance as an endpoint and configured for various vLANS.
Hello,
we have a Infoblox Appliance too and we use the Infoblox REST API to allocate a IP-Address in a specific network und to create a dns entry with vRO Workflows. We use the vRO REST PlugIn to invoke REST Calls to DDI. IN DDI we use Extensible Attributes to "tag" the networks. In the first step we have a workflow to ask for the specific network with the tags we´ve defined. Then we have a workflow that check the usage of the network and allocate a free IP-Address.
Example:
URI: https://gridmaster.domain.com/wapi/2.5/record:host
Method: POST
TYPE: application/json
BODY: '{"name":' + '"' + hostname + '","ipv4addrs":[{"ipv4addr":"func:nextavailableip:' + ipNetworkReference + '"}]}'
Example for Scriptable Task to invoke a Rest Call:
(Input Paramter are: requestMethod, requestUri, requestBody, username, password)
// Prepare Paramaters
var method = requestMethod;
var uri = requestUri;
var body = requestBody;
// Create REST Request
var restHost = RESTHostManager.createHost("dynamicRequest");
restHost.operationTimeout = 600;
httpRestHost = RESTHostManager.createTransientHostFrom(restHost);
httpRestHost.operationTimeout = 600;
httpRestHost.url = uri;
var request = httpRestHost.createRequest(method, uri, body);
// Basic authentication:
var authParams = ['Shared Session', username, password];
var authenticationObject = RESTAuthenticationManager.createAuthentication('Basic', authParams);
httpRestHost.authentication = authenticationObject;
// Set Content Type
request.contentType = requestContentType;
// Execute REST Request
System.log("REST Request: " + method + " " + request.fullUrl);
var response = request.execute();
// Output Handling
statusCodeAttribute = response.statusCode;
System.log("REST Response Status Code: " + statusCodeAttribute);
responseAsString = response.contentAsString;
System.log("REST Response Content: " + responseAsString);