Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
TFS
controller
Commits
8eac01b3
Commit
8eac01b3
authored
2 years ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Context component:
- Minor code cleanup before merging
parent
a30709e3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!142
Release TeraFlowSDN 2.1
,
!89
First implementation of location-aware services
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/context/service/database/Device.py
+2
-4
2 additions, 4 deletions
src/context/service/database/Device.py
src/context/service/database/models/ServiceModel.py
+1
-1
1 addition, 1 deletion
src/context/service/database/models/ServiceModel.py
with
3 additions
and
5 deletions
src/context/service/database/Device.py
+
2
−
4
View file @
8eac01b3
...
...
@@ -20,7 +20,7 @@ from sqlalchemy_cockroachdb import run_transaction
from
typing
import
Dict
,
List
,
Optional
,
Set
,
Tuple
from
common.method_wrappers.ServiceExceptions
import
InvalidArgumentException
,
NotFoundException
from
common.proto.context_pb2
import
Device
,
DeviceFilter
,
DeviceId
,
TopologyId
#
from common.tools.grpc.Tools import grpc_message_to_json_string
from
common.tools.grpc.Tools
import
grpc_message_to_json_string
from
common.tools.object_factory.Device
import
json_device_id
from
context.service.database.uuids.Topology
import
topology_get_uuid
from
.models.DeviceModel
import
DeviceModel
...
...
@@ -32,8 +32,6 @@ from .models.enums.KpiSampleType import grpc_to_enum__kpi_sample_type
from
.uuids.Device
import
device_get_uuid
from
.uuids.EndPoint
import
endpoint_get_uuid
from
.ConfigRule
import
compose_config_rules_data
,
upsert_config_rules
from
common.tools.grpc.Tools
import
grpc_message_to_json
import
json
LOGGER
=
logging
.
getLogger
(
__name__
)
...
...
@@ -118,7 +116,7 @@ def device_set(db_engine : Engine, request : Device) -> Tuple[Dict, bool]:
'
name
'
:
endpoint_name
,
'
endpoint_type
'
:
endpoint
.
endpoint_type
,
'
kpi_sample_types
'
:
kpi_sample_types
,
'
endpoint_location
'
:
json
.
dumps
(
grpc_message_to_json
(
endpoint
.
endpoint_location
)
)
,
'
endpoint_location
'
:
grpc_message_to_json
_string
(
endpoint
.
endpoint_location
),
'
created_at
'
:
now
,
'
updated_at
'
:
now
,
})
...
...
This diff is collapsed.
Click to expand it.
src/context/service/database/models/ServiceModel.py
+
1
−
1
View file @
8eac01b3
...
...
@@ -32,7 +32,7 @@ class ServiceModel(_Base):
created_at
=
Column
(
DateTime
,
nullable
=
False
)
updated_at
=
Column
(
DateTime
,
nullable
=
False
)
context
=
relationship
(
'
ContextModel
'
,
back_populates
=
'
services
'
,
lazy
=
'
selectin
'
,
)
context
=
relationship
(
'
ContextModel
'
,
back_populates
=
'
services
'
,
lazy
=
'
selectin
'
)
service_endpoints
=
relationship
(
'
ServiceEndPointModel
'
)
# lazy='selectin', back_populates='service'
constraints
=
relationship
(
'
ServiceConstraintModel
'
,
passive_deletes
=
True
)
# lazy='selectin', back_populates='service'
config_rules
=
relationship
(
'
ServiceConfigRuleModel
'
,
passive_deletes
=
True
)
# lazy='selectin', back_populates='service'
...
...
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