3.19.4.4.1.39 UpdateDnsResourceRecordDelegate

The UpdateDnsResourceRecordDelegate processing is done when the IpamOperationWithProgressParameter.OperationId is AdminOperationId.UpdateDnsResourceRecord. The IpamOperationWithProgressParameter instance in this case MUST be of type UpdateDnsResourceRecordParameters.

This operation is used to update a DNS resource record. In the following steps, at any time a fault is generated, SetOverallStatus (section 3.19.4.8) SHOULD be called with the fault details:

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

  2. If UpdateDnsResourceRecordParameters is NULL, UpdateDnsResourceRecordParameters.ResourceRecord is NULL, UpdateDnsResourceRecordParameters.ServerZoneId is 0, or UpdateDnsResourceRecordParameters.ZoneType equals ZoneLookupType.None, generate an appropriate SOAP fault.

  3. Validate the UpdateDnsResourceRecordParameters.ResourceRecord using the processing rules listed in ValidateDnsResourceRecord (as specified in section 3.1.4.24) by passing UpdateDnsResourceRecordParameters.ResourceRecord as Param_dnsResourceRecord. If any of the processing rules are not met, an appropriate SOAP fault MUST be returned.

  4. Call the procedure GetDnsResourceRecordByRecordId of ADM_ DNSResourceRecordTable table with UpdateDnsResourceRecordParameters.ResourceRecord.recordId as the parameter and store the output in oldRecord variable. If oldRecord is NULL, generate an appropriate SOAP fault. Otherwise, replace the following fields of oldRecord:

  5. Set RecordName to UpdateDnsResourceRecordParameters.ResourceRecord.Name.

  6. Set RecordClass to UpdateDnsResourceRecordParameters.ResourceRecord.RecordClass.

  7. Set RecordTTL as UpdateDnsResourceRecordParameters.ResourceRecord.TTL.

  8. Set RecordTimestamp as UpdateDnsResourceRecordParameters.ResourceRecord.TimeStamp.

  9. If the RecordType is not equal to A, AAAA, or PTR, set RecordData to UpdateDnsResourceRecordParameters.ResourceRecords.RecordData

  10. If the RecordType is NS, set RecordHostName as RecordData.NameServer.
    If the RecordType is CNAME, set RecordHostName as RecordData.HostName.
    If RecordType is MX, set RecordHostName as RecordData.MailServer.
    If RecordType is SRV, set RecordHostName as RecordData.ServerName.
    If RecordType is AFSDB, set RecordHostName as RecordData.ServerName.
    If resourceType is RP, set RecordHostName as RecordData.ResponsiblePerson.
    If RecordType is RT, set RecordHostName as RecordData.IntermediateHost.

  11. If the RecordType is not equal to A, AAAA or PTR, set RecordFQDN as RecordHostName + "." + CreateDnsResourceRecordsParameters.ResourceRecords.ZoneName.

  12. If the RecordType is equal to A and Address field of the resource record has changed, iterate through rows in ADM_DNSResourceRecordTable and find a record with RecordType as PTR and IPAddress as UpdateDnsResourceRecordParameters.ResourceRecord.Address, set IPv4AddressId to the IPv4AddressId of the PTR record. If no such record exists in the table, set IPv4AddressId to NULL. Set IPAddress as UpdateDnsResourceRecordParameters.ResourceRecord.Address.

  13. If the RecordType is equal to AAAA and the Address field of the resource record has changed, iterate through rows in ADM_DNSResourceRecordTable and find a record with RecordType as PTR and IPAddress as UpdateDnsResourceRecordParameters.ResourceRecord.Address. Set IPv6AddressId to the IPv6AddressId of the PTR record. If no such record exists in the table, set IPv6AddressId to NULL. Set IPAddress as UpdateDnsResourceRecordParameters.ResourceRecord.Address.

  14. Insert oldRecord back into the ADM_DnsResourceRecordTable.

  15. Call SetOverallStatus with Success and 100 percent completion.