-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GNOI Implementation of OS.Verify (#342)
Why I did it Supports OS.Verify for Upgrading OS How I did it Implement GNOI server and client for GNOI.OS.Verify Backend PR: sonic-net/sonic-host-services#206 How to verify it On Mellanox: gnoi_client -target 127.0.0.1:50052 -logtostderr -insecure -module OS -rpc Verify OS Verify {"version":"SONiC-OS-20240510.23"}
- Loading branch information
Showing
10 changed files
with
281 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package os | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"encoding/json" | ||
pb "github.com/openconfig/gnoi/os" | ||
"github.com/sonic-net/sonic-gnmi/gnoi_client/utils" | ||
"google.golang.org/grpc" | ||
) | ||
|
||
func Verify(conn *grpc.ClientConn, ctx context.Context) { | ||
fmt.Println("OS Verify") | ||
ctx = utils.SetUserCreds(ctx) | ||
osc := pb.NewOSClient(conn) | ||
resp, err := osc.Verify(ctx, new(pb.VerifyRequest)) | ||
if err != nil { | ||
panic(err.Error()) | ||
} | ||
respstr, err := json.Marshal(resp) | ||
if err != nil { | ||
panic(err.Error()) | ||
} | ||
fmt.Println(string(respstr)) | ||
} |
Oops, something went wrong.