Пример #1
0
 def create(exchange: str = DEFAULT_BUSNAME,
            broker: str = DEFAULT_BROKER,
            timeout: int = DEFAULT_RPC_TIMEOUT):
     return TBBRPC(
         RPCClient(service_name=DEFAULT_TBB_SERVICENAME,
                   exchange=exchange,
                   broker=broker,
                   timeout=timeout))
Пример #2
0
 def create(exchange: str = DEFAULT_BUSNAME,
            broker: str = DEFAULT_BROKER,
            timeout: int = DEFAULT_RPC_TIMEOUT):
     return ValidationRPC(
         RPCClient(service_name=VALIDATION_SERVICENAME,
                   exchange=exchange,
                   broker=broker,
                   timeout=timeout))
Пример #3
0
 def create(exchange: str = DEFAULT_BUSNAME,
            broker: str = DEFAULT_BROKER,
            timeout: int = DEFAULT_CLEANUPRPC_TIMEOUT):
     """Create a CleanupRPC connecting to the given exchange/broker on the default DEFAULT_CLEANUP_SERVICENAME service"""
     return CleanupRPC(
         RPCClient(service_name=DEFAULT_CLEANUP_SERVICENAME,
                   exchange=exchange,
                   broker=broker,
                   timeout=timeout))
Пример #4
0
 def create(exchange=DEFAULT_BUSNAME,
            broker=DEFAULT_BROKER,
            timeout=DEFAULT_RPC_TIMEOUT):
     """Create a OTDBRPC connecting to the given exchange/broker on the default DEFAULT_OTDB_SERVICENAME service"""
     return ObservationControlRPCClient(
         RPCClient(service_name=DEFAULT_OBSERVATION_CONTROL_SERVICE_NAME,
                   exchange=exchange,
                   broker=broker,
                   timeout=timeout))
Пример #5
0
 def create(exchange: str = DEFAULT_BUSNAME,
            broker: str = DEFAULT_BROKER,
            timeout: int = DEFAULT_RPC_TIMEOUT):
     """Create a SpecificationRPC connecting to the given exchange/broker on the default DEFAULT_MOMQUERY_SERVICENAME service"""
     return SpecificationRPC(
         RPCClient(service_name=SPECIFICATION_SERVICENAME,
                   exchange=exchange,
                   broker=broker,
                   timeout=timeout))
Пример #6
0
 def __init__(self, rpc_client: RPCClient = None):
     """Create an instance of the CleanupRPC using the given RPCClient,
     or if None given, to a default RPCClient connecting to the DEFAULT_CLEANUP_SERVICENAME service"""
     super().__init__()
     self._rpc_client = rpc_client or RPCClient(
         service_name=DEFAULT_CLEANUP_SERVICENAME)
Пример #7
0
 def __init__(self,
              rpc_client: RPCClient = RPCClient(
                  service_name=DEFAULT_OBSERVATION_CONTROL_SERVICE_NAME)):
     super().__init__()
     self._rpc_client = rpc_client
Пример #8
0
 def __init__(self, rpc_client: RPCClient = None):
     super(TriggerRPC, self).__init__()
     self._rpc_client = rpc_client or RPCClient(service_name=TRIGGER_SERVICENAME)
Пример #9
0
        print("** Executing {0}({1})...".format(method_name, arg_dict))
        answer = rpc_instance.execute(method_name=method_name, **arg_dict)
        print("result =", answer)
        print("======")
        return answer

    with TemporaryExchange(__name__) as tmp_exchange:
        exchange = tmp_exchange.address

        with BusListenerJanitor(
                create_service(exchange=exchange,
                               dbcreds=test_db.dbcreds)) as service:

            with RPCClient(
                    service_name=service.service_name,
                    exchange=exchange,
                    timeout=10
            ) as otdbRPC:  # Existing: otdb_id:1099268, mom_id:353713
                do_rpc(otdbRPC, "TaskGetIDs", {
                    'OtdbID': 1099268,
                    'MomID': 353713
                })
                do_rpc(otdbRPC, "TaskGetIDs", {'OtdbID': 1099268, 'MomID': 5})
                do_rpc(otdbRPC, "TaskGetIDs", {
                    'OtdbID': 1099268,
                    'MomID': None
                })
                do_rpc(otdbRPC, "TaskGetIDs", {'OtdbID': 5, 'MomID': 353713})
                do_rpc_catch_exception('', otdbRPC, "TaskGetIDs", {
                    'OtdbID': 5,
                    'MomID': 5
Пример #10
0
 def __init__(self, rpc_client: RPCClient = None):
     super(ValidationRPC, self).__init__()
     self._rpc_client = rpc_client or RPCClient(VALIDATION_SERVICENAME)
Пример #11
0
 def create(exchange: str = DEFAULT_BUSNAME, broker: str = DEFAULT_BROKER, timeout: int=DEFAULT_RPC_TIMEOUT):
     """Create a TriggerRPC connecting to the given exchange/broker on the default TRIGGER_SERVICENAME service"""
     return TriggerRPC(RPCClient(service_name=TRIGGER_SERVICENAME, exchange=exchange, broker=broker, timeout=timeout))
Пример #12
0
 def __init__(self, rpc_client: RPCClient = None):
     super(TaskManagementRPC, self).__init__()
     self._rpc_client = rpc_client or RPCClient(DEFAULT_SERVICENAME)
Пример #13
0
 def __init__(self, rpc_client: RPCClient = None):
     """Create an instance of the SpecificationRPC using the given RPCClient,
     or if None given, to a default RPCClient connecting to the SPECIFICATION_SERVICENAME service"""
     super().__init__()
     self._rpc_client = rpc_client or RPCClient(
         service_name=SPECIFICATION_SERVICENAME)
Пример #14
0
 def __init__(self, rpc_client: RPCClient = None):
     super(TBBRPC, self).__init__()
     self._rpc_client = rpc_client or RPCClient(DEFAULT_TBB_SERVICENAME)
Пример #15
0
 def __init__(self, rpc_client: RPCClient = None):
     super(TranslationRPC, self).__init__()
     self._rpc_client = rpc_client or RPCClient(SPECIFICATIONTRANSLATION_SERVICENAME)
Пример #16
0
 def create(exchange: str = DEFAULT_BUSNAME, broker: str = DEFAULT_BROKER, timeout: int = DEFAULT_RPC_TIMEOUT):
     return TranslationRPC(RPCClient(service_name=SPECIFICATIONTRANSLATION_SERVICENAME, exchange=exchange, broker=broker, timeout=timeout))
Пример #17
0
 def create(exchange: str = DEFAULT_BUSNAME, broker: str = DEFAULT_BROKER, timeout: int=DEFAULT_RPC_TIMEOUT):
     """Create a StorageQueryRPC connecting to the given exchange/broker on the default DEFAULT_STORAGEQUERY_SERVICENAME service"""
     return StorageQueryRPC(RPCClient(service_name=DEFAULT_STORAGEQUERY_SERVICENAME, exchange=exchange, broker=broker, timeout=timeout))
Пример #18
0
 def __init__(self, rpc_client: RPCClient = None):
     """Create an instance of the StorageQueryRPC using the given RPCClient,
     or if None given, to a default RPCClient connecting to the DEFAULT_STORAGEQUERY_SERVICENAME service"""
     super().__init__()
     self._rpc_client = rpc_client or RPCClient(service_name=DEFAULT_STORAGEQUERY_SERVICENAME)