Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inventory-provider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
dashboardv3
inventory-provider
Commits
ca9888bf
Commit
ca9888bf
authored
2 years ago
by
Sam Roberts
Browse files
Options
Downloads
Patches
Plain Diff
docstring added, tests next
parent
88ba6fbe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3
Feature/reporting 311 add msr asn peers
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inventory_provider/routes/msr.py
+23
-0
23 additions, 0 deletions
inventory_provider/routes/msr.py
with
23 additions
and
0 deletions
inventory_provider/routes/msr.py
+
23
−
0
View file @
ca9888bf
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment