def configure(app, count): """Create, get or modify an app monitor configuration""" zkclient = context.GLOBAL.zk.conn if count is not None: master.update_appmonitor(zkclient, app, count) cli.out(formatter(master.get_appmonitor(zkclient, app)))
def configure(app, count): """Configures app monitor.""" zkclient = context.GLOBAL.zk.conn if count is not None: master.update_appmonitor(zkclient, app, count) cli.out(formatter(master.get_appmonitor(zkclient, app)))
def set_count(monitor_name=None, count=None): """Set the count on the supplied monitor""" _LOGGER.debug('monitor_name: %s', monitor_name) _LOGGER.debug('count: %s', count) zkclient = context.GLOBAL.zk.conn if not monitor_name: _LOGGER.error('No monitor name supplied, cannot continue') return master.update_appmonitor(zkclient, monitor_name, count)
def update(rsrc_id, rsrc): """Update application configuration.""" zkclient = context.GLOBAL.zk.conn master.update_appmonitor(zkclient, rsrc_id, rsrc['count']) return master.get_appmonitor(zkclient, rsrc_id)
def create(rsrc_id, rsrc): """Create (configure) application monitor.""" zkclient = context.GLOBAL.zk.conn master.update_appmonitor(zkclient, rsrc_id, rsrc['count']) return master.get_appmonitor(zkclient, rsrc_id)