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
28897208
Commit
28897208
authored
5 years ago
by
Robert Latta
Browse files
Options
Downloads
Patches
Plain Diff
Added 'geant lambda' retrieval from OpsDB
parent
462f4e8e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inventory_provider/db/opsdb.py
+16
-0
16 additions, 0 deletions
inventory_provider/db/opsdb.py
with
16 additions
and
0 deletions
inventory_provider/db/opsdb.py
+
16
−
0
View file @
28897208
...
...
@@ -28,6 +28,14 @@ equipment_location_query = """SELECT
'
operational
'
)
"""
geant_lambda_sql
=
"""
SELECT
name,
status
FROM circuit
WHERE
status !=
'
terminated
'
AND service_type =
'
geant lambda
'"""
circuit_hierarchy_query
=
"""
SELECT
pc.name AS parent_circuit,
pc.absid AS parent_circuit_id,
...
...
@@ -189,10 +197,18 @@ def _update_fields(r):
return
func
(
r
)
if
func
else
r
def
get_geant_lambdas
(
connection
):
with
db
.
cursor
(
connection
)
as
crs
:
crs
.
execute
(
geant_lambda_sql
)
r
=
_convert_to_dict
(
crs
)
return
r
def
get_circuits
(
connection
):
with
db
.
cursor
(
connection
)
as
crs
:
crs
.
execute
(
retrieve_services_query
)
r
=
_convert_to_dict
(
crs
)
r
=
list
(
map
(
_update_fields
,
r
))
return
r
...
...
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