From 7aa587fd873947ef7cb5fea02ed47f5752a4dd2b Mon Sep 17 00:00:00 2001 From: Erik Reid <erik.reid@geant.org> Date: Fri, 12 Apr 2019 11:10:22 +0200 Subject: [PATCH] updated with pop & coriant protocol specs --- README.md | 241 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 182 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index 095672e5..8c64ad0f 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ The following resources can be requested from the webservice. Any non-empty responses are JSON formatted messages. -* `/data/version` +* /data/version The response will be an object containing the module and protocol versions of the @@ -241,62 +241,58 @@ Any non-empty responses are JSON formatted messages. } ``` -* /data/snmp/*`hostname`* +* /data/pop/*`name`* - The response will be a list of information about - the interfaces discovered through snmp - queries on the requested host - and will be formatted as follows: + Returns location information for the equipment identified + by `name`. + + The response will be formatted as follows: ```json { "$schema": "http://json-schema.org/draft-07/schema#", - "type": "array", - "items": { - "type": "object", - "properties": { - "index": {"type": "string"}, - "name": {"type": "string"} - }, - "required": ["index", "name"], - "additionalProperties": False - } - } - ``` + "type": "object", -* /data/bgp/*`hostname`* + "definitions": { + "pop-info": { + "type": "object", + "properties": { + "name": {"type": "string"}, + "abbreviation": {"type": "string"}, + "country": {"type": "string"}, + "city": {"type": "string"}, + "longitude": {"type": "number"}, + "latitude": {"type": "number"} + }, + "required": [ + "name", + "abbreviation", + "country", + "city", + "longitude", + "latitude" + ], + "additionalProperties": False + }, + "equipment-info": { + "type": "object", + "properties": { + 'equipment-name': {"type": "string"}, + 'status': {"type": "string"}, + 'pop': {"$ref": "#/definitions/pop-info"} + }, + "required": [ + "equipment-name", + "status", + "pop" + ], + "additionalProperties": False - The response will be a list of information about - the bgp peerings configured for the requested host - and will be formatted as follows: + } + }, - ```json - { - "$schema": "http://json-schema.org/draft-07/schema#", "type": "array", - "items": { - "type": "object", - "properties": { - "description": {"type": "string"}, - "as": { - "type": "object", - "properties": { - "peer": { - "type": "string", - "pattern": r'^\d+$' - }, - "local": { - "type": "string", - "pattern": r'^\d+$' - }, - }, - "required": ["peer", "local"], - "additionalProperties": False - }, - }, - "required": ["description", "as"], - "additionalProperties": False - } + "items": {"$ref": "#/definitions/equipment-info"} } ``` @@ -316,7 +312,7 @@ Any non-empty responses are JSON formatted messages. } ``` -* /jobs/reload-router-config/<equipment-name> +* /jobs/reload-router-config/*`equipment-name`* This resource updates the inventory network data for the identified juniper device. This function completes @@ -324,7 +320,7 @@ Any non-empty responses are JSON formatted messages. `/jobs/update`, except the return contains exactly one task id. -* /jobs/check-task-status/<task-id>" +* /jobs/check-task-status/*`task-id`* This resource returns the current status of an asynchronous task started by `/jobs/update` @@ -348,13 +344,6 @@ Any non-empty responses are JSON formatted messages. } ``` -* /jobs/update-interface-statuses - - This resource updates the last known statuses of all interfaces extracted - from the external inventory system, status information is retrieved from the - alarms database - - * /classifier/juniper-link-info/*`source-equipment`*/*`source-interface`* The source-equipment is the equipment that causes the trap, not the NMS that @@ -666,10 +655,83 @@ Any non-empty responses are JSON formatted messages. } ``` +* /classifier/coriant-info/*`equipment_name`*/*`card_id`*/*`port_number`* + + Returns information about the effective path + of a coriant card/port combination. + + The response will be formatted according to the following schema: + + ```json + { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + + "definitions": { + "pop-info": { + "type": "object", + "properties": { + "absid": {"type": "integer"}, + "name": {"type": "string"}, + "abbreviation": {"type": "string"}, + "country": {"type": "string"}, + "city": {"type": "string"}, + "longitude": {"type": "number"}, + "latitude": {"type": "number"} + }, + "required": [ + "absid", + "name", + "abbreviation", + "country", + "city", + "longitude", + "latitude" + ], + "additionalProperties": False + }, + "endpoint": { + "type": "object", + "properties": { + "name": {"type": "string"}, + "card id": {"type": "string"}, + "port number": {"type": "string"}, + "pop": {"$ref": "#/definitions/pop-info"} + }, + "required": ["name", "port number", "pop"], + "additionalProperties": False + } + }, + + "type": "object", + "properties": { + 'absid': {"type": "integer"}, + 'category': {"type": "string"}, + 'circuit_type': {"type": "string"}, + 'service_type': {"type": "string"}, + 'peering_type': {"type": "string"}, + 'status': {"type": "string"}, + 'name': {"type": "string"}, + 'a': {"$ref": "#/definitions/endpoint"}, + 'b': {"$ref": "#/definitions/endpoint"} + }, + "required": [ + "absid", + "category", + "circuit_type", + "service_type", + "peering_type", + "status", + "a", + "b"], + "additionalProperties": False + } + ``` + * /poller/interfaces/*`hostname`* - The response will be the list of active interfaces on the + The response will be the list of active interfac`es on the router `hostname`. Each element of the returned list contains information necessary for setting up snmp throughput counter polling. @@ -716,7 +778,9 @@ Any non-empty responses are JSON formatted messages. ### Testing utilities The following routes are only available if the server -was started with the `ENABLE_TESTING_ROUTES` flag. +was started with the `ENABLE_TESTING_ROUTES` flag. These routes +are present only for testing, or for deprectated routes that +are intended to be deleted. * `/testing/flushdb` @@ -739,6 +803,65 @@ was started with the `ENABLE_TESTING_ROUTES` flag. ``` +* /data/snmp/*`hostname`* + + The response will be a list of information about + the interfaces discovered through snmp + queries on the requested host + and will be formatted as follows: + + ```json + { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "array", + "items": { + "type": "object", + "properties": { + "index": {"type": "string"}, + "name": {"type": "string"} + }, + "required": ["index", "name"], + "additionalProperties": False + } + } + ``` + +* /data/bgp/*`hostname`* + + The response will be a list of information about + the bgp peerings configured for the requested host + and will be formatted as follows: + + ```json + { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "array", + "items": { + "type": "object", + "properties": { + "description": {"type": "string"}, + "as": { + "type": "object", + "properties": { + "peer": { + "type": "string", + "pattern": r'^\d+$' + }, + "local": { + "type": "string", + "pattern": r'^\d+$' + }, + }, + "required": ["peer", "local"], + "additionalProperties": False + }, + }, + "required": ["description", "as"], + "additionalProperties": False + } + } + ``` + ## Backend (Redis) Storage Schema * `netconf:<hostname>` -- GitLab