diff --git a/Changelog.md b/Changelog.md index 456304a655599175f5e4a43f9ac0624d2c1e6a4d..9fd92d47d7b60081c9d5c9b8e3b13f5ac1afc015 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## [0.44] - 2020-06-03 +- DBOARD3-284: accomodate IMS API updates +- DBOARD3-271: added customer-user weeding + ## [0.43] - 2020-05-12 - added poller api response caching diff --git a/inventory_provider/db/ims.py b/inventory_provider/db/ims.py index fd6b51dc863fab99a0d7a3efcb560dcec097c069..181cddf2c515f5685a8d62152267415ac97b1969 100644 --- a/inventory_provider/db/ims.py +++ b/inventory_provider/db/ims.py @@ -115,7 +115,7 @@ class IMS(object): auth=(username, password)) response.raise_for_status() cls.bearer_token_init_time = re_init_time - cls.bearer_token = response.json() + cls.bearer_token = response.text def _get_entity( self, @@ -156,16 +156,29 @@ class IMS(object): return False + def _convert_keys(source): + if isinstance(source, list): + return [_convert_keys(x) for x in source] + elif isinstance(source, dict): + new = {} + for k, v in source.items(): + if isinstance(v, (dict, list)): + v = _convert_keys(v) + new[k.lower()] = v + return new + return source + while True: response = requests.get( url, - headers={'Authorization': self.bearer_token}, + headers={'Authorization': f'Bearer {self.bearer_token}'}, params=params) if _is_invalid_login_state(response): IMS._init_bearer_token(self.username, self.password) else: response.raise_for_status() - return_value = response.json() + orig = response.json() + return_value = _convert_keys(orig) if use_cache: IMS.cache[cache_key] = return_value diff --git a/inventory_provider/db/ims_data.py b/inventory_provider/db/ims_data.py index 11dc04dfe2199df5201052fb82c30b40d6e4b3d5..b60116a7f21f535f4fdf95e09d82eeb505a361d6 100644 --- a/inventory_provider/db/ims_data.py +++ b/inventory_provider/db/ims_data.py @@ -5,10 +5,46 @@ from collections import OrderedDict from inventory_provider import environment from inventory_provider.db import ims from inventory_provider.db.ims import InventoryStatus - environment.setup_logging() logger = logging.getLogger(__name__) +# Dashboard V3 + + +def lookup_pop_info(ds, hostname): + site_nav_props = [ + ims.SITE_PROPERTIES['City'], + ims.SITE_PROPERTIES['SiteAliases'], + ims.SITE_PROPERTIES['Country'] + ] + + node = ds.get_entity_by_name('Node', hostname) + if not node: + return None + site = ds.get_entity_by_id('Site', node['SiteId'], site_nav_props, True) + city = site['City'] + abbreviation = '' + try: + abbreviation = site['SiteAliases'][0]['AliasName'] + except IndexError: + pass # no alias - ignore silently + eq = { + 'equipment-name': node['Name'], + 'status': InventoryStatus(node['InventoryStatusId']).name, + 'pop': { + 'name': site['Name'], + 'city': city['Name'], + 'country': city['Country']['Name'], + 'abbreviation': abbreviation, + 'longitude': site['Longitude'], + 'latitude': site['Latitude'], + } + } + return eq + + +# End of Dashboard V3 stuff + INTERNAL_POP_NAMES = { 'Cambridge OC', 'DANTE Lab', @@ -81,50 +117,18 @@ def lookup_lg_routers(ds): yield(eq) -def lookup_pop_info(ds, hostname): - site_nav_props = [ - ims.SITE_PROPERTIES['City'], - ims.SITE_PROPERTIES['SiteAliases'], - ims.SITE_PROPERTIES['Country'] - ] - - node = ds.get_entity_by_name('Node', hostname) - if not node: - return None - site = ds.get_entity_by_id('Site', node['SiteId'], site_nav_props, True) - city = site['City'] - abbreviation = '' - try: - abbreviation = site['SiteAliases'][0]['AliasName'] - except IndexError: - pass # no alias - ignore silently - eq = { - 'equipment-name': node['Name'], - 'status': InventoryStatus(node['InventoryStatusId']).name, - 'pop': { - 'name': site['Name'], - 'city': city['Name'], - 'country': city['Country']['Name'], - 'abbreviation': abbreviation, - 'longitude': site['Longitude'], - 'latitude': site['Latitude'], - } - } - return eq - - def otrs_get_customer_company_rows(ds): yield ['customer_id', 'name', 'street', 'zip', 'city', 'country', 'url', 'comments'] all_cus_comps = set() for customer in ds.get_all_entities('Customer'): - all_cus_comps.add(customer['Name']) - yield [customer['Name'].replace(' ', ''), customer['Name'], + all_cus_comps.add(customer['name']) + yield [customer['name'].replace(' ', ''), customer['name'], '', '', '', '', '', ''] for vendor in ds.get_all_entities('Vendor'): - if vendor['Name'] not in all_cus_comps: - all_cus_comps.add(vendor['Name']) - yield [vendor['Name'].replace(' ', ''), vendor['Name'], + if vendor['name'] not in all_cus_comps: + all_cus_comps.add(vendor['name']) + yield [vendor['name'].replace(' ', ''), vendor['name'], '', '', '', '', '', ''] @@ -138,7 +142,7 @@ def _is_valid_customer(cus): def otrs_get_customer_contacts(ds): def _get_customer_id2(t): - if t['Id'] == 3 or t['Name'] == 'EU NREN': + if t['id'] == 3 or t['name'] == 'EU NREN': return 'OTRS-GEANT-NREN' return '' @@ -149,21 +153,21 @@ def otrs_get_customer_contacts(ds): ims.CUSTOMER_PROPERTIES['CustomerType'] ]): - if customer['CustomerRelatedContacts']: + if customer['customerrelatedcontacts']: - for contact in customer['CustomerRelatedContacts']: + for contact in customer['customerrelatedcontacts']: t_customer_user = OrderedDict({ - 'email': contact['Contact']['Mail'], - 'username': contact['Contact']['Mail'], # TODO if tal_id is going to be present use that # noqa - 'customer_id': customer['Name'].replace(' ', ''), + 'email': contact['contact']['mail'], + 'username': contact['contact']['mail'], # TODO if tal_id is going to be present use that # noqa + 'customer_id': customer['name'].replace(' ', ''), 'customer_id_2': - _get_customer_id2(customer['CustomerType']), + _get_customer_id2(customer['customertype']), 'title': '', - 'firstname': contact['Contact']['Name'], + 'firstname': contact['contact']['name'], 'lastname': ' '.join(filter(None, [ - contact['Contact']['InFix'], - contact['Contact']['LastName'] + contact['contact']['infix'], + contact['contact']['lastname'] ])), 'phone': '', 'fax': '', @@ -189,16 +193,16 @@ def otrs_get_vendor_contacts(ds): ims.VENDOR_RELATED_CONTACT_PROPERTIES['Contact'] ]): t_customer_user = OrderedDict({ - 'email': vrc['Contact']['Mail'], - 'username': vrc['Contact']['Mail'], # TODO if tal_id is going to be present use that # noqa - 'customer_id': vrc['Vendor']['Name'].replace(' ', ''), + 'email': vrc['contact']['mail'], + 'username': vrc['contact']['mail'], # TODO if tal_id is going to be present use that # noqa + 'customer_id': vrc['vendor']['name'].replace(' ', ''), 'customer_id_2': '', 'title': '', - 'firstname': vrc['Contact']['Name'], + 'firstname': vrc['contact']['name'], 'lastname': ' '.join(filter(None, [ - vrc['Contact']['InFix'], - vrc['Contact']['LastName'] + vrc['contact']['infix'], + vrc['contact']['lastname'] ])), 'phone': '', 'fax': '', @@ -215,7 +219,7 @@ def otrs_get_vendor_contacts(ds): yield t_customer_user -def otrs_get_customer_users_rows(ds): +def otrs_get_customer_users_rows(ds, return_duplicates=False): yield ['email', 'username', 'customer_id', 'customer_id_2', 'title', 'firstname', 'lastname', 'phone', 'fax', 'mobile', 'street', 'zip', 'city', 'country', 'comments'] @@ -229,18 +233,56 @@ def otrs_get_customer_users_rows(ds): if c['email'] not in yielded_customer_emails: yield c - sorted_cus = sorted(get_all_cus_user_rows(), key=lambda x: x['email']) + def weed_duplicates(duplicates): + # this is here to allow for additional rules + id_rank = { + 'geant': 1 + } + top_rank = -1 + top_ranked = None + for d in duplicates: + rank = id_rank.get(d['customer_id'].lower(), 0) + if rank > top_rank: + top_rank = rank + top_ranked = [] + if rank == top_rank: + top_ranked.append(d) + return top_ranked + + cus_by_email = {} duplicate_emails = set() - previous_email = None - for cu in sorted_cus: - if cu['email'] == previous_email: - duplicate_emails.add(previous_email) - previous_email = cu['email'] + for cu in get_all_cus_user_rows(): + email = cu['email'] + cus_for_email = cus_by_email.get(email, []) + if cus_for_email: + duplicate_emails.add(email) + cus_for_email.append(cu) + cus_by_email[email] = cus_for_email + + remaining_duplicates = [] if duplicate_emails: - logger.error('Duplicate emails found in OTRS customer-user export: ' - f'{duplicate_emails}') - # raise KeyError('Duplicate emails found in OTRS customer-user export: ' # noqa - # f'{duplicate_emails}') - - for cu in sorted_cus: - yield list(cu.values()) + logger.info('Duplicate emails found in OTRS customer-user export: ' + f'{duplicate_emails} - attempting to weed') + for email in duplicate_emails: + weeded = weed_duplicates(cus_by_email.pop(email)) + if len(weeded) == 1: + cus_by_email[email] = weeded + else: + remaining_duplicates.extend( + sorted( + [list(w.values()) for w in weeded], key=lambda x: x[2]) + ) + + if remaining_duplicates: + logger.error('Duplicate emails remain after weeding, ' + f'{"including" if return_duplicates else "excluding"}' + ' duplicates in returned data: ') + + for rd in remaining_duplicates: + logger.debug(rd) + + for email, details in sorted(cus_by_email.items()): + yield list(details[0].values()) + + if return_duplicates: + yield from remaining_duplicates diff --git a/inventory_provider/routes/ims_otrs.py b/inventory_provider/routes/ims_otrs.py index cbae9e9e740f7de090b20b542e9f4439cc89af88..b03fec117fd2e6e70408e923d5a855f5d35e8cc8 100644 --- a/inventory_provider/routes/ims_otrs.py +++ b/inventory_provider/routes/ims_otrs.py @@ -18,16 +18,11 @@ def after_request(resp): return common.after_request(resp) -def get_otrs_data(fn): - ims_config = current_app.config['INVENTORY_PROVIDER_CONFIG']["ims"] - ds = IMS( - ims_config['api'], - ims_config['username'], - ims_config['password']) +def get_otrs_output(result): with StringIO() as sio: writer = csv.writer(sio, delimiter='^') - writer.writerows(fn(ds)) + writer.writerows(result) data = sio.getvalue() return Response( response=data, @@ -37,17 +32,24 @@ def get_otrs_data(fn): @routes.route('customer-companies') def get_customer_companies_data(): - return get_otrs_data(ims_data.otrs_get_customer_company_rows) + ims_config = current_app.config['INVENTORY_PROVIDER_CONFIG']["ims"] + ds = IMS(ims_config['api'], ims_config['username'], ims_config['password']) + return get_otrs_output(ims_data.otrs_get_customer_company_rows(ds)) @routes.route('customer-users') def get_customer_users_data(): - return get_otrs_data(ims_data.otrs_get_customer_users_rows) + ims_config = current_app.config['INVENTORY_PROVIDER_CONFIG']["ims"] + ds = IMS(ims_config['api'], ims_config['username'], ims_config['password']) + return_duplicates = request.args.get('duplicates', 'f').lower() == 'true' + return get_otrs_output(ims_data.otrs_get_customer_users_rows( + ds, return_duplicates=return_duplicates)) @routes.route('export') def send_exports(): files_value = request.args.get('files', None) + duplicates = request.args.get('duplicates', 'f').lower() == 'true' if files_value: try: files_value = int(files_value) @@ -61,7 +63,8 @@ def send_exports(): response=html.escape(f'Bad value for <files> {files_value}'), status=requests.codes.bad_request, mimetype="text/html") - task = export_data_for_otrs.delay(files_value) + task = export_data_for_otrs.delay( + files_to_export=files_value, export_duplicates=duplicates) return Response( response=task.id, status=requests.codes.ok, diff --git a/inventory_provider/routes/otrs_jobs.py b/inventory_provider/routes/otrs_jobs.py deleted file mode 100644 index 6de4678de1b8d27c5cb373d9f5208bf3ea6a5e0b..0000000000000000000000000000000000000000 --- a/inventory_provider/routes/otrs_jobs.py +++ /dev/null @@ -1,37 +0,0 @@ -import html - -import requests -from flask import Blueprint, request, Response - -from inventory_provider.routes import common -from inventory_provider.tasks.ims_worker import OTRSFiles, export_data_for_otrs - -routes = Blueprint("otrs", __name__) - - -@routes.after_request -def after_request(resp): - return common.after_request(resp) - - -@routes.route('export') -def send_exports(): - files_value = request.args.get('files', None) - if files_value: - try: - files_value = int(files_value) - except ValueError: - return Response( - response=html.escape('<files> should be an Integer'), - status=requests.codes.bad_request, - mimetype="text/html") - if files_value < 0 or files_value > sum(OTRSFiles): - return Response( - response=html.escape(f'Bad value for <files> {files_value}'), - status=requests.codes.bad_request, - mimetype="text/html") - task = export_data_for_otrs.delay(files_value) - return Response( - response=task.id, - status=requests.codes.ok, - mimetype="text/html") diff --git a/inventory_provider/routes/testing.py b/inventory_provider/routes/testing.py index 8900bfd813c5a079d56abf111cf4cbcc803bbca6..60073eae1eb16aa4ebc146202002a31a74979101 100644 --- a/inventory_provider/routes/testing.py +++ b/inventory_provider/routes/testing.py @@ -23,7 +23,7 @@ def flushdb(): @routes.route("update-lg-routers-ims", methods=['GET', 'POST']) def update_lg_routers_ims(): - ims_worker.update_lg_routers_ims.delay() + ims_worker.update_lg_routers_ims.delay(use_current=True) return Response('OK') # End of IMS routes diff --git a/inventory_provider/static/interfaces.html b/inventory_provider/static/interfaces.html index 898841231a75e0dc874307377bef7bae27c4a6b6..80ca1c39c1566406bc9acd27198ea2f4a15c4cf9 100644 --- a/inventory_provider/static/interfaces.html +++ b/inventory_provider/static/interfaces.html @@ -1,6 +1,7 @@ <!doctype html> -<html ng-app="inventoryApp"> +<html ng-app="inventoryApp" lang="en"> <head> + <title>interfaces</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.5/angular.min.js"></script> <script src="interfaces.js"></script> <link rel="stylesheet" href="style.css"> diff --git a/inventory_provider/static/juniper.html b/inventory_provider/static/juniper.html index 80e70c607a0fc98730a0df46b52b397798e56c59..212276b8004a62fba92d844e654f50e1b1338e32 100644 --- a/inventory_provider/static/juniper.html +++ b/inventory_provider/static/juniper.html @@ -1,6 +1,7 @@ <!doctype html> -<html ng-app="inventoryApp"> +<html ng-app="inventoryApp" lang="en"> <head> + <title>juniper</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.5/angular.min.js"></script> <script src="juniper.js"></script> <link rel="stylesheet" href="style.css"> @@ -17,7 +18,7 @@ </div> <div class="column"> - <p><b>interfaces</b></p> + <p><strong>interfaces</strong></p> <ul> <li ng-repeat="i in interfaces">{{i.name}} <ul> @@ -30,7 +31,7 @@ <div class="raw">{{interfaces}}</div> </div> <div class="column"> - <p><b>bgp</b></p> + <p><strong>bgp</strong></p> <ul> <li ng-repeat="p in bgp">{{p.description}} <ul> @@ -42,7 +43,7 @@ <div class="raw">{{bgp}}</div> </div> <div class="column"> - <p><b>snmp</b></p> + <p><strong>snmp</strong></p> <ul> <li ng-repeat="i in snmp">{{i.name}} <ul><li>index: {{i.index}}</li></ul> diff --git a/inventory_provider/static/update.html b/inventory_provider/static/update.html index 0d615b21b475c422331786b2957594cb78129725..18ba32d01b87676b3cef3f1f63696397f88a071f 100644 --- a/inventory_provider/static/update.html +++ b/inventory_provider/static/update.html @@ -1,6 +1,7 @@ <!doctype html> -<html ng-app="inventoryApp"> +<html ng-app="inventoryApp" lang="en"> <head> + <title>Update Inventory Provider</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.5/angular.min.js"></script> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script> @@ -30,7 +31,7 @@ </div> <span class="grid-item" ng-show="latch_error||latch_pending"> - <table class="table table-striped"> + <table class="table table-striped" summary="update tasks"> <tr> <th colspan="4" scope="col">update tasks</th> <tr> diff --git a/inventory_provider/tasks/ims_worker.py b/inventory_provider/tasks/ims_worker.py index 152591a60c5041155625a4e486a946dcb1f03720..26f7f09dccb3a2be7544604d73116d0228a7eaf7 100644 --- a/inventory_provider/tasks/ims_worker.py +++ b/inventory_provider/tasks/ims_worker.py @@ -11,7 +11,7 @@ from inventory_provider.db import ims_data from inventory_provider.db.ims import IMS from inventory_provider import environment from inventory_provider.tasks.app import app -from inventory_provider.tasks.common import get_next_redis +from inventory_provider.tasks.common import get_current_redis, get_next_redis from inventory_provider.tasks.worker import InventoryTask, \ log_task_entry_and_exit @@ -20,12 +20,17 @@ environment.setup_logging() logger = logging.getLogger(__name__) -@app.task(base=InventoryTask, bind=True) +@app.task(base=InventoryTask, bind=True, name='update_lg_routers_ims') @log_task_entry_and_exit -def update_lg_routers_ims(self): - logger.debug('>>> update_lg_routers_ims') +def update_lg_routers_ims(self, use_current=False): + + if use_current: + r = get_current_redis(InventoryTask.config) + for k in r.scan_iter('classifier-cache:ims-lg:*'): + r.delete(k) + else: + r = get_next_redis(InventoryTask.config) - r = get_next_redis(InventoryTask.config) for k in r.scan_iter('ims:lg:*'): r.delete(k) c = InventoryTask.config["ims"] @@ -34,23 +39,20 @@ def update_lg_routers_ims(self): for router in ims_data.lookup_lg_routers(ds): r.set(f'ims:lg:{router["equipment name"]}', json.dumps(router)) - logger.debug('<<< update_lg_routers_ims') - class OTRSFiles(IntFlag): CUSTOMER_COMPANIES = 1 CUSTOMER_USERS = 2 -@app.task(base=InventoryTask, bind=True) +@app.task(base=InventoryTask, bind=True, name='export_data_for_otrs') @log_task_entry_and_exit -def export_data_for_otrs(self, files_to_export=None): +def export_data_for_otrs(self, files_to_export=None, export_duplicates=False): if files_to_export: files_to_export = OTRSFiles(files_to_export) else: files_to_export = set(OTRSFiles) - logger.debug('>>> export_data_for_otrs_ims') ims_config = InventoryTask.config["ims"] otrs_config = InventoryTask.config["otrs-export"] @@ -75,7 +77,8 @@ def export_data_for_otrs(self, files_to_export=None): cus_usr_path = temp_path.joinpath(f'{prefix}customer_user.csv') with open(cus_usr_path, 'w+') as f: writer = csv.writer(f, delimiter='^') - writer.writerows(ims_data.otrs_get_customer_users_rows(ds)) + writer.writerows(ims_data.otrs_get_customer_users_rows( + ds, return_duplicates=export_duplicates)) command = command_template.format( user=otrs_config['username'], @@ -85,5 +88,3 @@ def export_data_for_otrs(self, files_to_export=None): destination=otrs_config['destination'] ) subprocess.run(command, shell=True, check=True) - - logger.debug('<<< export_data_for_otrs_ims') diff --git a/setup.py b/setup.py index 067f7381e1f766a6fb8a8265a26b30e475b97980..35ab81204f7ec07fd64a138a6eb76ce4c95c7ed8 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='inventory-provider', - version="0.43", + version="0.44", author='GEANT', author_email='swd@geant.org', description='Dashboard inventory provider', diff --git a/test/data/check-snmp-agent-configs.py b/test/data/check-snmp-agent-configs.py new file mode 100644 index 0000000000000000000000000000000000000000..77304c0636a22ce30db3eca9558ed41dea5e1a43 --- /dev/null +++ b/test/data/check-snmp-agent-configs.py @@ -0,0 +1,62 @@ +from inventory_provider.tasks.common import get_current_redis +from inventory_provider import config +from lxml import etree +import socket + +COLLECTORS = [ + 'prod-noc-alarms01.geant.org', + 'prod-noc-alarms02.geant.org', + 'prod-noc-alarms03.geant.org', + 'uat-noc-alarms01.geant.org', + 'uat-noc-alarms02.geant.org', + 'uat-noc-alarms03.geant.org', + 'test-noc-alarms01.geant.org', + 'test-noc-alarms02.geant.org', + 'test-noc-alarms03.geant.org' +] + + +def v4_address(hostname): + for a in socket.getaddrinfo(hostname, None): + (family, type, proto, canonname, sockaddr) = a + if family != socket.AF_INET: + continue + if type != socket.SOCK_DGRAM: + continue + return sockaddr[0] + assert False, 'not resolveable' + + +ADDRESS = dict([(c, v4_address(c)) for c in COLLECTORS]) + +with open('config-sentinel.json') as f: + params = config.load(f) + + +def agent_addresses(netconf_string): + doc = etree.fromstring(netconf_string) + return doc.xpath('//configuration/snmp/trap-group/targets/name/text()') + + +columns = [''] + COLLECTORS +print(','.join(columns)) +columns = [''] + [ADDRESS[c] for c in COLLECTORS] +print(','.join(columns)) + + +def _c(b): + return '+' if b else 'MISSING' + + +r = get_current_redis(params) +for k in r.scan_iter('netconf:*'): + k = k.decode('utf-8') + + router = k[len('netconf:'):] + columns = [router] + + data = r.get(k).decode('utf-8') + agents = agent_addresses(data) + + columns += [_c(ADDRESS[c] in agents) for c in COLLECTORS] + print(','.join(columns)) diff --git a/test/data/ims_otrs_customers.json b/test/data/ims_otrs_customers.json index c5da5600087ba4175a495f9ad802674ce684db6b..5f6053a9800e19159a505232c5622ab6bdd7461e 100644 --- a/test/data/ims_otrs_customers.json +++ b/test/data/ims_otrs_customers.json @@ -1,276 +1 @@ -{ - "Customer": [ - { - "Id": 57284, - "ParentCustomerId": null, - "Name": "DUMMY 1", - "FullName": "DUMMY 1", - "Number": null, - "Address": "", - "PhoneNumber": "", - "FaxNumber": "", - "AccountManager": "", - "AccountEmail": "", - "Code": "", - "SlaId": null, - "ServiceCenter": 0, - "ServiceCenterName": "", - "Website": "", - "CustomerTypeId": null, - "PwCodeBlue": 0, - "PwInformProtectionSwitch": 0, - "PwInformDown": 0, - "PwInformAtRisk": 0, - "PwInformImPact": 0, - "PwInformNoImPact": 0, - "PwExtraInfo": "", - "PwLanguage": "", - "CountryId": null, - "Sla": null, - "Sites": null, - "Nodes": null, - "Racks": null, - "Orders": null, - "PwInformedList": null, - "Circuits": null, - "OloCircuits": null, - "ChannelReservations": null, - "PortReservations": null, - "IpRanges": null, - "NumberManagementList": null, - "CustomerRelatedContacts": null, - "CustomerRelatedContracts": null, - "InNumbers": null, - "ManagementSystems": null, - "CustomerType": null, - "ContractCustomerRelations": null, - "ParentCustomer": null, - "SubCustomers": null, - "EsimProfiles": null, - "Esims": null, - "Country": null, - "PwEmailSetups": null, - "TelephoneNumbers": null, - "TelephoneNumberRanges": null, - "RowVersion": "2016-05-18T10:20:38", - "Errors": null, - "HasErrors": false - }, - { - "Id": 57603, - "ParentCustomerId": null, - "Name": "DUMMY 2", - "FullName": "DUMMY 2", - "Number": null, - "Address": "", - "PhoneNumber": "", - "FaxNumber": "", - "AccountManager": "", - "AccountEmail": "", - "Code": "", - "SlaId": null, - "ServiceCenter": 0, - "ServiceCenterName": "", - "Website": "", - "CustomerTypeId": 1, - "PwCodeBlue": 0, - "PwInformProtectionSwitch": 1, - "PwInformDown": 1, - "PwInformAtRisk": 1, - "PwInformImPact": 1, - "PwInformNoImPact": 1, - "PwExtraInfo": "", - "PwLanguage": "", - "CountryId": null, - "Sla": null, - "Sites": null, - "Nodes": null, - "Racks": null, - "Orders": null, - "PwInformedList": null, - "Circuits": null, - "OloCircuits": null, - "ChannelReservations": null, - "PortReservations": null, - "IpRanges": null, - "NumberManagementList": null, - "CustomerRelatedContacts": null, - "CustomerRelatedContracts": null, - "InNumbers": null, - "ManagementSystems": null, - "CustomerType": null, - "ContractCustomerRelations": null, - "ParentCustomer": null, - "SubCustomers": null, - "EsimProfiles": null, - "Esims": null, - "Country": null, - "PwEmailSetups": null, - "TelephoneNumbers": null, - "TelephoneNumberRanges": null, - "RowVersion": "2020-01-31T13:35:07", - "Errors": null, - "HasErrors": false - }, - { - "Id": 57604, - "ParentCustomerId": null, - "Name": "DUMMY 3", - "FullName": "DUMMY 3", - "Number": null, - "Address": "", - "PhoneNumber": "", - "FaxNumber": "", - "AccountManager": "", - "AccountEmail": "", - "Code": "", - "SlaId": null, - "ServiceCenter": 0, - "ServiceCenterName": "", - "Website": "", - "CustomerTypeId": 1, - "PwCodeBlue": 0, - "PwInformProtectionSwitch": 1, - "PwInformDown": 1, - "PwInformAtRisk": 1, - "PwInformImPact": 1, - "PwInformNoImPact": 1, - "PwExtraInfo": "", - "PwLanguage": "", - "CountryId": null, - "Sla": null, - "Sites": null, - "Nodes": null, - "Racks": null, - "Orders": null, - "PwInformedList": null, - "Circuits": null, - "OloCircuits": null, - "ChannelReservations": null, - "PortReservations": null, - "IpRanges": null, - "NumberManagementList": null, - "CustomerRelatedContacts": null, - "CustomerRelatedContracts": null, - "InNumbers": null, - "ManagementSystems": null, - "CustomerType": null, - "ContractCustomerRelations": null, - "ParentCustomer": null, - "SubCustomers": null, - "EsimProfiles": null, - "Esims": null, - "Country": null, - "PwEmailSetups": null, - "TelephoneNumbers": null, - "TelephoneNumberRanges": null, - "RowVersion": "2020-01-31T13:35:07", - "Errors": null, - "HasErrors": false - } - ], - "Vendor": [ - { - "Id": 2482, - "Name": "DUMMY 4", - "TypeId": 1, - "SlaOnSiteId": null, - "SlaMainTimeToRepairId": null, - "SlaLink": "", - "SlaDescription": "", - "Description": "TESTVENDORDESCRIPTION", - "SpareOwner": "", - "StockLocation": "", - "StockContact": "", - "InternetAddress": "", - "MasterAccount": "", - "EscalationDescription": "", - "Color": "", - "IssuerCodeEsim": null, - "MnoCode": "", - "EumId": "", - "EquipmentDefinitions": null, - "ManagementSystems": null, - "CardCodes": null, - "CardDefinitions": null, - "CableTypes": null, - "VendorRelatedContacts": null, - "VendorMaterialTypes": null, - "Contract": null, - "SlaOnSite": null, - "SlaMainTimeToRepair": null, - "Type": null, - "RowVersion": "2020-01-23T16:34:30", - "Errors": null, - "HasErrors": false - }, - { - "Id": 2502, - "Name": "DUMMY 5", - "TypeId": 13, - "SlaOnSiteId": null, - "SlaMainTimeToRepairId": null, - "SlaLink": "", - "SlaDescription": "", - "Description": "", - "SpareOwner": "", - "StockLocation": "", - "StockContact": "", - "InternetAddress": "", - "MasterAccount": "", - "EscalationDescription": "", - "Color": "", - "IssuerCodeEsim": null, - "MnoCode": "", - "EumId": "", - "EquipmentDefinitions": null, - "ManagementSystems": null, - "CardCodes": null, - "CardDefinitions": null, - "CableTypes": null, - "VendorRelatedContacts": null, - "VendorMaterialTypes": null, - "Contract": null, - "SlaOnSite": null, - "SlaMainTimeToRepair": null, - "Type": null, - "RowVersion": "2020-01-31T13:30:42", - "Errors": null, - "HasErrors": false - }, - { - "Id": 2503, - "Name": "DUMMY 2", - "TypeId": 14, - "SlaOnSiteId": null, - "SlaMainTimeToRepairId": null, - "SlaLink": "", - "SlaDescription": "", - "Description": "", - "SpareOwner": "", - "StockLocation": "", - "StockContact": "", - "InternetAddress": "", - "MasterAccount": "", - "EscalationDescription": "", - "Color": "", - "IssuerCodeEsim": null, - "MnoCode": "", - "EumId": "", - "EquipmentDefinitions": null, - "ManagementSystems": null, - "CardCodes": null, - "CardDefinitions": null, - "CableTypes": null, - "VendorRelatedContacts": null, - "VendorMaterialTypes": null, - "Contract": null, - "SlaOnSite": null, - "SlaMainTimeToRepair": null, - "Type": null, - "RowVersion": "2020-01-31T13:30:42", - "Errors": null, - "HasErrors": false - } - ] -} \ No newline at end of file +{"Customer": [{"id": 57284, "parentcustomerid": null, "name": "DUMMY 1", "fullname": "DUMMY 1", "number": null, "address": "", "phonenumber": "", "faxnumber": "", "accountmanager": "", "accountemail": "", "code": "", "slaid": null, "servicecenter": 0, "servicecentername": "", "website": "", "customertypeid": null, "pwcodeblue": 0, "pwinformprotectionswitch": 0, "pwinformdown": 0, "pwinformatrisk": 0, "pwinformimpact": 0, "pwinformnoimpact": 0, "pwextrainfo": "", "pwlanguage": "", "countryid": null, "sla": null, "sites": null, "nodes": null, "racks": null, "orders": null, "pwinformedlist": null, "circuits": null, "olocircuits": null, "channelreservations": null, "portreservations": null, "ipranges": null, "numbermanagementlist": null, "customerrelatedcontacts": null, "customerrelatedcontracts": null, "innumbers": null, "managementsystems": null, "customertype": null, "contractcustomerrelations": null, "parentcustomer": null, "subcustomers": null, "esimprofiles": null, "esims": null, "country": null, "pwemailsetups": null, "telephonenumbers": null, "telephonenumberranges": null, "rowversion": "2016-05-18T10:20:38", "errors": null, "haserrors": false}, {"id": 57603, "parentcustomerid": null, "name": "DUMMY 2", "fullname": "DUMMY 2", "number": null, "address": "", "phonenumber": "", "faxnumber": "", "accountmanager": "", "accountemail": "", "code": "", "slaid": null, "servicecenter": 0, "servicecentername": "", "website": "", "customertypeid": 1, "pwcodeblue": 0, "pwinformprotectionswitch": 1, "pwinformdown": 1, "pwinformatrisk": 1, "pwinformimpact": 1, "pwinformnoimpact": 1, "pwextrainfo": "", "pwlanguage": "", "countryid": null, "sla": null, "sites": null, "nodes": null, "racks": null, "orders": null, "pwinformedlist": null, "circuits": null, "olocircuits": null, "channelreservations": null, "portreservations": null, "ipranges": null, "numbermanagementlist": null, "customerrelatedcontacts": null, "customerrelatedcontracts": null, "innumbers": null, "managementsystems": null, "customertype": null, "contractcustomerrelations": null, "parentcustomer": null, "subcustomers": null, "esimprofiles": null, "esims": null, "country": null, "pwemailsetups": null, "telephonenumbers": null, "telephonenumberranges": null, "rowversion": "2020-01-31T13:35:07", "errors": null, "haserrors": false}, {"id": 57604, "parentcustomerid": null, "name": "DUMMY 3", "fullname": "DUMMY 3", "number": null, "address": "", "phonenumber": "", "faxnumber": "", "accountmanager": "", "accountemail": "", "code": "", "slaid": null, "servicecenter": 0, "servicecentername": "", "website": "", "customertypeid": 1, "pwcodeblue": 0, "pwinformprotectionswitch": 1, "pwinformdown": 1, "pwinformatrisk": 1, "pwinformimpact": 1, "pwinformnoimpact": 1, "pwextrainfo": "", "pwlanguage": "", "countryid": null, "sla": null, "sites": null, "nodes": null, "racks": null, "orders": null, "pwinformedlist": null, "circuits": null, "olocircuits": null, "channelreservations": null, "portreservations": null, "ipranges": null, "numbermanagementlist": null, "customerrelatedcontacts": null, "customerrelatedcontracts": null, "innumbers": null, "managementsystems": null, "customertype": null, "contractcustomerrelations": null, "parentcustomer": null, "subcustomers": null, "esimprofiles": null, "esims": null, "country": null, "pwemailsetups": null, "telephonenumbers": null, "telephonenumberranges": null, "rowversion": "2020-01-31T13:35:07", "errors": null, "haserrors": false}], "Vendor": [{"id": 2482, "name": "DUMMY 4", "typeid": 1, "slaonsiteid": null, "slamaintimetorepairid": null, "slalink": "", "sladescription": "", "description": "TESTVENDORDESCRIPTION", "spareowner": "", "stocklocation": "", "stockcontact": "", "internetaddress": "", "masteraccount": "", "escalationdescription": "", "color": "", "issuercodeesim": null, "mnocode": "", "eumid": "", "equipmentdefinitions": null, "managementsystems": null, "cardcodes": null, "carddefinitions": null, "cabletypes": null, "vendorrelatedcontacts": null, "vendormaterialtypes": null, "contract": null, "slaonsite": null, "slamaintimetorepair": null, "type": null, "rowversion": "2020-01-23T16:34:30", "errors": null, "haserrors": false}, {"id": 2502, "name": "DUMMY 5", "typeid": 13, "slaonsiteid": null, "slamaintimetorepairid": null, "slalink": "", "sladescription": "", "description": "", "spareowner": "", "stocklocation": "", "stockcontact": "", "internetaddress": "", "masteraccount": "", "escalationdescription": "", "color": "", "issuercodeesim": null, "mnocode": "", "eumid": "", "equipmentdefinitions": null, "managementsystems": null, "cardcodes": null, "carddefinitions": null, "cabletypes": null, "vendorrelatedcontacts": null, "vendormaterialtypes": null, "contract": null, "slaonsite": null, "slamaintimetorepair": null, "type": null, "rowversion": "2020-01-31T13:30:42", "errors": null, "haserrors": false}, {"id": 2503, "name": "DUMMY 2", "typeid": 14, "slaonsiteid": null, "slamaintimetorepairid": null, "slalink": "", "sladescription": "", "description": "", "spareowner": "", "stocklocation": "", "stockcontact": "", "internetaddress": "", "masteraccount": "", "escalationdescription": "", "color": "", "issuercodeesim": null, "mnocode": "", "eumid": "", "equipmentdefinitions": null, "managementsystems": null, "cardcodes": null, "carddefinitions": null, "cabletypes": null, "vendorrelatedcontacts": null, "vendormaterialtypes": null, "contract": null, "slaonsite": null, "slamaintimetorepair": null, "type": null, "rowversion": "2020-01-31T13:30:42", "errors": null, "haserrors": false}]} diff --git a/test/data/ims_otrs_customers_extra.json b/test/data/ims_otrs_customers_extra.json index b8b5c94c52f83c1e315ed693958a94bc405a7b3e..f10de965ac3c347a5236177691206e96d87d46e3 100644 --- a/test/data/ims_otrs_customers_extra.json +++ b/test/data/ims_otrs_customers_extra.json @@ -1,1001 +1 @@ -[ - { - "Id": 57284, - "ParentCustomerId": null, - "Name": "DUMMY 1", - "FullName": "DUMMY 1", - "Number": null, - "Address": "", - "PhoneNumber": "", - "FaxNumber": "", - "AccountManager": "", - "AccountEmail": "", - "Code": "", - "SlaId": null, - "ServiceCenter": 0, - "ServiceCenterName": "", - "Website": "", - "CustomerTypeId": null, - "PwCodeBlue": 0, - "PwInformProtectionSwitch": 0, - "PwInformDown": 0, - "PwInformAtRisk": 0, - "PwInformImPact": 0, - "PwInformNoImPact": 0, - "PwExtraInfo": "", - "PwLanguage": "", - "CountryId": null, - "Sla": null, - "Sites": null, - "Nodes": null, - "Racks": null, - "Orders": null, - "PwInformedList": null, - "Circuits": null, - "OloCircuits": null, - "ChannelReservations": null, - "PortReservations": null, - "IpRanges": null, - "NumberManagementList": null, - "CustomerRelatedContacts": [], - "CustomerRelatedContracts": null, - "InNumbers": null, - "ManagementSystems": null, - "CustomerType": null, - "ContractCustomerRelations": null, - "ParentCustomer": null, - "SubCustomers": null, - "EsimProfiles": null, - "Esims": null, - "Country": null, - "PwEmailSetups": null, - "TelephoneNumbers": null, - "TelephoneNumberRanges": null, - "RowVersion": "2016-05-18T10:20:38", - "Errors": null, - "HasErrors": false - }, - { - "Id": 57603, - "ParentCustomerId": null, - "Name": "DUMMY 2", - "FullName": "DUMMY 2", - "Number": null, - "Address": "", - "PhoneNumber": "", - "FaxNumber": "", - "AccountManager": "", - "AccountEmail": "", - "Code": "", - "SlaId": null, - "ServiceCenter": 0, - "ServiceCenterName": "", - "Website": "", - "CustomerTypeId": 1, - "PwCodeBlue": 0, - "PwInformProtectionSwitch": 1, - "PwInformDown": 1, - "PwInformAtRisk": 1, - "PwInformImPact": 1, - "PwInformNoImPact": 1, - "PwExtraInfo": "", - "PwLanguage": "", - "CountryId": null, - "Sla": null, - "Sites": null, - "Nodes": null, - "Racks": null, - "Orders": null, - "PwInformedList": null, - "Circuits": null, - "OloCircuits": null, - "ChannelReservations": null, - "PortReservations": null, - "IpRanges": null, - "NumberManagementList": null, - "CustomerRelatedContacts": [ - { - "Id": 706, - "MainTypeId": 5, - "CustomerId": 57603, - "RelateTypeId": 2, - "ContactId": 1081, - "Contact": { - "Id": 1081, - "IsGroup": 1, - "Name": "DUMMY 2 NOC", - "InFix": "", - "LastName": "-", - "Gender": "", - "Phone": "", - "Mobile": "", - "Fax": "", - "Webpage": "", - "Mail": "BANOC@DUMMY2.COM", - "PlannedworkMail": "", - "TroubleticketMail": "", - "JobTitle": "", - "Priority": null, - "PlannedWorkMailType": null, - "Language": "", - "PreFix": "", - "SmsQuery": "", - "ExtraInfo": "", - "CustomerRelatedContacts": [], - "ContactRelatedContacts": null, - "MainContactRelatedContacts": null, - "SiteRelatedContacts": null, - "VendorRelatedContacts": null, - "QueueContacts": null, - "RowVersion": "2020-03-04T10:55:58", - "Errors": null, - "HasErrors": false - }, - "RowVersion": "2020-03-04T13:03:03", - "Errors": null, - "HasErrors": false - }, - { - "Id": 1771, - "MainTypeId": 5, - "CustomerId": 57603, - "RelateTypeId": 2, - "ContactId": 1082, - "Contact": { - "Id": 1082, - "IsGroup": 1, - "Name": "DUMMY 2 PEERING", - "InFix": "", - "LastName": "-", - "Gender": "", - "Phone": "", - "Mobile": "", - "Fax": "", - "Webpage": "", - "Mail": "BBPEERING@DUMMY2.COM", - "PlannedworkMail": "", - "TroubleticketMail": "", - "JobTitle": "", - "Priority": null, - "PlannedWorkMailType": null, - "Language": "", - "PreFix": "", - "SmsQuery": "", - "ExtraInfo": "", - "CustomerRelatedContacts": [], - "ContactRelatedContacts": null, - "MainContactRelatedContacts": null, - "SiteRelatedContacts": null, - "VendorRelatedContacts": null, - "QueueContacts": null, - "RowVersion": "2020-03-04T10:56:07", - "Errors": null, - "HasErrors": false - }, - "RowVersion": "2020-03-04T18:05:14", - "Errors": null, - "HasErrors": false - } - ], - "CustomerRelatedContracts": null, - "InNumbers": null, - "ManagementSystems": null, - "CustomerType": { - "Id": 1, - "Name": "COMMERCIAL PEER", - "Customers": [], - "RowVersion": "2020-01-31T13:26:02", - "Errors": null, - "HasErrors": false - }, - "ContractCustomerRelations": null, - "ParentCustomer": null, - "SubCustomers": null, - "EsimProfiles": null, - "Esims": null, - "Country": null, - "PwEmailSetups": null, - "TelephoneNumbers": null, - "TelephoneNumberRanges": null, - "RowVersion": "2020-01-31T13:35:07", - "Errors": null, - "HasErrors": false - }, - { - "Id": 57604, - "ParentCustomerId": null, - "Name": "DUMMY 3", - "FullName": "DUMMY 3", - "Number": null, - "Address": "", - "PhoneNumber": "", - "FaxNumber": "", - "AccountManager": "", - "AccountEmail": "", - "Code": "", - "SlaId": null, - "ServiceCenter": 0, - "ServiceCenterName": "", - "Website": "", - "CustomerTypeId": 1, - "PwCodeBlue": 0, - "PwInformProtectionSwitch": 1, - "PwInformDown": 1, - "PwInformAtRisk": 1, - "PwInformImPact": 1, - "PwInformNoImPact": 1, - "PwExtraInfo": "", - "PwLanguage": "", - "CountryId": null, - "Sla": null, - "Sites": null, - "Nodes": null, - "Racks": null, - "Orders": null, - "PwInformedList": null, - "Circuits": null, - "OloCircuits": null, - "ChannelReservations": null, - "PortReservations": null, - "IpRanges": null, - "NumberManagementList": null, - "CustomerRelatedContacts": [], - "CustomerRelatedContracts": null, - "InNumbers": null, - "ManagementSystems": null, - "CustomerType": { - "Id": 1, - "Name": "COMMERCIAL PEER", - "Customers": [], - "RowVersion": "2020-01-31T13:26:02", - "Errors": null, - "HasErrors": false - }, - "ContractCustomerRelations": null, - "ParentCustomer": null, - "SubCustomers": null, - "EsimProfiles": null, - "Esims": null, - "Country": null, - "PwEmailSetups": null, - "TelephoneNumbers": null, - "TelephoneNumberRanges": null, - "RowVersion": "2020-01-31T13:35:07", - "Errors": null, - "HasErrors": false - }, - { - "Id": 57605, - "ParentCustomerId": null, - "Name": "DUMMY 4", - "FullName": "DUMMY 4", - "Number": null, - "Address": "", - "PhoneNumber": "", - "FaxNumber": "", - "AccountManager": "", - "AccountEmail": "", - "Code": "", - "SlaId": null, - "ServiceCenter": 0, - "ServiceCenterName": "", - "Website": "", - "CustomerTypeId": 1, - "PwCodeBlue": 0, - "PwInformProtectionSwitch": 1, - "PwInformDown": 1, - "PwInformAtRisk": 1, - "PwInformImPact": 1, - "PwInformNoImPact": 1, - "PwExtraInfo": "", - "PwLanguage": "", - "CountryId": null, - "Sla": null, - "Sites": null, - "Nodes": null, - "Racks": null, - "Orders": null, - "PwInformedList": null, - "Circuits": null, - "OloCircuits": null, - "ChannelReservations": null, - "PortReservations": null, - "IpRanges": null, - "NumberManagementList": null, - "CustomerRelatedContacts": [], - "CustomerRelatedContracts": null, - "InNumbers": null, - "ManagementSystems": null, - "CustomerType": { - "Id": 1, - "Name": "COMMERCIAL PEER", - "Customers": [], - "RowVersion": "2020-01-31T13:26:02", - "Errors": null, - "HasErrors": false - }, - "ContractCustomerRelations": null, - "ParentCustomer": null, - "SubCustomers": null, - "EsimProfiles": null, - "Esims": null, - "Country": null, - "PwEmailSetups": null, - "TelephoneNumbers": null, - "TelephoneNumberRanges": null, - "RowVersion": "2020-02-24T12:08:46", - "Errors": null, - "HasErrors": false - }, - { - "Id": 57606, - "ParentCustomerId": null, - "Name": "DUMMY 5", - "FullName": "DUMMY 5", - "Number": null, - "Address": "", - "PhoneNumber": "", - "FaxNumber": "", - "AccountManager": "", - "AccountEmail": "", - "Code": "", - "SlaId": null, - "ServiceCenter": 0, - "ServiceCenterName": "", - "Website": "", - "CustomerTypeId": 1, - "PwCodeBlue": 0, - "PwInformProtectionSwitch": 1, - "PwInformDown": 1, - "PwInformAtRisk": 1, - "PwInformImPact": 1, - "PwInformNoImPact": 1, - "PwExtraInfo": "", - "PwLanguage": "", - "CountryId": null, - "Sla": null, - "Sites": null, - "Nodes": null, - "Racks": null, - "Orders": null, - "PwInformedList": null, - "Circuits": null, - "OloCircuits": null, - "ChannelReservations": null, - "PortReservations": null, - "IpRanges": null, - "NumberManagementList": null, - "CustomerRelatedContacts": [ - { - "Id": 839, - "MainTypeId": 5, - "CustomerId": 57606, - "RelateTypeId": 2, - "ContactId": 1521, - "Contact": { - "Id": 1521, - "IsGroup": 1, - "Name": "DUMMY 5", - "InFix": "", - "LastName": "-", - "Gender": "", - "Phone": "E 1234 5678", - "Mobile": "", - "Fax": "", - "Webpage": "", - "Mail": "ENOC@DUMMY5.NET", - "PlannedworkMail": "", - "TroubleticketMail": "", - "JobTitle": "", - "Priority": null, - "PlannedWorkMailType": null, - "Language": "", - "PreFix": "", - "SmsQuery": "", - "ExtraInfo": "", - "CustomerRelatedContacts": [], - "ContactRelatedContacts": null, - "MainContactRelatedContacts": null, - "SiteRelatedContacts": null, - "VendorRelatedContacts": null, - "QueueContacts": null, - "RowVersion": "2020-03-03T19:26:57", - "Errors": null, - "HasErrors": false - }, - "RowVersion": "2020-03-04T13:03:17", - "Errors": null, - "HasErrors": false - } - ], - "CustomerRelatedContracts": null, - "InNumbers": null, - "ManagementSystems": null, - "CustomerType": { - "Id": 1, - "Name": "COMMERCIAL PEER", - "Customers": [], - "RowVersion": "2020-01-31T13:26:02", - "Errors": null, - "HasErrors": false - }, - "ContractCustomerRelations": null, - "ParentCustomer": null, - "SubCustomers": null, - "EsimProfiles": null, - "Esims": null, - "Country": null, - "PwEmailSetups": null, - "TelephoneNumbers": null, - "TelephoneNumberRanges": null, - "RowVersion": "2020-01-31T13:35:07", - "Errors": null, - "HasErrors": false - }, - { - "Id": 57607, - "ParentCustomerId": null, - "Name": "DUMMY 6", - "FullName": "DUMMY 6", - "Number": null, - "Address": "", - "PhoneNumber": "", - "FaxNumber": "", - "AccountManager": "", - "AccountEmail": "", - "Code": "", - "SlaId": null, - "ServiceCenter": 0, - "ServiceCenterName": "", - "Website": "", - "CustomerTypeId": 1, - "PwCodeBlue": 0, - "PwInformProtectionSwitch": 1, - "PwInformDown": 1, - "PwInformAtRisk": 1, - "PwInformImPact": 1, - "PwInformNoImPact": 1, - "PwExtraInfo": "", - "PwLanguage": "", - "CountryId": null, - "Sla": null, - "Sites": null, - "Nodes": null, - "Racks": null, - "Orders": null, - "PwInformedList": null, - "Circuits": null, - "OloCircuits": null, - "ChannelReservations": null, - "PortReservations": null, - "IpRanges": null, - "NumberManagementList": null, - "CustomerRelatedContacts": [ - { - "Id": 844, - "MainTypeId": 5, - "CustomerId": 57607, - "RelateTypeId": 2, - "ContactId": 1528, - "Contact": { - "Id": 1528, - "IsGroup": 1, - "Name": "DUMMY 6", - "InFix": "", - "LastName": "-", - "Gender": "", - "Phone": "", - "Mobile": "", - "Fax": "", - "Webpage": "", - "Mail": "FNOC@DUMMY6.COM", - "PlannedworkMail": "", - "TroubleticketMail": "", - "JobTitle": "", - "Priority": null, - "PlannedWorkMailType": null, - "Language": "", - "PreFix": "", - "SmsQuery": "", - "ExtraInfo": "", - "CustomerRelatedContacts": [], - "ContactRelatedContacts": null, - "MainContactRelatedContacts": null, - "SiteRelatedContacts": null, - "VendorRelatedContacts": null, - "QueueContacts": null, - "RowVersion": "2020-03-03T19:26:58", - "Errors": null, - "HasErrors": false - }, - "RowVersion": "2020-03-04T13:03:17", - "Errors": null, - "HasErrors": false - } - ], - "CustomerRelatedContracts": null, - "InNumbers": null, - "ManagementSystems": null, - "CustomerType": { - "Id": 1, - "Name": "COMMERCIAL PEER", - "Customers": [], - "RowVersion": "2020-01-31T13:26:02", - "Errors": null, - "HasErrors": false - }, - "ContractCustomerRelations": null, - "ParentCustomer": null, - "SubCustomers": null, - "EsimProfiles": null, - "Esims": null, - "Country": null, - "PwEmailSetups": null, - "TelephoneNumbers": null, - "TelephoneNumberRanges": null, - "RowVersion": "2020-01-31T13:35:07", - "Errors": null, - "HasErrors": false - }, - { - "Id": 57608, - "ParentCustomerId": null, - "Name": "DUMMY 7", - "FullName": "DUMMY 7", - "Number": null, - "Address": "", - "PhoneNumber": "", - "FaxNumber": "", - "AccountManager": "", - "AccountEmail": "", - "Code": "", - "SlaId": null, - "ServiceCenter": 0, - "ServiceCenterName": "", - "Website": "", - "CustomerTypeId": 1, - "PwCodeBlue": 0, - "PwInformProtectionSwitch": 1, - "PwInformDown": 1, - "PwInformAtRisk": 1, - "PwInformImPact": 1, - "PwInformNoImPact": 1, - "PwExtraInfo": "", - "PwLanguage": "", - "CountryId": null, - "Sla": null, - "Sites": null, - "Nodes": null, - "Racks": null, - "Orders": null, - "PwInformedList": null, - "Circuits": null, - "OloCircuits": null, - "ChannelReservations": null, - "PortReservations": null, - "IpRanges": null, - "NumberManagementList": null, - "CustomerRelatedContacts": [ - { - "Id": 872, - "MainTypeId": 5, - "CustomerId": 57608, - "RelateTypeId": 2, - "ContactId": 1598, - "Contact": { - "Id": 1598, - "IsGroup": 0, - "Name": "DUMMY 7", - "InFix": "", - "LastName": "NOC", - "Gender": "", - "Phone": "G 1234 5678", - "Mobile": "", - "Fax": "", - "Webpage": "", - "Mail": "GNOC@DUMMY7.COM", - "PlannedworkMail": "", - "TroubleticketMail": "", - "JobTitle": "", - "Priority": null, - "PlannedWorkMailType": null, - "Language": "", - "PreFix": "", - "SmsQuery": "", - "ExtraInfo": "", - "CustomerRelatedContacts": [], - "ContactRelatedContacts": null, - "MainContactRelatedContacts": null, - "SiteRelatedContacts": null, - "VendorRelatedContacts": null, - "QueueContacts": null, - "RowVersion": "2020-03-03T19:27:00", - "Errors": null, - "HasErrors": false - }, - "RowVersion": "2020-03-04T13:03:20", - "Errors": null, - "HasErrors": false - } - ], - "CustomerRelatedContracts": null, - "InNumbers": null, - "ManagementSystems": null, - "CustomerType": { - "Id": 1, - "Name": "COMMERCIAL PEER", - "Customers": [], - "RowVersion": "2020-01-31T13:26:02", - "Errors": null, - "HasErrors": false - }, - "ContractCustomerRelations": null, - "ParentCustomer": null, - "SubCustomers": null, - "EsimProfiles": null, - "Esims": null, - "Country": null, - "PwEmailSetups": null, - "TelephoneNumbers": null, - "TelephoneNumberRanges": null, - "RowVersion": "2020-01-31T13:35:07", - "Errors": null, - "HasErrors": false - }, - { - "Id": 57609, - "ParentCustomerId": null, - "Name": "DUMMY 8", - "FullName": "DUMMY 8", - "Number": null, - "Address": "", - "PhoneNumber": "", - "FaxNumber": "", - "AccountManager": "", - "AccountEmail": "", - "Code": "", - "SlaId": null, - "ServiceCenter": 0, - "ServiceCenterName": "", - "Website": "", - "CustomerTypeId": 1, - "PwCodeBlue": 0, - "PwInformProtectionSwitch": 1, - "PwInformDown": 1, - "PwInformAtRisk": 1, - "PwInformImPact": 1, - "PwInformNoImPact": 1, - "PwExtraInfo": "", - "PwLanguage": "", - "CountryId": null, - "Sla": null, - "Sites": null, - "Nodes": null, - "Racks": null, - "Orders": null, - "PwInformedList": null, - "Circuits": null, - "OloCircuits": null, - "ChannelReservations": null, - "PortReservations": null, - "IpRanges": null, - "NumberManagementList": null, - "CustomerRelatedContacts": [ - { - "Id": 944, - "MainTypeId": 5, - "CustomerId": 57609, - "RelateTypeId": 2, - "ContactId": 1997, - "Contact": { - "Id": 1997, - "IsGroup": 1, - "Name": "H D_FIRST", - "InFix": "H D_INFIX", - "LastName": "H D_LAST", - "Gender": "H GENDER", - "Phone": "H 1234 5678", - "Mobile": "H 2345 6789", - "Fax": "H FAX NUMBER", - "Webpage": "H WEB", - "Mail": "HNOC@DUMMY8.COM", - "PlannedworkMail": "H PLANNED WORK MAIL", - "TroubleticketMail": "H TROUBLE TICKET MAIL", - "JobTitle": "H JOB TITLE", - "Priority": null, - "PlannedWorkMailType": null, - "Language": "H LANG", - "PreFix": "H PREFIX", - "SmsQuery": "H SMS", - "ExtraInfo": "H EXTRA", - "CustomerRelatedContacts": [], - "ContactRelatedContacts": null, - "MainContactRelatedContacts": null, - "SiteRelatedContacts": null, - "VendorRelatedContacts": null, - "QueueContacts": null, - "RowVersion": "2020-03-03T19:27:14", - "Errors": null, - "HasErrors": false - }, - "RowVersion": "2020-03-04T13:03:28", - "Errors": null, - "HasErrors": false - } - ], - "CustomerRelatedContracts": null, - "InNumbers": null, - "ManagementSystems": null, - "CustomerType": { - "Id": 3, - "Name": "EU NREN", - "Customers": [], - "RowVersion": "2020-01-31T13:26:02", - "Errors": null, - "HasErrors": false - }, - "ContractCustomerRelations": null, - "ParentCustomer": null, - "SubCustomers": null, - "EsimProfiles": null, - "Esims": null, - "Country": null, - "PwEmailSetups": null, - "TelephoneNumbers": null, - "TelephoneNumberRanges": null, - "RowVersion": "2020-01-31T13:35:07", - "Errors": null, - "HasErrors": false - }, - { - "Id": 57610, - "ParentCustomerId": null, - "Name": "DUMMY 9", - "FullName": "DUMMY 9", - "Number": null, - "Address": "", - "PhoneNumber": "", - "FaxNumber": "", - "AccountManager": "", - "AccountEmail": "", - "Code": "", - "SlaId": null, - "ServiceCenter": 0, - "ServiceCenterName": "", - "Website": "", - "CustomerTypeId": 1, - "PwCodeBlue": 0, - "PwInformProtectionSwitch": 1, - "PwInformDown": 1, - "PwInformAtRisk": 1, - "PwInformImPact": 1, - "PwInformNoImPact": 1, - "PwExtraInfo": "", - "PwLanguage": "", - "CountryId": null, - "Sla": null, - "Sites": null, - "Nodes": null, - "Racks": null, - "Orders": null, - "PwInformedList": null, - "Circuits": null, - "OloCircuits": null, - "ChannelReservations": null, - "PortReservations": null, - "IpRanges": null, - "NumberManagementList": null, - "CustomerRelatedContacts": [ - { - "Id": 1274, - "MainTypeId": 5, - "CustomerId": 57610, - "RelateTypeId": 2, - "ContactId": 2069, - "Contact": { - "Id": 2069, - "IsGroup": 1, - "Name": "DUMMY 9", - "InFix": "", - "LastName": "-", - "Gender": "", - "Phone": "", - "Mobile": "", - "Fax": "", - "Webpage": "", - "Mail": "IAF_NAME.L_NAME@DUMMY9.COM", - "PlannedworkMail": "", - "TroubleticketMail": "", - "JobTitle": "", - "Priority": null, - "PlannedWorkMailType": null, - "Language": "", - "PreFix": "", - "SmsQuery": "", - "ExtraInfo": "", - "CustomerRelatedContacts": [], - "ContactRelatedContacts": null, - "MainContactRelatedContacts": null, - "SiteRelatedContacts": null, - "VendorRelatedContacts": null, - "QueueContacts": null, - "RowVersion": "2020-03-03T19:27:17", - "Errors": null, - "HasErrors": false - }, - "RowVersion": "2020-03-04T13:04:02", - "Errors": null, - "HasErrors": false - }, - { - "Id": 1275, - "MainTypeId": 5, - "CustomerId": 57610, - "RelateTypeId": 2, - "ContactId": 2070, - "Contact": { - "Id": 2070, - "IsGroup": 1, - "Name": "DUMMY 9 NOC", - "InFix": "", - "LastName": "-", - "Gender": "", - "Phone": "", - "Mobile": "I 2345 6789", - "Fax": "", - "Webpage": "", - "Mail": "IBNOC@DUMMY9.COM", - "PlannedworkMail": "", - "TroubleticketMail": "", - "JobTitle": "", - "Priority": null, - "PlannedWorkMailType": null, - "Language": "", - "PreFix": "", - "SmsQuery": "", - "ExtraInfo": "", - "CustomerRelatedContacts": [], - "ContactRelatedContacts": null, - "MainContactRelatedContacts": null, - "SiteRelatedContacts": null, - "VendorRelatedContacts": null, - "QueueContacts": null, - "RowVersion": "2020-03-03T19:27:17", - "Errors": null, - "HasErrors": false - }, - "RowVersion": "2020-03-04T13:04:02", - "Errors": null, - "HasErrors": false - } - ], - "CustomerRelatedContracts": null, - "InNumbers": null, - "ManagementSystems": null, - "CustomerType": { - "Id": 1, - "Name": "COMMERCIAL PEER", - "Customers": [], - "RowVersion": "2020-01-31T13:26:02", - "Errors": null, - "HasErrors": false - }, - "ContractCustomerRelations": null, - "ParentCustomer": null, - "SubCustomers": null, - "EsimProfiles": null, - "Esims": null, - "Country": null, - "PwEmailSetups": null, - "TelephoneNumbers": null, - "TelephoneNumberRanges": null, - "RowVersion": "2020-01-31T13:35:07", - "Errors": null, - "HasErrors": false - }, - { - "Id": 57611, - "ParentCustomerId": null, - "Name": "DUMMY 10", - "FullName": "DUMMY 10", - "Number": null, - "Address": "", - "PhoneNumber": "", - "FaxNumber": "", - "AccountManager": "", - "AccountEmail": "", - "Code": "", - "SlaId": null, - "ServiceCenter": 0, - "ServiceCenterName": "", - "Website": "", - "CustomerTypeId": 1, - "PwCodeBlue": 0, - "PwInformProtectionSwitch": 1, - "PwInformDown": 1, - "PwInformAtRisk": 1, - "PwInformImPact": 1, - "PwInformNoImPact": 1, - "PwExtraInfo": "", - "PwLanguage": "", - "CountryId": null, - "Sla": null, - "Sites": null, - "Nodes": null, - "Racks": null, - "Orders": null, - "PwInformedList": null, - "Circuits": null, - "OloCircuits": null, - "ChannelReservations": null, - "PortReservations": null, - "IpRanges": null, - "NumberManagementList": null, - "CustomerRelatedContacts": [ - { - "Id": 1154, - "MainTypeId": 5, - "CustomerId": 57611, - "RelateTypeId": 2, - "ContactId": 2408, - "Contact": { - "Id": 2408, - "IsGroup": 1, - "Name": "DUMMY 10", - "InFix": "", - "LastName": "-", - "Gender": "", - "Phone": "", - "Mobile": "", - "Fax": "", - "Webpage": "", - "Mail": "JNOC@DUMMY10.TV", - "PlannedworkMail": "", - "TroubleticketMail": "", - "JobTitle": "", - "Priority": null, - "PlannedWorkMailType": null, - "Language": "", - "PreFix": "", - "SmsQuery": "", - "ExtraInfo": "", - "CustomerRelatedContacts": [], - "ContactRelatedContacts": null, - "MainContactRelatedContacts": null, - "SiteRelatedContacts": null, - "VendorRelatedContacts": null, - "QueueContacts": null, - "RowVersion": "2020-03-03T19:27:29", - "Errors": null, - "HasErrors": false - }, - "RowVersion": "2020-03-04T13:03:50", - "Errors": null, - "HasErrors": false - } - ], - "CustomerRelatedContracts": null, - "InNumbers": null, - "ManagementSystems": null, - "CustomerType": { - "Id": 1, - "Name": "COMMERCIAL PEER", - "Customers": [], - "RowVersion": "2020-01-31T13:26:02", - "Errors": null, - "HasErrors": false - }, - "ContractCustomerRelations": null, - "ParentCustomer": null, - "SubCustomers": null, - "EsimProfiles": null, - "Esims": null, - "Country": null, - "PwEmailSetups": null, - "TelephoneNumbers": null, - "TelephoneNumberRanges": null, - "RowVersion": "2020-01-31T13:35:07", - "Errors": null, - "HasErrors": false - } -] \ No newline at end of file +[{"id": 57284, "parentcustomerid": null, "name": "DUMMY 1", "fullname": "DUMMY 1", "number": null, "address": "", "phonenumber": "", "faxnumber": "", "accountmanager": "", "accountemail": "", "code": "", "slaid": null, "servicecenter": 0, "servicecentername": "", "website": "", "customertypeid": null, "pwcodeblue": 0, "pwinformprotectionswitch": 0, "pwinformdown": 0, "pwinformatrisk": 0, "pwinformimpact": 0, "pwinformnoimpact": 0, "pwextrainfo": "", "pwlanguage": "", "countryid": null, "sla": null, "sites": null, "nodes": null, "racks": null, "orders": null, "pwinformedlist": null, "circuits": null, "olocircuits": null, "channelreservations": null, "portreservations": null, "ipranges": null, "numbermanagementlist": null, "customerrelatedcontacts": [], "customerrelatedcontracts": null, "innumbers": null, "managementsystems": null, "customertype": null, "contractcustomerrelations": null, "parentcustomer": null, "subcustomers": null, "esimprofiles": null, "esims": null, "country": null, "pwemailsetups": null, "telephonenumbers": null, "telephonenumberranges": null, "rowversion": "2016-05-18T10:20:38", "errors": null, "haserrors": false}, {"id": 57603, "parentcustomerid": null, "name": "DUMMY 2", "fullname": "DUMMY 2", "number": null, "address": "", "phonenumber": "", "faxnumber": "", "accountmanager": "", "accountemail": "", "code": "", "slaid": null, "servicecenter": 0, "servicecentername": "", "website": "", "customertypeid": 1, "pwcodeblue": 0, "pwinformprotectionswitch": 1, "pwinformdown": 1, "pwinformatrisk": 1, "pwinformimpact": 1, "pwinformnoimpact": 1, "pwextrainfo": "", "pwlanguage": "", "countryid": null, "sla": null, "sites": null, "nodes": null, "racks": null, "orders": null, "pwinformedlist": null, "circuits": null, "olocircuits": null, "channelreservations": null, "portreservations": null, "ipranges": null, "numbermanagementlist": null, "customerrelatedcontacts": [{"id": 706, "maintypeid": 5, "customerid": 57603, "relatetypeid": 2, "contactid": 1081, "contact": {"id": 1081, "isgroup": 1, "name": "DUMMY 2 NOC", "infix": "", "lastname": "-", "gender": "", "phone": "", "mobile": "", "fax": "", "webpage": "", "mail": "BANOC@DUMMY2.COM", "plannedworkmail": "", "troubleticketmail": "", "jobtitle": "", "priority": null, "plannedworkmailtype": null, "language": "", "prefix": "", "smsquery": "", "extrainfo": "", "customerrelatedcontacts": [], "contactrelatedcontacts": null, "maincontactrelatedcontacts": null, "siterelatedcontacts": null, "vendorrelatedcontacts": null, "queuecontacts": null, "rowversion": "2020-03-04T10:55:58", "errors": null, "haserrors": false}, "rowversion": "2020-03-04T13:03:03", "errors": null, "haserrors": false}, {"id": 1771, "maintypeid": 5, "customerid": 57603, "relatetypeid": 2, "contactid": 1082, "contact": {"id": 1082, "isgroup": 1, "name": "DUMMY 2 PEERING", "infix": "", "lastname": "-", "gender": "", "phone": "", "mobile": "", "fax": "", "webpage": "", "mail": "BBPEERING@DUMMY2.COM", "plannedworkmail": "", "troubleticketmail": "", "jobtitle": "", "priority": null, "plannedworkmailtype": null, "language": "", "prefix": "", "smsquery": "", "extrainfo": "", "customerrelatedcontacts": [], "contactrelatedcontacts": null, "maincontactrelatedcontacts": null, "siterelatedcontacts": null, "vendorrelatedcontacts": null, "queuecontacts": null, "rowversion": "2020-03-04T10:56:07", "errors": null, "haserrors": false}, "rowversion": "2020-03-04T18:05:14", "errors": null, "haserrors": false}], "customerrelatedcontracts": null, "innumbers": null, "managementsystems": null, "customertype": {"id": 1, "name": "COMMERCIAL PEER", "customers": [], "rowversion": "2020-01-31T13:26:02", "errors": null, "haserrors": false}, "contractcustomerrelations": null, "parentcustomer": null, "subcustomers": null, "esimprofiles": null, "esims": null, "country": null, "pwemailsetups": null, "telephonenumbers": null, "telephonenumberranges": null, "rowversion": "2020-01-31T13:35:07", "errors": null, "haserrors": false}, {"id": 57604, "parentcustomerid": null, "name": "DUMMY 3", "fullname": "DUMMY 3", "number": null, "address": "", "phonenumber": "", "faxnumber": "", "accountmanager": "", "accountemail": "", "code": "", "slaid": null, "servicecenter": 0, "servicecentername": "", "website": "", "customertypeid": 1, "pwcodeblue": 0, "pwinformprotectionswitch": 1, "pwinformdown": 1, "pwinformatrisk": 1, "pwinformimpact": 1, "pwinformnoimpact": 1, "pwextrainfo": "", "pwlanguage": "", "countryid": null, "sla": null, "sites": null, "nodes": null, "racks": null, "orders": null, "pwinformedlist": null, "circuits": null, "olocircuits": null, "channelreservations": null, "portreservations": null, "ipranges": null, "numbermanagementlist": null, "customerrelatedcontacts": [], "customerrelatedcontracts": null, "innumbers": null, "managementsystems": null, "customertype": {"id": 1, "name": "COMMERCIAL PEER", "customers": [], "rowversion": "2020-01-31T13:26:02", "errors": null, "haserrors": false}, "contractcustomerrelations": null, "parentcustomer": null, "subcustomers": null, "esimprofiles": null, "esims": null, "country": null, "pwemailsetups": null, "telephonenumbers": null, "telephonenumberranges": null, "rowversion": "2020-01-31T13:35:07", "errors": null, "haserrors": false}, {"id": 57605, "parentcustomerid": null, "name": "DUMMY 4", "fullname": "DUMMY 4", "number": null, "address": "", "phonenumber": "", "faxnumber": "", "accountmanager": "", "accountemail": "", "code": "", "slaid": null, "servicecenter": 0, "servicecentername": "", "website": "", "customertypeid": 1, "pwcodeblue": 0, "pwinformprotectionswitch": 1, "pwinformdown": 1, "pwinformatrisk": 1, "pwinformimpact": 1, "pwinformnoimpact": 1, "pwextrainfo": "", "pwlanguage": "", "countryid": null, "sla": null, "sites": null, "nodes": null, "racks": null, "orders": null, "pwinformedlist": null, "circuits": null, "olocircuits": null, "channelreservations": null, "portreservations": null, "ipranges": null, "numbermanagementlist": null, "customerrelatedcontacts": [], "customerrelatedcontracts": null, "innumbers": null, "managementsystems": null, "customertype": {"id": 1, "name": "COMMERCIAL PEER", "customers": [], "rowversion": "2020-01-31T13:26:02", "errors": null, "haserrors": false}, "contractcustomerrelations": null, "parentcustomer": null, "subcustomers": null, "esimprofiles": null, "esims": null, "country": null, "pwemailsetups": null, "telephonenumbers": null, "telephonenumberranges": null, "rowversion": "2020-02-24T12:08:46", "errors": null, "haserrors": false}, {"id": 57606, "parentcustomerid": null, "name": "DUMMY 5", "fullname": "DUMMY 5", "number": null, "address": "", "phonenumber": "", "faxnumber": "", "accountmanager": "", "accountemail": "", "code": "", "slaid": null, "servicecenter": 0, "servicecentername": "", "website": "", "customertypeid": 1, "pwcodeblue": 0, "pwinformprotectionswitch": 1, "pwinformdown": 1, "pwinformatrisk": 1, "pwinformimpact": 1, "pwinformnoimpact": 1, "pwextrainfo": "", "pwlanguage": "", "countryid": null, "sla": null, "sites": null, "nodes": null, "racks": null, "orders": null, "pwinformedlist": null, "circuits": null, "olocircuits": null, "channelreservations": null, "portreservations": null, "ipranges": null, "numbermanagementlist": null, "customerrelatedcontacts": [{"id": 839, "maintypeid": 5, "customerid": 57606, "relatetypeid": 2, "contactid": 1521, "contact": {"id": 1521, "isgroup": 1, "name": "DUMMY 5", "infix": "", "lastname": "-", "gender": "", "phone": "E 1234 5678", "mobile": "", "fax": "", "webpage": "", "mail": "ENOC@DUMMY5.NET", "plannedworkmail": "", "troubleticketmail": "", "jobtitle": "", "priority": null, "plannedworkmailtype": null, "language": "", "prefix": "", "smsquery": "", "extrainfo": "", "customerrelatedcontacts": [], "contactrelatedcontacts": null, "maincontactrelatedcontacts": null, "siterelatedcontacts": null, "vendorrelatedcontacts": null, "queuecontacts": null, "rowversion": "2020-03-03T19:26:57", "errors": null, "haserrors": false}, "rowversion": "2020-03-04T13:03:17", "errors": null, "haserrors": false}], "customerrelatedcontracts": null, "innumbers": null, "managementsystems": null, "customertype": {"id": 1, "name": "COMMERCIAL PEER", "customers": [], "rowversion": "2020-01-31T13:26:02", "errors": null, "haserrors": false}, "contractcustomerrelations": null, "parentcustomer": null, "subcustomers": null, "esimprofiles": null, "esims": null, "country": null, "pwemailsetups": null, "telephonenumbers": null, "telephonenumberranges": null, "rowversion": "2020-01-31T13:35:07", "errors": null, "haserrors": false}, {"id": 57607, "parentcustomerid": null, "name": "DUMMY 6", "fullname": "DUMMY 6", "number": null, "address": "", "phonenumber": "", "faxnumber": "", "accountmanager": "", "accountemail": "", "code": "", "slaid": null, "servicecenter": 0, "servicecentername": "", "website": "", "customertypeid": 1, "pwcodeblue": 0, "pwinformprotectionswitch": 1, "pwinformdown": 1, "pwinformatrisk": 1, "pwinformimpact": 1, "pwinformnoimpact": 1, "pwextrainfo": "", "pwlanguage": "", "countryid": null, "sla": null, "sites": null, "nodes": null, "racks": null, "orders": null, "pwinformedlist": null, "circuits": null, "olocircuits": null, "channelreservations": null, "portreservations": null, "ipranges": null, "numbermanagementlist": null, "customerrelatedcontacts": [{"id": 844, "maintypeid": 5, "customerid": 57607, "relatetypeid": 2, "contactid": 1528, "contact": {"id": 1528, "isgroup": 1, "name": "DUMMY 6", "infix": "", "lastname": "-", "gender": "", "phone": "", "mobile": "", "fax": "", "webpage": "", "mail": "FNOC@DUMMY6.COM", "plannedworkmail": "", "troubleticketmail": "", "jobtitle": "", "priority": null, "plannedworkmailtype": null, "language": "", "prefix": "", "smsquery": "", "extrainfo": "", "customerrelatedcontacts": [], "contactrelatedcontacts": null, "maincontactrelatedcontacts": null, "siterelatedcontacts": null, "vendorrelatedcontacts": null, "queuecontacts": null, "rowversion": "2020-03-03T19:26:58", "errors": null, "haserrors": false}, "rowversion": "2020-03-04T13:03:17", "errors": null, "haserrors": false}], "customerrelatedcontracts": null, "innumbers": null, "managementsystems": null, "customertype": {"id": 1, "name": "COMMERCIAL PEER", "customers": [], "rowversion": "2020-01-31T13:26:02", "errors": null, "haserrors": false}, "contractcustomerrelations": null, "parentcustomer": null, "subcustomers": null, "esimprofiles": null, "esims": null, "country": null, "pwemailsetups": null, "telephonenumbers": null, "telephonenumberranges": null, "rowversion": "2020-01-31T13:35:07", "errors": null, "haserrors": false}, {"id": 57608, "parentcustomerid": null, "name": "DUMMY 7", "fullname": "DUMMY 7", "number": null, "address": "", "phonenumber": "", "faxnumber": "", "accountmanager": "", "accountemail": "", "code": "", "slaid": null, "servicecenter": 0, "servicecentername": "", "website": "", "customertypeid": 1, "pwcodeblue": 0, "pwinformprotectionswitch": 1, "pwinformdown": 1, "pwinformatrisk": 1, "pwinformimpact": 1, "pwinformnoimpact": 1, "pwextrainfo": "", "pwlanguage": "", "countryid": null, "sla": null, "sites": null, "nodes": null, "racks": null, "orders": null, "pwinformedlist": null, "circuits": null, "olocircuits": null, "channelreservations": null, "portreservations": null, "ipranges": null, "numbermanagementlist": null, "customerrelatedcontacts": [{"id": 872, "maintypeid": 5, "customerid": 57608, "relatetypeid": 2, "contactid": 1598, "contact": {"id": 1598, "isgroup": 0, "name": "DUMMY 7", "infix": "", "lastname": "NOC", "gender": "", "phone": "G 1234 5678", "mobile": "", "fax": "", "webpage": "", "mail": "GNOC@DUMMY7.COM", "plannedworkmail": "", "troubleticketmail": "", "jobtitle": "", "priority": null, "plannedworkmailtype": null, "language": "", "prefix": "", "smsquery": "", "extrainfo": "", "customerrelatedcontacts": [], "contactrelatedcontacts": null, "maincontactrelatedcontacts": null, "siterelatedcontacts": null, "vendorrelatedcontacts": null, "queuecontacts": null, "rowversion": "2020-03-03T19:27:00", "errors": null, "haserrors": false}, "rowversion": "2020-03-04T13:03:20", "errors": null, "haserrors": false}], "customerrelatedcontracts": null, "innumbers": null, "managementsystems": null, "customertype": {"id": 1, "name": "COMMERCIAL PEER", "customers": [], "rowversion": "2020-01-31T13:26:02", "errors": null, "haserrors": false}, "contractcustomerrelations": null, "parentcustomer": null, "subcustomers": null, "esimprofiles": null, "esims": null, "country": null, "pwemailsetups": null, "telephonenumbers": null, "telephonenumberranges": null, "rowversion": "2020-01-31T13:35:07", "errors": null, "haserrors": false}, {"id": 57609, "parentcustomerid": null, "name": "DUMMY 8", "fullname": "DUMMY 8", "number": null, "address": "", "phonenumber": "", "faxnumber": "", "accountmanager": "", "accountemail": "", "code": "", "slaid": null, "servicecenter": 0, "servicecentername": "", "website": "", "customertypeid": 1, "pwcodeblue": 0, "pwinformprotectionswitch": 1, "pwinformdown": 1, "pwinformatrisk": 1, "pwinformimpact": 1, "pwinformnoimpact": 1, "pwextrainfo": "", "pwlanguage": "", "countryid": null, "sla": null, "sites": null, "nodes": null, "racks": null, "orders": null, "pwinformedlist": null, "circuits": null, "olocircuits": null, "channelreservations": null, "portreservations": null, "ipranges": null, "numbermanagementlist": null, "customerrelatedcontacts": [{"id": 944, "maintypeid": 5, "customerid": 57609, "relatetypeid": 2, "contactid": 1997, "contact": {"id": 1997, "isgroup": 1, "name": "H D_FIRST", "infix": "H D_INFIX", "lastname": "H D_LAST", "gender": "H GENDER", "phone": "H 1234 5678", "mobile": "H 2345 6789", "fax": "H FAX NUMBER", "webpage": "H WEB", "mail": "HNOC@DUMMY8.COM", "plannedworkmail": "H PLANNED WORK MAIL", "troubleticketmail": "H TROUBLE TICKET MAIL", "jobtitle": "H JOB TITLE", "priority": null, "plannedworkmailtype": null, "language": "H LANG", "prefix": "H PREFIX", "smsquery": "H SMS", "extrainfo": "H EXTRA", "customerrelatedcontacts": [], "contactrelatedcontacts": null, "maincontactrelatedcontacts": null, "siterelatedcontacts": null, "vendorrelatedcontacts": null, "queuecontacts": null, "rowversion": "2020-03-03T19:27:14", "errors": null, "haserrors": false}, "rowversion": "2020-03-04T13:03:28", "errors": null, "haserrors": false}], "customerrelatedcontracts": null, "innumbers": null, "managementsystems": null, "customertype": {"id": 3, "name": "EU NREN", "customers": [], "rowversion": "2020-01-31T13:26:02", "errors": null, "haserrors": false}, "contractcustomerrelations": null, "parentcustomer": null, "subcustomers": null, "esimprofiles": null, "esims": null, "country": null, "pwemailsetups": null, "telephonenumbers": null, "telephonenumberranges": null, "rowversion": "2020-01-31T13:35:07", "errors": null, "haserrors": false}, {"id": 57610, "parentcustomerid": null, "name": "DUMMY 9", "fullname": "DUMMY 9", "number": null, "address": "", "phonenumber": "", "faxnumber": "", "accountmanager": "", "accountemail": "", "code": "", "slaid": null, "servicecenter": 0, "servicecentername": "", "website": "", "customertypeid": 1, "pwcodeblue": 0, "pwinformprotectionswitch": 1, "pwinformdown": 1, "pwinformatrisk": 1, "pwinformimpact": 1, "pwinformnoimpact": 1, "pwextrainfo": "", "pwlanguage": "", "countryid": null, "sla": null, "sites": null, "nodes": null, "racks": null, "orders": null, "pwinformedlist": null, "circuits": null, "olocircuits": null, "channelreservations": null, "portreservations": null, "ipranges": null, "numbermanagementlist": null, "customerrelatedcontacts": [{"id": 1274, "maintypeid": 5, "customerid": 57610, "relatetypeid": 2, "contactid": 2069, "contact": {"id": 2069, "isgroup": 1, "name": "DUMMY 9", "infix": "", "lastname": "-", "gender": "", "phone": "", "mobile": "", "fax": "", "webpage": "", "mail": "IAF_NAME.L_NAME@DUMMY9.COM", "plannedworkmail": "", "troubleticketmail": "", "jobtitle": "", "priority": null, "plannedworkmailtype": null, "language": "", "prefix": "", "smsquery": "", "extrainfo": "", "customerrelatedcontacts": [], "contactrelatedcontacts": null, "maincontactrelatedcontacts": null, "siterelatedcontacts": null, "vendorrelatedcontacts": null, "queuecontacts": null, "rowversion": "2020-03-03T19:27:17", "errors": null, "haserrors": false}, "rowversion": "2020-03-04T13:04:02", "errors": null, "haserrors": false}, {"id": 1275, "maintypeid": 5, "customerid": 57610, "relatetypeid": 2, "contactid": 2070, "contact": {"id": 2070, "isgroup": 1, "name": "DUMMY 9 NOC", "infix": "", "lastname": "-", "gender": "", "phone": "", "mobile": "I 2345 6789", "fax": "", "webpage": "", "mail": "IBNOC@DUMMY9.COM", "plannedworkmail": "", "troubleticketmail": "", "jobtitle": "", "priority": null, "plannedworkmailtype": null, "language": "", "prefix": "", "smsquery": "", "extrainfo": "", "customerrelatedcontacts": [], "contactrelatedcontacts": null, "maincontactrelatedcontacts": null, "siterelatedcontacts": null, "vendorrelatedcontacts": null, "queuecontacts": null, "rowversion": "2020-03-03T19:27:17", "errors": null, "haserrors": false}, "rowversion": "2020-03-04T13:04:02", "errors": null, "haserrors": false}], "customerrelatedcontracts": null, "innumbers": null, "managementsystems": null, "customertype": {"id": 1, "name": "COMMERCIAL PEER", "customers": [], "rowversion": "2020-01-31T13:26:02", "errors": null, "haserrors": false}, "contractcustomerrelations": null, "parentcustomer": null, "subcustomers": null, "esimprofiles": null, "esims": null, "country": null, "pwemailsetups": null, "telephonenumbers": null, "telephonenumberranges": null, "rowversion": "2020-01-31T13:35:07", "errors": null, "haserrors": false}, {"id": 57611, "parentcustomerid": null, "name": "DUMMY 10", "fullname": "DUMMY 10", "number": null, "address": "", "phonenumber": "", "faxnumber": "", "accountmanager": "", "accountemail": "", "code": "", "slaid": null, "servicecenter": 0, "servicecentername": "", "website": "", "customertypeid": 1, "pwcodeblue": 0, "pwinformprotectionswitch": 1, "pwinformdown": 1, "pwinformatrisk": 1, "pwinformimpact": 1, "pwinformnoimpact": 1, "pwextrainfo": "", "pwlanguage": "", "countryid": null, "sla": null, "sites": null, "nodes": null, "racks": null, "orders": null, "pwinformedlist": null, "circuits": null, "olocircuits": null, "channelreservations": null, "portreservations": null, "ipranges": null, "numbermanagementlist": null, "customerrelatedcontacts": [{"id": 1154, "maintypeid": 5, "customerid": 57611, "relatetypeid": 2, "contactid": 2408, "contact": {"id": 2408, "isgroup": 1, "name": "DUMMY 10", "infix": "", "lastname": "-", "gender": "", "phone": "", "mobile": "", "fax": "", "webpage": "", "mail": "JNOC@DUMMY10.TV", "plannedworkmail": "", "troubleticketmail": "", "jobtitle": "", "priority": null, "plannedworkmailtype": null, "language": "", "prefix": "", "smsquery": "", "extrainfo": "", "customerrelatedcontacts": [], "contactrelatedcontacts": null, "maincontactrelatedcontacts": null, "siterelatedcontacts": null, "vendorrelatedcontacts": null, "queuecontacts": null, "rowversion": "2020-03-03T19:27:29", "errors": null, "haserrors": false}, "rowversion": "2020-03-04T13:03:50", "errors": null, "haserrors": false}], "customerrelatedcontracts": null, "innumbers": null, "managementsystems": null, "customertype": {"id": 1, "name": "COMMERCIAL PEER", "customers": [], "rowversion": "2020-01-31T13:26:02", "errors": null, "haserrors": false}, "contractcustomerrelations": null, "parentcustomer": null, "subcustomers": null, "esimprofiles": null, "esims": null, "country": null, "pwemailsetups": null, "telephonenumbers": null, "telephonenumberranges": null, "rowversion": "2020-01-31T13:35:07", "errors": null, "haserrors": false}] \ No newline at end of file diff --git a/test/data/ims_otrs_vendor_contact_extra.json b/test/data/ims_otrs_vendor_contact_extra.json index 9d052833a6b198e76a1335768a65413b1367f68e..871c22e3c6573776d0c4c16d29f4a3c9d55e6c44 100644 --- a/test/data/ims_otrs_vendor_contact_extra.json +++ b/test/data/ims_otrs_vendor_contact_extra.json @@ -1,227 +1 @@ -[ - { - "Id": 1288, - "MainTypeId": 1, - "VendorId": 2584, - "RelateTypeId": 2, - "ContactId": 1085, - "Vendor": { - "Id": 2584, - "Name": "DUMMY 10", - "TypeId": 1, - "SlaOnSiteId": null, - "SlaMainTimeToRepairId": null, - "SlaLink": "", - "SlaDescription": "", - "Description": "", - "SpareOwner": "", - "StockLocation": "", - "StockContact": "", - "InternetAddress": "", - "MasterAccount": "", - "EscalationDescription": "", - "Color": "", - "IssuerCodeEsim": null, - "MnoCode": "", - "EumId": "", - "EquipmentDefinitions": null, - "ManagementSystems": null, - "CardCodes": null, - "CardDefinitions": null, - "CableTypes": null, - "VendorRelatedContacts": [], - "VendorMaterialTypes": null, - "Contract": null, - "SlaOnSite": null, - "SlaMainTimeToRepair": null, - "Type": null, - "RowVersion": "2020-01-31T17:18:22", - "Errors": null, - "HasErrors": false - }, - "Contact": { - "Id": 1085, - "IsGroup": 0, - "Name": "K D_FIRST", - "InFix": "K D_INFIX", - "LastName": "K D_LAST", - "Gender": "K GENDER", - "Phone": "K PHONE", - "Mobile": "K MOBILE", - "Fax": "K FAX", - "Webpage": "K WEB", - "Mail": "K@DUMMY10.FR", - "PlannedworkMail": "K PLANNED MAIL", - "TroubleticketMail": "K TT MAIL", - "JobTitle": "K JOB", - "Priority": null, - "PlannedWorkMailType": null, - "Language": "K LANG", - "PreFix": "K PREFIX", - "SmsQuery": "K SMS", - "ExtraInfo": "K EXTRA", - "CustomerRelatedContacts": null, - "ContactRelatedContacts": null, - "MainContactRelatedContacts": null, - "SiteRelatedContacts": null, - "VendorRelatedContacts": [], - "QueueContacts": null, - "RowVersion": "2020-03-03T19:26:42", - "Errors": null, - "HasErrors": false - }, - "RowVersion": "2020-03-04T16:33:09", - "Errors": null, - "HasErrors": false - }, - { - "Id": 1289, - "MainTypeId": 1, - "VendorId": 2584, - "RelateTypeId": 2, - "ContactId": 1092, - "Vendor": { - "Id": 2584, - "Name": "DUMMY 11", - "TypeId": 1, - "SlaOnSiteId": null, - "SlaMainTimeToRepairId": null, - "SlaLink": "", - "SlaDescription": "", - "Description": "", - "SpareOwner": "", - "StockLocation": "", - "StockContact": "", - "InternetAddress": "", - "MasterAccount": "", - "EscalationDescription": "", - "Color": "", - "IssuerCodeEsim": null, - "MnoCode": "", - "EumId": "", - "EquipmentDefinitions": null, - "ManagementSystems": null, - "CardCodes": null, - "CardDefinitions": null, - "CableTypes": null, - "VendorRelatedContacts": [], - "VendorMaterialTypes": null, - "Contract": null, - "SlaOnSite": null, - "SlaMainTimeToRepair": null, - "Type": null, - "RowVersion": "2020-01-31T17:18:22", - "Errors": null, - "HasErrors": false - }, - "Contact": { - "Id": 1092, - "IsGroup": 1, - "Name": "L DUMMY FIRST", - "InFix": "", - "LastName": "-", - "Gender": "", - "Phone": "", - "Mobile": "", - "Fax": "", - "Webpage": "", - "Mail": "L_DUMMY@DUMM11.COM", - "PlannedworkMail": "", - "TroubleticketMail": "", - "JobTitle": "", - "Priority": null, - "PlannedWorkMailType": null, - "Language": "", - "PreFix": "", - "SmsQuery": "", - "ExtraInfo": "", - "CustomerRelatedContacts": null, - "ContactRelatedContacts": null, - "MainContactRelatedContacts": null, - "SiteRelatedContacts": null, - "VendorRelatedContacts": [], - "QueueContacts": null, - "RowVersion": "2020-03-03T19:26:43", - "Errors": null, - "HasErrors": false - }, - "RowVersion": "2020-03-04T16:33:09", - "Errors": null, - "HasErrors": false - }, - { - "Id": 1290, - "MainTypeId": 1, - "VendorId": 2584, - "RelateTypeId": 2, - "ContactId": 1093, - "Vendor": { - "Id": 2584, - "Name": "DUMMY 12", - "TypeId": 1, - "SlaOnSiteId": null, - "SlaMainTimeToRepairId": null, - "SlaLink": "", - "SlaDescription": "", - "Description": "", - "SpareOwner": "", - "StockLocation": "", - "StockContact": "", - "InternetAddress": "", - "MasterAccount": "", - "EscalationDescription": "", - "Color": "", - "IssuerCodeEsim": null, - "MnoCode": "", - "EumId": "", - "EquipmentDefinitions": null, - "ManagementSystems": null, - "CardCodes": null, - "CardDefinitions": null, - "CableTypes": null, - "VendorRelatedContacts": [], - "VendorMaterialTypes": null, - "Contract": null, - "SlaOnSite": null, - "SlaMainTimeToRepair": null, - "Type": null, - "RowVersion": "2020-01-31T17:18:22", - "Errors": null, - "HasErrors": false - }, - "Contact": { - "Id": 1093, - "IsGroup": 1, - "Name": "M FIRST", - "InFix": "", - "LastName": "M LAST", - "Gender": "", - "Phone": "M PHONE", - "Mobile": "", - "Fax": "", - "Webpage": "", - "Mail": "M@DUMMY12.DE", - "PlannedworkMail": "", - "TroubleticketMail": "", - "JobTitle": "", - "Priority": null, - "PlannedWorkMailType": null, - "Language": "", - "PreFix": "", - "SmsQuery": "", - "ExtraInfo": "", - "CustomerRelatedContacts": null, - "ContactRelatedContacts": null, - "MainContactRelatedContacts": null, - "SiteRelatedContacts": null, - "VendorRelatedContacts": [], - "QueueContacts": null, - "RowVersion": "2020-03-03T19:26:43", - "Errors": null, - "HasErrors": false - }, - "RowVersion": "2020-03-04T16:33:09", - "Errors": null, - "HasErrors": false - } -] \ No newline at end of file +[{"id": 1288, "maintypeid": 1, "vendorid": 2584, "relatetypeid": 2, "contactid": 1085, "vendor": {"id": 2584, "name": "DUMMY 10", "typeid": 1, "slaonsiteid": null, "slamaintimetorepairid": null, "slalink": "", "sladescription": "", "description": "", "spareowner": "", "stocklocation": "", "stockcontact": "", "internetaddress": "", "masteraccount": "", "escalationdescription": "", "color": "", "issuercodeesim": null, "mnocode": "", "eumid": "", "equipmentdefinitions": null, "managementsystems": null, "cardcodes": null, "carddefinitions": null, "cabletypes": null, "vendorrelatedcontacts": [], "vendormaterialtypes": null, "contract": null, "slaonsite": null, "slamaintimetorepair": null, "type": null, "rowversion": "2020-01-31T17:18:22", "errors": null, "haserrors": false}, "contact": {"id": 1085, "isgroup": 0, "name": "K D_FIRST", "infix": "K D_INFIX", "lastname": "K D_LAST", "gender": "K GENDER", "phone": "K PHONE", "mobile": "K MOBILE", "fax": "K FAX", "webpage": "K WEB", "mail": "K@DUMMY10.FR", "plannedworkmail": "K PLANNED MAIL", "troubleticketmail": "K TT MAIL", "jobtitle": "K JOB", "priority": null, "plannedworkmailtype": null, "language": "K LANG", "prefix": "K PREFIX", "smsquery": "K SMS", "extrainfo": "K EXTRA", "customerrelatedcontacts": null, "contactrelatedcontacts": null, "maincontactrelatedcontacts": null, "siterelatedcontacts": null, "vendorrelatedcontacts": [], "queuecontacts": null, "rowversion": "2020-03-03T19:26:42", "errors": null, "haserrors": false}, "rowversion": "2020-03-04T16:33:09", "errors": null, "haserrors": false}, {"id": 1289, "maintypeid": 1, "vendorid": 2584, "relatetypeid": 2, "contactid": 1092, "vendor": {"id": 2584, "name": "DUMMY 11", "typeid": 1, "slaonsiteid": null, "slamaintimetorepairid": null, "slalink": "", "sladescription": "", "description": "", "spareowner": "", "stocklocation": "", "stockcontact": "", "internetaddress": "", "masteraccount": "", "escalationdescription": "", "color": "", "issuercodeesim": null, "mnocode": "", "eumid": "", "equipmentdefinitions": null, "managementsystems": null, "cardcodes": null, "carddefinitions": null, "cabletypes": null, "vendorrelatedcontacts": [], "vendormaterialtypes": null, "contract": null, "slaonsite": null, "slamaintimetorepair": null, "type": null, "rowversion": "2020-01-31T17:18:22", "errors": null, "haserrors": false}, "contact": {"id": 1092, "isgroup": 1, "name": "L DUMMY FIRST", "infix": "", "lastname": "-", "gender": "", "phone": "", "mobile": "", "fax": "", "webpage": "", "mail": "L_DUMMY@DUMM11.COM", "plannedworkmail": "", "troubleticketmail": "", "jobtitle": "", "priority": null, "plannedworkmailtype": null, "language": "", "prefix": "", "smsquery": "", "extrainfo": "", "customerrelatedcontacts": null, "contactrelatedcontacts": null, "maincontactrelatedcontacts": null, "siterelatedcontacts": null, "vendorrelatedcontacts": [], "queuecontacts": null, "rowversion": "2020-03-03T19:26:43", "errors": null, "haserrors": false}, "rowversion": "2020-03-04T16:33:09", "errors": null, "haserrors": false}, {"id": 1290, "maintypeid": 1, "vendorid": 2584, "relatetypeid": 2, "contactid": 1093, "vendor": {"id": 2584, "name": "DUMMY 12", "typeid": 1, "slaonsiteid": null, "slamaintimetorepairid": null, "slalink": "", "sladescription": "", "description": "", "spareowner": "", "stocklocation": "", "stockcontact": "", "internetaddress": "", "masteraccount": "", "escalationdescription": "", "color": "", "issuercodeesim": null, "mnocode": "", "eumid": "", "equipmentdefinitions": null, "managementsystems": null, "cardcodes": null, "carddefinitions": null, "cabletypes": null, "vendorrelatedcontacts": [], "vendormaterialtypes": null, "contract": null, "slaonsite": null, "slamaintimetorepair": null, "type": null, "rowversion": "2020-01-31T17:18:22", "errors": null, "haserrors": false}, "contact": {"id": 1093, "isgroup": 1, "name": "M FIRST", "infix": "", "lastname": "M LAST", "gender": "", "phone": "M PHONE", "mobile": "", "fax": "", "webpage": "", "mail": "M@DUMMY12.DE", "plannedworkmail": "", "troubleticketmail": "", "jobtitle": "", "priority": null, "plannedworkmailtype": null, "language": "", "prefix": "", "smsquery": "", "extrainfo": "", "customerrelatedcontacts": null, "contactrelatedcontacts": null, "maincontactrelatedcontacts": null, "siterelatedcontacts": null, "vendorrelatedcontacts": [], "queuecontacts": null, "rowversion": "2020-03-03T19:26:43", "errors": null, "haserrors": false}, "rowversion": "2020-03-04T16:33:09", "errors": null, "haserrors": false}] \ No newline at end of file diff --git a/test/test_ims.py b/test/test_ims.py index 773ef0dbfbda489b15d0e52a3fc34d778d288c3c..0f4ed193c21c1a5e01905906de97e5805d9bc173 100644 --- a/test/test_ims.py +++ b/test/test_ims.py @@ -17,6 +17,7 @@ def test_ims_class_login(mocker): mock_post = mocker.patch('inventory_provider.db.ims.requests.post') mock_get = mocker.patch('inventory_provider.db.ims.requests.get') mock_post.return_value = MockResponse("my_bearer_token", 200) + mock_post.return_value.text = "my_bearer_token" ds = inventory_provider.db.ims.IMS( 'dummy_base', 'dummy_username', 'dummy_password') @@ -25,7 +26,7 @@ def test_ims_class_login(mocker): 'dummy_base/login', auth=('dummy_username', 'dummy_password')) mock_get.assert_called_once_with( 'dummy_base/ims/Node/1234', - headers={'Authorization': 'my_bearer_token'}, + headers={'Authorization': 'Bearer my_bearer_token'}, params=None) @@ -37,7 +38,7 @@ def test_ims_class_entity_by_id(mocker): ds.get_entity_by_id('Node', 1234) mock_get.assert_called_once_with( 'dummy_base/ims/Node/1234', - headers={'Authorization': 'dummy_bt'}, + headers={'Authorization': 'Bearer dummy_bt'}, params=None) @@ -49,7 +50,7 @@ def test_ims_class_entity_by_name(mocker): ds.get_entity_by_name('Node', 'dummy_name') mock_get.assert_called_once_with( 'dummy_base/ims/Node/byname/dummy_name', - headers={'Authorization': 'dummy_bt'}, + headers={'Authorization': 'Bearer dummy_bt'}, params=None) @@ -61,7 +62,7 @@ def test_ims_class_filtered_entities(mocker): list(ds.get_filtered_entities('Node', 'dummy_param=dummy value')) mock_get.assert_called_once_with( 'dummy_base/ims/Node/filtered/dummy_param=dummy value', - headers={'Authorization': 'dummy_bt'}, + headers={'Authorization': 'Bearer dummy_bt'}, params={ 'paginatorStartElement': 0, 'paginatorNumberOfElements': @@ -81,14 +82,14 @@ def test_ims_class_filtered_entities(mocker): res = list(ds.get_filtered_entities('Node', 'dummy_param=dummy value')) mock_multi_get.assert_any_call( 'dummy_base/ims/Node/filtered/dummy_param=dummy value', - headers={'Authorization': 'dummy_bt'}, + headers={'Authorization': 'Bearer dummy_bt'}, params={ 'paginatorStartElement': 0, 'paginatorNumberOfElements': 2 }) mock_multi_get.assert_any_call( 'dummy_base/ims/Node/filtered/dummy_param=dummy value', - headers={'Authorization': 'dummy_bt'}, + headers={'Authorization': 'Bearer dummy_bt'}, params={ 'paginatorStartElement': 2, 'paginatorNumberOfElements': 2 @@ -105,7 +106,7 @@ def test_ims_class_get_all_entities(mocker): list(ds.get_all_entities('Node')) mock_get.assert_called_once_with( 'dummy_base/ims/Node/filtered/Id <> 0', - headers={'Authorization': 'dummy_bt'}, + headers={'Authorization': 'Bearer dummy_bt'}, params={ 'paginatorStartElement': 0, 'paginatorNumberOfElements': @@ -121,7 +122,7 @@ def test_ims_class_navigation_properties(mocker): ds.get_entity_by_id('Node', 1234, navigation_properties=[1, 2, 3]) mock_get.assert_called_with( 'dummy_base/ims/Node/1234', - headers={'Authorization': 'dummy_bt'}, + headers={'Authorization': 'Bearer dummy_bt'}, params={'navigationproperty': 6})