3.19.4.4.1.42 CreateDnsZoneDelegate

The CreateDnsZoneDelegate processing is done when the IpamOperationWithProgressParameter.OperationId is AdminOperationId.CreateDnsZone. The IpamOperationWithProgressParameter instance in this case MUST be of type CreateDnsZoneParameters.

This operation is used to create a DNS zone. The following are the steps involved. In these steps, at any time a fault is generated, the SetOverallStatus SHOULD be called with the fault details: 

  1. If IpamOperationWithProgressParameter is NULL or not of type CreateDnsZoneParameters, generate an appropriate SOAP fault (as specified in section 2.2.2.1). Project IpamOperationWithProgressParameter in a local variable as CreateDnsZoneParameters

  2. If CreateDnsZoneParameters is NULL or CreateDnsZoneParameters.ServerZone is NULL or CreateDnsZoneParameters.ServerId is 0, generate an appropriate SOAP fault. 

  3. Validate the CreateDnsZoneParameters.ServerZone using the processing rules listed under ValidateBaseDnsServerZone by passing CreateDnsZoneParameters.ServerZone as Param_baseDnsServerZone. If any of the processing rules are not met, an appropriate SOAP fault (as specified in section 2.2.2.1) MUST be returned. 

  4. If the CreateDnsZoneParameters.ZoneType is equal to DNSForwardLookupZone, retrieve the row in ADM_DNSForwardLookupTable which has Name as CreateDnsZoneParameters.ServerZone.Zone.Name and assign output to a local variable Zone and perform the following steps: 

  5. If Zone is not NULL, keep the RecordId of the Zone in the local variable ZoneRecordId. Else if Zone is NULL, insert a new row into ADM_DNSForwardLookupTable with all the field values populated from the corresponding fields of CreateDnsZoneParameters.ServerZone.Zone. Keep the returned RecordId of the new zone in the local variable ZoneRecordId.

  6. Insert a new row into ADM_DNSServerForwardLookupZoneTable with all the field values populated from the corresponding fields of CreateDnsZoneParameters.ServerZone, along with DnsZoneId assigned to ZoneRecordId and DnsServerId assigned to CreateDnsZoneParameters.ServerId.

  7. If the CreateDnsZoneParameters.ZoneType is equal to DNSReverseLookupZone, retrieve the row in ADM_DNSReverseLookupTable which has Name is equal to CreateDnsZoneParameters.ServerZone.Zone.Name and assign output to a local variable Zone and perform the following steps: 

  8. If Zone is not NULL, keep the RecordId of the Zone in the local variable ZoneRecordId. Else if Zone is NULL, insert a new row into ADM_DNSReverseLookupTable with all the field values populated from the corresponding fields of CreateDnsZoneParameters.ServerZone.Zone. Keep the returned RecordId of the new zone in the local variable ZoneRecordId.

  9. Insert a new row into ADM_DNSServerReverseLookupZoneTable with all the field values populated from the corresponding fields of CreateDnsZoneParameters.ServerZone, along with DnsReverseZoneId assigned to ZoneRecordId and DnsServerId assigned to CreateDnsZoneParameters.ServerId.

  10. If Zone is NULL, iterate through the ADM_IPRange table and retrieve the IP ranges whose StartIPAddress and EndIPAddress lie within the boundary of Zone's StartIP and EndIP and store the output in temp_MappedRangesIds variable. 

  11. For each range in temp_MappedRangesIds, call the GetOverlappingRanges procedure procedure in ADM_IPRangeTable with range.Param_StartIPAddress and range.Param_EndIPAddress as input to identify other overlapping ranges with this range. In case there are any such overlapping ranges found, remove both this range and the corresponding overlapping ranges from the set of temp_MappedRangesIds.

  12. Iterate through the remaining list of ranges in temp_MappedRangesIds and exclude the ranges from the list whose RecordId is present in RangeRecordId field of any row in ADM_RangeDNSReverseLookupTable.

  13. For each of the remaining ranges in temp_MappedRangesIds, add a new row in ADM_RangeDNSReverseLookupTable table with RangeRecordId as the element in temp_MappedRangeIds and DNSZoneRecordId as ZoneRecordId.

  14. Call SetOverallStatus with Success and 100 percent completion.