open-traffic-generator / snappi

Open Traffic Generator SDK in Python and Go
MIT License
69 stars 7 forks source link

GoSnappi: Need access to api GrpcClient #134

Closed rudranil-das closed 2 years ago

rudranil-das commented 2 years ago

Use case: We would like to replace grpc calls to protocol-engine (currently via otg_grpc_pb.go) by gosnappi in ixia-c controller implementation.

The issue is grpc-Client in gosnappiApi is a private member with no public accessible APIs

type gosnappiApi struct {
    api
    grpcClient snappipb.OpenapiClient
    httpClient httpClient
}

It would be help if api.grpcClient is exposed through a new/get hook on gosnappiApi so that further API calls (SetConfig/SetProtocolState/...) using this client could be made; e.g.

gosnappi.NewApi().GetGrpcClient().SetConfig(...)
rudranil-das commented 2 years ago

To support the use case, we would need the following:

  1. grpcConnect to be available as public (or equivalent)
  2. something like GetGrpcClient which would return api.grpcClient.
ashutshkumr commented 2 years ago

Checked with @rudranil-das further on the usecase. Existing functionality (NewGrpcTransport()) should suffice.