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

updated gws-direct schema

parent 093132bd
No related branches found
No related tags found
No related merge requests found
......@@ -92,44 +92,46 @@ CONFIG_SCHEMA = {
'required': ['address', 'network', 'interface', 'router'],
'additionalProperties': False
},
'gws-direct-snmp-counter': {
'oid': {
'type': 'string',
'pattern': r'^(\d+\.)*\d+$'
},
'gws-direct-counters': {
'type': 'object',
'properties': {
'hostname': {'type': 'string'},
'community': {'type': 'string'},
'oid': {
'type': 'string',
'pattern': r'^(\d+\.)*\d+$'
}
'discards_in': {'$ref': '#/definitions/oid'},
'discards_out': {'$ref': '#/definitions/oid'},
'errors_in': {'$ref': '#/definitions/oid'},
'errors_out': {'$ref': '#/definitions/oid'},
'traffic_in': {'$ref': '#/definitions/oid'},
'traffic_out': {'$ref': '#/definitions/oid'},
},
'required': ['hostname', 'community', 'oid'],
'additionalProperties': False
},
'gws-direct-snmp-counter-list': {
'type': 'array',
'items': {'$ref': '#/definitions/gws-direct-snmp-counter'},
'minItems': 1
'gws-direct-interface': {
'type': 'object',
'properties': {
'tag': {'type': 'string'},
'counters': {'$ref': '#/definitions/gws-direct-counters'}
},
'required': ['tag', 'counters'],
'additionalProperties': False
},
'gws-direct-counters': {
'gws-direct-host': {
'type': 'object',
'properties': {
'traffic_in': {
'$ref': '#/definitions/gws-direct-snmp-counter-list'},
'traffic_out': {
'$ref': '#/definitions/gws-direct-snmp-counter-list'},
'discards_in': {
'$ref': '#/definitions/gws-direct-snmp-counter-list'},
'discards_out': {
'$ref': '#/definitions/gws-direct-snmp-counter-list'},
'errors_in': {
'$ref': '#/definitions/gws-direct-snmp-counter-list'},
'errors_out': {
'$ref': '#/definitions/gws-direct-snmp-counter-list'}
'hostname': {'type': 'string'},
'community': {'type': 'string'},
'interfaces': {
'type': 'array',
'items': {'$ref': '#/definitions/gws-direct-interface'},
'minItems': 1
}
},
'required': ['traffic_in', 'traffic_out'],
'required': ['hostname', 'community', 'interfaces'],
'additionalProperties': False
},
'gws-direct-nren-isp-counters': {
'gws-direct-nren-isp': {
'type': 'object',
'properties': {
'nren': {'type': 'string'},
......@@ -137,14 +139,18 @@ CONFIG_SCHEMA = {
'type': 'string',
'enum': ['Cogent', 'Telia', 'Century Link']
},
'counters': {'$ref': '#/definitions/gws-direct-counters'},
'hosts': {
'type': 'array',
'items': {'$ref': '#/definitions/gws-direct-host'},
'minItems': 1
}
},
'required': ['nren', 'isp', 'counters'],
'required': ['nren', 'isp', 'hosts'],
'additionalProperties': False
},
'gws-direct': {
'type': 'array',
'items': {'$ref': '#/definitions/gws-direct-nren-isp-counters'}
'items': {'$ref': '#/definitions/gws-direct-nren-isp'}
},
},
......
......@@ -153,38 +153,46 @@ GWS_DIRECT_DATA_SCHEMA = {
'$schema': 'http://json-schema.org/draft-07/schema#',
'definitions': {
'snmp-counter': {
'oid': {
'type': 'string',
'pattern': r'^(\d+\.)*\d+$'
},
'counters': {
'type': 'object',
'properties': {
'hostname': {'type': 'string'},
'community': {'type': 'string'},
'oid': {
'type': 'string',
'pattern': r'^(\d+\.)*\d+$'
}
'discards_in': {'$ref': '#/definitions/oid'},
'discards_out': {'$ref': '#/definitions/oid'},
'errors_in': {'$ref': '#/definitions/oid'},
'errors_out': {'$ref': '#/definitions/oid'},
'traffic_in': {'$ref': '#/definitions/oid'},
'traffic_out': {'$ref': '#/definitions/oid'},
},
'required': ['hostname', 'community', 'oid'],
'additionalProperties': False
},
'snmp-counter-list': {
'type': 'array',
'items': {'$ref': '#/definitions/snmp-counter'},
'minItems': 1
'interface': {
'type': 'object',
'properties': {
'tag': {'type': 'string'},
'counters': {'$ref': '#/definitions/counters'}
},
'required': ['tag', 'counters'],
'additionalProperties': False
},
'isp-counters': {
'host': {
'type': 'object',
'properties': {
'traffic_in': {'$ref': '#/definitions/snmp-counter-list'},
'traffic_out': {'$ref': '#/definitions/snmp-counter-list'},
'discards_in': {'$ref': '#/definitions/snmp-counter-list'},
'discards_out': {'$ref': '#/definitions/snmp-counter-list'},
'errors_in': {'$ref': '#/definitions/snmp-counter-list'},
'errors_out': {'$ref': '#/definitions/snmp-counter-list'}
'hostname': {'type': 'string'},
'community': {'type': 'string'},
'interfaces': {
'type': 'array',
'items': {'$ref': '#/definitions/interface'},
'minItems': 1
}
},
'required': ['traffic_in', 'traffic_out'],
'required': ['hostname', 'community', 'interfaces'],
'additionalProperties': False
},
'nren-isp-direct-counters': {
'nren-isp': {
'type': 'object',
'properties': {
'nren': {'type': 'string'},
......@@ -192,15 +200,19 @@ GWS_DIRECT_DATA_SCHEMA = {
'type': 'string',
'enum': ['Cogent', 'Telia', 'Century Link']
},
'counters': {'$ref': '#/definitions/isp-counters'},
'hosts': {
'type': 'array',
'items': {'$ref': '#/definitions/host'},
'minItems': 1
}
},
'required': ['nren', 'isp', 'counters'],
'required': ['nren', 'isp', 'hosts'],
'additionalProperties': False
}
},
'type': 'array',
'items': {'$ref': '#/definitions/nren-isp-direct-counters'}
'items': {'$ref': '#/definitions/nren-isp'}
}
......
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