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
cfd557e9
Commit
cfd557e9
authored
4 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
added peer-info, juniper-link-info schemas to docs
parent
5be403d2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/source/protocol/classifier.rst
+4
-1
4 additions, 1 deletion
docs/source/protocol/classifier.rst
inventory_provider/routes/classifier.py
+24
-0
24 additions, 0 deletions
inventory_provider/routes/classifier.py
with
28 additions
and
1 deletion
docs/source/protocol/classifier.rst
+
4
−
1
View file @
cfd557e9
...
...
@@ -5,4 +5,7 @@ Classifier Endpoints
=========================
todo
.. autofunction:: inventory_provider.routes.classifier.peer_info
.. autofunction:: inventory_provider.routes.classifier.get_juniper_link_info
This diff is collapsed.
Click to expand it.
inventory_provider/routes/classifier.py
+
24
−
0
View file @
cfd557e9
...
...
@@ -183,6 +183,20 @@ def _link_interface_info(r, hostname, interface):
methods
=
[
'
GET
'
,
'
POST
'
])
@common.require_accepts_json
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
()
cache_key
=
'
classifier-cache:juniper:%s:%s
'
%
(
...
...
@@ -473,7 +487,17 @@ def find_interfaces_and_services(address_str):
@routes.route
(
"
/peer-info/<address>
"
,
methods
=
[
'
GET
'
,
'
POST
'
])
@common.require_accepts_json
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 ...
try
:
obj
=
ipaddress
.
ip_address
(
address
)
...
...
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