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. RecordName assigned UpdateDnsResourceRecordParameters.ResourceRecord.Name.

  6. RecordClass assigned UpdateDnsResourceRecordParameters.ResourceRecord.RecordClass.

  7. RecordTTL assigned UpdateDnsResourceRecordParameters.ResourceRecord.TTL.

  8. RecordTimestamp assigned UpdateDnsResourceRecordParameters.ResourceRecord.TimeStamp.

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

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

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

  12. If 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 equal to PTR and IPAddress equal to  UpdateDnsResourceRecordParameters.ResourceRecord.Address, set IPv4AddressId assigned to the IPv4AddressId of the PTR record. If no such record exists in the table, set IPv4AddressId to NULL. Set IPAddress assigned to UpdateDnsResourceRecordParameters.ResourceRecord.Address.

  13. If 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 equal to PTR and IPAddress equal to UpdateDnsResourceRecordParameters.ResourceRecord.Address. Set IPv6AddressId assigned to the IPv6AddressId of the PTR record. If no such record exists in the table, set IPv6AddressId assigned to NULL. Set IPAddress assigned to UpdateDnsResourceRecordParameters.ResourceRecord.Address.

  14. Insert oldRecord back into the ADM_DnsResourceRecordTable.

  15. Call SetOverallStatus with Success and 100 percent completion.