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

add service info details to link metadata schema

parent 49a7ade4
No related branches found
No related tags found
No related merge requests found
......@@ -32,14 +32,52 @@ JUNIPER_LINK_METADATA = {
"properties": {
"name": {"type": "string"},
"description": {"type": "string"},
"ipv4": {"$ref": "#/definitions/ipv4-interface-addres"},
"ipv4": {"$ref": "#/definitions/ipv6-interface-addres"},
"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
},
# TODO: modify service-info so that "" entries are just omitted
# (... rather than requiring 'oneOf')
"service-info": {
"type": "object"
"type": "object",
"properties": {
"id": {"type": "integer"},
"name": {"type": "string"},
"status": {"type": "string"},
"circuit_type": {"type": "string"},
"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"},
"card_id": {"type": "string"},
"other_end_card_id": {"type": "string"},
"interface_name": {"type": "string"},
"other_end_interface_name": {"type": "string"}
},
# "required": ["name", "description", "ipv4", "ipv6"],
"additionalProperties": False
}
},
......@@ -60,17 +98,13 @@ JUNIPER_LINK_METADATA = {
def test_trap_metadata(client_with_mocked_data):
response_schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object"
}
rv = client_with_mocked_data.get(
'/classifier/trap-metadata/mx1.ams.nl.geant.net/ae15.1500',
headers=DEFAULT_REQUEST_HEADERS)
assert rv.status_code == 200
assert rv.is_json
response_data = json.loads(rv.data.decode('utf-8'))
jsonschema.validate(response_data, response_schema)
jsonschema.validate(response_data, JUNIPER_LINK_METADATA)
VPN_RR_PEER_INFO_KEYS = {'vpn-rr-peer-info'}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment