Sequence of Calls in the Client - BlueCat Address Manager - 9.0.0

Address Manager API Guide

prodname
BlueCat Address Manager
version_custom
9.0.0
This example adds a host record to an existing zone. It demonstrates a complete session using the Address Manager API from Java. This example implements the following steps:
  1. Connect to the Address Manager API service.
  2. Log in.
  3. Get the parent configuration object by name.
  4. Get the parent view object by name.
  5. Get the parent zone object by name (you can use the absolute name), and then retrieve its child. In this case, to retrieve example.net, we retrieve the parent com to find its child object example.com.
  6. Define a host record object and add it to the parent zone object.
  7. Log out.
import com.bluecatnetworks.proteus.api.client.java.APILoginUtils;
import com.bluecatnetworks.proteus.api.client.java.constants.ObjectTypes;
import com.bluecatnetworks.proteus.api.client.java.proxy.APIEntity;
import com.bluecatnetworks.proteus.api.client.java.proxy.ProteusAPI;

public class ProteusAddHostRecord
{
    public static void main( String[] args ) throws Exception
    {
        ProteusAPI service = APILoginUtils.connect( "ProteusIPAddress" );
        service.login( "api_user", "password" );
        APIEntity existingConfiguration = service.getEntityByName( 0, "Existing Config", ObjectTypes.Configuration );
        APIEntity existingView = service.getEntityByName( existingConfiguration.getId(), "Existing View", ObjectTypes.View );
        long hostRecordId = service.addHostRecord( existingView.getId(), "www.example.com", "10.0.0.6,10.0.0.8", 1, "" );
        service.logout();
    }
}