From 0599f9e59de30b375cc948efba5724a1f4b07c91 Mon Sep 17 00:00:00 2001 From: Robert Latta <robert.latta@geant.org> Date: Mon, 24 Feb 2020 10:09:33 +0000 Subject: [PATCH] added additional Navigation Properties; added RelateType --- inventory_provider/db/ims.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/inventory_provider/db/ims.py b/inventory_provider/db/ims.py index 832c39b6..6f952413 100644 --- a/inventory_provider/db/ims.py +++ b/inventory_provider/db/ims.py @@ -11,6 +11,17 @@ from enum import Enum CIRCUIT_PROPERTIES = { 'InternalPorts': 1024 } +# http://149.210.162.190:81/ImsVersions/4.19.9/html/dbc969d0-e735-132e-6281-f724c6d7da64.htm # NOQA +CONTACT_PROPERTIES = { + 'SiteRelatedContacts': 8, + 'CustomerRelatedContacts': 16, + 'GroupRelatedContacts': 32, + 'VendorRelatedContacts': 64 +} +# http://149.210.162.190:81/ImsVersions/4.19.9/html/5a40472e-48ee-c120-0a36-52a85d52127c.htm # NOQA +CUSTOMER_PROPERTIES = { + 'CustomerRelatedContacts': 32768 +} # http://149.210.162.190:81/ImsVersions/4.19.9/html/2d27d509-77cb-537d-3ffa-796de7e82af8.htm # noqa NODE_PROPERTIES = { 'equipment definition': 16, @@ -45,6 +56,15 @@ class InventoryStatus(Enum): READY_FOR_CEASURE = 7 +class RelateType(Enum): + VENDOR = 1 + CONTACT = 2 + GROUP = 3 + CONTRACT = 4 + CUSTOMER = 5 + SITE = 6 + + class IMSError(Exception): pass @@ -125,6 +145,7 @@ class IMS(object): if j is None: # Sometime the API returns a 200 response but with no # body when the token has expired e.g. on a filtered query + # This also happens when there is an error in the query :( return True if j and isinstance(j, dict) and \ j.get('HasErrors', False) and 'guid expired' in \ -- GitLab