3.3.4.153 UpdateSubnet

The UpdateSubnet operation is used to edit the settings of an existing address subnet in the IPAM data store.

 <wsdl:operation name="UpdateSubnet">
   <wsdl:input wsaw:Action="http://Microsoft.Windows.Ipam/IIpamServer/UpdateSubnet" message="ipam:IIpamServer_UpdateSubnet_InputMessage" />
   <wsdl:output wsaw:Action="http://Microsoft.Windows.Ipam/IIpamServer/UpdateSubnetResponse" message="ipam:IIpamServer_UpdateSubnet_OutputMessage" />
 </wsdl:operation>

Upon receiving the IIpamServer_UpdateSubnet_InputMessage request message, the server performs the following processing steps. Upon successful completion of these steps, the server MUST respond with the IIpamServer_UpdateSubnet_OutputMessage message. In the event of a failure, an appropriate SOAP fault MUST be sent to the client as specified in section 2.2.2.1:

  1. Validate the UpdateSubnet.subnet.RecordId is a valid entry by invoking the GetSubnetById procedure of ADM_SubnetTable by passing the UpdateSubnet.subnet.RecordId as the Param_SubnetId.

  2. If the Result_Subnet is NULL, the subnet specified is not present and is not processed further. Otherwise store result as the OldSubnetData variable.

  3. Assign UpdateSubnet.subnet to a temporary data store updatedSubnet.

  4. If updatedSubnet.ModifiedProperties is empty, there are no updates to be performed and the block is not processed further.

  5. Validate the updatedSubnet by invoking the ValidateSubnet passing the updatedSubnet as Param_IPSubnet.

  6. If all the validation requirements are not met, an appropriate SOAP fault MUST be generated.

  7. If any of the following fields are modified, the block hierarchy can potentially change. Set a temporary store, keyPropertiesChanged to TRUE:

  8. NetworkId

  9. PrefixLength

  10. StartIPAddress

  11. If OldSubnetData.addressSpaceId is not same as updatedSubnet.AddressSpaceId, set a temporary data store, addressSpaceChanged, to TRUE.

  12. If either keyPropertiesChanged or addressSpaceChanged is TRUE, do the following:

  13. If key properties of the subnet have changed and oldSubnet had child ranges mapping to it, an appropriate SOAP fault MUST be sent. Use the following tasks to achieve this:

  14. Get the child ranges for oldSubnet by calling the procedure GetChildRangesForBlock of ADM_IPRangeTable with OldSubnetData.RecordId assigned to Param_blockId. Determine the AddressFamily of the OldSubnetData based on OldSubnetData.StartIPAddress. If it is InterNetwork, assign InterNetwork to Param_addressFamily. If it is InterNetworkV6, assign InterNetworkV6 to Param_addressFamily.

  15. If Result_Ranges is not empty and keyPropertiesChanged is TRUE, raise a fault since there are dependent child ranges, and the networkId/prefix cannot be changed.

  16. If either keyPropertiesChanged or addressSpaceChanged is TRUE, check if a duplicate subnet already exists. A SOAP fault MUST be raised if a duplicate subnet is found:

  17. Call the procedure GetAllSubnetsForAddressCategory of ADM_SubnetTable with the following parameters for the call:

  18. Assign updatedSubnet.AddressCategory to Param_AddressCategory.

  19. Assign the Result_Subnets to a temporary data store possibleDuplicateSubnets.

  20. For each of the currentSubnet subnets in possibleDuplicateSubnets, if currentSubnet.startIPAddress is equal to updatedSubnet.startIPAddress and currentSubnet.EndIPAddress is equal to updatedSubnet.EndIPAddress and currentSubnet.AddressSpaceId is equal to updatedSubnet.AddressSpaceId, raise a fault since the subnet already exists in the IPAM data store.

  21. If either of keyPropertiesChanged and addressSpaceChanged is TRUE, calculate the isOverlapping and UseForUtilization for updatedSubnet. For this, get all the subnets overlapping with updatedSubnet by calling the procedure GetOverlappingSubnets for ADM_SubnetTable with the following parameters:

  22. Assign updatedSubnet.startIPAddress to Param_StartIPAddress.

  23. Assign updatedSubnet.EndIPAddress to Param_EndIPAddress.

  24. Assign updatedSubnet.PrefixLength to Param_ PrefixLength.

  25. Assign updatedSubnet.AddressSpaceId to Param_AddressSpaceId.

  26. Assign updatedSubnet.RecordId to Param_RecordIdToExclude.

  27. For each of the subnets in Result_OverlappingBlocks, check if UseForUtilization property is set. If none of these subnets have the useForUtilization set to TRUE or if the Result_OverlappingBlocks is empty, set UseForUtilization property for updatedSubnet to TRUE.

  28. If Result_OverlappingBlocks is empty, set the isOverlapping property to FALSE. Otherwise, set the isOverlapping property of updatedSubnet to TRUE.

  29. Update the isOverlapping property for all the rows in set Result_OverlappingBlocks in ADM_IPBlock.

  30. If address space has changed and the subnet now maps to default address space, then set the parent block for the updatedSubnet. Only subnets that belong to the default address space map to a block. Call CalculateParentForIPBlock for ADM_IPBlocksTable with the following parameters:

  31. Assign updatedSubnet.startIPAddress to Param_StartIPAddress.

  32. Assign updatedSubnet.EndIPAddress to Param_EndIPAddress.

  33. Assign updatedSubnet.PrefixLength to Param_ PrefixLength.

  34. Assign updatedSubnet.RecordId to Param_RecordIdToExclude.

  35. Assign updatedSubnet.AddressCategory to Param_AddressCategory.

  36. Set the ParentIPBlockRecordID of updatedSubnet to RecordId returned in the previous result.

  37. Update the properties inherited from ADM_IPBlock table using the properties set in updatedSubnet.

  38. Update the subnet properties from updatedSubnet into ADM_Subnet.

  39. If addressSpaceChanged is TRUE and Result_Ranges in step 8(b) is not empty, the address space change needs to be reflected to the child ranges that can still map to the modified subnet as well. Perform the following:

  40. For each row in ADM_IPRangeTable that corresponds to each element in Result_Ranges from step 10(2):

  41. Set the AddressSpaceId of the row in ADM_IPRangeTable to addressSpaceId of updatedSubnet.

  42. Set the VirtualizationType of the row in ADM_IPRangeTable to VirtualizationType of updatedSubnet.

  43. Get all the child addresses that mapped to the oldSubnet by following these steps:

  44. Initialize a collection of IPAddresses as Result_Addresses.

  45. Call the GetAllMappingIPAddressesForRange procedure of ADM_ IPAddressTable for each entry range in Result_Ranges from step 10(2.) assigning range.RecordId to Param_Id and range.AddressFamily to Param_addressfamily. Add the contents of collection of output Result_mappingAddresses to Result_Addresses.

  46. For each row in ADM_IPAddressTable that corresponds to each element in Result_Addresses:

  47. Set the AddressSpaceId of the row in ADM_IPAddressTable to addressSpaceId of UpdateSubnet.subnet.

  48. Set the VirtualizationType of the row in ADM_IPAddressTable to VirtualizationType of UpdateSubnet.subnet.

  49. If the CustomFieldValues is also part of the ModifiedProperties of the IPBlock, call the procedure SetCustomFieldValues in ADM_CustomFieldValuesAssociationTable by passing the following parameters:

  50. Param_ObjectType is set to EnumerationObjectType.IPBlock.

  51. Param_addressFamily is set to InterNetwork if the updatedSubnet is IPv4Subnet. It is set to InterNetworkV6 if the updatedSubnet is IPv6Subnet.

  52. Param_ObjectRecordId is assigned the value of updatedSubnet.RecordId.

  53. Param_CustomFieldValuesCollection is assigned the value of updatedSubnet.CustomFieldValues.

  54. Update the isOverlapping and UseForUtilization properties of all the subnets that conflicted with this subnet before the modification. To do this, get all overlapping subnets for the oldSubnet. For each overlapping subnet, recompute the isOverlapping and UseForUtilization properties:

  55. Call the procedure GetOverlappingSubnets for ADM_SubnetTable with the following parameters:

  56. Assign OldSubnet.startIPAddress to Param_StartIPAddress.

  57. Assign OldSubnet.EndIPAddress to Param_EndIPAddress.

  58. Assign OldSubnet.PrefixLength to Param_PrefixLength.

  59. Assign OldSubnet.AddressSpaceId to Param_AddressSpaceId.

  60. Assign OldSubnet.RecordId to Param_RecordIdToExclude.

  61. For each of the subnets currentOverlappingSubnet in Result_OverlappingBlocks, get all overlapping subnets by calling GetOverlappingSubnets for ADM_SubnetTable with these parameters:

  62. Assign currentOverlappingSubnet.startIPAddress to Param_StartIPAddress.

  63. Assign currentOverlappingSubnet.EndIPAddress to Param_EndIPAddress.

  64. Assign currentOverlappingSubnet.PrefixLength to Param_PrefixLength.

  65. Assign currentOverlappingSubnet.AddressSpaceId to Param_AddressSpaceId.

  66. Assign currentOverlappingSubnet.RecordId to Param_RecordIdToExclude.

  67. For each of the subnets in Result_OverlappingBlocks for currentOverlappingSubnet, check if UseForUtilization property is set. If none of these subnets have the useForUtilization set to TRUE or if the Result_OverlappingBlocks is empty, set UseForUtilization property for currentOverlappingSubnet to TRUE.

  68. If Result_OverlappingBlocks is empty, set isOverlapping property to FALSE. Otherwise, set the isOverlapping property of currentOverlappingSubnet to TRUE.

  69. If the block hierarchy can change as computed in step 6. Call the CreateAssociationEntry procedure of ADM_AccessScopeAssociationTable with the following parameters to adjust the access scope associations:

  70. Param_ObjectType is set to EnumerationObjectType.IPSubnet.

  71. Param_ObjectId is assigned the value of updatedSubnet.RecordId.