diff --git a/README.md b/README.md index e02b06014b530972ce2ccaf8b0a4ffe2d8c1a69a..4e85d1f04d4cb93e9acbf4121d9c44d404526d70 100644 --- a/README.md +++ b/README.md @@ -360,13 +360,107 @@ Any non-empty responses are JSON formatted messages. The source-equipment is the equipment that causes the trap, not the NMS that sends it. - The response will be an object containing the metadata + The response will be an object containing the + metadata, formatted according to the following schema: ```json { "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object" - } + "type": "object", + + "definitions": { + "ip-address": { + "type": "string", + "oneOf": [ + {"pattern": r'^(\d+\.){3}\d+$'}, + {"pattern": r'^([a-f\d]{4}:){7}[a-f\d]{4}$'} + ] + }, + "ipv4-interface-address": { + "type": "string", + "pattern": r'^(\d+\.){3}\d+/\d+$' + }, + "ipv6-interface-address": { + "type": "string", + "pattern": r'^[a-f\d:]+/\d+$' + }, + "interface-info": { + "type": "object", + "properties": { + "name": {"type": "string"}, + "description": {"type": "string"}, + "ipv4": { + "type": "array", + "items": {"$ref": "#/definitions/ipv4-interface-address"} + }, + "ipv6": { + "type": "array", + "items": {"$ref": "#/definitions/ipv6-interface-address"} + } + }, + "required": ["name", "description", "ipv4", "ipv6"], + "additionalProperties": False + }, + "service-info": { + "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"}, + "other_end_equipment": {"type": "string"}, + "port": {"type": "string"}, + "logical_unit": { + "oneOf": [ + {"type": "integer"}, + {"type": "string", "maxLength": 0} + ] + }, + "other_end_logical_unit": { + "oneOf": [ + {"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"}, + "other_end_card_id": {"type": "string"}, + "interface_name": {"type": "string"}, + "other_end_interface_name": {"type": "string"} + }, + "additionalProperties": False + } + }, + + "type": "object", + "properties": { + "services": { + "type": "array", + "items": {"$ref": "#/definitions/service-info"} + }, + "interface": {"$ref": "#/definitions/interface-info"}, + "related-services": { + "type": "array", + "items": {"$ref": "#/definitions/service-info"} + } + }, + "additionalProperties": False + } ``` * /classifier/peer-info/*`address`*