3.5.4.8.1.43 IpamIPAddressByManagedByAndManagedByEntityEnumerationParameters
The IpamIPAddressByManagedByAndManagedByEntityEnumerationParameters processing is done when the EnumInputParameters contains data of type IpamIPAddressByManagedByAndManagedByEntityEnumerationParameters. The ObjectType MUST be EnumerationObjectType.IPAddress. This is used to enumerate addresses mapped to the specified address block given by IpamIPAddressByBlockIdEnumerationParameters.BlockId. The IpamIPAddressByBlockIdEnumerationParameters.AddressFamily is used to determine the simple table within the ADM_IPAddressTable on which the processing has to be done. If AddressFamily is InterNetwork, the EnumOutputData will be a collection of IpamIPv4Address and if it is InterNetworkV6, the EnumOutputData will be a collection of IpamIPv6Address.
The following are the steps involved in identifying the rows to be returned as a part of the enumeration:
Enumerate the row in ADM_CustomFieldValues where CustomFieldValueDetails.Value is equal to IpamIPAddressByManagedByAndManagedByEntityEnumerationParameters.ManagedByValue. Store the RecordId of the row in requiredManagedByCustomFieldValueId.
Enumerate the row in ADM_CustomFieldValues where CustomFieldValueDetails.Value is equal to IpamIPAddressByManagedByAndManagedByEntityEnumerationParameters.ManagedByEntityValue. Store the RecordId of the row in requiredManagedByEntityCustomFieldValueId.
Enumerate the rows in ADM_CustomFieldValuesAssociationTable that meet the following criteria:
ObjectType is EnumerationObjectType.IPAddress.
Af is IpamIPAddressByManagedByAndManagedByEntityEnumerationParameters.AddressFamily.
CustomFieldId is equal to ADM_ManagedByCustomFieldId.
CustomFieldValueId is equal to requiredManagedByCustomFieldValueId.
The rows enumerated in step 3 will provide the list of IP addresses that have the specified value for the ManagedBy custom field. For each of these rows, perform the following steps to filter out the rows that have the specified custom field value as well.
Enumerate the rows in ADM_CustomFieldValuesAssociationTable that meet the following criteria:
Param_ObjectType is EnumerationObjectType.IPAddress.
Af is IpamIPAddressByManagedByAndManagedByEntityEnumerationParameters.AddressFamily.
CustomFieldId is equal to ADM_ManagedByEntityCustomFieldId.
CustomFieldValueId is equal to requiredManagedByEntityCustomFieldValueId.
UsedById is equal to row.RecordId.
If there is a row that meets the previously mentioned criteria, the address with RecordId equal to row.RecordId meets the required condition. Call the procedure GetIPAddressFromTable by passing the following parameters:
row.RecordId as Param_Id.
IpamIPAddressByManagedByAndManagedByEntityEnumerationParameters.AddressFamily as Param_addressfamily.
Add result to EnumOutputData.