Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions patches/gnmi_get.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
pb "github.com/openconfig/gnmi/proto/gnmi"
)

@@ -63,16 +64,20 @@
@@ -63,19 +64,25 @@
xPathFlags arrayFlags
pbPathFlags arrayFlags
pbModelDataFlags arrayFlags
Expand All @@ -28,6 +28,7 @@
timeOut = flag.Duration("time_out", 10*time.Second, "Timeout for the Get request, 10 seconds by default")
encodingName = flag.String("encoding", "JSON_IETF", "value encoding format to be used")
+ jwtToken = flag.String("jwt_token", "", "JWT Token if required")
+ maxRecvMsgSize = flag.Int("max_recv_msg_size", 8*1024*1024, "Maximum receive message size in bytes")
)

func main() {
Expand All @@ -38,7 +39,11 @@
flag.Parse()

opts := credentials.ClientCredentials(*targetName)
@@ -87,6 +92,10 @@
+ opts = append(opts, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(*maxRecvMsgSize)))
conn, err := grpc.Dial(*targetAddr, opts...)
if err != nil {
log.Exitf("Dialing to %q failed: %v", *targetAddr, err)
@@ -87,6 +94,10 @@
ctx, cancel := context.WithTimeout(context.Background(), *timeOut)
defer cancel()

Expand All @@ -49,7 +54,7 @@
encoding, ok := pb.Encoding_value[*encodingName]
if !ok {
var gnmiEncodingList []string
@@ -96,12 +105,14 @@
@@ -96,12 +107,14 @@
log.Exitf("Supported encodings: %s", strings.Join(gnmiEncodingList, ", "))
}

Expand All @@ -65,15 +70,15 @@
}
pbPathList = append(pbPathList, pbPath)
}
@@ -120,6 +131,7 @@
@@ -120,6 +133,7 @@
}

getRequest := &pb.GetRequest{
+ Prefix: &prefix,
Comment thread
Sreevanich16 marked this conversation as resolved.
Encoding: pb.Encoding(encoding),
Path: pbPathList,
UseModels: pbModelDataList,
@@ -135,4 +147,20 @@
@@ -135,4 +149,20 @@

fmt.Println("== getResponse:")
utils.PrintProto(getResponse)
Expand Down
2 changes: 1 addition & 1 deletion telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func setupFlags(fs *flag.FlagSet) (*TelemetryConfig, *gnmi.Config, error) {
AuthzPolicyFile: fs.String("authorization_policy_file", "/keys/authorization_policy.json", "Full path name of the JSON authorization policy file."),
EnableStreamMultiplexing: fs.Bool("enable_stream_multiplexing", false, "Allow multiple Subscribe RPCs on a single TCP connection via HTTP/2 stream multiplexing"),
MaxRecvMsgSize: fs.Int("max_recv_msg_size", 4*1024*1024, "Maximum message size in bytes that the server can receive"),
MaxSendMsgSize: fs.Int("max_send_msg_size", 4*1024*1024, "Maximum message size in bytes that the server can send"),
MaxSendMsgSize: fs.Int("max_send_msg_size", 8*1024*1024, "Maximum message size in bytes that the server can send"),
}

fs.Var(&telemetryCfg.UserAuth, "client_auth", "Client auth mode(s) - none,cert,password")
Expand Down
Loading