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
a9ba387f
Commit
a9ba387f
authored
5 years ago
by
Robert Latta
Browse files
Options
Downloads
Patches
Plain Diff
added project to circuits in circuit_hierarchy info
parent
a60f2733
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inventory_provider/db/opsdb.py
+15
-8
15 additions, 8 deletions
inventory_provider/db/opsdb.py
inventory_provider/routes/classifier.py
+3
-1
3 additions, 1 deletion
inventory_provider/routes/classifier.py
with
18 additions
and
9 deletions
inventory_provider/db/opsdb.py
+
15
−
8
View file @
a9ba387f
from
inventory_provider.db
import
db
geant_lambda_sql
=
"""
SELECT
absid AS id,
name,
LOWER(status) AS status
FROM circuit
c.absid AS id,
c.name as name,
LOWER(c.status) AS status,
p.short_descr as project
FROM vcircuitconns c
left join events p
on p.absid = c.PTR_project
WHERE
status !=
'
terminated
'
AND service_type =
'
geant lambda
'"""
c.
status !=
'
terminated
'
AND
c.
service_type =
'
geant lambda
'"""
circuit_hierarchy_query
=
"""
SELECT
pc.name AS parent_circuit,
pc.absid AS parent_circuit_id,
pc.circuit_type AS parent_circuit_type,
LOWER(pc.status) AS parent_circuit_status,
pp.short_descr AS parent_project,
cc.name AS child_circuit,
cc.absid AS child_circuit_id,
cc.circuit_type AS child_circuit_type,
LOWER(cc.status) AS child_circuit_status,
cp.short_descr AS child_project,
cg.segment_group AS segment_group
FROM circuit_glue cg
INNER JOIN circuit pc ON pc.absid = cg.PTR_circuit
INNER JOIN circuit cc ON cc.absid = cg.PTR_component
"""
INNER JOIN vcircuitconns pc ON pc.absid = cg.PTR_circuit
INNER JOIN vcircuitconns cc ON cc.absid = cg.PTR_component
LEFT JOIN events pp on pp.absid = pc.PTR_project
LEFT JOIN events cp on cp.absid = cc.PTR_project
"""
retrieve_services_query
=
"""
SELECT *
...
...
This diff is collapsed.
Click to expand it.
inventory_provider/routes/classifier.py
+
3
−
1
View file @
a9ba387f
...
...
@@ -66,7 +66,9 @@ def get_top_level_services(circuit_id, r):
tls
.
append
(
{
'
name
'
:
c
[
'
parent_circuit
'
],
'
status
'
:
c
[
'
parent_circuit_status
'
],
'
circuit_type
'
:
c
[
'
parent_circuit_type
'
].
lower
()})
'
circuit_type
'
:
c
[
'
parent_circuit_type
'
].
lower
(),
'
project
'
:
c
[
'
parent_project
'
]
})
tls
.
extend
(
temp_parents
)
return
tls
...
...
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