From d22cdccc54c652835e3351165603e1d85b7c9954 Mon Sep 17 00:00:00 2001 From: Hosang Kim Date: Wed, 2 Nov 2022 15:40:30 +0900 Subject: [PATCH] aurum: make examples for guide Change-Id: I045c6b6c720c57deb0922bf232fbf46ae5ff1a76 --- examples/python/helloworld.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 examples/python/helloworld.py diff --git a/examples/python/helloworld.py b/examples/python/helloworld.py new file mode 100644 index 0000000..2dbf7dc --- /dev/null +++ b/examples/python/helloworld.py @@ -0,0 +1,17 @@ +import grpc +from aurum_pb2 import * +from aurum_pb2_grpc import BootstrapStub + +def run(): + with grpc.insecure_channel('localhost:50051') as channel: +# If you have a proxy problem, use the below code instead of the above code. +# with grpc.insecure_channel('localhost:50051', options=(('grpc.enable_http_proxy', 0),)) as channel: + stub = BootstrapStub(channel) + getDeviceTime(stub) + +def getDeviceTime(stub): + response = stub.getDeviceTime(ReqGetDeviceTime(type='SYSTEM')) + print(response) + +if __name__ == '__main__': + run() -- 2.34.1