vent.api package

Submodules

vent.api.actions module

class vent.api.actions.Action(**kargs)[source]

Handle actions in menu

add(repo, tools=None, overrides=None, version='HEAD', branch='master', build=True, user=None, pw=None, groups=None, version_alias=None, wild=None, remove_old=True, disable_old=True)[source]

Add a new set of tool(s)

add_image(image, link_name, tag=None, registry=None, groups=None)[source]

Add a new image from a Docker registry

backup()[source]

Saves the configuration information of the current running vent instance to be used for restoring at a later time

build(repo=None, name=None, groups=None, enabled='yes', branch='master', version='HEAD')[source]

Build a set of tools that match the parameters given

clean(repo=None, name=None, groups=None, enabled='yes', branch='master', version='HEAD')[source]

Clean (stop and remove) a set of tools that match the parameters given, if no parameters are given, clean all installed tools on the master branch at verison HEAD that are enabled

static configure()[source]
disable(repo=None, name=None, groups=None, enabled='yes', branch='master', version='HEAD')[source]

Take an enabled tool and disable it

enable(repo=None, name=None, groups=None, enabled='no', branch='master', version='HEAD')[source]

Take a disabled tool and enable it

get_configure(repo=None, name=None, groups=None, enabled='yes', branch='master', version='HEAD', main_cfg=False)[source]

Get the vent.template settings for a given tool by looking at the plugin_manifest

static get_request(url)[source]

Send a get request to the given url

Args:
url(str): url to send the data to. Eg: http://0.0.0.0:37728
Returns:
A tuple of success status and whatever the url is supposed to give after a GET request or a failure message
static get_vent_tool_url(tool_name)[source]

Iterate through all containers and grab the port number corresponding to the given tool name. Works for only CORE tools since it specifically looks for core

Args:
tool_name(str): tool name to search for. Eg: network-tap
Returns:
A tuple of success status and the url corresponding to the given tool name or a failure mesage. An example return url is http://0.0.0.0:37728. Works well with send_request and get_request.
static help()[source]
inventory(choices=None)[source]

Return a dictionary of the inventory items and status

logs(c_type=None, grep_list=None)[source]

Generically filter logs stored in log containers

static post_request(url, json_data)[source]

Send a application/json post request to the given url

Args:

url(str): url to send the data to. Eg: http://0.0.0.0:37728 json_data(dict): json obj with data that will be sent to specified

url

action(str): what is being done. Eg: ‘starting a container’

Returns:
A tuple of success status and whatever the url is supposed to give after a POST request or a failure message
prep_start(repo=None, name=None, groups=None, enabled='yes', branch='master', version='HEAD')[source]

Prep a bunch of containers to be started to they can be ordered

remove(repo=None, namespace=None, name=None, groups=None, enabled='yes', branch='master', version='HEAD', built='yes')[source]

Remove tools or a repo

reset()[source]

Factory reset all of Vent’s user data, containers, and images

restart_tools(repo=None, name=None, groups=None, enabled='yes', branch='master', version='HEAD', main_cfg=False, old_val='', new_val='')[source]

Restart necessary tools based on changes that have been made either to vent.cfg or to vent.template. This includes tools that need to be restarted because they depend on other tools that were changed.

restore(backup_dir)[source]

Restores a vent configuration from a previously backed up version

save_configure(repo=None, name=None, groups=None, enabled='yes', branch='master', version='HEAD', config_val='', from_registry=False, main_cfg=False)[source]

Save changes made to vent.template through npyscreen to the template and to plugin_manifest

start(tool_d)[source]

Start a set of tools that match the parameters given, if no parameters are given, start all installed tools on the master branch at verison HEAD that are enabled

stop(repo=None, name=None, groups=None, enabled='yes', branch='master', version='HEAD')[source]

Stop a set of tools that match the parameters given, if no parameters are given, stop all installed tools on the master branch at verison HEAD that are enabled

update(repo=None, name=None, groups=None, enabled='yes', branch='master', version='HEAD', new_version='HEAD')[source]

Update a set of tools that match the parameters given, if no parameters are given, updated all installed tools on the master branch at verison HEAD that are enabled

static upgrade()[source]

vent.api.menu_helpers module

class vent.api.menu_helpers.MenuHelper(**kargs)[source]

Handle helper functions in the API for the Menu

cores(action, branch='master', version='HEAD')[source]

Supply action (install, build, start, stop, clean) for core tools

repo_branches(repo)[source]

Get the branches of a repository

repo_commits(repo)[source]

Get the commit IDs for all of the branches of a repository

repo_tools(repo, branch, version)[source]

Get available tools for a repository branch at a version

tools_status(core, branch='master', version='HEAD', **kargs)[source]

Get tools that are currently installed/built/running and also the number of repos that those tools come from; can toggle whether looking for core tools or plugin tools

vent.api.plugin_helpers module

class vent.api.plugin_helpers.PluginHelper(**kargs)[source]

Handle helper functions for the Plugin class

apply_path(repo)[source]

Set path to where the repo is and return original path

available_tools(path, version='HEAD', groups=None)[source]

Return list of possible tools in repo for the given version and branch

checkout(branch='master', version='HEAD')[source]

Checkout a specific version and branch of a repo

clone(repo, user=None, pw=None)[source]

Clone the repository

constraint_options(constraint_dict, options)[source]

