Example #1
0
    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)))
Example #2
0
    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)))
Example #3
0
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)
Example #4
0
 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)
Example #5
0
 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)