Skip to content

Commit 7f65cbc

Browse files
Add get sansshell servers version function (#536)
1 parent 20f215a commit 7f65cbc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

services/sansshell/client/utils.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,17 @@ func GetSansshellVersion(ctx context.Context, conn *proxy.Conn) (string, error)
4545

4646
return resp.GetVersion(), nil
4747
}
48+
49+
// GetSansshellVersionForMany gets the version of the sansshell servers.
50+
// Returns error if:
51+
// - could not get the version from targets
52+
func GetSansshellVersionForMany(ctx context.Context, conn *proxy.Conn) (<-chan *pb.VersionManyResponse, error) {
53+
client := pb.NewStateClientProxy(conn)
54+
55+
responses, err := client.VersionOneMany(ctx, &emptypb.Empty{})
56+
if err != nil {
57+
return nil, fmt.Errorf("Could not get server(-s) version: %v\n", err)
58+
}
59+
60+
return responses, nil
61+
}

0 commit comments

Comments
 (0)