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

added peer-info, juniper-link-info schemas to docs

parent 5be403d2
No related branches found
No related tags found
No related merge requests found
...@@ -5,4 +5,7 @@ Classifier Endpoints ...@@ -5,4 +5,7 @@ Classifier Endpoints
========================= =========================
todo .. autofunction:: inventory_provider.routes.classifier.peer_info
.. autofunction:: inventory_provider.routes.classifier.get_juniper_link_info
...@@ -183,6 +183,20 @@ def _link_interface_info(r, hostname, interface): ...@@ -183,6 +183,20 @@ def _link_interface_info(r, hostname, interface):
methods=['GET', 'POST']) methods=['GET', 'POST'])
@common.require_accepts_json @common.require_accepts_json
def get_juniper_link_info(source_equipment, interface): def get_juniper_link_info(source_equipment, interface):
"""
Handler for /classifier/juniper-link-info that
returns metadata about an IP interface.
The response will be formatted according to the following schema:
.. asjson::
inventory_provider.routes.classifier_schema.JUNIPER_LINK_RESPONSE_SCHEMA
:param source_equipment: router hostname
:param interface: link interface name
:return:
"""
r = common.get_current_redis() r = common.get_current_redis()
cache_key = 'classifier-cache:juniper:%s:%s' % ( cache_key = 'classifier-cache:juniper:%s:%s' % (
...@@ -473,7 +487,17 @@ def find_interfaces_and_services(address_str): ...@@ -473,7 +487,17 @@ def find_interfaces_and_services(address_str):
@routes.route("/peer-info/<address>", methods=['GET', 'POST']) @routes.route("/peer-info/<address>", methods=['GET', 'POST'])
@common.require_accepts_json @common.require_accepts_json
def peer_info(address): def peer_info(address):
"""
Handler for /classifier/peer-info that returns bgp peering metadata.
The response will be formatted according to the following schema:
.. asjson::
inventory_provider.routes.classifier_schema.PEER_INFO_RESPONSE_SCHEMA
:param address: string representation of a bgp peer address
:return:
"""
# canonicalize the input address first ... # canonicalize the input address first ...
try: try:
obj = ipaddress.ip_address(address) obj = ipaddress.ip_address(address)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment