manageengineapi.ipgroup — IP Group Management¶
Object to represent and facilitate IP Group operations in ManageEngine. All get, add, modify, and delete methods of API session relating to IP Group will return objects defined here instead of JSON.
-
class
manageengineapi.ipgroup.IPGroup(**kwargs)¶ IP Group object. Group can either be defined by include/exclude of IPNetwork and IPRange objects or defined as between IPNetwork objects. It can not contain both. If group definition is for traffic between 2 IP addresses, the IP group can be only for those 2 IPs of type between and NOTHING else.
More info: https://www.manageengine.com/products/netflow/help/admin-operations/ip-group-mgmt.html
Params app: Applications
Parameters: - dscp (str) – QoS DSCP tags
- name (str) – group name
- description (str) – group description
- speed (int) – speed in bits per second
- ID (str) – unique identifier
- status (str) – group type. include/exclude for IPs/networks, between for traffic between IPs
-
add_ip(obj)¶ Method to add IPNetwork or IPRange to IPGroup object. Using this method instead of appending to self.ip list validates that between type relationships are handled as the API endpoint expects them.
Parameters: obj (manageengineapi.IPNetwork or manageengineapi.IPRange) – object to add to IPGroup
-
process_api_group_list(ipgs)¶ Function to parse list of IP definitions from API JSON output and return list of IPNetwork/IPRange objects and whether it’s a between relationships or not.
Parameters: ipgs (list) – list of IP from JSON response response[‘IPGroup_List’][index][‘ip’] Returns: list or bool
-
class
manageengineapi.ipgroup.IPNetwork(cidr=None, status='include')¶ Object for both network and host objects. Hosts should be passed in with /32 subnet mask, or else they will be created as network object with appropriate CIDR mask.
Parameters: - cidr (str) – network or host in CIDR format
- status (str) – enabled/disabled
-
class
manageengineapi.ipgroup.IPRange(**kwargs)¶ Object for IP range. Addresses will be stored as IPv4Address objects.
Parameters: - rangestart (str) – IP at beginning of range
- rangeend (str) – IP at end of range
- netmask (str) – subnet mask of IPs within range
- status (str) – enabled/disabled