예제 #1
0
def stop(job_id=None, app_name=None):
    """Stop an application"""
    _LOGGER.debug('app_name: %r', app_name)
    _LOGGER.debug('job_id: %s', job_id)

    zkclient = context.GLOBAL.zk.conn

    instances = master.list_scheduled_apps(zkclient)

    app_name_pattern = '{}*'.format(app_name)
    filtered = [
        inst for inst in instances if fnmatch.fnmatch(inst, app_name_pattern)
    ]

    if not filtered:
        _LOGGER.info('Nothing is running for %s', app_name)
        return

    _LOGGER.info('Stopping all instances: %r', filtered)
    master.delete_apps(zkclient, filtered)
예제 #2
0
 def delete(apps):
     """Deletes (unschedules) the app by pattern"""
     master.delete_apps(context.GLOBAL.zk.conn, apps)
예제 #3
0
        def delete(rsrc_id):
            """Delete configured instance."""
            _LOGGER.info('delete: %s', rsrc_id)

            master.delete_apps(context.GLOBAL.zk.conn, [rsrc_id])