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

draft of redis storage schema

some issues to fix ...
parent 2ba56a14
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,8 @@
2. [Configuration]
3. [Running this module]
4. [Protocol specification]
5. [backend (Redis) storage schema]
# Inventory Provider
......@@ -353,3 +355,242 @@ Any non-empty responses are JSON formatted messages.
}
}
```
## backend (Redis) storage schema
`netconf:<hostname>`
* key example
* `netconf:mx1.ams.nl.geant.net`
* value format
* cf. validation in `inventory_provider.juniper.load_config`
`snmp-interfaces:<hostname>`
* key example:
* `snmp-interfaces:mx1.lon2.uk.geant.net`
* value schema
```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"v4ifc": {
"type": "object",
"properties": {
"v4Address": {
"type": "string",
"pattern": "^(\d+\.){3}\d+$"
},
"v4Mask": {
"type": "string",
"pattern": "^(\d+\.){3}\d+$"
},
"v4InterfaceName": {:"type", "string"},
"index": {`
"type": "string",
"pattern": "^\d+$"
}
},
"required": [
"v4Address", "v4Mask", "v4InterfaceName", "index],
"additionalProperties": False
},
"v6ifc": {
"type": "object",
"properties": {
"v6Address": {
"type": "string",
"pattern": "^[\d:]+$"
},
"v6Mask": {
"type": "string",
"pattern": "^\d+$"
},
"v6InterfaceName": {:"type", "string"},
"index": {`
"type": "string",
"pattern": "^\d+$"
}
},
"required": [
"v6Address", "v6Mask", "v6InterfaceName", "index],
"additionalProperties": False
}
},
"type": "array",
"items": {
"anyOf": {
"$ref": "#/definitions/v4Ifc",
"$ref": "#/definitions/v6Ifc"
}
}
}
```
`opsdb:interface_services:<equipment name>:<interface name>`
* key examples
* `opsdb:interface_services:mx1.ams.nl.geant.net:ae15.1103`
* `opsdb:interface_services:Lab node 2:1-1/5`
* value schema
```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"interface": {
"type": "object",
"properties": {
"id": {"type": "integer"},
"name": {"type": "string"},
"status": {
"type": "string",
"enum": ["operational", "installed", "planned", "ordered"]
},
"circuit_type": {
"type": "string",
"enum": ["path", "service", "l2circuit"]
},
"service_type": {"type": "string"},
"project": {"type": "string"},
"equipment": {"type": "string"},
"port": {
"anyOf": [
{
"type": "string",
"pattern": r'^[\d:]+$'
},
{
"type": "string",
"enum": ['console']
}
]
},
"logical_unit": {
"anyOf": [
{"type": "integer"},
{"type": "string", "maxLength": 0}
]
},
"manufacturer": {
"type": "string",
"enum": ["juniper", "coriant", "infinera",
"cisco", "hewlett packard",
"corsa", "graham smith uk ltd",
"unknown", ""]
},
"card_id": {"type": "string"},
"interface_name": {"type": "string"}
},
"required": ["id", "name", "status",
"circuit_type", "service_type",
"project", "equipment", "port",
"logical_unit", "manufacturer",
"card_id", "interface_name"],
"additionalProperties": False
}
},
"type": "object",
"patternProperties": {
"^.+$": {
"type": "array",
"items": {"$ref": "#/definitions/interface"}
}
}
}
```
`opsdb:location:<equipment name>`
* key examples
* `opsdb:location:mx1.ams.nl.geant.net`
* `opsdb:location:taas.srv1.par.fr.geant.net`
* `opsdb:location:A test EX 3-Oct`
* value schema
```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"absid": {"type": "integer"},
"equipment_name": {"type": "string"},
"pop_name": {"type": "string"},
"pop_abbreviation": {"type": "string"},
"pop_site_id": {"type": "string"},
"country": {"type": "string"},
"longitude": {"type": "number"},
"latitude": {"type": "number"},
},
"required": ["absid", "equipment_name",
"pop_name", "pop_abbreviation", "pop_site_id",
"country", "longitude", "latitude"],
"additionalProperties": False
}
}
```
`opsdb:services:children:<circuit db id>`
`opsdb:services:parents:<circuit db id>`
* key examples
* `opsdb:services:children:12363`
* `opsdb:services:parents:14407`
* value schema
```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"circuit_relationship": {
"type": "object",
"properties": {
"parent_circuit": {"type": "string"},
"parent_circuit_id": {"type": "integer"},
"parent_circuit_status": {
"type": "string",
"enum": ["operational", "installed", "planned", "ordered"]
},
"child_circuit": {"type": "string"},
"child_circuit_id": {"type": "integer"},
"child_circuit_status": {
"type": "string",
"enum": ["operational", "installed", "planned", "ordered"]
}
"circuit_group": {"type": "integer"},
},
"required": [
"parent_circuit",
"parent_circuit_id",
"parent_circuit_status",
"child_circuit",
"child_circuit_id",
"child_circuit_status",
"circuit_group"
],
"additionalProperties": False
}
},
"type": "object",
"patternProperties": {
"^\d+$": {
"type": "array",
"items": {"$ref": "#/definitions/circuit_relationship"}
}
}
}
```
`alarmsdb:interface_status:<equipment name>:<interface name>`
* key examples
* `alarmsdb:interface_status:Lab node 1:1-1/3`
* `alarmsdb:interface_status:mx1.ams.nl.geant.net:ae15.1500`
* valid values:
* `unknown`
* `up`
* `down`
\ No newline at end of file
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