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

added locations to response schema

parent 11b1841f
Branches
Tags
No related merge requests found
......@@ -6,74 +6,103 @@ DEFAULT_REQUEST_HEADERS = {
"Accept": ["application/json"]
}
LOCATIONS_DEFINITIONS = {
"location-endpoint": {
"type": "object",
"properties": {
"equipment": {"type": "string"},
"name": {"type": "string"},
"abbreviation": {"type": "string"}
},
"required": ["equipment", "name", "abbreviation"],
"additionalProperties": False
},
"location": {
"type": "object",
"properties": {
"a": {"$ref": "#/definitions/location-endpoint"},
"b": {"$ref": "#/definitions/location-endpoint"}
},
"required": ["a"],
"additionalProperties": False
},
"locations-list": {
"type": "array",
"items": {"$ref": "#/definitions/location"}
}
}
INFINERA_LINK_METADATA_DEFINITIONS = {
"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"},
"pop_name": {"type": "string"},
"pop_abbreviation": {"type": "string"},
"other_end_pop_name": {"type": "string"},
"other_end_pop_abbreviation": {"type": "string"},
"equipment": {"type": "string"},
"other_end_equipment": {"type": "string"},
"port": {"type": "string"},
"other_end_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
},
"geant-lambda": {
"type": "object",
"properties": {
"id": {"type": "integer"},
"name": {"type": "string"},
"project": {"type": "string"},
"status": {
"type": "string",
"enum": ["operational", "installed", "planned", "ordered"]
},
},
"additionalProperties": False
}
}
INFINERA_LINK_METADATA = {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"definitions": {
"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"},
"pop_name": {"type": "string"},
"pop_abbreviation": {"type": "string"},
"other_end_pop_name": {"type": "string"},
"other_end_pop_abbreviation": {"type": "string"},
"equipment": {"type": "string"},
"other_end_equipment": {"type": "string"},
"port": {"type": "string"},
"other_end_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
},
"geant-lambda": {
"type": "object",
"properties": {
"id": {"type": "integer"},
"name": {"type": "string"},
"project": {"type": "string"},
"status": {
"type": "string",
"enum": ["operational", "installed", "planned", "ordered"]
},
},
"additionalProperties": False
}
**INFINERA_LINK_METADATA_DEFINITIONS, **LOCATIONS_DEFINITIONS
},
"type": "object",
......@@ -89,6 +118,7 @@ INFINERA_LINK_METADATA = {
"geant-lambda": {
"$ref": "#/definitions/geant-lambda"
},
"locations": {"$ref": "#/definitions/locations-list"}
},
"additionalProperties": False
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment