1
# Copyright 2014 Canonical Ltd. This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
4
"""Region Controller RPC."""
6
from __future__ import (
20
from maasserver import eventloop
21
from provisioningserver.rpc import exceptions
22
from provisioningserver.utils import asynchronous
26
def getClientFor(uuid):
29
Get a client with which to make RPCs to the specified cluster.
31
:raises: :py:class:`~.exceptions.NoConnectionsAvailable` when there
32
are no open connections to the specified cluster controller.
35
service = eventloop.services.getServiceNamed("rpc")
37
raise exceptions.NoConnectionsAvailable()
39
return service.getClientFor(uuid)
46
Get all recorded clients ready to make RPCs to clusters.
49
service = eventloop.services.getServiceNamed("rpc")
53
return service.getAllClients()