예제 #1
0
class HaUtil:
    def __init__(self):
        self._ha_stub = HaServiceStub(get_rpc_channel("spgw_service"))

    def offload_agw(self, imsi, enbID, offloadtype=0):
        req = StartAgwOffloadRequest(
            enb_id=enbID,
            enb_offload_type=offloadtype,
            imsi=imsi,
        )
        try:
            self._ha_stub.StartAgwOffload(req)
        except grpc.RpcError as e:
            print("gRPC failed with %s: %s" % (e.code(), e.details()))
예제 #2
0
 def __init__(self):
     self._ha_stub = HaServiceStub(get_rpc_channel("spgw_service"))