Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
prinikasn committed Sep 22, 2023
1 parent 7afdc89 commit 3a82e60
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions system/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,22 +161,18 @@ func NewSwitchControlProcessorOperation() *SwitchControlProcessorOperation {
return &SwitchControlProcessorOperation{req: &spb.SwitchControlProcessorRequest{}}
}

// PathFromSubcomponentName and Path set the route processor path. These functions override each other and only
// the last function used will be applied.

// PathFromSubcomponentName sets the path `/components/component[name=<string>]` for route processor to switch.
// PathFromSubcomponentName sets the path of the target route processor to `/openconfig/components/component[name=<n>]`.
func (s *SwitchControlProcessorOperation) PathFromSubcomponentName(n string) *SwitchControlProcessorOperation {
s.req.ControlProcessor = &tpb.Path{
return s.Path(&tpb.Path{
Origin: "openconfig",
Elem: []*tpb.PathElem{
{Name: "components"},
{Name: "component", Key: map[string]string{"name": n}},
},
}
return s
})
}

// Path sets the full path for the route processor to switch.
// Path sets the path of the target route processor.
func (s *SwitchControlProcessorOperation) Path(p *tpb.Path) *SwitchControlProcessorOperation {
s.req.ControlProcessor = p
return s
Expand Down

0 comments on commit 3a82e60

Please sign in to comment.