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
77b5f7ab
Commit
77b5f7ab
authored
4 years ago
by
Robert Latta
Browse files
Options
Downloads
Patches
Plain Diff
rejigged ciruit_type assignment
parent
7fd1ddd6
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/ims_data.py
+29
-25
29 additions, 25 deletions
inventory_provider/db/ims_data.py
with
29 additions
and
25 deletions
inventory_provider/db/ims_data.py
+
29
−
25
View file @
77b5f7ab
...
...
@@ -31,19 +31,19 @@ def get_interface_services(ds: IMS):
# include the relevant carrier circuits
# service types come from the 'product' information
service_types
=
{
'
geant lambda
'
,
'
geant plus
'
,
'
geant ip
'
,
'
l
3-
vpn
'
,
'
ip peering - non r&e (public
)
'
,
'
ip peering - non r&e (private
)
'
,
'
ip peering - r&e
'
,
'
ip trunk
'
,
'
ip access
'
,
'
geant cloud peering
'
,
'
geant open port
'
,
'
geant open cross connect
'
,
'
pop lan link
'
,
'
GEANT LAMBDA
'
,
'
GEANT PLUS
'
,
'
GEANT IP
'
,
'
L
3-
VPN
'
,
'
IP PEERING - NON R&E (PUBLIC
)
'
,
'
IP PEERING - NON R&E (PRIVATE
)
'
,
'
IP PEERING - R&E
'
,
'
IP TRUNK
'
,
'
IP ACCESS
'
,
'
GEANT CLOUD PEERING
'
,
'
GEANT OPEN PORT
'
,
'
GEANT OPEN CROSS CONNECT
'
,
'
POP LAN LINK
'
,
'
SERVER LINK
'
,
'
GEANT - GBS
'
,
}
...
...
@@ -61,17 +61,22 @@ def get_interface_services(ds: IMS):
def
_get_circuits
():
for
st
in
service_types
:
yield
from
ds
.
get_filtered_entities
(
'
Circuit
'
,
f
'
product.name ==
"
{
st
}
"'
,
circuit_nav_props
,
step_count
=
1000
)
for
c
in
ds
.
get_filtered_entities
(
'
Circuit
'
,
f
'
product.name ==
"
{
st
}
"'
,
circuit_nav_props
,
step_count
=
1000
):
c
[
'
circuit_type
'
]
=
'
service
'
yield
c
for
spd
in
speeds
:
yield
from
ds
.
get_filtered_entities
(
'
Circuit
'
,
f
'
speed.name ==
"
{
spd
}
"'
,
circuit_nav_props
,
step_count
=
1000
)
for
c
in
ds
.
get_filtered_entities
(
'
Circuit
'
,
f
'
speed.name ==
"
{
spd
}
"'
,
circuit_nav_props
,
step_count
=
1000
):
c
[
'
circuit_type
'
]
=
'
circuit
'
yield
c
circuits
=
_get_circuits
()
...
...
@@ -112,8 +117,7 @@ def get_interface_services(ds: IMS):
'
name
'
:
circuit
[
'
name
'
],
'
status
'
:
IMS_OPSDB_STATUS_MAP
.
get
(
InventoryStatus
(
circuit
[
'
inventorystatusid
'
]),
'
unknown
'
),
'
circuit_type
'
:
'
service
'
if
circuit
[
'
product
'
][
'
name
'
]
in
service_types
else
'
circuit
'
,
'
circuit_type
'
:
circuit
[
'
circuit_type
'
],
'
service_type
'
:
circuit
[
'
product
'
][
'
name
'
],
'
project
'
:
circuit
[
'
product
'
][
'
name
'
]
}
...
...
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