client.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # Copyright 2025 Cloudbase Solutions Srl
  2. # All Rights Reserved.
  3. from oslo_config import cfg
  4. import oslo_messaging as messaging
  5. from coriolis import constants
  6. from coriolis import rpc
  7. VERSION = "1.0"
  8. deployer_manager_opts = [
  9. cfg.IntOpt(
  10. 'deployer_manager_rpc_timeout',
  11. help="Number of seconds until RPC calls to the deployer manager "
  12. "timeout.")]
  13. CONF = cfg.CONF
  14. CONF.register_opts(deployer_manager_opts, 'deployer_manager')
  15. class DeployerManagerClient(rpc.BaseRPCClient):
  16. def __init__(
  17. self, timeout=None):
  18. target = messaging.Target(
  19. topic=constants.DEPLOYER_MANAGER_MAIN_MESSAGING_TOPIC,
  20. version=VERSION)
  21. if timeout is None:
  22. timeout = CONF.deployer_manager.deployer_manager_rpc_timeout
  23. super(DeployerManagerClient, self).__init__(target, timeout=timeout)
  24. def execute_auto_deployment(
  25. self, ctxt, transfer_id, deployer_id, **kwargs):
  26. self._cast(
  27. ctxt, 'execute_auto_deployment', transfer_id=transfer_id,
  28. deployer_id=deployer_id, **kwargs)