Skip to content
Snippets Groups Projects
Select Git revision
  • c685607f5db622dbf58475b30a1c35a6fa40831d
  • master default protected
  • L2SS-1914-fix_job_dispatch
  • TMSS-3170
  • TMSS-3167
  • TMSS-3161
  • TMSS-3158-Front-End-Only-Allow-Changing-Again
  • TMSS-3133
  • TMSS-3319-Fix-Templates
  • test-fix-deploy
  • TMSS-3134
  • TMSS-2872
  • defer-state
  • add-custom-monitoring-points
  • TMSS-3101-Front-End-Only
  • TMSS-984-choices
  • SDC-1400-Front-End-Only
  • TMSS-3079-PII
  • TMSS-2936
  • check-for-max-244-subbands
  • TMSS-2927---Front-End-Only-PXII
  • Before-Remove-TMSS
  • LOFAR-Release-4_4_318 protected
  • LOFAR-Release-4_4_317 protected
  • LOFAR-Release-4_4_316 protected
  • LOFAR-Release-4_4_315 protected
  • LOFAR-Release-4_4_314 protected
  • LOFAR-Release-4_4_313 protected
  • LOFAR-Release-4_4_312 protected
  • LOFAR-Release-4_4_311 protected
  • LOFAR-Release-4_4_310 protected
  • LOFAR-Release-4_4_309 protected
  • LOFAR-Release-4_4_308 protected
  • LOFAR-Release-4_4_307 protected
  • LOFAR-Release-4_4_306 protected
  • LOFAR-Release-4_4_304 protected
  • LOFAR-Release-4_4_303 protected
  • LOFAR-Release-4_4_302 protected
  • LOFAR-Release-4_4_301 protected
  • LOFAR-Release-4_4_300 protected
  • LOFAR-Release-4_4_299 protected
41 results

translation_service_rpc.py

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    translation_service_rpc.py 1.30 KiB
    
    from lofar.messaging import RPCClientContextManagerMixin, RPCClient, DEFAULT_BROKER, DEFAULT_BUSNAME, DEFAULT_RPC_TIMEOUT
    from .config import SPECIFICATIONTRANSLATION_SERVICENAME
    import logging
    logger = logging.getLogger(__file__)
    
    
    class TranslationRPC(RPCClientContextManagerMixin):
    
        def __init__(self, busname=DEFAULT_BUSNAME,
                     broker=DEFAULT_BROKER,
                     timeout=DEFAULT_RPC_TIMEOUT):
            super(TranslationRPC, self).__init__()
            self._rpc_client = RPCClient(SPECIFICATIONTRANSLATION_SERVICENAME, busname, broker, timeout=timeout)
    
    
        def trigger_to_specification(self, trigger_spec, trigger_id, job_priority):
            logger.info("Requesting validation of trigger XML")
            result = self._rpc_client.execute('trigger_to_specification',
                              trigger_spec=trigger_spec,
                              trigger_id=trigger_id,
                              job_priority=job_priority)
            logger.info("Received validation result -> " +str(result))
            return result
    
    
        def specification_to_momspecification(self, spec):
            logger.info("Requesting validation of trigger XML")
            result = self._rpc_client.exchange('specification_to_momspecification', spec_xml=spec)
            logger.info("Received validation result -> " +str(result))
            return result