Return result of constraints and options against a template

get_path(repo, core=False)[source]

Return the path for the repo

prep_start(repo=None, name=None, groups=None, enabled='yes', branch='master', version='HEAD')[source]

Start a set of tools that match the parameters given, if no parameters are given, start all installed tools on the master branch at verison HEAD that are enabled

start_containers(container, tool_d, s_containers, f_containers)[source]

Start container that was passed in and return status

start_priority_containers(groups, group_orders, tool_d)[source]

Select containers based on priorities to start

start_remaining_containers(containers_remaining, tool_d)[source]

Select remaining containers that didn’t have priorities to start

start_sections(s, files, groups, enabled, branch, version)[source]

Run through sections for prep_start

static tool_matches(tools=None, version='HEAD')[source]

Get the tools paths and versions that were specified

vent.api.plugins module

class vent.api.plugins.Plugin(**kargs)[source]

Handle Plugins

add(repo, tools=None, overrides=None, version='HEAD', branch='master', build=True, user=None, pw=None, groups=None, version_alias=None, wild=None, remove_old=True, disable_old=True, limit_groups=None, core=False)[source]

Adds a plugin of tool(s) tools is a list of tuples, where the pair is a tool name (path to Dockerfile) and version tools are for explicitly limiting which tools and versions (if version in tuple is ‘’, then defaults to version) overrides is a list of tuples, where the pair is a tool name (path to Dockerfile) and a version overrides are for explicitly removing tools and overriding versions of tools (if version in tuple is ‘’, then tool is removed, otherwise that tool is checked out at the specific version in the tuple) if tools and overrides are left as empty lists, then all tools in the repo are pulled down at the version and branch specified or defaulted to version is globally set for all tools, unless overridden in tools or overrides branch is globally set for all tools build is a boolean of whether or not to build the tools now user is the username for a private repo if needed pw is the password to go along with the username for a private repo groups is globally set for all tools version_alias is globally set for all tools and is a mapping from a friendly version tag to the real version commit ID wild lets you specify individual overrides for additional values in the tuple of tools or overrides. wild is a list containing one or more of the following: branch, build, groups, version_alias the order of the items in the wild list will expect values to be tacked on in the same order to the tuple for tools and overrides in additional to the tool name and version remove_old lets you specify whether or not to remove previously found tools that match to ones being added currently (note does not stop currently running instances of the older version) disable_old lets you specify whether or not to disable previously found tools that match to ones being added currently (note does not stop currently running instances of the older version) limit_groups is a list of groups to build tools for that match group names in vent.template of each tool if exists Examples: - repo=fe: (get all tools from repo ‘fe’ at version ‘HEAD’ on branch ‘master’) - repo=foo, version=”3d1f”, branch=”foo”: (get all tools from repo ‘foo’ at verion ‘3d1f’ on branch ‘foo’) - repo=foo, tools=[(‘bar’, ‘’), (‘baz’, ‘1d32’)]: (get only ‘bar’ from repo ‘foo’ at version ‘HEAD’ on branch ‘master’ and ‘baz’ from repo ‘foo’ at version ‘1d32’ on branch ‘master’, ignore all other tools in repo ‘foo’) - repo=foo overrides=[(‘baz/bar’, ‘’), (‘.’, ‘1c4e’)], version=‘4fad’: (get all tools from repo ‘foo’ at verion ‘4fad’ on branch ‘master’ except ‘baz/bar’ and for tool ‘.’ get version ‘1c4e’) - repo=foo tools=[(‘bar’, ‘1a2d’)], overrides=[(‘baz’, ‘f2a1’)]: (not a particularly useful example, but get ‘bar’ from ‘foo’ at version ‘1a2d’ and get ‘baz’ from ‘foo’ at version ‘f2a1’ on branch ‘master’, ignore all other tools)

add_image(*args, **kwargs)
auto_install()[source]

Automatically detects images and installs them in the manifest if they are not there already

builder(*args, **kwargs)
current_version(name, namespace=None, branch='master')[source]

Return current version for a given tool

disable(name, namespace=None, branch='master', version='HEAD')[source]

Disable tool at a specific version, default to head

enable(name, namespace=None, branch='master', version='HEAD')[source]

Enable tool at a specific version, default to head

list_tools()[source]

Return list of tuples of all tools

remove(name=None, repo=None, namespace=None, branch='master', groups=None, enabled='yes', version='HEAD', built='yes')[source]

Remove tool (name) or repository, repository is the url. If no arguments are specified, all tools will be removed for the defaults.

state(name, namespace=None, branch='master')[source]

Return state of a tool, disabled/enabled for each version

update(name=None, repo=None, namespace=None, branch=None, groups=None)[source]

Update tool (name) or repository, repository is the url. If no arguments are specified, all tools will be updated

versions(name, namespace=None, branch='master')[source]

Return available versions of a tool

vent.api.templates module

class vent.api.templates.Template(template=None)[source]

Handle parsing templates

add_option(*args, **kwargs)
add_section(*args, **kwargs)
constrained_sections(*args, **kwargs)
del_option(*args, **kwargs)
del_section(*args, **kwargs)
option(*args, **kwargs)
options(*args, **kwargs)
section(*args, **kwargs)
sections(*args, **kwargs)
set_option(*args, **kwargs)
write_config(*args, **kwargs)

Module contents