Skip to content
Snippets Groups Projects
Commit ca9888bf authored by Sam Roberts's avatar Sam Roberts
Browse files

docstring added, tests next

parent 88ba6fbe
Branches
No related tags found
1 merge request!3Feature/reporting 311 add msr asn peers
......@@ -1179,6 +1179,29 @@ def vpn_proxy():
@routes.route('/asn-peers/<asn>', methods=['GET', 'POST'])
@common.require_accepts_json
def asn_peers(asn):
"""
Handler for `/asn-peers`
This method returns a list of all peers filtered by `group` and `instance`,
which can be passed either as URL query parameters or as entries in a
POST request with a JSON body that matches this schema:
`{
"group": "group to filter by",
"instance": "instance to filter by"
}`
Results are returned where all filters given are true, and exact string
matches.
An optional URL parameter can be used to also filter by a specific ASN.
The response will be formatted according to the following schema:
.. asjson::
inventory_provider.routes.msr.PEERING_LIST_SCHEMA
:param asn: specific ASN to get peers for
:return:
"""
r = common.get_current_redis()
def _get_filtered_peers_for_asn(asn, group, instance):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment