Idoit-Tests 01

This commit is contained in:
Sven Riwoldt
2024-12-15 14:38:48 +01:00
parent 16d9b8bd2c
commit e06c448a46
51 changed files with 1181 additions and 0 deletions

41
idoit_scaleup/cat_ip.py Executable file
View File

@@ -0,0 +1,41 @@
from .consts import C__CATG__IP
from .category import IDoitCategory
class IDoitIP(IDoitCategory):
CATEGORY = C__CATG__IP
def __init__(self, cfg):
super().__init__(cfg, self.CATEGORY)
def convert_field_with_name_primary(self, data):
if data['primary']['value']==None:
return False
return int(data['primary']['value'])
def convert_field_with_name_active(self, data):
if data['active']['value']==None:
return False
return int(data['active']['value'])
def convert_field_with_name_use_standard_gateway(self, data):
if data['use_standard_gateway']['value']==None:
return False
return int(data['use_standard_gateway']['value'])
def convert_field_with_name_ipv4_address(self, data):
return data['ipv4_address']['ref_title']
def convert_field_with_name_ipv6_address(self, data):
return data['ipv6_address']['ref_title']
def convert_field_with_name_assigned_port(self,data):
return data['assigned_port']['title']
def convert_field_with_name_dns_domain(self, data):
rtn=[]
if 'dns_domain' in data and data['dns_domain'] is not None:
for ele in data['dns_domain']:
rtn.append(ele['title'])
return rtn