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 = {
'traffic_out'
]
},
'oid': {'$ref': '#/definitions/oid'}
'oid': {'$ref': '#/definitions/oid'},
'community': {'type': 'string'}
},
'required': ['field', 'oid'],
'required': ['field', 'oid', 'community'],
'additionalProperties': False
},
'interface-counters': {
......@@ -184,7 +185,6 @@ GWS_DIRECT_DATA_SCHEMA = {
'enum': ['Cogent', 'Telia', 'Century Link']
},
'hostname': {'type': 'string'},
'community': {'type': 'string'},
'tag': {'type': 'string'},
'counters': {
'type': 'array',
......@@ -193,7 +193,7 @@ GWS_DIRECT_DATA_SCHEMA = {
}
},
'required': [
'nren', 'isp', 'hostname', 'community', 'tag', 'counters'],
'nren', 'isp', 'hostname', 'tag', 'counters'],
'additionalProperties': False
}
},
......@@ -622,8 +622,10 @@ def gws_direct():
.. asjson::
inventory_provider.routes.poller.GWS_DIRECT_DATA_SCHEMA
This method returns essentially hard-coded data,
based on the information in POL1-422.
WARNING: interface tags in the `gws-direct` section of the config data
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:
"""
......@@ -645,11 +647,13 @@ def gws_direct():
'nren': nren_isp['nren'],
'isp': nren_isp['isp'],
'hostname': host['hostname'],
'community': host['community'],
'tag': ifc['tag'],
'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()))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment