def add(ctx, name, value, example): response = post(ctx.parent.base_url, {k: v for k, v in ctx.params.items() if v}, debug=ctx.obj['DEBUG']) if ctx.obj['DEBUG']: click.echo('Response: %s' % (response)) click.echo('Setting added.')
def add( ctx, tool, ): # response = get('%s/tools/?search=%s' % (ctx.obj['URL'], tool), debug=ctx.obj['DEBUG']) _tool = response['data'][0] params = {k: v for k, v in ctx.params.items() if v} params['tools_id'] = _tool['id'] params['command'] = _tool['command'] response = post(ctx.parent.base_url, params, debug=ctx.obj['DEBUG']) if ctx.obj['DEBUG']: click.echo('Response: %s' % (response)) click.echo('Job added.')
def add(ctx, name, command, stdout, description, url): response = post(ctx.parent.base_url, {k: v for k, v in ctx.params.items() if v}, debug=ctx.obj['DEBUG']) if ctx.obj['DEBUG']: click.echo('Response: %s' % (response)) click.echo('Setting added.')
def execute(ctx, id): url = "%s%d/execute" % (ctx.parent.base_url, id) response = post(url, debug=ctx.obj['DEBUG']) if ctx.obj['DEBUG']: click.echo('Response: %s' % (response)) click.echo('Job executed.')