3.19.4.4.1.37 UpdateIpamIPAddressDelegate
The UpdateIpamIPAddressDelegate processing is done when the IpamOperationWithProgressParameter.OperationId is AdminOperationId.UpdateIpamIpAddress. The IpamOperationWithProgressParameter instance in this case MUST be of type UpdateIpamIpAddressParameters.
This operation is used to update the properties of an IP address. In the following steps, any time a fault is generated, the SetOverallStatus SHOULD be called with the fault details:
If IpamOperationWithProgressParameter is NULL or not of type UpdateIpamIpAddressParameters, generate an appropriate SOAP fault (as specified in section 2.2.2.1). Project IpamOperationWithProgressParameter in a local variable as UpdateIpamIpAddressParameters.
The updateIpAddress is assigned UpdateIpamIpAddressParameters.Address.
The currentIpAddress is assigned UpdateIpamIpAddressParameters.OldAddress.
If updateIpAddress or currentIpAddress is NULL, an appropriate SOAP fault (as specified in section 2.2.2.1) MUST be returned.
Validate the updateIpAddress using the processing rules listed under ValidateIpamIPAddress, passing updateIpAddress as Param_address. If any of the processing rules are not met, an appropriate SOAP fault (as specified in section 2.2.2.1) MUST be returned.
Identify the list of modified properties in the updateIpAddress by finding the number of properties modified in updateIpAddress.ModifiedProperties. If there are none, no further processing is required, and success is returned.
The addressfamily is assigned InterNetwork if the updateIpAddress is IpamIPv4Address and assigned InterNetworkV6 if the updateIpAddress is IpamIPv6Address. If the addressFamily is InterNetwork, the rest of the processing is done with the IPv4-specific tables. Otherwise IPv6-specific tables are used for further processing.
Fetch the existing IpamIPAddress data by invoking the GetIPAddressFromTable procedure of ADM_IPAddressTable by passing the currentIpAddress.RecordId as the Param_id parameter and addressfamily as Param_addressfamily.
Compare the values of the properties listed in updateIpAddress.ModifiedProperties to their corresponding values in currentIpAddress. Only those values that have changed will be used to update the values in the data store.
Identify whether any of the following properties are part of updateIPAddress.ModifiedProperties and whether there is a difference in value between the one present in currentIPAddress and updateIPaddress:
IPAddress.
ManagedByValue: This is a computed field of the updateIpAddress. This is the value of the custom field whose record identifier is ADM_ManagedByCustomFieldId retrieved from updateIpAddress.CustomFieldValues.
ManagedByEntityValue: This is a computed field of the updateIpAddress. This is the value of the custom field whose record identifier is ManagedByEntityCustomFieldId, retrieved from updateIpAddress.CustomFieldValues.
If any of the above fields have changed and are different from the values in currentIpAddress, the following additional processing has to be done:
Validate if adding updateIpAddress can lead to any invalid duplicate addresses in the IPAM data store as follows:
Enumerate all rows in ADM_IPAddressTable where IPAddress value is the same as updateIpAddress.IPAddress.
For each row:
Calculate the ManagedBy value to be the custom field value whose custom field identifier is the same value as ADM_ManagedByCustomFieldId.
Calculate the ManagedByEntity value to be the custom field value whose custom field identifier is the same as the ADM_ManagedByEntityCustomFieldId.
If the ManagedBy and ManagedByEntity values of the row are the same as updateIpAddress.ManagedByValue and updateIpAddress.ManagedByEntityValue, respectively, then an appropriate SOAP fault (as specified in section 2.2.2.1) MUST be returned.
The IsDuplicate field of the existing IP address needs to be reset for currentIPAddress. Enumerate all rows in IP address table, where the value of IPAddress is the same as currentIPAddress.IPAddress, and the RecordId is not the same as currentIPAddress.RecordId, to find the duplicate addresses of the address that got modified. If the number of rows found is 1, there is only one duplicate address, and its duplicate status SHOULD be reset. Update the IsDuplicate field of the only IpamIPAddress found thus as 0.
The IsDuplicate field is recalculated for the addresses based on the new address updateIpAddress. Enumerate all rows in the table whose IPAddress value is the same as updateIpAddress.IPAddress. If one or more rows are enumerated, update the IsDuplicate field of all these rows as 1. Also update the IsDuplicate value of updateIpAddress to 1.
Update the modified fields of the address in the IP address table by looking up the row with the RecordId being updateIpAddress.RecordId.
If UpdateIpamIpAddressParameters.CreateDhcpReservation is TRUE and updateIpAddress.DhcpScopeId is specified:
Call the procedure AddOrUpdateReservation in ADM_DHCPReservationTable with the following parameters:
Param_addressfamily is assigned to addressfamily.
If updateIPAddress.ReservationId is specified, set Param_reservationId to the value.
Param_scopeId is assigned updateIPAddress.DhcpScopeId.
Param_addressId is assigned updateIPAddress.RecordId.
Copy ReservationDetails from updateIPAddress to Param_reservationDetails.
If the reservation detail is being added newly, assign Result_reservationId to updateIPAddress.ReservationId and store it in ADM_IPAddressTable.
If UpdateIpamIpAddressParameters.CreateDNSRecord is TRUE, call the procedure AddOrUpdateAddressDNSForwardLookupTable in ADM_AddressDNSForwardLookupTable with the following parameters:
Param_addressfamily is assigned addressfamily.
Param_addressId is assigned updateIPAddress.RecordId.
Param_dnsZoneId is assigned the value of updateIPAddress.DnsZoneId.
Param_serverDnsZoneId is assigned the value of updateIPAddress.DnsForwardLookupZoneDnsServerId.
If updateIPAddress.DnsForwardLookupZoneRecordId is specified assign it to Param_recordId.
On return, assign Result_recordId to updateIPAddress.DnsForwardLookupZoneRecordId.
If UpdateIpamIpAddressParameters.CreateDNSRecord is TRUE, call the procedure AddOrUpdateAddressDNSReverseLookup in ADM_AddressDNSReverseLookupTable with the following parameters:
Param_addressfamily is assigned addressfamily.
Param_addressId is assigned updateIPAddress.RecordId.
Param_dnsZoneId is assigned the value of updateIPAddress.DnsReverseLookupZoneId.
Param_serverDnsZoneId is assigned the value of updateIPAddress.DnsReverseLookupZoneDnsServerId.
If updateIPAddress.DnsReverseLookupZoneRecordId is specified assign it to Param_recordId.
On return, assign Result_recordId to updateIPAddress.DnsReverseLookupZoneRecordId.
Validate the updateIpAddress.CustomFieldValues by performing the processing rules listed under the ValidateCustomFieldValues section. If the custom field values are valid, call the SetCustomFieldValues procedure in ADM_CustomFieldValuesAssociationTable with the following parameters:
Param_ObjectRecordId is assigned the value of updateIpAddress.RecordId.
Param_ObjectType is assigned EnumerationObjectType.IPAddress.
Param_addressFamily is assigned the value of addressfamily.
Param_CustomFieldValuesCollection is assigned the value of updateIpAddress.CustomFieldValues.
If the ADM_CommonProperties.ExpiryAlertThreshold is not 0, and if updateIPAddress.ExpiryDate is modified, then set updateIPAddress.InWarningPeriod to TRUE if the following conditions are satisfied. Otherwise, InWarningPeriod is assigned FALSE.
Current date and time is less than updateIPAddress.ExpiryDate.
Current date and time + ADM_CommonProperties.ExpiryAlertThreshold is greater than updateIPAddress.ExpiryDate.
If current date and time is greater than updateIPAddress.ExpiryDate, set updateIPAddress.IsExpired to TRUE. Otherwise, updateIPAddress.IsExpired is assigned FALSE.
Call SetOverallStatus with Success and 100 percent completion.