Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
goSDN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
danet
goSDN
Commits
a0a3477e
Commit
a0a3477e
authored
2 years ago
by
Malte Bauch
Browse files
Options
Downloads
Patches
Plain Diff
Change pnd.Request to use UpdateModel method
parent
81af1518
No related branches found
No related tags found
1 merge request
!410
Some basic house keeping
Pipeline
#125975
failed
2 years ago
Stage: build
Stage: test
Stage: analyze
Stage: integration-test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
controller/interfaces/networkdomain/pnd.go
+0
-1
0 additions, 1 deletion
controller/interfaces/networkdomain/pnd.go
controller/nucleus/principalNetworkDomain.go
+10
-10
10 additions, 10 deletions
controller/nucleus/principalNetworkDomain.go
with
10 additions
and
11 deletions
controller/interfaces/networkdomain/pnd.go
+
0
−
1
View file @
a0a3477e
...
@@ -37,5 +37,4 @@ type NetworkDomain interface {
...
@@ -37,5 +37,4 @@ type NetworkDomain interface {
Commit
(
uuid
.
UUID
)
error
Commit
(
uuid
.
UUID
)
error
Confirm
(
uuid
.
UUID
)
error
Confirm
(
uuid
.
UUID
)
error
SubscribePath
(
uuid
.
UUID
,
*
ppb
.
SubscriptionList
)
error
SubscribePath
(
uuid
.
UUID
,
*
ppb
.
SubscriptionList
)
error
UpdateNetworkElementAfterSubscribeResponse
(
networkelement
.
NetworkElement
)
error
}
}
This diff is collapsed.
Click to expand it.
controller/nucleus/principalNetworkDomain.go
+
10
−
10
View file @
a0a3477e
...
@@ -310,6 +310,8 @@ func (pnd *pndImplementation) UpdateNetworkElement(networkElementID uuid.UUID, m
...
@@ -310,6 +310,8 @@ func (pnd *pndImplementation) UpdateNetworkElement(networkElementID uuid.UUID, m
return
err
return
err
}
}
//TODO: check if it could be worth to provide the method with a network
//element instead of an ID.
err
=
pnd
.
ensureIntendedConfigurationIsAppliedOnNetworkElement
(
networkElementID
)
err
=
pnd
.
ensureIntendedConfigurationIsAppliedOnNetworkElement
(
networkElementID
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
@@ -405,6 +407,8 @@ func (pnd *pndImplementation) MarshalNetworkElement(identifier string) (string,
...
@@ -405,6 +407,8 @@ func (pnd *pndImplementation) MarshalNetworkElement(identifier string) (string,
}
}
// Request sends a get request to a specific network element.
// Request sends a get request to a specific network element.
// TODO: this method needs some heavy refactoring, especially in regards to the
// UpdateModel call
func
(
pnd
*
pndImplementation
)
Request
(
uuid
uuid
.
UUID
,
path
string
)
(
proto
.
Message
,
error
)
{
func
(
pnd
*
pndImplementation
)
Request
(
uuid
uuid
.
UUID
,
path
string
)
(
proto
.
Message
,
error
)
{
mne
,
err
:=
pnd
.
networkElementService
.
Get
(
store
.
Query
{
mne
,
err
:=
pnd
.
networkElementService
.
Get
(
store
.
Query
{
ID
:
uuid
,
ID
:
uuid
,
...
@@ -433,8 +437,13 @@ func (pnd *pndImplementation) Request(uuid uuid.UUID, path string) (proto.Messag
...
@@ -433,8 +437,13 @@ func (pnd *pndImplementation) Request(uuid uuid.UUID, path string) (proto.Messag
return
nil
,
err
return
nil
,
err
}
}
modelAsString
,
err
:=
mne
.
GetModelAsString
()
if
err
!=
nil
{
return
nil
,
err
}
// TODO(path): We probably have to remove this when we address path request handling.
// TODO(path): We probably have to remove this when we address path request handling.
err
=
pnd
.
networkElementService
.
Update
(
mne
)
err
=
pnd
.
networkElementService
.
Update
Model
(
uuid
,
modelAsString
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -950,12 +959,3 @@ func (pnd *pndImplementation) MarshalBSON() ([]byte, error) {
...
@@ -950,12 +959,3 @@ func (pnd *pndImplementation) MarshalBSON() ([]byte, error) {
Description
:
pnd
.
Description
,
Description
:
pnd
.
Description
,
})
})
}
}
// UpdateMNEAfterSubscribeResponse takes a network element and forwards it to the network element service to handle the update.
func
(
pnd
*
pndImplementation
)
UpdateNetworkElementAfterSubscribeResponse
(
mne
networkelement
.
NetworkElement
)
error
{
if
err
:=
pnd
.
networkElementService
.
Update
(
mne
);
err
!=
nil
{
return
err
}
return
nil
}
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