Exemplo n.º 1
0
        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)
Exemplo n.º 2
0
        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
Exemplo n.º 3
0
 def configure(instance):
     """View app instance configuration"""
     scheduled = master.get_app(context.GLOBAL.zk.conn, instance)
     cli.out(formatter(scheduled))