def update(rsrc_id, rsrc): """Update instance configuration.""" _LOGGER.info('update: %s %r', rsrc_id, rsrc) delta = {rsrc_id: rsrc['priority']} master.update_app_priorities(context.GLOBAL.zk.conn, delta) return master.get_app(context.GLOBAL.zk.conn, rsrc_id)
def get(rsrc_id): """Get instance configuration.""" inst = master.get_app(context.GLOBAL.zk.conn, rsrc_id) if inst is None: return inst inst['_id'] = rsrc_id if instance_plugin: return instance_plugin.remove_attributes(inst) else: return inst
def configure(instance): """View app instance configuration""" scheduled = master.get_app(context.GLOBAL.zk.conn, instance) cli.out(formatter(scheduled))