Class IpamService
- java.lang.Object
-
- com.neotropic.kuwaiba.modules.commercial.ipam.IpamService
-
@Service public class IpamService extends Object
The logic behind the IPAM module.- Author:
- Charles Edward Bedon Cortazar <charles.bedon@kuwaiba.org>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
IpamService.IPAddressComparator
Custom comparator to sort lists of IP addressesclass
IpamService.SubnetComparator
Custom subnet comparator to sort subnets lists
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_MASK
default mask for individual IP addresses created in folders
-
Constructor Summary
Constructors Constructor Description IpamService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
addIPAddressToFolder(String parentFolderId, HashMap<String,String> attributes)
creates an IP address that has no subnet parent as direct child of a folderString
addIPAddressToSubnet(String parentSubnetId, String parentSubnetClassName, HashMap<String,String> attributes)
creates an IP address inside a subnetString
createFolder(String parentId, String subnetPoolName, String subnetPoolDescription, String className)
Creates a pool(folder) of subnets if the parentId is -1 the pool will be created in the default root for pools of subnetsString
createSubnet(String parentId, String className, HashMap<String,String> attributes)
create a subnetList<String>
createSubnets(String parentId, String className, List<HashMap<String,String>> subnetsAttributes)
Creates several subnets in a subnetvoid
deleteIpAddress(List<String> ipAddressesIds, boolean releaseRelationships)
Removes an IP address from a subnet or foldervoid
deleteSubnetPools(String[] subnetPoolsId)
deletes a subnet Poolvoid
deleteSubnets(String className, List<String> subnetIds, boolean releaseRelationships)
Deletes a subnetList<BusinessObjectLight>
existInInventory(List<String> addresses, String className)
Checks if a a list of subnet or IP addresses names exist in the whole inventory it will return a list of all the existing subnet foundInventoryObjectPool
getFolder(String oid)
Retrieves a subnet pool by its idlong
getFolderInFolderCount(String parentId, String className)
Returns the count of subnets folders Retrieves a pool of subnets pools from a pool of subnets or from the rootList<BusinessObjectLight>
getFolderItems(String subnetPoolId, String classNameToFilter, int page, int limit)
Get a set of subnets from a pool folderlong
getFolderItemsCount(String subnetPoolId, String className)
Retrieve the count of subnets from a pool of subnetsList<InventoryObjectPool>
getFoldersInFolder(String parentId, String className, int page, int limit)
Returns the folders Retrieves a pool of subnets pools from a pool of subnets or from the rootInventoryObjectPool
getIpv4Root()
InventoryObjectPool
getIpv6Root()
BusinessObject
getSubnet(String className, String oid)
Retrieves a subnet by its className and idList<BusinessObjectLight>
getSubnetCreatedIPAddresses(String id, String className, int page, int limit)
Retrieves all the IP address created in a subnetList<BusinessObjectLight>
getSubnetIpAddrsInUse(String subnetId, String subnetClassName)
Gets the number of IP addresses instantiated (created) in the subnet that has a relationship with an inventory object e.g.List<BusinessObjectLight>
getSubnetIpAddrsReserved(String subnetId, String subnetClassName)
List<BusinessObjectLight>
getSubnetsInSubnet(String id, String className, int page, int limit)
Retrieves all the Subnets created inside a subnetlong
getSubnetsInSubnetCount(String id, String className)
Retrieves all the Subnets created inside a subnetvoid
ipv4getOverlapedSubnets(String cidr, String newNetworkIpAddress, String newBroadcastIpAddress)
Checks if the new subnet exists or overlaps with in other created subnetsvoid
relateIPAddressToPort(String subnetId, String portClassName, String portId)
Relates an IP address with a generic communication portvoid
relatePortToInterface(String portId, String portClassName, String interfaceClassName, String interfaceId)
Relates an interface with a GenericCommunicationPortvoid
relateSubnetToVLAN(String subnetId, String className, String vlanId)
Relate a Subnet with a VLAN, this method also allow to relate VLANs to BDIs, VFRIs.void
relateSubnetToVRF(String subnetId, String className, String vrfId)
Relate a Subnet with a VRFvoid
releasePortFromInterface(String interfaceClassName, String interfaceId, String portId)
Release the relationship between a GenericCommunicationPort and an interfacevoid
releasePortFromIP(String portClass, String portId, String id)
Release the relationship between a GenericPort and an IP Address.void
releaseSubnetFromVLAN(String subnetId, String vlanId)
Release a relationship between a subnet and a VLAN, this method also allow to relate VLANs to BDIs, VFRIs.void
releaseSubnetFromVRF(String subnetId, String vrfId)
Release a relationship between a subnet and a VRFvoid
updateIpAdress(String id, HashMap<String,String> attributes)
Updates some attributes of the ip address, description, state are the only editable attributes of an ip address
-
-
-
Field Detail
-
DEFAULT_MASK
public static final String DEFAULT_MASK
default mask for individual IP addresses created in folders- See Also:
- Constant Field Values
-
-
Method Detail
-
getIpv4Root
public InventoryObjectPool getIpv4Root()
-
getIpv6Root
public InventoryObjectPool getIpv6Root()
-
createFolder
public String createFolder(String parentId, String subnetPoolName, String subnetPoolDescription, String className) throws InvalidArgumentException, MetadataObjectNotFoundException, NotAuthorizedException, ApplicationObjectNotFoundException
Creates a pool(folder) of subnets if the parentId is -1 the pool will be created in the default root for pools of subnets- Parameters:
parentId
- the given parent id if the id is -1 it means the parent could be one of the default root nodes.subnetPoolName
- subnet pool namesubnetPoolDescription
- subnet pool descriptionclassName
- if is a IPv4 subnet or if is a IPv6 subnet- Returns:
- the id of the created new subnet pool
- Throws:
InvalidArgumentException
- if something goes wrong and can't reach the backendMetadataObjectNotFoundException
- If the class IPv4 o IPv6 doesn't existsNotAuthorizedException
- If the user is not authorized to create pool nodesApplicationObjectNotFoundException
- if the IPAM root nodes doesn't exists
-
getSubnet
public BusinessObject getSubnet(String className, String oid) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException, NotAuthorizedException
Retrieves a subnet by its className and id- Parameters:
className
- if the subnet is IPv4 or IPv6oid
- the subnet id- Returns:
- a business object that represents the subnet, note: the name of the subnet is in CIDR format networkAddress/mask bits
- Throws:
MetadataObjectNotFoundException
- If the class IPv4 o IPv6 can't be findBusinessObjectNotFoundException
- if the requested object(subnet) can't be foundInvalidArgumentException
- if the requested object(subnet) can't be foundNotAuthorizedException
- If the user is not authorized to get subnets
-
getFolder
public InventoryObjectPool getFolder(String oid) throws NotAuthorizedException, InvalidArgumentException, ApplicationObjectNotFoundException
Retrieves a subnet pool by its id- Parameters:
oid
- the subnet id- Returns:
- a subnet pool
- Throws:
ApplicationObjectNotFoundException
- if the subnet pool can't be foundNotAuthorizedException
- If the user is not authorized to use the IPAM moduleInvalidArgumentException
- It the subnet pool does not have uuid
-
getFoldersInFolder
public List<InventoryObjectPool> getFoldersInFolder(String parentId, String className, int page, int limit) throws NotAuthorizedException, ApplicationObjectNotFoundException, InvalidArgumentException, MetadataObjectNotFoundException
Returns the folders Retrieves a pool of subnets pools from a pool of subnets or from the root- Parameters:
parentId
- parent idclassName
- if is a IPv4 subnet or if is a IPv6 subnet- Returns:
- a list of subnet pools
- Throws:
NotAuthorizedException
- If the user is not authorized to use the IPAM moduleApplicationObjectNotFoundException
- if can't get the pools of a subnet poolMetadataObjectNotFoundException
- if there are not IPAM root nodesInvalidArgumentException
- If the parent does not have uuid public ListgetFoldersInFolder(String parentId, String className, int page, int limit)
-
getFolderInFolderCount
public long getFolderInFolderCount(String parentId, String className) throws NotAuthorizedException, ApplicationObjectNotFoundException, InvalidArgumentException
Returns the count of subnets folders Retrieves a pool of subnets pools from a pool of subnets or from the root- Parameters:
parentId
- parent idclassName
- if is a IPv4 subnet or if is a IPv6 subnet- Returns:
- a list of subnet pools
- Throws:
NotAuthorizedException
- If the user is not authorized to use the IPAM moduleApplicationObjectNotFoundException
- if can't get the pools of a subnet poolMetadataObjectNotFoundException
- if there are not IPAM root nodesInvalidArgumentException
- If the parent does not have uuid
-
getFolderItems
public List<BusinessObjectLight> getFolderItems(String subnetPoolId, String classNameToFilter, int page, int limit) throws ApplicationObjectNotFoundException, NotAuthorizedException, InvalidArgumentException
Get a set of subnets from a pool folder- Parameters:
subnetPoolId
- subnet pool idclassNameToFilter
- the className of the wished folder objects, subents or ip addresspage
- the page or the number of elements to skip, to no pagination -1.limit
- the limit of elements by page, no limit -1- Returns:
- a list of subnets
- Throws:
ApplicationObjectNotFoundException
- if the given subnet pool id is not validNotAuthorizedException
- If the user is not authorized to use the IPAM moduleInvalidArgumentException
- If the subnet pool does not have uuid public ListgetFolderItems(String subnetPoolId, HashMap filters, int page, int limit)
-
getFolderItemsCount
public long getFolderItemsCount(String subnetPoolId, String className) throws ApplicationObjectNotFoundException, NotAuthorizedException, InvalidArgumentException
Retrieve the count of subnets from a pool of subnets- Parameters:
attributesToFilter
- attributes names and values to filtersubnetPoolId
- subnet pool id- Returns:
- a list of subnets
- Throws:
ApplicationObjectNotFoundException
- if the given subnet pool id is not validNotAuthorizedException
- If the user is not authorized to use the IPAM moduleInvalidArgumentException
- If the subnet pool does not have uuid
-
getSubnetsInSubnet
public List<BusinessObjectLight> getSubnetsInSubnet(String id, String className, int page, int limit) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, NotAuthorizedException, InvalidArgumentException
Retrieves all the Subnets created inside a subnet- Parameters:
id
- a given subnet idclassName
- If the subnet has IPv4 or an IPv6 addresses- Returns:
- A list of subnets for the given subnet id
- Throws:
MetadataObjectNotFoundException
- If can't find IPv4 or IPV6 classesBusinessObjectNotFoundException
- If the object(subnet) could not be found.NotAuthorizedException
- If the user is not authorized to use the IPAM moduleInvalidArgumentException
- If the subnet does not have uuid
-
getSubnetsInSubnetCount
public long getSubnetsInSubnetCount(String id, String className) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, NotAuthorizedException, InvalidArgumentException
Retrieves all the Subnets created inside a subnet- Parameters:
id
- a given subnet idclassName
- If the subnet has IPv4 or an IPv6 addresses- Returns:
- A list of subnets for the given subnet id
- Throws:
MetadataObjectNotFoundException
- If can't find IPv4 or IPV6 classesBusinessObjectNotFoundException
- If the object(subnet) could not be found.NotAuthorizedException
- If the user is not authorized to use the IPAM moduleInvalidArgumentException
- If the subnet does not have uuid
-
createSubnet
public String createSubnet(String parentId, String className, HashMap<String,String> attributes) throws InvalidArgumentException, ArraySizeMismatchException, NotAuthorizedException, MetadataObjectNotFoundException, OperationNotPermittedException, BusinessObjectNotFoundException, ApplicationObjectNotFoundException
create a subnet- Parameters:
parentId
- subnet pool idclassName
- subnet class nameattributes
- subnet attributes, networkIP, broadcastIP, hosts- Returns:
- new subnet id
- Throws:
ApplicationObjectNotFoundException
- can't find the parent(a subnet pool) to create the subnetInvalidArgumentException
- If any of the attributes or its type is invalidArraySizeMismatchException
- If attributeNames and attributeValues have different sizes.NotAuthorizedException
- If the user is not authorized to use the IPAM moduleMetadataObjectNotFoundException
- If can't find IPv4 or IPV6 classesBusinessObjectNotFoundException
- Thrown if the parent id is not foundOperationNotPermittedException
- If the update can't be performed due to a format issue
-
createSubnets
public List<String> createSubnets(String parentId, String className, List<HashMap<String,String>> subnetsAttributes) throws InvalidArgumentException, ArraySizeMismatchException, NotAuthorizedException, MetadataObjectNotFoundException, OperationNotPermittedException, BusinessObjectNotFoundException, ApplicationObjectNotFoundException
Creates several subnets in a subnet- Parameters:
parentId
- subnet pool idclassName
- subnet class namesubnetsAttributes
- all the attributes of the subnets to be created: networkIP, broadcastIP, hosts, etc- Returns:
- a list of the new subnet ids
- Throws:
ApplicationObjectNotFoundException
- can't find the parent(a subnet pool) to create the subnetInvalidArgumentException
- If any of the attributes or its type is invalidArraySizeMismatchException
- If attributeNames and attributeValues have different sizes.NotAuthorizedException
- If the user is not authorized to use the IPAM moduleMetadataObjectNotFoundException
- If can't find IPv4 or IPV6 classesBusinessObjectNotFoundException
- Thrown if the parent id is not foundOperationNotPermittedException
- If the update can't be performed due to a format issue
-
existInInventory
public List<BusinessObjectLight> existInInventory(List<String> addresses, String className) throws InvalidArgumentException
Checks if a a list of subnet or IP addresses names exist in the whole inventory it will return a list of all the existing subnet found- Parameters:
ipAddresses
- subnets name should be in cidr format, or ip addressesclassName
- class of subnets ipv4 or ipv 6- Returns:
- a list of found subnets
- Throws:
InvalidArgumentException
-
deleteSubnets
public void deleteSubnets(String className, List<String> subnetIds, boolean releaseRelationships) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, OperationNotPermittedException, InvalidArgumentException
Deletes a subnet- Parameters:
subnetIds
- subnet idsclassName
- subnets class namereleaseRelationships
- release any relationship- Throws:
BusinessObjectNotFoundException
- If the requested subnet can't be foundMetadataObjectNotFoundException
- If the requested object class can't be found (problems with IPv4 or IPV6 classes)OperationNotPermittedException
- If the update can't be performed due a business rule or because the object is blocked or it has relationships and releaseRelationships is falseInvalidArgumentException
- If it was not possible to release the possible unique attributes
-
deleteSubnetPools
public void deleteSubnetPools(String[] subnetPoolsId) throws OperationNotPermittedException, ApplicationObjectNotFoundException
deletes a subnet Pool- Parameters:
subnetPoolsId
- subnet ids- Throws:
OperationNotPermittedException
- If any of the objects in the pool can not be deleted because it's not a business related instance (it's more a security restriction)ApplicationObjectNotFoundException
- If the subnet pool can't be found
-
addIPAddressToSubnet
public String addIPAddressToSubnet(String parentSubnetId, String parentSubnetClassName, HashMap<String,String> attributes) throws ApplicationObjectNotFoundException, InvalidArgumentException, ArraySizeMismatchException, NotAuthorizedException, MetadataObjectNotFoundException, BusinessObjectNotFoundException, OperationNotPermittedException
creates an IP address inside a subnet- Parameters:
parentSubnetId
- subnet IdparentSubnetClassName
- if is a IPv4 or an IPv6 subnetattributes
- ip Address attributes, name description- Returns:
- IP address id
- Throws:
ApplicationObjectNotFoundException
- Can't find the parent(a subnet) to create the IP addressInvalidArgumentException
- If any of the attributes or its type is invalidArraySizeMismatchException
- If attributeNames and attributeValues have different sizes.NotAuthorizedException
- If the user is not authorized to use the IPAM moduleMetadataObjectNotFoundException
- if can't find IPv4 or IPV6 classesBusinessObjectNotFoundException
- Thrown if the parent(the subnet) id is not foundOperationNotPermittedException
- If the update can't be performed due to a format issue
-
updateIpAdress
public void updateIpAdress(String id, HashMap<String,String> attributes) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, OperationNotPermittedException, InvalidArgumentException
Updates some attributes of the ip address, description, state are the only editable attributes of an ip address- Parameters:
id
- ip addres idattributes
- attribuetes to update description or state.- Throws:
MetadataObjectNotFoundException
BusinessObjectNotFoundException
OperationNotPermittedException
InvalidArgumentException
-
addIPAddressToFolder
public String addIPAddressToFolder(String parentFolderId, HashMap<String,String> attributes) throws ApplicationObjectNotFoundException, InvalidArgumentException, ArraySizeMismatchException, NotAuthorizedException, MetadataObjectNotFoundException, BusinessObjectNotFoundException, OperationNotPermittedException
creates an IP address that has no subnet parent as direct child of a folder- Parameters:
parentFolderId
- subnet Idif
- is a IPv4 or an IPv6 subnetattributes
- ip Address attributes, name description- Returns:
- IP address id
- Throws:
ApplicationObjectNotFoundException
- Can't find the parent(a subnet) to create the IP addressInvalidArgumentException
- If any of the attributes or its type is invalidArraySizeMismatchException
- If attributeNames and attributeValues have different sizes.NotAuthorizedException
- If the user is not authorized to use the IPAM moduleMetadataObjectNotFoundException
- if can't find IPv4 or IPV6 classesBusinessObjectNotFoundException
- Thrown if the parent(the subnet) id is not foundOperationNotPermittedException
- If the update can't be performed due to a format issue
-
deleteIpAddress
public void deleteIpAddress(List<String> ipAddressesIds, boolean releaseRelationships) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, OperationNotPermittedException, NotAuthorizedException, InvalidArgumentException
Removes an IP address from a subnet or folder- Parameters:
ipIds
- IP addresses idsreleaseRelationships
- release existing relationships- Throws:
BusinessObjectNotFoundException
- If the requested IP address can't be foundMetadataObjectNotFoundException
- If can't find IPv4 or IPV6 classesOperationNotPermittedException
- If the update can't be performed due a business rule or because the object is blocked or it has relationships and releaseRelationships is falseNotAuthorizedException
- If the user is not authorized to use the IPAM moduleInvalidArgumentException
- If the ip ids do no have uuid
-
relateIPAddressToPort
public void relateIPAddressToPort(String subnetId, String portClassName, String portId) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException
Relates an IP address with a generic communication port- Parameters:
subnetId
- subnet idportClassName
- Generic communications elementportId
- generic communications id- Throws:
BusinessObjectNotFoundException
- If any of the objects can't be foundOperationNotPermittedException
- If any of the objects involved can't be connected (i.e. if it's not an inventory object)MetadataObjectNotFoundException
- If any of the classes provided can not be foundInvalidArgumentException
- If the subnet/port do not have uuid
-
relateSubnetToVLAN
public void relateSubnetToVLAN(String subnetId, String className, String vlanId) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException
Relate a Subnet with a VLAN, this method also allow to relate VLANs to BDIs, VFRIs.- Parameters:
subnetId
- subnet idclassName
- if the subnet has IPv4 or IPv6 addressesvlanId
- VLAN id- Throws:
BusinessObjectNotFoundException
- If any of the objects can't be foundOperationNotPermittedException
- If any of the objects involved can't be connected (i.e. if it's not an inventory object)MetadataObjectNotFoundException
- If any of the classes provided can not be foundInvalidArgumentException
- If the subnet/vlan do not have uuid
-
releaseSubnetFromVLAN
public void releaseSubnetFromVLAN(String subnetId, String vlanId) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Release a relationship between a subnet and a VLAN, this method also allow to relate VLANs to BDIs, VFRIs.- Parameters:
vlanId
- the vlan IdsubnetId
- the subnet id- Throws:
BusinessObjectNotFoundException
- If any of the objects can't be foundMetadataObjectNotFoundException
- If any of the classes provided can not be foundInvalidArgumentException
- If the subnet/vlan do not have uuid
-
relateSubnetToVRF
public void relateSubnetToVRF(String subnetId, String className, String vrfId) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException
Relate a Subnet with a VRF- Parameters:
subnetId
- subnet idclassName
- if the subnet has IPv4 or IPv6 addressesvrfId
- VLAN id- Throws:
BusinessObjectNotFoundException
- If any of the objects can't be foundOperationNotPermittedException
- If any of the objects involved can't be connected (i.e. if it's not an inventory object)MetadataObjectNotFoundException
- If any of the classes provided can not be foundInvalidArgumentException
- If the subnet/vrf do not have uuid
-
releasePortFromIP
public void releasePortFromIP(String portClass, String portId, String id) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException, NotAuthorizedException
Release the relationship between a GenericPort and an IP Address.- Parameters:
portClass
- GenericCommunications ElementportId
- GenericCommunications idid
- IP address id- Throws:
BusinessObjectNotFoundException
- If the object can not be foundMetadataObjectNotFoundException
- If the port class can not be foundNotAuthorizedException
- If the user is not authorized to use the IPAM moduleInvalidArgumentException
- If the port does not have uuid
-
releaseSubnetFromVRF
public void releaseSubnetFromVRF(String subnetId, String vrfId) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, NotAuthorizedException, InvalidArgumentException
Release a relationship between a subnet and a VRF- Parameters:
subnetId
- the subnet idvrfId
- the VRF Id- Throws:
BusinessObjectNotFoundException
- If the object can not be foundMetadataObjectNotFoundException
- If the port class can not be foundNotAuthorizedException
- If the user is not authorized to use the IPAM moduleInvalidArgumentException
- If the subnet/vrf do not have uuid
-
getSubnetCreatedIPAddresses
public List<BusinessObjectLight> getSubnetCreatedIPAddresses(String id, String className, int page, int limit) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, NotAuthorizedException, InvalidArgumentException
Retrieves all the IP address created in a subnet- Parameters:
id
- a given subnet idclassName
- If the subnet has IPv4 or an IPv6 addresses- Returns:
- a list of IP addresses that are related to an interface
- Throws:
MetadataObjectNotFoundException
- If can't find IPv4 or IPV6 classesBusinessObjectNotFoundException
- If the object(subnet) could not be found.NotAuthorizedException
- If the user is not authorized to use the IPAM moduleInvalidArgumentException
- If the subnet does not have uuid public ListgetSubnetCreatedIPAddresses(String id, String className, HashMap filters, int page, int limit)
-
relatePortToInterface
public void relatePortToInterface(String portId, String portClassName, String interfaceClassName, String interfaceId) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, NotAuthorizedException, InvalidArgumentException
Relates an interface with a GenericCommunicationPort- Parameters:
portId
- port idportClassName
- the class name of the configuration you want to relate withinterfaceClassName
- the interface class nameinterfaceId
- interface id- Throws:
BusinessObjectNotFoundException
- If any of the objects can't be foundOperationNotPermittedException
- If any of the objects involved can't be connected (i.e. if it's not an inventory object)MetadataObjectNotFoundException
- If any of the classes provided can not be foundNotAuthorizedException
- If the user is not authorized to use the IPAM moduleInvalidArgumentException
- If the port/interface do not have uuid
-
releasePortFromInterface
public void releasePortFromInterface(String interfaceClassName, String interfaceId, String portId) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, NotAuthorizedException, InvalidArgumentException
Release the relationship between a GenericCommunicationPort and an interface- Parameters:
interfaceClassName
- interface's classinterfaceId
- interface idportId
- port id- Throws:
BusinessObjectNotFoundException
- If the object can not be foundMetadataObjectNotFoundException
- If the port class can not be foundNotAuthorizedException
- If the user is not authorized to use the IPAM moduleInvalidArgumentException
- If the interface/port do not have uuid
-
ipv4getOverlapedSubnets
public void ipv4getOverlapedSubnets(String cidr, String newNetworkIpAddress, String newBroadcastIpAddress) throws InvalidArgumentException
Checks if the new subnet exists or overlaps with in other created subnets- Parameters:
cidr
- subnet's cidr formatnetworkIp
- subnet's network ip addressbroadcastIp
- subnet's boradcast ip address- Throws:
InvalidArgumentException
- if a subnet with the exact cidr already exists or if it overlaps with others created subnets
-
getSubnetIpAddrsInUse
public List<BusinessObjectLight> getSubnetIpAddrsInUse(String subnetId, String subnetClassName) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Gets the number of IP addresses instantiated (created) in the subnet that has a relationship with an inventory object e.g. port- Parameters:
subnetId
- the subnet idsubnetClassName
- subnet class name- Returns:
- the number of IP addresses with relationships
- Throws:
MetadataObjectNotFoundException
- class name of the subnet not foundBusinessObjectNotFoundException
- the IP address not foundInvalidArgumentException
- if son parameter is missing in the methods used
-
getSubnetIpAddrsReserved
public List<BusinessObjectLight> getSubnetIpAddrsReserved(String subnetId, String subnetClassName) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
-
-