Skip to content
Snippets Groups Projects
Commit d97b4a22 authored by Erik Reid's avatar Erik Reid
Browse files

was supposed to be in previous feature

parent dcc7eb5c
No related branches found
No related tags found
No related merge requests found
...@@ -170,9 +170,10 @@ GWS_DIRECT_DATA_SCHEMA = { ...@@ -170,9 +170,10 @@ GWS_DIRECT_DATA_SCHEMA = {
'traffic_out' 'traffic_out'
] ]
}, },
'oid': {'$ref': '#/definitions/oid'} 'oid': {'$ref': '#/definitions/oid'},
'community': {'type': 'string'}
}, },
'required': ['field', 'oid'], 'required': ['field', 'oid', 'community'],
'additionalProperties': False 'additionalProperties': False
}, },
'interface-counters': { 'interface-counters': {
...@@ -184,7 +185,6 @@ GWS_DIRECT_DATA_SCHEMA = { ...@@ -184,7 +185,6 @@ GWS_DIRECT_DATA_SCHEMA = {
'enum': ['Cogent', 'Telia', 'Century Link'] 'enum': ['Cogent', 'Telia', 'Century Link']
}, },
'hostname': {'type': 'string'}, 'hostname': {'type': 'string'},
'community': {'type': 'string'},
'tag': {'type': 'string'}, 'tag': {'type': 'string'},
'counters': { 'counters': {
'type': 'array', 'type': 'array',
...@@ -193,7 +193,7 @@ GWS_DIRECT_DATA_SCHEMA = { ...@@ -193,7 +193,7 @@ GWS_DIRECT_DATA_SCHEMA = {
} }
}, },
'required': [ 'required': [
'nren', 'isp', 'hostname', 'community', 'tag', 'counters'], 'nren', 'isp', 'hostname', 'tag', 'counters'],
'additionalProperties': False 'additionalProperties': False
} }
}, },
...@@ -622,8 +622,10 @@ def gws_direct(): ...@@ -622,8 +622,10 @@ def gws_direct():
.. asjson:: .. asjson::
inventory_provider.routes.poller.GWS_DIRECT_DATA_SCHEMA inventory_provider.routes.poller.GWS_DIRECT_DATA_SCHEMA
This method returns essentially hard-coded data, WARNING: interface tags in the `gws-direct` section of the config data
based on the information in POL1-422. should be unique for each nren/isp/hostname combination. i.e. if there
are multiple community strings in use for a particular host, then please
keep the interface tags unique.
:return: :return:
""" """
...@@ -645,11 +647,13 @@ def gws_direct(): ...@@ -645,11 +647,13 @@ def gws_direct():
'nren': nren_isp['nren'], 'nren': nren_isp['nren'],
'isp': nren_isp['isp'], 'isp': nren_isp['isp'],
'hostname': host['hostname'], 'hostname': host['hostname'],
'community': host['community'],
'tag': ifc['tag'], 'tag': ifc['tag'],
'counters': [ 'counters': [
{'field': k, 'oid': v} {
for k, v in ifc['counters'].items()] 'field': k,
'oid': v,
'community': host['community']
} for k, v in ifc['counters'].items()]
} }
result = json.dumps(list(_interfaces())) result = json.dumps(list(_interfaces()))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment