vCO Workflow Script to Add an A and CName Record using the InfoBlox Plugin

The following script adds an A and CName record using the InfoBlox plugin

 

try
{
	objIpamConnection.reconnect();
}
catch (objException)
{
	System.log(objException);
}

var objIpamNetwork;
	objIpamNetwork = new IpamNetwork("10.0.0.0", "24", "Production Network");

try
{
	var strIPAddress;
		strIPAddress = objIpamConnection.getNextAvailableIP(objIpamNetwork);

	var objIpamExtensibleAttribute;
		objIpamExtensibleAttribute = new IpamExtensibleAttribute("fqdn.vcoflow.co.uk", "vCO Created DNS Records", "Virtual Data Center", "Organisation");

 var objIpamHost;
 objIpamHost = new IpamHost(strIPAddress, "00:00:00:00:00:00", "fqdn.vcoflow.co.uk", "DNS - A Record Deployed by vCO");

 var objIpamCnameRecord;
 objIpamCnameRecord = new IpamCnameRecord("fqdn.vcoflow.co.uk", "fqdn.vcoflow.co.uk", "DNS - CName Record Deployed by vCO");

 try
 {
 objIpamConnection.addHost(objIpamNetwork, objIpamHost, objIpamExtensibleAttribute);
 }
 catch (objException)
 {
 System.log(objException);
 }

 try
 {
 objIpamConnection.addCnameRecord(objIpamCnameRecord, objIpamExtensibleAttribute);
 }
 catch (objException)
 {
 System.log(objException);
 }
}
catch (objException)
{
 System.log(objException);
}

2 Comments

  1. Gavin July 16, 2015 1:29 am  Reply

    Hi,

    Bit of a newbie here – but what part would I just use if I only wanted to create a C-Name for an existing A-Record?

    • SImon Sparks July 16, 2015 9:41 am  Reply

      The following is the code to add just a CName Record to InfoBlox

      try
      {
      objIpamConnection.reconnect();
      }
      catch (objException)
      {
      System.log(objException);
      }

      try
      {
      var objIpamExtensibleAttribute;
      objIpamExtensibleAttribute = new IpamExtensibleAttribute(“fqdn.vcoflow.co.uk”, “vCO Created DNS Records”, “Virtual Data Center”, “Organisation”);

      var objIpamCnameRecord;
      objIpamCnameRecord = new IpamCnameRecord(“fqdn.vcoflow.co.uk”, “fqdn.vcoflow.co.uk”, “DNS – CName Record Deployed by vCO”);

      try
      {
      objIpamConnection.addCnameRecord(objIpamCnameRecord, objIpamExtensibleAttribute);
      }
      catch (objException)
      {
      System.log(objException);
      }
      }
      catch (objException)
      {
      System.log(objException);
      }

Leave a Reply