Skip to content

Add SetBuilder for batched gNMI Set operations#445

Open
felix-kaestner wants to merge 1 commit into
mainfrom
refactor/gnmiext
Open

Add SetBuilder for batched gNMI Set operations#445
felix-kaestner wants to merge 1 commit into
mainfrom
refactor/gnmiext

Conversation

@felix-kaestner

Copy link
Copy Markdown
Contributor

Introduce a SetBuilder type that accumulates update, patch, and delete operations to be executed as a single gNMI Set RPC via the new Client.Do method. This allows atomic multi-operation commits without multiple round-trips to the device.

An optional Limit method controls the maximum number of operations per SetRequest, splitting into multiple RPCs when set.

cp "github.com/felix-kaestner/copy"
"github.com/go-logr/logr"
gpb "github.com/openconfig/gnmi/proto/gnmi"
gnmipb "github.com/openconfig/gnmi/proto/gnmi"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"pb" is the canonical suffix for packages exposing protobuf generated grpc client/server code. ref/ https://pkg.go.dev/google.golang.org/protobuf/types/known

Introduce a SetBuilder type that accumulates update, patch, and
delete operations to be executed as a single gNMI Set RPC via the
new Client.Do method. This allows atomic multi-operation commits
without multiple round-trips to the device.

An optional Limit method controls the maximum number of operations
per SetRequest, splitting into multiple RPCs when set.

Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
@github-actions

Copy link
Copy Markdown

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/internal/provider/cisco/iosxr 36.07% (ø)
github.com/ironcore-dev/network-operator/internal/transport/gnmiext 89.04% (-0.91%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/internal/transport/gnmiext/client.go 87.03% (-0.71%) 185 (+30) 161 (+25) 24 (+5) 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/ironcore-dev/network-operator/internal/provider/cisco/iosxr/provider_test.go
  • github.com/ironcore-dev/network-operator/internal/transport/gnmiext/client_test.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant