class Controller(object):
- def __init__(self, loop=None):
+ def __init__(self, loop=None,
+ max_frame_size=connection.Connection.DEFAULT_FRAME_SIZE):
"""Instantiate a new Controller.
One of the connect_* methods will need to be called before this
"""
self.loop = loop or asyncio.get_event_loop()
+ self.max_frame_size = None
self.connection = None
self.controller_name = None
"""
self.connection = await connection.Connection.connect(
- endpoint, None, username, password, cacert, macaroons)
+ endpoint, None, username, password, cacert, macaroons,
+ max_frame_size=self.max_frame_size)
async def connect_current(self):
"""Connect to the current Juju controller.
"""
self.connection = (
- await connection.Connection.connect_current_controller())
+ await connection.Connection.connect_current_controller(
+ max_frame_size=self.max_frame_size))
async def connect_controller(self, controller_name):
"""Connect to a Juju controller by name.
"""
self.connection = (
- await connection.Connection.connect_controller(controller_name))
+ await connection.Connection.connect_controller(
+ controller_name, max_frame_size=self.max_frame_size))
self.controller_name = controller_name
async def disconnect(self):
self.connection)
return await controller_facade.AllModels()
-
def get_payloads(self, *patterns):
"""Return list of known payloads.
client_facade = client.UserManagerFacade.from_connection(
self.connection)
user = tag.user(username)
- return await client_facade.UserInfo([client.Entity(user)], include_disabled)
+ return await client_facade.UserInfo([client.Entity(user)],
+ include_disabled)
async def grant(self, username, acl='login'):
"""Set access level of the given user on the controller