File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -7,16 +7,18 @@ import sys
77import fossildbapi_pb2 as proto
88import fossildbapi_pb2_grpc as proto_rpc
99
10+ from grpc_health .v1 import health_pb2
11+ from grpc_health .v1 import health_pb2_grpc
1012
1113def main ():
1214
1315 commands = {
14- 'backup' : lambda stub :
16+ 'backup' : lambda stub , healthStub :
1517 stub .Backup (proto .BackupRequest ()),
16- 'restore' : lambda stub :
18+ 'restore' : lambda stub , healthStub :
1719 stub .RestoreFromBackup (proto .RestoreFromBackupRequest ()),
18- 'health' : lambda stub :
19- stub . Health ( proto . HealthRequest ( ))
20+ 'health' : lambda stub , healthStub :
21+ healthStub . Check ( health_pb2 . HealthCheckRequest ( service = '' ))
2022 }
2123
2224 parser = argparse .ArgumentParser ()
@@ -43,8 +45,9 @@ def main():
4345
4446 channel = grpc .insecure_channel (full_address )
4547 stub = proto_rpc .FossilDBStub (channel )
48+ healthStub = health_pb2_grpc .HealthStub (channel )
4649
47- reply = commands [args .command ](stub )
50+ reply = commands [args .command ](stub , healthStub )
4851
4952 print (reply )
5053 if not reply .success :
Original file line number Diff line number Diff line change 11argparse
22grpcio-tools
3+ grpcio-health-checking
You can’t perform that action at this time.
0 commit comments