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
6fb43483
Commit
6fb43483
authored
2 years ago
by
Robert Latta
Browse files
Options
Downloads
Patches
Plain Diff
added customer type to related customers data
parent
93e1edff
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
inventory_provider/db/ims.py
+11
-0
11 additions, 0 deletions
inventory_provider/db/ims.py
inventory_provider/db/ims_data.py
+13
-14
13 additions, 14 deletions
inventory_provider/db/ims_data.py
with
24 additions
and
14 deletions
inventory_provider/db/ims.py
+
11
−
0
View file @
6fb43483
...
@@ -148,6 +148,17 @@ IMS_SERVICE_NAMES = {
...
@@ -148,6 +148,17 @@ IMS_SERVICE_NAMES = {
}
}
class
CustomerType
(
Enum
):
COMMERCIAL_PEER
=
1
CONNECTIVITY_SUPPLIER
=
2
EU_NREN
=
3
HOUSING_SUPPLIER
=
4
IX_SUPPLIER
=
5
OTHER
=
6
R_AND_E_PEER
=
7
UNKNOWN
=
'
UNKNOWN
'
class
InventoryStatus
(
Enum
):
class
InventoryStatus
(
Enum
):
PLANNED
=
1
PLANNED
=
1
READY_FOR_SERVICE
=
2
READY_FOR_SERVICE
=
2
...
...
This diff is collapsed.
Click to expand it.
inventory_provider/db/ims_data.py
+
13
−
14
View file @
6fb43483
...
@@ -2,8 +2,7 @@ import logging
...
@@ -2,8 +2,7 @@ import logging
import
re
import
re
from
collections
import
defaultdict
from
collections
import
defaultdict
from
copy
import
copy
from
copy
import
copy
from
itertools
import
chain
,
groupby
from
itertools
import
chain
from
operator
import
itemgetter
from
inventory_provider
import
environment
from
inventory_provider
import
environment
from
inventory_provider.db
import
ims
from
inventory_provider.db
import
ims
...
@@ -127,20 +126,20 @@ def get_customer_service_emails(ds: IMS):
...
@@ -127,20 +126,20 @@ def get_customer_service_emails(ds: IMS):
def
get_circuit_related_customers
(
ds
:
IMS
):
def
get_circuit_related_customers
(
ds
:
IMS
):
relations
=
sorted
(
list
(
return_value
=
defaultdict
(
list
)
ds
.
get_filtered_entities
(
for
ccr
in
ds
.
get_filtered_entities
(
'
CircuitCustomerRelation
'
,
'
CircuitCustomerRelation
'
,
'
circuit.inventoryStatusId== 3
'
,
'
circuit.inventoryStatusId== 3
'
,
ims
.
CIRCUIT_CUSTOMER_RELATION
[
'
Customer
'
]
ims
.
CIRCUIT_CUSTOMER_RELATION
[
'
Customer
'
]
):
)
return_value
[
ccr
[
'
circuitid
'
]].
append
(
),
key
=
itemgetter
(
'
circuitid
'
))
{
'
id
'
:
ccr
[
'
customer
'
][
'
id
'
],
return
{
k
:
[{
'
name
'
:
ccr
[
'
customer
'
][
'
name
'
],
'
id
'
:
c
[
'
customer
'
][
'
id
'
]
,
'
type
'
:
c
cr
[
'
customer
'
][
'
customertype
id
'
]
'
name
'
:
c
[
'
customer
'
][
'
name
'
]
}
}
for
c
in
v
]
for
k
,
v
in
)
groupby
(
relations
,
key
=
itemgetter
(
'
circuitid
'
))}
return
return_value
def
get_port_id_services
(
ds
:
IMS
):
def
get_port_id_services
(
ds
:
IMS
):
...
...
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