Assign or Update Template - BlueCat Address Manager - 9.0.0

Address Manager API Guide

English (United States)
Product name
BlueCat Address Manager

Assigns, updates, or removes DNS zone and IPv4 network templates.

Output / Response


API Call:

void assignOrUpdateTemplate( long entityId, long templateId, String properties )
Parameter Description
entityId The object ID of the IPv4 network to which the network template is to be assigned or updated, or the object ID of the zone to which the zone template is to be assigned or updated.
templateId The object ID of the DNS zone template or IPv4 network template. To remove a template, set this value to 0 (zero).
properties A string containing the following settings:
  • ObjectProperties.templateType—Specifies the type of template on which this operation is being performed.

    The possible values are ObjectProperties.IP4NetworkTemplateType (Assigning or updating IP4NetworkTemplate on an IP4Network) and ObjectProperties.zoneTemplateType (Assigning or updating zoneTemplate on a DNS zone). This is mandatory.

Along with ObjectProperties.templateType, user can also specify the reapply mode for various properties of the template.
  • For Network template, the following additional parameters can also be specified:
    • ObjectProperties.gatewayReapplyMode
    • ObjectProperties.reservedAddressesReapplyMode
    • ObjectProperties.dhcpRangesReapplyMode
    • ObjectProperties.ipGroupsReapplyMode
    • ObjectProperties.optionsReapplyMode
  • For Zone Template, the following additional parameter can also be specified:
    • ObjectProperties.zoneTemplateReapplyMode
    The possible values for re-apply mode properties are:
    • ObjectProperties.templateReapplyModeUpdate
    • ObjectProperties.templateReapplyModeIgnore
    • ObjectProperties.templateReapplyModeOverwrite
    If the re-apply mode is not specified in the properties, the default ObjectProperties.templateReapplyModeIgnoremode is used.
Note: If you are not using Java or Perl, refer to Object Properties for the actual values.

Java client example:

EntityProperties ntProp = new EntityProperties();
ntProp.addProperty( ObjectProperties.templateType, 
ObjectProperties.IP4NetworkTemplateType );
ntProp.addProperty( ObjectProperties.gatewayReapplyMode, 
ObjectProperties.templateReapplyModeUpdate );
ntProp.addProperty( ObjectProperties.reservedAddressesReapplyMode, 
ObjectProperties.templateReapplyModeUpdate );
service.assignOrUpdateTemplate( ip4N20_26Id, networkTemplateId, 
ntProp.getPropertiesString() );

Perl client example:

SOAP::Data->type( 'string' )->name( 'properties' )->
value( ObjectProperties::templateType."=".ObjectProperties:: 
ObjectProperties:: gatewayReapplyMode."=".ObjectProperties:: 
templateReapplyModeUpdate."|" )
->attr({xmlns => ''}) )->result;