partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
_scrub_links
Remove container name from HostConfig:Links values to enable comparing container configurations correctly.
salt/modules/dockermod.py
def _scrub_links(links, name): ''' Remove container name from HostConfig:Links values to enable comparing container configurations correctly. ''' if isinstance(links, list): ret = [] for l in links: ret.append(l.replace('/{0}/'.format(name), '/', 1)) else: ret...
def _scrub_links(links, name): ''' Remove container name from HostConfig:Links values to enable comparing container configurations correctly. ''' if isinstance(links, list): ret = [] for l in links: ret.append(l.replace('/{0}/'.format(name), '/', 1)) else: ret...
[ "Remove", "container", "name", "from", "HostConfig", ":", "Links", "values", "to", "enable", "comparing", "container", "configurations", "correctly", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L584-L596
[ "def", "_scrub_links", "(", "links", ",", "name", ")", ":", "if", "isinstance", "(", "links", ",", "list", ")", ":", "ret", "=", "[", "]", "for", "l", "in", "links", ":", "ret", ".", "append", "(", "l", ".", "replace", "(", "'/{0}/'", ".", "forma...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_size_fmt
Format bytes as human-readable file sizes
salt/modules/dockermod.py
def _size_fmt(num): ''' Format bytes as human-readable file sizes ''' try: num = int(num) if num < 1024: return '{0} bytes'.format(num) num /= 1024.0 for unit in ('KiB', 'MiB', 'GiB', 'TiB', 'PiB'): if num < 1024.0: return '{0:3.1f}...
def _size_fmt(num): ''' Format bytes as human-readable file sizes ''' try: num = int(num) if num < 1024: return '{0} bytes'.format(num) num /= 1024.0 for unit in ('KiB', 'MiB', 'GiB', 'TiB', 'PiB'): if num < 1024.0: return '{0:3.1f}...
[ "Format", "bytes", "as", "human", "-", "readable", "file", "sizes" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L608-L623
[ "def", "_size_fmt", "(", "num", ")", ":", "try", ":", "num", "=", "int", "(", "num", ")", "if", "num", "<", "1024", ":", "return", "'{0} bytes'", ".", "format", "(", "num", ")", "num", "/=", "1024.0", "for", "unit", "in", "(", "'KiB'", ",", "'MiB...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_client_wrapper
Common functionality for running low-level API calls
salt/modules/dockermod.py
def _client_wrapper(attr, *args, **kwargs): ''' Common functionality for running low-level API calls ''' catch_api_errors = kwargs.pop('catch_api_errors', True) func = getattr(__context__['docker.client'], attr, None) if func is None or not hasattr(func, '__call__'): raise SaltInvocation...
def _client_wrapper(attr, *args, **kwargs): ''' Common functionality for running low-level API calls ''' catch_api_errors = kwargs.pop('catch_api_errors', True) func = getattr(__context__['docker.client'], attr, None) if func is None or not hasattr(func, '__call__'): raise SaltInvocation...
[ "Common", "functionality", "for", "running", "low", "-", "level", "API", "calls" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L627-L671
[ "def", "_client_wrapper", "(", "attr", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "catch_api_errors", "=", "kwargs", ".", "pop", "(", "'catch_api_errors'", ",", "True", ")", "func", "=", "getattr", "(", "__context__", "[", "'docker.client'", "]",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_build_status
Process a status update from a docker build, updating the data structure
salt/modules/dockermod.py
def _build_status(data, item): ''' Process a status update from a docker build, updating the data structure ''' stream = item['stream'] if 'Running in' in stream: data.setdefault('Intermediate_Containers', []).append( stream.rstrip().split()[-1]) if 'Successfully built' in st...
def _build_status(data, item): ''' Process a status update from a docker build, updating the data structure ''' stream = item['stream'] if 'Running in' in stream: data.setdefault('Intermediate_Containers', []).append( stream.rstrip().split()[-1]) if 'Successfully built' in st...
[ "Process", "a", "status", "update", "from", "a", "docker", "build", "updating", "the", "data", "structure" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L674-L683
[ "def", "_build_status", "(", "data", ",", "item", ")", ":", "stream", "=", "item", "[", "'stream'", "]", "if", "'Running in'", "in", "stream", ":", "data", ".", "setdefault", "(", "'Intermediate_Containers'", ",", "[", "]", ")", ".", "append", "(", "stre...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_import_status
Process a status update from docker import, updating the data structure
salt/modules/dockermod.py
def _import_status(data, item, repo_name, repo_tag): ''' Process a status update from docker import, updating the data structure ''' status = item['status'] try: if 'Downloading from' in status: return elif all(x in string.hexdigits for x in status): # Status ...
def _import_status(data, item, repo_name, repo_tag): ''' Process a status update from docker import, updating the data structure ''' status = item['status'] try: if 'Downloading from' in status: return elif all(x in string.hexdigits for x in status): # Status ...
[ "Process", "a", "status", "update", "from", "docker", "import", "updating", "the", "data", "structure" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L686-L699
[ "def", "_import_status", "(", "data", ",", "item", ",", "repo_name", ",", "repo_tag", ")", ":", "status", "=", "item", "[", "'status'", "]", "try", ":", "if", "'Downloading from'", "in", "status", ":", "return", "elif", "all", "(", "x", "in", "string", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_pull_status
Process a status update from a docker pull, updating the data structure. For containers created with older versions of Docker, there is no distinction in the status updates between layers that were already present (and thus not necessary to download), and those which were actually downloaded. Because o...
salt/modules/dockermod.py
def _pull_status(data, item): ''' Process a status update from a docker pull, updating the data structure. For containers created with older versions of Docker, there is no distinction in the status updates between layers that were already present (and thus not necessary to download), and those whi...
def _pull_status(data, item): ''' Process a status update from a docker pull, updating the data structure. For containers created with older versions of Docker, there is no distinction in the status updates between layers that were already present (and thus not necessary to download), and those whi...
[ "Process", "a", "status", "update", "from", "a", "docker", "pull", "updating", "the", "data", "structure", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L702-L759
[ "def", "_pull_status", "(", "data", ",", "item", ")", ":", "def", "_already_exists", "(", "id_", ")", ":", "'''\n Layer already exists\n '''", "already_pulled", "=", "data", ".", "setdefault", "(", "'Layers'", ",", "{", "}", ")", ".", "setdefault",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_push_status
Process a status update from a docker push, updating the data structure
salt/modules/dockermod.py
def _push_status(data, item): ''' Process a status update from a docker push, updating the data structure ''' status = item['status'].lower() if 'id' in item: if 'already pushed' in status or 'already exists' in status: # Layer already exists already_pushed = data.set...
def _push_status(data, item): ''' Process a status update from a docker push, updating the data structure ''' status = item['status'].lower() if 'id' in item: if 'already pushed' in status or 'already exists' in status: # Layer already exists already_pushed = data.set...
[ "Process", "a", "status", "update", "from", "a", "docker", "push", "updating", "the", "data", "structure" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L762-L777
[ "def", "_push_status", "(", "data", ",", "item", ")", ":", "status", "=", "item", "[", "'status'", "]", ".", "lower", "(", ")", "if", "'id'", "in", "item", ":", "if", "'already pushed'", "in", "status", "or", "'already exists'", "in", "status", ":", "#...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_error_detail
Process an API error, updating the data structure
salt/modules/dockermod.py
def _error_detail(data, item): ''' Process an API error, updating the data structure ''' err = item['errorDetail'] if 'code' in err: try: msg = ': '.join(( item['errorDetail']['code'], item['errorDetail']['message'] )) except Ty...
def _error_detail(data, item): ''' Process an API error, updating the data structure ''' err = item['errorDetail'] if 'code' in err: try: msg = ': '.join(( item['errorDetail']['code'], item['errorDetail']['message'] )) except Ty...
[ "Process", "an", "API", "error", "updating", "the", "data", "structure" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L780-L798
[ "def", "_error_detail", "(", "data", ",", "item", ")", ":", "err", "=", "item", "[", "'errorDetail'", "]", "if", "'code'", "in", "err", ":", "try", ":", "msg", "=", "': '", ".", "join", "(", "(", "item", "[", "'errorDetail'", "]", "[", "'code'", "]...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_create_kwargs
Take input kwargs and return a kwargs dict to pass to docker-py's create_container() function.
salt/modules/dockermod.py
def _get_create_kwargs(skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_args=None, **kwargs): ''' Take input kwargs and return a kwargs dict to pass to docker-py's create_container() funct...
def _get_create_kwargs(skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_args=None, **kwargs): ''' Take input kwargs and return a kwargs dict to pass to docker-py's create_container() funct...
[ "Take", "input", "kwargs", "and", "return", "a", "kwargs", "dict", "to", "pass", "to", "docker", "-", "py", "s", "create_container", "()", "function", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L852-L907
[ "def", "_get_create_kwargs", "(", "skip_translate", "=", "None", ",", "ignore_collisions", "=", "False", ",", "validate_ip_addrs", "=", "True", ",", "client_args", "=", "None", ",", "*", "*", "kwargs", ")", ":", "networks", "=", "kwargs", ".", "pop", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
compare_containers
.. versionadded:: 2017.7.0 .. versionchanged:: 2018.3.0 Renamed from ``docker.compare_container`` to ``docker.compare_containers`` (old function name remains as an alias) Compare two containers' Config and and HostConfig and return any differences between the two. first Name or...
salt/modules/dockermod.py
def compare_containers(first, second, ignore=None): ''' .. versionadded:: 2017.7.0 .. versionchanged:: 2018.3.0 Renamed from ``docker.compare_container`` to ``docker.compare_containers`` (old function name remains as an alias) Compare two containers' Config and and HostConfig and return...
def compare_containers(first, second, ignore=None): ''' .. versionadded:: 2017.7.0 .. versionchanged:: 2018.3.0 Renamed from ``docker.compare_container`` to ``docker.compare_containers`` (old function name remains as an alias) Compare two containers' Config and and HostConfig and return...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "0", "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "Renamed", "from", "docker", ".", "compare_container", "to", "docker", ".", "compare_containers", "(", "old", "function", "name", "remains", "...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L910-L1004
[ "def", "compare_containers", "(", "first", ",", "second", ",", "ignore", "=", "None", ")", ":", "ignore", "=", "__utils__", "[", "'args.split_input'", "]", "(", "ignore", "or", "[", "]", ")", "result1", "=", "inspect_container", "(", "first", ")", "result2...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
compare_container_networks
.. versionadded:: 2018.3.0 Returns the differences between two containers' networks. When a network is only present one of the two containers, that network's diff will simply be represented with ``True`` for the side of the diff in which the network is present) and ``False`` for the side of the diff in...
salt/modules/dockermod.py
def compare_container_networks(first, second): ''' .. versionadded:: 2018.3.0 Returns the differences between two containers' networks. When a network is only present one of the two containers, that network's diff will simply be represented with ``True`` for the side of the diff in which the networ...
def compare_container_networks(first, second): ''' .. versionadded:: 2018.3.0 Returns the differences between two containers' networks. When a network is only present one of the two containers, that network's diff will simply be represented with ``True`` for the side of the diff in which the networ...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1012-L1248
[ "def", "compare_container_networks", "(", "first", ",", "second", ")", ":", "def", "_get_nets", "(", "data", ")", ":", "return", "data", ".", "get", "(", "'NetworkSettings'", ",", "{", "}", ")", ".", "get", "(", "'Networks'", ",", "{", "}", ")", "compa...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
compare_networks
.. versionadded:: 2018.3.0 Compare two networks and return any differences between the two first Name or ID of first container second Name or ID of second container ignore : Name,Id,Created,Containers A comma-separated list (or Python list) of keys to ignore when comp...
salt/modules/dockermod.py
def compare_networks(first, second, ignore='Name,Id,Created,Containers'): ''' .. versionadded:: 2018.3.0 Compare two networks and return any differences between the two first Name or ID of first container second Name or ID of second container ignore : Name,Id,Created,Containe...
def compare_networks(first, second, ignore='Name,Id,Created,Containers'): ''' .. versionadded:: 2018.3.0 Compare two networks and return any differences between the two first Name or ID of first container second Name or ID of second container ignore : Name,Id,Created,Containe...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1251-L1322
[ "def", "compare_networks", "(", "first", ",", "second", ",", "ignore", "=", "'Name,Id,Created,Containers'", ")", ":", "ignore", "=", "__utils__", "[", "'args.split_input'", "]", "(", "ignore", "or", "[", "]", ")", "net1", "=", "inspect_network", "(", "first", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
connected
.. versionadded:: 2018.3.0 Return a list of running containers attached to the specified network name Network name verbose : False If ``True``, return extended info about each container (IP configuration, etc.) CLI Example: .. code-block:: bash salt myminion doc...
salt/modules/dockermod.py
def connected(name, verbose=False): ''' .. versionadded:: 2018.3.0 Return a list of running containers attached to the specified network name Network name verbose : False If ``True``, return extended info about each container (IP configuration, etc.) CLI Example: ...
def connected(name, verbose=False): ''' .. versionadded:: 2018.3.0 Return a list of running containers attached to the specified network name Network name verbose : False If ``True``, return extended info about each container (IP configuration, etc.) CLI Example: ...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1325-L1366
[ "def", "connected", "(", "name", ",", "verbose", "=", "False", ")", ":", "containers", "=", "inspect_network", "(", "name", ")", ".", "get", "(", "'Containers'", ",", "{", "}", ")", "ret", "=", "{", "}", "for", "cid", ",", "cinfo", "in", "six", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
login
.. versionadded:: 2016.3.7,2016.11.4,2017.7.0 Performs a ``docker login`` to authenticate to one or more configured repositories. See the documentation at the top of this page to configure authentication credentials. Multiple registry URLs (matching those configured in Pillar) can be passed, and S...
salt/modules/dockermod.py
def login(*registries): ''' .. versionadded:: 2016.3.7,2016.11.4,2017.7.0 Performs a ``docker login`` to authenticate to one or more configured repositories. See the documentation at the top of this page to configure authentication credentials. Multiple registry URLs (matching those configured...
def login(*registries): ''' .. versionadded:: 2016.3.7,2016.11.4,2017.7.0 Performs a ``docker login`` to authenticate to one or more configured repositories. See the documentation at the top of this page to configure authentication credentials. Multiple registry URLs (matching those configured...
[ "..", "versionadded", "::", "2016", ".", "3", ".", "7", "2016", ".", "11", ".", "4", "2017", ".", "7", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1369-L1465
[ "def", "login", "(", "*", "registries", ")", ":", "# NOTE: This function uses the \"docker login\" CLI command so that login", "# information is added to the config.json, since docker-py isn't designed", "# to do so.", "registry_auth", "=", "__pillar__", ".", "get", "(", "'docker-reg...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
depends
Returns the containers and images, if any, which depend on the given image name Name or ID of image **RETURN DATA** A dictionary containing the following keys: - ``Containers`` - A list of containers which depend on the specified image - ``Images`` - A list of IDs of images which depend...
salt/modules/dockermod.py
def depends(name): ''' Returns the containers and images, if any, which depend on the given image name Name or ID of image **RETURN DATA** A dictionary containing the following keys: - ``Containers`` - A list of containers which depend on the specified image - ``Images`` - A lis...
def depends(name): ''' Returns the containers and images, if any, which depend on the given image name Name or ID of image **RETURN DATA** A dictionary containing the following keys: - ``Containers`` - A list of containers which depend on the specified image - ``Images`` - A lis...
[ "Returns", "the", "containers", "and", "images", "if", "any", "which", "depend", "on", "the", "given", "image" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1469-L1506
[ "def", "depends", "(", "name", ")", ":", "# Resolve tag or short-SHA to full SHA", "image_id", "=", "inspect_image", "(", "name", ")", "[", "'Id'", "]", "container_depends", "=", "[", "]", "for", "container", "in", "six", ".", "itervalues", "(", "ps_", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
diff
Get information on changes made to container's filesystem since it was created. Equivalent to running the ``docker diff`` Docker CLI command. name Container name or ID **RETURN DATA** A dictionary containing any of the following keys: - ``Added`` - A list of paths that were added. -...
salt/modules/dockermod.py
def diff(name): ''' Get information on changes made to container's filesystem since it was created. Equivalent to running the ``docker diff`` Docker CLI command. name Container name or ID **RETURN DATA** A dictionary containing any of the following keys: - ``Added`` - A list of ...
def diff(name): ''' Get information on changes made to container's filesystem since it was created. Equivalent to running the ``docker diff`` Docker CLI command. name Container name or ID **RETURN DATA** A dictionary containing any of the following keys: - ``Added`` - A list of ...
[ "Get", "information", "on", "changes", "made", "to", "container", "s", "filesystem", "since", "it", "was", "created", ".", "Equivalent", "to", "running", "the", "docker", "diff", "Docker", "CLI", "command", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1509-L1548
[ "def", "diff", "(", "name", ")", ":", "changes", "=", "_client_wrapper", "(", "'diff'", ",", "name", ")", "kind_map", "=", "{", "0", ":", "'Changed'", ",", "1", ":", "'Added'", ",", "2", ":", "'Deleted'", "}", "ret", "=", "{", "}", "for", "change",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
exists
Check if a given container exists name Container name or ID **RETURN DATA** A boolean (``True`` if the container exists, otherwise ``False``) CLI Example: .. code-block:: bash salt myminion docker.exists mycontainer
salt/modules/dockermod.py
def exists(name): ''' Check if a given container exists name Container name or ID **RETURN DATA** A boolean (``True`` if the container exists, otherwise ``False``) CLI Example: .. code-block:: bash salt myminion docker.exists mycontainer ''' contextkey = 'dock...
def exists(name): ''' Check if a given container exists name Container name or ID **RETURN DATA** A boolean (``True`` if the container exists, otherwise ``False``) CLI Example: .. code-block:: bash salt myminion docker.exists mycontainer ''' contextkey = 'dock...
[ "Check", "if", "a", "given", "container", "exists" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1551-L1581
[ "def", "exists", "(", "name", ")", ":", "contextkey", "=", "'docker.exists.{0}'", ".", "format", "(", "name", ")", "if", "contextkey", "in", "__context__", ":", "return", "__context__", "[", "contextkey", "]", "try", ":", "c_info", "=", "_client_wrapper", "(...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
history
Return the history for an image. Equivalent to running the ``docker history`` Docker CLI command. name Container name or ID quiet : False If ``True``, the return data will simply be a list of the commands run to build the container. .. code-block:: bash $ salt...
salt/modules/dockermod.py
def history(name, quiet=False): ''' Return the history for an image. Equivalent to running the ``docker history`` Docker CLI command. name Container name or ID quiet : False If ``True``, the return data will simply be a list of the commands run to build the container. ...
def history(name, quiet=False): ''' Return the history for an image. Equivalent to running the ``docker history`` Docker CLI command. name Container name or ID quiet : False If ``True``, the return data will simply be a list of the commands run to build the container. ...
[ "Return", "the", "history", "for", "an", "image", ".", "Equivalent", "to", "running", "the", "docker", "history", "Docker", "CLI", "command", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1584-L1670
[ "def", "history", "(", "name", ",", "quiet", "=", "False", ")", ":", "response", "=", "_client_wrapper", "(", "'history'", ",", "name", ")", "key_map", "=", "{", "'CreatedBy'", ":", "'Command'", ",", "'Created'", ":", "'Time_Created_Epoch'", ",", "}", "com...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
images
Returns information about the Docker images on the Minion. Equivalent to running the ``docker images`` Docker CLI command. all : False If ``True``, untagged images will also be returned verbose : False If ``True``, a ``docker inspect`` will be run on each image returned. **RETURN DAT...
salt/modules/dockermod.py
def images(verbose=False, **kwargs): ''' Returns information about the Docker images on the Minion. Equivalent to running the ``docker images`` Docker CLI command. all : False If ``True``, untagged images will also be returned verbose : False If ``True``, a ``docker inspect`` will ...
def images(verbose=False, **kwargs): ''' Returns information about the Docker images on the Minion. Equivalent to running the ``docker images`` Docker CLI command. all : False If ``True``, untagged images will also be returned verbose : False If ``True``, a ``docker inspect`` will ...
[ "Returns", "information", "about", "the", "Docker", "images", "on", "the", "Minion", ".", "Equivalent", "to", "running", "the", "docker", "images", "Docker", "CLI", "command", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1673-L1739
[ "def", "images", "(", "verbose", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", "'docker.images'", "not", "in", "__context__", ":", "response", "=", "_client_wrapper", "(", "'images'", ",", "all", "=", "kwargs", ".", "get", "(", "'all'", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
inspect
.. versionchanged:: 2017.7.0 Volumes and networks are now checked, in addition to containers and images. This is a generic container/image/volume/network inspecton function. It will run the following functions in order: - :py:func:`docker.inspect_container <salt.modules.dockermod.ins...
salt/modules/dockermod.py
def inspect(name): ''' .. versionchanged:: 2017.7.0 Volumes and networks are now checked, in addition to containers and images. This is a generic container/image/volume/network inspecton function. It will run the following functions in order: - :py:func:`docker.inspect_container ...
def inspect(name): ''' .. versionchanged:: 2017.7.0 Volumes and networks are now checked, in addition to containers and images. This is a generic container/image/volume/network inspecton function. It will run the following functions in order: - :py:func:`docker.inspect_container ...
[ "..", "versionchanged", "::", "2017", ".", "7", ".", "0", "Volumes", "and", "networks", "are", "now", "checked", "in", "addition", "to", "containers", "and", "images", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1756-L1812
[ "def", "inspect", "(", "name", ")", ":", "try", ":", "return", "inspect_container", "(", "name", ")", "except", "CommandExecutionError", "as", "exc", ":", "if", "'does not exist'", "not", "in", "exc", ".", "strerror", ":", "raise", "try", ":", "return", "i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
inspect_image
Retrieves image information. Equivalent to running the ``docker inspect`` Docker CLI command, but will only look for image information. .. note:: To inspect an image, it must have been pulled from a registry or built locally. Images on a Docker registry which have not been pulled cannot ...
salt/modules/dockermod.py
def inspect_image(name): ''' Retrieves image information. Equivalent to running the ``docker inspect`` Docker CLI command, but will only look for image information. .. note:: To inspect an image, it must have been pulled from a registry or built locally. Images on a Docker registry whic...
def inspect_image(name): ''' Retrieves image information. Equivalent to running the ``docker inspect`` Docker CLI command, but will only look for image information. .. note:: To inspect an image, it must have been pulled from a registry or built locally. Images on a Docker registry whic...
[ "Retrieves", "image", "information", ".", "Equivalent", "to", "running", "the", "docker", "inspect", "Docker", "CLI", "command", "but", "will", "only", "look", "for", "image", "information", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1839-L1870
[ "def", "inspect_image", "(", "name", ")", ":", "ret", "=", "_client_wrapper", "(", "'inspect_image'", ",", "name", ")", "for", "param", "in", "(", "'Size'", ",", "'VirtualSize'", ")", ":", "if", "param", "in", "ret", ":", "ret", "[", "'{0}_Human'", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_containers
Returns a list of containers by name. This is different from :py:func:`docker.ps <salt.modules.dockermod.ps_>` in that :py:func:`docker.ps <salt.modules.dockermod.ps_>` returns its results organized by container ID. all : False If ``True``, stopped containers will be included in return data ...
salt/modules/dockermod.py
def list_containers(**kwargs): ''' Returns a list of containers by name. This is different from :py:func:`docker.ps <salt.modules.dockermod.ps_>` in that :py:func:`docker.ps <salt.modules.dockermod.ps_>` returns its results organized by container ID. all : False If ``True``, stopped con...
def list_containers(**kwargs): ''' Returns a list of containers by name. This is different from :py:func:`docker.ps <salt.modules.dockermod.ps_>` in that :py:func:`docker.ps <salt.modules.dockermod.ps_>` returns its results organized by container ID. all : False If ``True``, stopped con...
[ "Returns", "a", "list", "of", "containers", "by", "name", ".", "This", "is", "different", "from", ":", "py", ":", "func", ":", "docker", ".", "ps", "<salt", ".", "modules", ".", "dockermod", ".", "ps_", ">", "in", "that", ":", "py", ":", "func", ":...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1873-L1896
[ "def", "list_containers", "(", "*", "*", "kwargs", ")", ":", "ret", "=", "set", "(", ")", "for", "item", "in", "six", ".", "itervalues", "(", "ps_", "(", "all", "=", "kwargs", ".", "get", "(", "'all'", ",", "False", ")", ")", ")", ":", "names", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_tags
Returns a list of tagged images CLI Example: .. code-block:: bash salt myminion docker.list_tags
salt/modules/dockermod.py
def list_tags(): ''' Returns a list of tagged images CLI Example: .. code-block:: bash salt myminion docker.list_tags ''' ret = set() for item in six.itervalues(images()): if not item.get('RepoTags'): continue ret.update(set(item['RepoTags'])) retur...
def list_tags(): ''' Returns a list of tagged images CLI Example: .. code-block:: bash salt myminion docker.list_tags ''' ret = set() for item in six.itervalues(images()): if not item.get('RepoTags'): continue ret.update(set(item['RepoTags'])) retur...
[ "Returns", "a", "list", "of", "tagged", "images" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1899-L1914
[ "def", "list_tags", "(", ")", ":", "ret", "=", "set", "(", ")", "for", "item", "in", "six", ".", "itervalues", "(", "images", "(", ")", ")", ":", "if", "not", "item", ".", "get", "(", "'RepoTags'", ")", ":", "continue", "ret", ".", "update", "(",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
resolve_image_id
.. versionadded:: 2018.3.0 Given an image name (or partial image ID), return the full image ID. If no match is found among the locally-pulled images, then ``False`` will be returned. CLI Examples: .. code-block:: bash salt myminion docker.resolve_image_id foo salt myminion docker...
salt/modules/dockermod.py
def resolve_image_id(name): ''' .. versionadded:: 2018.3.0 Given an image name (or partial image ID), return the full image ID. If no match is found among the locally-pulled images, then ``False`` will be returned. CLI Examples: .. code-block:: bash salt myminion docker.resolve_i...
def resolve_image_id(name): ''' .. versionadded:: 2018.3.0 Given an image name (or partial image ID), return the full image ID. If no match is found among the locally-pulled images, then ``False`` will be returned. CLI Examples: .. code-block:: bash salt myminion docker.resolve_i...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1917-L1944
[ "def", "resolve_image_id", "(", "name", ")", ":", "try", ":", "inspect_result", "=", "inspect_image", "(", "name", ")", "return", "inspect_result", "[", "'Id'", "]", "except", "CommandExecutionError", ":", "# No matching image pulled locally, or inspect_image otherwise fa...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
resolve_tag
.. versionadded:: 2017.7.2 .. versionchanged:: 2018.3.0 Instead of matching against pulled tags using :py:func:`docker.list_tags <salt.modules.dockermod.list_tags>`, this function now simply inspects the passed image name using :py:func:`docker.inspect_image <salt.modules.dockermod.i...
salt/modules/dockermod.py
def resolve_tag(name, **kwargs): ''' .. versionadded:: 2017.7.2 .. versionchanged:: 2018.3.0 Instead of matching against pulled tags using :py:func:`docker.list_tags <salt.modules.dockermod.list_tags>`, this function now simply inspects the passed image name using :py:func:`d...
def resolve_tag(name, **kwargs): ''' .. versionadded:: 2017.7.2 .. versionchanged:: 2018.3.0 Instead of matching against pulled tags using :py:func:`docker.list_tags <salt.modules.dockermod.list_tags>`, this function now simply inspects the passed image name using :py:func:`d...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "2", "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "Instead", "of", "matching", "against", "pulled", "tags", "using", ":", "py", ":", "func", ":", "docker", ".", "list_tags", "<salt", ".", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L1947-L2012
[ "def", "resolve_tag", "(", "name", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "__utils__", "[", "'args.clean_kwargs'", "]", "(", "*", "*", "kwargs", ")", "all_", "=", "kwargs", ".", "pop", "(", "'all'", ",", "False", ")", "if", "kwargs", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
logs
.. versionchanged:: 2018.3.0 Support for all of docker-py's `logs()`_ function's arguments, with the exception of ``stream``. Returns the logs for the container. An interface to docker-py's `logs()`_ function. name Container name or ID stdout : True Return stdout lines...
salt/modules/dockermod.py
def logs(name, **kwargs): ''' .. versionchanged:: 2018.3.0 Support for all of docker-py's `logs()`_ function's arguments, with the exception of ``stream``. Returns the logs for the container. An interface to docker-py's `logs()`_ function. name Container name or ID std...
def logs(name, **kwargs): ''' .. versionchanged:: 2018.3.0 Support for all of docker-py's `logs()`_ function's arguments, with the exception of ``stream``. Returns the logs for the container. An interface to docker-py's `logs()`_ function. name Container name or ID std...
[ "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "Support", "for", "all", "of", "docker", "-", "py", "s", "logs", "()", "_", "function", "s", "arguments", "with", "the", "exception", "of", "stream", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2015-L2096
[ "def", "logs", "(", "name", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "__utils__", "[", "'args.clean_kwargs'", "]", "(", "*", "*", "kwargs", ")", "if", "'stream'", "in", "kwargs", ":", "raise", "SaltInvocationError", "(", "'The \\'stream\\' argument ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
port
Returns port mapping information for a given container. Equivalent to running the ``docker port`` Docker CLI command. name Container name or ID .. versionchanged:: 2019.2.0 This value can now be a pattern expression (using the pattern-matching characters defined in fnma...
salt/modules/dockermod.py
def port(name, private_port=None): ''' Returns port mapping information for a given container. Equivalent to running the ``docker port`` Docker CLI command. name Container name or ID .. versionchanged:: 2019.2.0 This value can now be a pattern expression (using the ...
def port(name, private_port=None): ''' Returns port mapping information for a given container. Equivalent to running the ``docker port`` Docker CLI command. name Container name or ID .. versionchanged:: 2019.2.0 This value can now be a pattern expression (using the ...
[ "Returns", "port", "mapping", "information", "for", "a", "given", "container", ".", "Equivalent", "to", "running", "the", "docker", "port", "Docker", "CLI", "command", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2116-L2192
[ "def", "port", "(", "name", ",", "private_port", "=", "None", ")", ":", "pattern_used", "=", "bool", "(", "re", ".", "search", "(", "r'[*?\\[]'", ",", "name", ")", ")", "names", "=", "fnmatch", ".", "filter", "(", "list_containers", "(", "all", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ps_
Returns information about the Docker containers on the Minion. Equivalent to running the ``docker ps`` Docker CLI command. all : False If ``True``, stopped containers will also be returned host: False If ``True``, local host's network topology will be included verbose : False ...
salt/modules/dockermod.py
def ps_(filters=None, **kwargs): ''' Returns information about the Docker containers on the Minion. Equivalent to running the ``docker ps`` Docker CLI command. all : False If ``True``, stopped containers will also be returned host: False If ``True``, local host's network topology w...
def ps_(filters=None, **kwargs): ''' Returns information about the Docker containers on the Minion. Equivalent to running the ``docker ps`` Docker CLI command. all : False If ``True``, stopped containers will also be returned host: False If ``True``, local host's network topology w...
[ "Returns", "information", "about", "the", "Docker", "containers", "on", "the", "Minion", ".", "Equivalent", "to", "running", "the", "docker", "ps", "Docker", "CLI", "command", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2195-L2268
[ "def", "ps_", "(", "filters", "=", "None", ",", "*", "*", "kwargs", ")", ":", "response", "=", "_client_wrapper", "(", "'containers'", ",", "all", "=", "True", ",", "filters", "=", "filters", ")", "key_map", "=", "{", "'Created'", ":", "'Time_Created_Epo...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
state
Returns the state of the container name Container name or ID **RETURN DATA** A string representing the current state of the container (either ``running``, ``paused``, or ``stopped``) CLI Example: .. code-block:: bash salt myminion docker.state mycontainer
salt/modules/dockermod.py
def state(name): ''' Returns the state of the container name Container name or ID **RETURN DATA** A string representing the current state of the container (either ``running``, ``paused``, or ``stopped``) CLI Example: .. code-block:: bash salt myminion docker.state...
def state(name): ''' Returns the state of the container name Container name or ID **RETURN DATA** A string representing the current state of the container (either ``running``, ``paused``, or ``stopped``) CLI Example: .. code-block:: bash salt myminion docker.state...
[ "Returns", "the", "state", "of", "the", "container" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2271-L2295
[ "def", "state", "(", "name", ")", ":", "contextkey", "=", "'docker.state.{0}'", ".", "format", "(", "name", ")", "if", "contextkey", "in", "__context__", ":", "return", "__context__", "[", "contextkey", "]", "__context__", "[", "contextkey", "]", "=", "_get_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
search
Searches the registry for an image name Search keyword official : False Limit results to official builds trusted : False Limit results to `trusted builds`_ **RETURN DATA** A dictionary with each key being the name of an image, and the following information for each i...
salt/modules/dockermod.py
def search(name, official=False, trusted=False): ''' Searches the registry for an image name Search keyword official : False Limit results to official builds trusted : False Limit results to `trusted builds`_ **RETURN DATA** A dictionary with each key being the n...
def search(name, official=False, trusted=False): ''' Searches the registry for an image name Search keyword official : False Limit results to official builds trusted : False Limit results to `trusted builds`_ **RETURN DATA** A dictionary with each key being the n...
[ "Searches", "the", "registry", "for", "an", "image" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2298-L2365
[ "def", "search", "(", "name", ",", "official", "=", "False", ",", "trusted", "=", "False", ")", ":", "response", "=", "_client_wrapper", "(", "'search'", ",", "name", ")", "if", "not", "response", ":", "raise", "CommandExecutionError", "(", "'No images match...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
top
Runs the `docker top` command on a specific container name Container name or ID CLI Example: **RETURN DATA** A list of dictionaries containing information about each process .. code-block:: bash salt myminion docker.top mycontainer salt myminion docker.top 0123456789a...
salt/modules/dockermod.py
def top(name): ''' Runs the `docker top` command on a specific container name Container name or ID CLI Example: **RETURN DATA** A list of dictionaries containing information about each process .. code-block:: bash salt myminion docker.top mycontainer salt mymi...
def top(name): ''' Runs the `docker top` command on a specific container name Container name or ID CLI Example: **RETURN DATA** A list of dictionaries containing information about each process .. code-block:: bash salt myminion docker.top mycontainer salt mymi...
[ "Runs", "the", "docker", "top", "command", "on", "a", "specific", "container" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2368-L2402
[ "def", "top", "(", "name", ")", ":", "response", "=", "_client_wrapper", "(", "'top'", ",", "name", ")", "# Read in column names", "columns", "=", "{", "}", "for", "idx", ",", "col_name", "in", "enumerate", "(", "response", "[", "'Titles'", "]", ")", ":"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
version
Returns a dictionary of Docker version information. Equivalent to running the ``docker version`` Docker CLI command. CLI Example: .. code-block:: bash salt myminion docker.version
salt/modules/dockermod.py
def version(): ''' Returns a dictionary of Docker version information. Equivalent to running the ``docker version`` Docker CLI command. CLI Example: .. code-block:: bash salt myminion docker.version ''' ret = _client_wrapper('version') version_re = re.compile(VERSION_RE) i...
def version(): ''' Returns a dictionary of Docker version information. Equivalent to running the ``docker version`` Docker CLI command. CLI Example: .. code-block:: bash salt myminion docker.version ''' ret = _client_wrapper('version') version_re = re.compile(VERSION_RE) i...
[ "Returns", "a", "dictionary", "of", "Docker", "version", "information", ".", "Equivalent", "to", "running", "the", "docker", "version", "Docker", "CLI", "command", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2405-L2430
[ "def", "version", "(", ")", ":", "ret", "=", "_client_wrapper", "(", "'version'", ")", "version_re", "=", "re", ".", "compile", "(", "VERSION_RE", ")", "if", "'Version'", "in", "ret", ":", "match", "=", "version_re", ".", "match", "(", "six", ".", "tex...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Create a new container image Image from which to create the container name Name for the new container. If not provided, Docker will randomly generate one for you (it will be included in the return data). start : False If ``True``, start container after creating it ...
salt/modules/dockermod.py
def create(image, name=None, start=False, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.docker.CLIENT_TIMEOUT, **kwargs): ''' Create a new container image Image from which ...
def create(image, name=None, start=False, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.docker.CLIENT_TIMEOUT, **kwargs): ''' Create a new container image Image from which ...
[ "Create", "a", "new", "container" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L2440-L3210
[ "def", "create", "(", "image", ",", "name", "=", "None", ",", "start", "=", "False", ",", "skip_translate", "=", "None", ",", "ignore_collisions", "=", "False", ",", "validate_ip_addrs", "=", "True", ",", "client_timeout", "=", "salt", ".", "utils", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
run_container
.. versionadded:: 2018.3.0 Equivalent to ``docker run`` on the Docker CLI. Runs the container, waits for it to exit, and returns the container's logs when complete. .. note:: Not to be confused with :py:func:`docker.run <salt.modules.dockermod.run>`, which provides a :py:func:`cmd.run ...
salt/modules/dockermod.py
def run_container(image, name=None, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.docker.CLIENT_TIMEOUT, bg=False, replace=False, ...
def run_container(image, name=None, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.docker.CLIENT_TIMEOUT, bg=False, replace=False, ...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L3214-L3452
[ "def", "run_container", "(", "image", ",", "name", "=", "None", ",", "skip_translate", "=", "None", ",", "ignore_collisions", "=", "False", ",", "validate_ip_addrs", "=", "True", ",", "client_timeout", "=", "salt", ".", "utils", ".", "docker", ".", "CLIENT_T...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
copy_from
Copy a file from inside a container to the Minion name Container name source Path of the file on the container's filesystem dest Destination on the Minion. Must be an absolute path. If the destination is a directory, the file will be copied into that directory. overwr...
salt/modules/dockermod.py
def copy_from(name, source, dest, overwrite=False, makedirs=False): ''' Copy a file from inside a container to the Minion name Container name source Path of the file on the container's filesystem dest Destination on the Minion. Must be an absolute path. If the destination ...
def copy_from(name, source, dest, overwrite=False, makedirs=False): ''' Copy a file from inside a container to the Minion name Container name source Path of the file on the container's filesystem dest Destination on the Minion. Must be an absolute path. If the destination ...
[ "Copy", "a", "file", "from", "inside", "a", "container", "to", "the", "Minion" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L3455-L3563
[ "def", "copy_from", "(", "name", ",", "source", ",", "dest", ",", "overwrite", "=", "False", ",", "makedirs", "=", "False", ")", ":", "c_state", "=", "state", "(", "name", ")", "if", "c_state", "!=", "'running'", ":", "raise", "CommandExecutionError", "(...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
copy_to
Copy a file from the host into a container name Container name source File to be copied to the container. Can be a local path on the Minion or a remote file from the Salt fileserver. dest Destination on the container. Must be an absolute path. If the destination is...
salt/modules/dockermod.py
def copy_to(name, source, dest, exec_driver=None, overwrite=False, makedirs=False): ''' Copy a file from the host into a container name Container name source File to be copied to the container. Can be a local path on the Minio...
def copy_to(name, source, dest, exec_driver=None, overwrite=False, makedirs=False): ''' Copy a file from the host into a container name Container name source File to be copied to the container. Can be a local path on the Minio...
[ "Copy", "a", "file", "from", "the", "host", "into", "a", "container" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L3570-L3624
[ "def", "copy_to", "(", "name", ",", "source", ",", "dest", ",", "exec_driver", "=", "None", ",", "overwrite", "=", "False", ",", "makedirs", "=", "False", ")", ":", "if", "exec_driver", "is", "None", ":", "exec_driver", "=", "_get_exec_driver", "(", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
export
Exports a container to a tar archive. It can also optionally compress that tar archive, and push it up to the Master. name Container name or ID path Absolute path on the Minion where the container will be exported overwrite : False Unless this option is set to ``True``, then i...
salt/modules/dockermod.py
def export(name, path, overwrite=False, makedirs=False, compression=None, **kwargs): ''' Exports a container to a tar archive. It can also optionally compress that tar archive, and push it up to the Master. name Container name or ID pa...
def export(name, path, overwrite=False, makedirs=False, compression=None, **kwargs): ''' Exports a container to a tar archive. It can also optionally compress that tar archive, and push it up to the Master. name Container name or ID pa...
[ "Exports", "a", "container", "to", "a", "tar", "archive", ".", "It", "can", "also", "optionally", "compress", "that", "tar", "archive", "and", "push", "it", "up", "to", "the", "Master", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L3627-L3806
[ "def", "export", "(", "name", ",", "path", ",", "overwrite", "=", "False", ",", "makedirs", "=", "False", ",", "compression", "=", "None", ",", "*", "*", "kwargs", ")", ":", "err", "=", "'Path \\'{0}\\' is not absolute'", ".", "format", "(", "path", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rm_
Removes a container name Container name or ID force : False If ``True``, the container will be killed first before removal, as the Docker API will not permit a running container to be removed. This option is set to ``False`` by default to prevent accidental removal of a...
salt/modules/dockermod.py
def rm_(name, force=False, volumes=False, **kwargs): ''' Removes a container name Container name or ID force : False If ``True``, the container will be killed first before removal, as the Docker API will not permit a running container to be removed. This option is set t...
def rm_(name, force=False, volumes=False, **kwargs): ''' Removes a container name Container name or ID force : False If ``True``, the container will be killed first before removal, as the Docker API will not permit a running container to be removed. This option is set t...
[ "Removes", "a", "container" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L3810-L3880
[ "def", "rm_", "(", "name", ",", "force", "=", "False", ",", "volumes", "=", "False", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "__utils__", "[", "'args.clean_kwargs'", "]", "(", "*", "*", "kwargs", ")", "stop_", "=", "kwargs", ".", "pop", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rename
.. versionadded:: 2017.7.0 Renames a container. Returns ``True`` if successful, and raises an error if the API returns one. If unsuccessful and the API returns no error (should not happen), then ``False`` will be returned. name Name or ID of existing container new_name New name to...
salt/modules/dockermod.py
def rename(name, new_name): ''' .. versionadded:: 2017.7.0 Renames a container. Returns ``True`` if successful, and raises an error if the API returns one. If unsuccessful and the API returns no error (should not happen), then ``False`` will be returned. name Name or ID of existing con...
def rename(name, new_name): ''' .. versionadded:: 2017.7.0 Renames a container. Returns ``True`` if successful, and raises an error if the API returns one. If unsuccessful and the API returns no error (should not happen), then ``False`` will be returned. name Name or ID of existing con...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L3883-L3909
[ "def", "rename", "(", "name", ",", "new_name", ")", ":", "id_", "=", "inspect_container", "(", "name", ")", "[", "'Id'", "]", "log", ".", "debug", "(", "'Renaming container \\'%s\\' (ID: %s) to \\'%s\\''", ",", "name", ",", "id_", ",", "new_name", ")", "_cli...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
build
.. versionchanged:: 2018.3.0 If the built image should be tagged, then the repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argument. Builds a docker image from a Dockerfile or a U...
salt/modules/dockermod.py
def build(path=None, repository=None, tag=None, cache=True, rm=True, api_response=False, fileobj=None, dockerfile=None, buildargs=None, network_mode=None, labels=None, cache_from=None, target=None): ...
def build(path=None, repository=None, tag=None, cache=True, rm=True, api_response=False, fileobj=None, dockerfile=None, buildargs=None, network_mode=None, labels=None, cache_from=None, target=None): ...
[ "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "If", "the", "built", "image", "should", "be", "tagged", "then", "the", "repository", "and", "tag", "must", "now", "be", "passed", "separately", "using", "the", "repository", "and", "tag", "argument...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L3913-L4106
[ "def", "build", "(", "path", "=", "None", ",", "repository", "=", "None", ",", "tag", "=", "None", ",", "cache", "=", "True", ",", "rm", "=", "True", ",", "api_response", "=", "False", ",", "fileobj", "=", "None", ",", "dockerfile", "=", "None", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
commit
.. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argument. Commits a container, thereby promoting it to an image. Equivalent to running the ``docker co...
salt/modules/dockermod.py
def commit(name, repository, tag='latest', message=None, author=None): ''' .. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprec...
def commit(name, repository, tag='latest', message=None, author=None): ''' .. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprec...
[ "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "The", "repository", "and", "tag", "must", "now", "be", "passed", "separately", "using", "the", "repository", "and", "tag", "arguments", "rather", "than", "together", "in", "the", "(", "now", "depre...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L4109-L4188
[ "def", "commit", "(", "name", ",", "repository", ",", "tag", "=", "'latest'", ",", "message", "=", "None", ",", "author", "=", "None", ")", ":", "if", "not", "isinstance", "(", "repository", ",", "six", ".", "string_types", ")", ":", "repository", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
dangling
Return top-level images (those on which no other images depend) which do not have a tag assigned to them. These include: - Images which were once tagged but were later untagged, such as those which were superseded by committing a new copy of an existing tagged image. - Images which were loaded ...
salt/modules/dockermod.py
def dangling(prune=False, force=False): ''' Return top-level images (those on which no other images depend) which do not have a tag assigned to them. These include: - Images which were once tagged but were later untagged, such as those which were superseded by committing a new copy of an existing...
def dangling(prune=False, force=False): ''' Return top-level images (those on which no other images depend) which do not have a tag assigned to them. These include: - Images which were once tagged but were later untagged, such as those which were superseded by committing a new copy of an existing...
[ "Return", "top", "-", "level", "images", "(", "those", "on", "which", "no", "other", "images", "depend", ")", "which", "do", "not", "have", "a", "tag", "assigned", "to", "them", ".", "These", "include", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L4191-L4245
[ "def", "dangling", "(", "prune", "=", "False", ",", "force", "=", "False", ")", ":", "all_images", "=", "images", "(", "all", "=", "True", ")", "dangling_images", "=", "[", "x", "[", ":", "12", "]", "for", "x", "in", "_get_top_level_images", "(", "al...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
import_
.. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argument. Imports content from a local tarball or a URL as a new docker image source Content ...
salt/modules/dockermod.py
def import_(source, repository, tag='latest', api_response=False): ''' .. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``imag...
def import_(source, repository, tag='latest', api_response=False): ''' .. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``imag...
[ "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "The", "repository", "and", "tag", "must", "now", "be", "passed", "separately", "using", "the", "repository", "and", "tag", "arguments", "rather", "than", "together", "in", "the", "(", "now", "depre...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L4248-L4348
[ "def", "import_", "(", "source", ",", "repository", ",", "tag", "=", "'latest'", ",", "api_response", "=", "False", ")", ":", "if", "not", "isinstance", "(", "repository", ",", "six", ".", "string_types", ")", ":", "repository", "=", "six", ".", "text_ty...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
load
.. versionchanged:: 2018.3.0 If the loaded image should be tagged, then the repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argument. Load a tar archive that was created using :py...
salt/modules/dockermod.py
def load(path, repository=None, tag=None): ''' .. versionchanged:: 2018.3.0 If the loaded image should be tagged, then the repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argum...
def load(path, repository=None, tag=None): ''' .. versionchanged:: 2018.3.0 If the loaded image should be tagged, then the repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argum...
[ "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "If", "the", "loaded", "image", "should", "be", "tagged", "then", "the", "repository", "and", "tag", "must", "now", "be", "passed", "separately", "using", "the", "repository", "and", "tag", "argumen...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L4351-L4469
[ "def", "load", "(", "path", ",", "repository", "=", "None", ",", "tag", "=", "None", ")", ":", "if", "(", "repository", "or", "tag", ")", "and", "not", "(", "repository", "and", "tag", ")", ":", "# Have to have both or neither", "raise", "SaltInvocationErr...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
layers
Returns a list of the IDs of layers belonging to the specified image, with the top-most layer (the one correspnding to the passed name) appearing last. name Image name or ID CLI Example: .. code-block:: bash salt myminion docker.layers centos:7
salt/modules/dockermod.py
def layers(name): ''' Returns a list of the IDs of layers belonging to the specified image, with the top-most layer (the one correspnding to the passed name) appearing last. name Image name or ID CLI Example: .. code-block:: bash salt myminion docker.layers centos:7 '...
def layers(name): ''' Returns a list of the IDs of layers belonging to the specified image, with the top-most layer (the one correspnding to the passed name) appearing last. name Image name or ID CLI Example: .. code-block:: bash salt myminion docker.layers centos:7 '...
[ "Returns", "a", "list", "of", "the", "IDs", "of", "layers", "belonging", "to", "the", "specified", "image", "with", "the", "top", "-", "most", "layer", "(", "the", "one", "correspnding", "to", "the", "passed", "name", ")", "appearing", "last", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L4472-L4494
[ "def", "layers", "(", "name", ")", ":", "ret", "=", "[", "]", "cmd", "=", "[", "'docker'", ",", "'history'", ",", "'-q'", ",", "name", "]", "for", "line", "in", "reversed", "(", "__salt__", "[", "'cmd.run_stdout'", "]", "(", "cmd", ",", "python_shell...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pull
.. versionchanged:: 2018.3.0 If no tag is specified in the ``image`` argument, all tags for the image will be pulled. For this reason is it recommended to pass ``image`` using the ``repo:tag`` notation. Pulls an image from a Docker registry image Image to be pulled insecur...
salt/modules/dockermod.py
def pull(image, insecure_registry=False, api_response=False, client_timeout=salt.utils.docker.CLIENT_TIMEOUT): ''' .. versionchanged:: 2018.3.0 If no tag is specified in the ``image`` argument, all tags for the image will be pulled. For this reason is it recommended to...
def pull(image, insecure_registry=False, api_response=False, client_timeout=salt.utils.docker.CLIENT_TIMEOUT): ''' .. versionchanged:: 2018.3.0 If no tag is specified in the ``image`` argument, all tags for the image will be pulled. For this reason is it recommended to...
[ "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "If", "no", "tag", "is", "specified", "in", "the", "image", "argument", "all", "tags", "for", "the", "image", "will", "be", "pulled", ".", "For", "this", "reason", "is", "it", "recommended", "to...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L4497-L4593
[ "def", "pull", "(", "image", ",", "insecure_registry", "=", "False", ",", "api_response", "=", "False", ",", "client_timeout", "=", "salt", ".", "utils", ".", "docker", ".", "CLIENT_TIMEOUT", ")", ":", "_prep_pull", "(", ")", "kwargs", "=", "{", "'stream'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
push
.. versionchanged:: 2015.8.4 The ``Id`` and ``Image`` keys are no longer present in the return data. This is due to changes in the Docker Remote API. Pushes an image to a Docker registry. See the documentation at top of this page to configure authentication credentials. image Image...
salt/modules/dockermod.py
def push(image, insecure_registry=False, api_response=False, client_timeout=salt.utils.docker.CLIENT_TIMEOUT): ''' .. versionchanged:: 2015.8.4 The ``Id`` and ``Image`` keys are no longer present in the return data. This is due to changes in the Docker Remote API. ...
def push(image, insecure_registry=False, api_response=False, client_timeout=salt.utils.docker.CLIENT_TIMEOUT): ''' .. versionchanged:: 2015.8.4 The ``Id`` and ``Image`` keys are no longer present in the return data. This is due to changes in the Docker Remote API. ...
[ "..", "versionchanged", "::", "2015", ".", "8", ".", "4", "The", "Id", "and", "Image", "keys", "are", "no", "longer", "present", "in", "the", "return", "data", ".", "This", "is", "due", "to", "changes", "in", "the", "Docker", "Remote", "API", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L4596-L4688
[ "def", "push", "(", "image", ",", "insecure_registry", "=", "False", ",", "api_response", "=", "False", ",", "client_timeout", "=", "salt", ".", "utils", ".", "docker", ".", "CLIENT_TIMEOUT", ")", ":", "if", "not", "isinstance", "(", "image", ",", "six", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rmi
Removes an image name Name (in ``repo:tag`` notation) or ID of image. force : False If ``True``, the image will be removed even if the Minion has containers created from that image prune : True If ``True``, untagged parent image layers will be removed as well, set ...
salt/modules/dockermod.py
def rmi(*names, **kwargs): ''' Removes an image name Name (in ``repo:tag`` notation) or ID of image. force : False If ``True``, the image will be removed even if the Minion has containers created from that image prune : True If ``True``, untagged parent image layer...
def rmi(*names, **kwargs): ''' Removes an image name Name (in ``repo:tag`` notation) or ID of image. force : False If ``True``, the image will be removed even if the Minion has containers created from that image prune : True If ``True``, untagged parent image layer...
[ "Removes", "an", "image" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L4691-L4765
[ "def", "rmi", "(", "*", "names", ",", "*", "*", "kwargs", ")", ":", "pre_images", "=", "images", "(", "all", "=", "True", ")", "pre_tags", "=", "list_tags", "(", ")", "force", "=", "kwargs", ".", "get", "(", "'force'", ",", "False", ")", "noprune",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
tag_
.. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argument. Tag an image into a repository and return ``True``. If the tag was unsuccessful, an error wi...
salt/modules/dockermod.py
def tag_(name, repository, tag='latest', force=False): ''' .. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argument. Tag an image into a repositor...
def tag_(name, repository, tag='latest', force=False): ''' .. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argument. Tag an image into a repositor...
[ "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "The", "repository", "and", "tag", "must", "now", "be", "passed", "separately", "using", "the", "repository", "and", "tag", "arguments", "rather", "than", "together", "in", "the", "(", "now", "depre...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L4973-L5022
[ "def", "tag_", "(", "name", ",", "repository", ",", "tag", "=", "'latest'", ",", "force", "=", "False", ")", ":", "if", "not", "isinstance", "(", "repository", ",", "six", ".", "string_types", ")", ":", "repository", "=", "six", ".", "text_type", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
networks
.. versionchanged:: 2017.7.0 The ``names`` and ``ids`` can be passed as a comma-separated list now, as well as a Python list. .. versionchanged:: 2018.3.0 The ``Containers`` key for each network is no longer always empty. List existing networks names Filter by name ids...
salt/modules/dockermod.py
def networks(names=None, ids=None): ''' .. versionchanged:: 2017.7.0 The ``names`` and ``ids`` can be passed as a comma-separated list now, as well as a Python list. .. versionchanged:: 2018.3.0 The ``Containers`` key for each network is no longer always empty. List existing net...
def networks(names=None, ids=None): ''' .. versionchanged:: 2017.7.0 The ``names`` and ``ids`` can be passed as a comma-separated list now, as well as a Python list. .. versionchanged:: 2018.3.0 The ``Containers`` key for each network is no longer always empty. List existing net...
[ "..", "versionchanged", "::", "2017", ".", "7", ".", "0", "The", "names", "and", "ids", "can", "be", "passed", "as", "a", "comma", "-", "separated", "list", "now", "as", "well", "as", "a", "Python", "list", ".", "..", "versionchanged", "::", "2018", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L5026-L5065
[ "def", "networks", "(", "names", "=", "None", ",", "ids", "=", "None", ")", ":", "if", "names", "is", "not", "None", ":", "names", "=", "__utils__", "[", "'args.split_input'", "]", "(", "names", ")", "if", "ids", "is", "not", "None", ":", "ids", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_network
.. versionchanged:: 2018.3.0 Support added for network configuration options other than ``driver`` and ``driver_opts``, as well as IPAM configuration. Create a new network .. note:: This function supports all arguments for network and IPAM pool configuration which are available...
salt/modules/dockermod.py
def create_network(name, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.docker.CLIENT_TIMEOUT, **kwargs): ''' .. versionchanged:: 2018.3.0 Support added for net...
def create_network(name, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.docker.CLIENT_TIMEOUT, **kwargs): ''' .. versionchanged:: 2018.3.0 Support added for net...
[ "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "Support", "added", "for", "network", "configuration", "options", "other", "than", "driver", "and", "driver_opts", "as", "well", "as", "IPAM", "configuration", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L5068-L5335
[ "def", "create_network", "(", "name", ",", "skip_translate", "=", "None", ",", "ignore_collisions", "=", "False", ",", "validate_ip_addrs", "=", "True", ",", "client_timeout", "=", "salt", ".", "utils", ".", "docker", ".", "CLIENT_TIMEOUT", ",", "*", "*", "k...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
connect_container_to_network
.. versionadded:: 2015.8.3 .. versionchanged:: 2017.7.0 Support for ``ipv4_address`` argument added .. versionchanged:: 2018.3.0 All arguments are now passed through to `connect_container_to_network()`_, allowing for any new arguments added to this function to be supported automa...
salt/modules/dockermod.py
def connect_container_to_network(container, net_id, **kwargs): ''' .. versionadded:: 2015.8.3 .. versionchanged:: 2017.7.0 Support for ``ipv4_address`` argument added .. versionchanged:: 2018.3.0 All arguments are now passed through to `connect_container_to_network()`_, allowing ...
def connect_container_to_network(container, net_id, **kwargs): ''' .. versionadded:: 2015.8.3 .. versionchanged:: 2017.7.0 Support for ``ipv4_address`` argument added .. versionchanged:: 2018.3.0 All arguments are now passed through to `connect_container_to_network()`_, allowing ...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "3", "..", "versionchanged", "::", "2017", ".", "7", ".", "0", "Support", "for", "ipv4_address", "argument", "added", "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "All", "arguments", "are", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L5376-L5417
[ "def", "connect_container_to_network", "(", "container", ",", "net_id", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "__utils__", "[", "'args.clean_kwargs'", "]", "(", "*", "*", "kwargs", ")", "log", ".", "debug", "(", "'Connecting container \\'%s\\' to net...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
disconnect_container_from_network
.. versionadded:: 2015.8.3 Disconnect container from network container Container name or ID network_id Network name or ID CLI Examples: .. code-block:: bash salt myminion docker.disconnect_container_from_network web-1 mynet salt myminion docker.disconnect_contai...
salt/modules/dockermod.py
def disconnect_container_from_network(container, network_id): ''' .. versionadded:: 2015.8.3 Disconnect container from network container Container name or ID network_id Network name or ID CLI Examples: .. code-block:: bash salt myminion docker.disconnect_contain...
def disconnect_container_from_network(container, network_id): ''' .. versionadded:: 2015.8.3 Disconnect container from network container Container name or ID network_id Network name or ID CLI Examples: .. code-block:: bash salt myminion docker.disconnect_contain...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "3" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L5420-L5451
[ "def", "disconnect_container_from_network", "(", "container", ",", "network_id", ")", ":", "log", ".", "debug", "(", "'Disconnecting container \\'%s\\' from network \\'%s\\''", ",", "container", ",", "network_id", ")", "response", "=", "_client_wrapper", "(", "'disconnect...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
disconnect_all_containers_from_network
.. versionadded:: 2018.3.0 Runs :py:func:`docker.disconnect_container_from_network <salt.modules.dockermod.disconnect_container_from_network>` on all containers connected to the specified network, and returns the names of all containers that were disconnected. network_id Network name or ID...
salt/modules/dockermod.py
def disconnect_all_containers_from_network(network_id): ''' .. versionadded:: 2018.3.0 Runs :py:func:`docker.disconnect_container_from_network <salt.modules.dockermod.disconnect_container_from_network>` on all containers connected to the specified network, and returns the names of all container...
def disconnect_all_containers_from_network(network_id): ''' .. versionadded:: 2018.3.0 Runs :py:func:`docker.disconnect_container_from_network <salt.modules.dockermod.disconnect_container_from_network>` on all containers connected to the specified network, and returns the names of all container...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L5454-L5492
[ "def", "disconnect_all_containers_from_network", "(", "network_id", ")", ":", "connected_containers", "=", "connected", "(", "network_id", ")", "ret", "=", "[", "]", "failed", "=", "[", "]", "for", "cname", "in", "connected_containers", ":", "try", ":", "disconn...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_volume
Create a new volume .. versionadded:: 2015.8.4 name name of volume driver Driver of the volume driver_opts Options for the driver volume CLI Example: .. code-block:: bash salt myminion docker.create_volume my_volume driver=local
salt/modules/dockermod.py
def create_volume(name, driver=None, driver_opts=None): ''' Create a new volume .. versionadded:: 2015.8.4 name name of volume driver Driver of the volume driver_opts Options for the driver volume CLI Example: .. code-block:: bash salt myminion dock...
def create_volume(name, driver=None, driver_opts=None): ''' Create a new volume .. versionadded:: 2015.8.4 name name of volume driver Driver of the volume driver_opts Options for the driver volume CLI Example: .. code-block:: bash salt myminion dock...
[ "Create", "a", "new", "volume" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L5516-L5541
[ "def", "create_volume", "(", "name", ",", "driver", "=", "None", ",", "driver_opts", "=", "None", ")", ":", "response", "=", "_client_wrapper", "(", "'create_volume'", ",", "name", ",", "driver", "=", "driver", ",", "driver_opts", "=", "driver_opts", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pause
Pauses a container name Container name or ID **RETURN DATA** A dictionary will be returned, containing the following keys: - ``status`` - A dictionary showing the prior state of the container as well as the new state - ``result`` - A boolean noting whether or not the action was su...
salt/modules/dockermod.py
def pause(name): ''' Pauses a container name Container name or ID **RETURN DATA** A dictionary will be returned, containing the following keys: - ``status`` - A dictionary showing the prior state of the container as well as the new state - ``result`` - A boolean noting whe...
def pause(name): ''' Pauses a container name Container name or ID **RETURN DATA** A dictionary will be returned, containing the following keys: - ``status`` - A dictionary showing the prior state of the container as well as the new state - ``result`` - A boolean noting whe...
[ "Pauses", "a", "container" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L5615-L5645
[ "def", "pause", "(", "name", ")", ":", "orig_state", "=", "state", "(", "name", ")", "if", "orig_state", "==", "'stopped'", ":", "return", "{", "'result'", ":", "False", ",", "'state'", ":", "{", "'old'", ":", "orig_state", ",", "'new'", ":", "orig_sta...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
restart
Restarts a container name Container name or ID timeout : 10 Timeout in seconds after which the container will be killed (if it has not yet gracefully shut down) **RETURN DATA** A dictionary will be returned, containing the following keys: - ``status`` - A dictionary sho...
salt/modules/dockermod.py
def restart(name, timeout=10): ''' Restarts a container name Container name or ID timeout : 10 Timeout in seconds after which the container will be killed (if it has not yet gracefully shut down) **RETURN DATA** A dictionary will be returned, containing the following...
def restart(name, timeout=10): ''' Restarts a container name Container name or ID timeout : 10 Timeout in seconds after which the container will be killed (if it has not yet gracefully shut down) **RETURN DATA** A dictionary will be returned, containing the following...
[ "Restarts", "a", "container" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L5651-L5684
[ "def", "restart", "(", "name", ",", "timeout", "=", "10", ")", ":", "ret", "=", "_change_state", "(", "name", ",", "'restart'", ",", "'running'", ",", "timeout", "=", "timeout", ")", "if", "ret", "[", "'result'", "]", ":", "ret", "[", "'restarted'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
start_
Start a container name Container name or ID **RETURN DATA** A dictionary will be returned, containing the following keys: - ``status`` - A dictionary showing the prior state of the container as well as the new state - ``result`` - A boolean noting whether or not the action was succ...
salt/modules/dockermod.py
def start_(name): ''' Start a container name Container name or ID **RETURN DATA** A dictionary will be returned, containing the following keys: - ``status`` - A dictionary showing the prior state of the container as well as the new state - ``result`` - A boolean noting whet...
def start_(name): ''' Start a container name Container name or ID **RETURN DATA** A dictionary will be returned, containing the following keys: - ``status`` - A dictionary showing the prior state of the container as well as the new state - ``result`` - A boolean noting whet...
[ "Start", "a", "container" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L5716-L5746
[ "def", "start_", "(", "name", ")", ":", "orig_state", "=", "state", "(", "name", ")", "if", "orig_state", "==", "'paused'", ":", "return", "{", "'result'", ":", "False", ",", "'state'", ":", "{", "'old'", ":", "orig_state", ",", "'new'", ":", "orig_sta...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
stop
Stops a running container name Container name or ID unpause : False If ``True`` and the container is paused, it will be unpaused before attempting to stop the container. timeout Timeout in seconds after which the container will be killed (if it has not yet graceful...
salt/modules/dockermod.py
def stop(name, timeout=None, **kwargs): ''' Stops a running container name Container name or ID unpause : False If ``True`` and the container is paused, it will be unpaused before attempting to stop the container. timeout Timeout in seconds after which the containe...
def stop(name, timeout=None, **kwargs): ''' Stops a running container name Container name or ID unpause : False If ``True`` and the container is paused, it will be unpaused before attempting to stop the container. timeout Timeout in seconds after which the containe...
[ "Stops", "a", "running", "container" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L5750-L5814
[ "def", "stop", "(", "name", ",", "timeout", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "timeout", "is", "None", ":", "try", ":", "# Get timeout from container config", "timeout", "=", "inspect_container", "(", "name", ")", "[", "'Config'", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
unpause
Unpauses a container name Container name or ID **RETURN DATA** A dictionary will be returned, containing the following keys: - ``status`` - A dictionary showing the prior state of the container as well as the new state - ``result`` - A boolean noting whether or not the action was ...
salt/modules/dockermod.py
def unpause(name): ''' Unpauses a container name Container name or ID **RETURN DATA** A dictionary will be returned, containing the following keys: - ``status`` - A dictionary showing the prior state of the container as well as the new state - ``result`` - A boolean noting...
def unpause(name): ''' Unpauses a container name Container name or ID **RETURN DATA** A dictionary will be returned, containing the following keys: - ``status`` - A dictionary showing the prior state of the container as well as the new state - ``result`` - A boolean noting...
[ "Unpauses", "a", "container" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L5818-L5848
[ "def", "unpause", "(", "name", ")", ":", "orig_state", "=", "state", "(", "name", ")", "if", "orig_state", "==", "'stopped'", ":", "return", "{", "'result'", ":", "False", ",", "'state'", ":", "{", "'old'", ":", "orig_state", ",", "'new'", ":", "orig_s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
wait
Wait for the container to exit gracefully, and return its exit code .. note:: This function will block until the container is stopped. name Container name or ID ignore_already_stopped Boolean flag that prevents execution to fail, if a container is already stopped. fa...
salt/modules/dockermod.py
def wait(name, ignore_already_stopped=False, fail_on_exit_status=False): ''' Wait for the container to exit gracefully, and return its exit code .. note:: This function will block until the container is stopped. name Container name or ID ignore_already_stopped Boolean fla...
def wait(name, ignore_already_stopped=False, fail_on_exit_status=False): ''' Wait for the container to exit gracefully, and return its exit code .. note:: This function will block until the container is stopped. name Container name or ID ignore_already_stopped Boolean fla...
[ "Wait", "for", "the", "container", "to", "exit", "gracefully", "and", "return", "its", "exit", "code" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L5854-L5919
[ "def", "wait", "(", "name", ",", "ignore_already_stopped", "=", "False", ",", "fail_on_exit_status", "=", "False", ")", ":", "try", ":", "pre", "=", "state", "(", "name", ")", "except", "CommandExecutionError", ":", "# Container doesn't exist anymore", "return", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
prune
.. versionadded:: 2019.2.0 Prune Docker's various subsystems .. note:: This requires docker-py version 2.1.0 or later. containers : False If ``True``, prunes stopped containers (documentation__) .. __: https://docs.docker.com/engine/reference/commandline/container_prune/#filterin...
salt/modules/dockermod.py
def prune(containers=False, networks=False, images=False, build=False, volumes=False, system=None, **filters): ''' .. versionadded:: 2019.2.0 Prune Docker's various subsystems .. note:: This requires docker-py version 2.1.0 or later. containers : False If ``True``, prune...
def prune(containers=False, networks=False, images=False, build=False, volumes=False, system=None, **filters): ''' .. versionadded:: 2019.2.0 Prune Docker's various subsystems .. note:: This requires docker-py version 2.1.0 or later. containers : False If ``True``, prune...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L5922-L6020
[ "def", "prune", "(", "containers", "=", "False", ",", "networks", "=", "False", ",", "images", "=", "False", ",", "build", "=", "False", ",", "volumes", "=", "False", ",", "system", "=", "None", ",", "*", "*", "filters", ")", ":", "if", "system", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_run
Common logic for docker.run functions
salt/modules/dockermod.py
def _run(name, cmd, exec_driver=None, output=None, stdin=None, python_shell=True, output_loglevel='debug', ignore_retcode=False, use_vt=False, keep_env=None): ''' Common logic for docker.run functions ''' if exec_driver is ...
def _run(name, cmd, exec_driver=None, output=None, stdin=None, python_shell=True, output_loglevel='debug', ignore_retcode=False, use_vt=False, keep_env=None): ''' Common logic for docker.run functions ''' if exec_driver is ...
[ "Common", "logic", "for", "docker", ".", "run", "functions" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L6025-L6056
[ "def", "_run", "(", "name", ",", "cmd", ",", "exec_driver", "=", "None", ",", "output", "=", "None", ",", "stdin", "=", "None", ",", "python_shell", "=", "True", ",", "output_loglevel", "=", "'debug'", ",", "ignore_retcode", "=", "False", ",", "use_vt", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_script
Common logic to run a script on a container
salt/modules/dockermod.py
def _script(name, source, saltenv='base', args=None, template=None, exec_driver=None, stdin=None, python_shell=True, output_loglevel='debug', ignore_retcode=False, use_vt=False, keep_env=N...
def _script(name, source, saltenv='base', args=None, template=None, exec_driver=None, stdin=None, python_shell=True, output_loglevel='debug', ignore_retcode=False, use_vt=False, keep_env=N...
[ "Common", "logic", "to", "run", "a", "script", "on", "a", "container" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L6060-L6128
[ "def", "_script", "(", "name", ",", "source", ",", "saltenv", "=", "'base'", ",", "args", "=", "None", ",", "template", "=", "None", ",", "exec_driver", "=", "None", ",", "stdin", "=", "None", ",", "python_shell", "=", "True", ",", "output_loglevel", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
script
Run :py:func:`cmd.script <salt.modules.cmdmod.script>` within a container .. note:: While the command is run within the container, it is initiated from the host. Therefore, the PID in the return dict is from the host, not from the container. name Container name or ID sour...
salt/modules/dockermod.py
def script(name, source, saltenv='base', args=None, template=None, exec_driver=None, stdin=None, python_shell=True, output_loglevel='debug', ignore_retcode=False, use_vt=False, keep_env=None): ''...
def script(name, source, saltenv='base', args=None, template=None, exec_driver=None, stdin=None, python_shell=True, output_loglevel='debug', ignore_retcode=False, use_vt=False, keep_env=None): ''...
[ "Run", ":", "py", ":", "func", ":", "cmd", ".", "script", "<salt", ".", "modules", ".", "cmdmod", ".", "script", ">", "within", "a", "container" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L6424-L6499
[ "def", "script", "(", "name", ",", "source", ",", "saltenv", "=", "'base'", ",", "args", "=", "None", ",", "template", "=", "None", ",", "exec_driver", "=", "None", ",", "stdin", "=", "None", ",", "python_shell", "=", "True", ",", "output_loglevel", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_prepare_trans_tar
Prepares a self contained tarball that has the state to be applied in the container
salt/modules/dockermod.py
def _prepare_trans_tar(name, sls_opts, mods=None, pillar=None, extra_filerefs=''): ''' Prepares a self contained tarball that has the state to be applied in the container ''' chunks = _compile_state(sls_opts, mods) # reuse it from salt.ssh, however this function should ...
def _prepare_trans_tar(name, sls_opts, mods=None, pillar=None, extra_filerefs=''): ''' Prepares a self contained tarball that has the state to be applied in the container ''' chunks = _compile_state(sls_opts, mods) # reuse it from salt.ssh, however this function should ...
[ "Prepares", "a", "self", "contained", "tarball", "that", "has", "the", "state", "to", "be", "applied", "in", "the", "container" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L6590-L6604
[ "def", "_prepare_trans_tar", "(", "name", ",", "sls_opts", ",", "mods", "=", "None", ",", "pillar", "=", "None", ",", "extra_filerefs", "=", "''", ")", ":", "chunks", "=", "_compile_state", "(", "sls_opts", ",", "mods", ")", "# reuse it from salt.ssh, however ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_compile_state
Generates the chunks of lowdata from the list of modules
salt/modules/dockermod.py
def _compile_state(sls_opts, mods=None): ''' Generates the chunks of lowdata from the list of modules ''' st_ = HighState(sls_opts) if not mods: return st_.compile_low_chunks() high_data, errors = st_.render_highstate({sls_opts['saltenv']: mods}) high_data, ext_errors = st_.state.r...
def _compile_state(sls_opts, mods=None): ''' Generates the chunks of lowdata from the list of modules ''' st_ = HighState(sls_opts) if not mods: return st_.compile_low_chunks() high_data, errors = st_.render_highstate({sls_opts['saltenv']: mods}) high_data, ext_errors = st_.state.r...
[ "Generates", "the", "chunks", "of", "lowdata", "from", "the", "list", "of", "modules" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L6607-L6631
[ "def", "_compile_state", "(", "sls_opts", ",", "mods", "=", "None", ")", ":", "st_", "=", "HighState", "(", "sls_opts", ")", "if", "not", "mods", ":", "return", "st_", ".", "compile_low_chunks", "(", ")", "high_data", ",", "errors", "=", "st_", ".", "r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
call
Executes a Salt function inside a running container .. versionadded:: 2016.11.0 The container does not need to have Salt installed, but Python is required. name Container name or ID function Salt execution module function CLI Example: .. code-block:: bash salt mymi...
salt/modules/dockermod.py
def call(name, function, *args, **kwargs): ''' Executes a Salt function inside a running container .. versionadded:: 2016.11.0 The container does not need to have Salt installed, but Python is required. name Container name or ID function Salt execution module function CL...
def call(name, function, *args, **kwargs): ''' Executes a Salt function inside a running container .. versionadded:: 2016.11.0 The container does not need to have Salt installed, but Python is required. name Container name or ID function Salt execution module function CL...
[ "Executes", "a", "Salt", "function", "inside", "a", "running", "container" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L6634-L6720
[ "def", "call", "(", "name", ",", "function", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# where to put the salt-thin", "thin_dest_path", "=", "_generate_tmp_path", "(", ")", "mkdirp_thin_argv", "=", "[", "'mkdir'", ",", "'-p'", ",", "thin_dest_path"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
apply_
.. versionadded:: 2019.2.0 Apply states! This function will call highstate or state.sls based on the arguments passed in, ``apply`` is intended to be the main gateway for all state executions. CLI Example: .. code-block:: bash salt 'docker' docker.apply web01 salt 'docker' docker...
salt/modules/dockermod.py
def apply_(name, mods=None, **kwargs): ''' .. versionadded:: 2019.2.0 Apply states! This function will call highstate or state.sls based on the arguments passed in, ``apply`` is intended to be the main gateway for all state executions. CLI Example: .. code-block:: bash salt 'dock...
def apply_(name, mods=None, **kwargs): ''' .. versionadded:: 2019.2.0 Apply states! This function will call highstate or state.sls based on the arguments passed in, ``apply`` is intended to be the main gateway for all state executions. CLI Example: .. code-block:: bash salt 'dock...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L6723-L6741
[ "def", "apply_", "(", "name", ",", "mods", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "mods", ":", "return", "sls", "(", "name", ",", "mods", ",", "*", "*", "kwargs", ")", "return", "highstate", "(", "name", ",", "*", "*", "kwargs", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sls
Apply the states defined by the specified SLS modules to the running container .. versionadded:: 2016.11.0 The container does not need to have Salt installed, but Python is required. name Container name or ID mods : None A string containing comma-separated list of SLS with define...
salt/modules/dockermod.py
def sls(name, mods=None, **kwargs): ''' Apply the states defined by the specified SLS modules to the running container .. versionadded:: 2016.11.0 The container does not need to have Salt installed, but Python is required. name Container name or ID mods : None A string co...
def sls(name, mods=None, **kwargs): ''' Apply the states defined by the specified SLS modules to the running container .. versionadded:: 2016.11.0 The container does not need to have Salt installed, but Python is required. name Container name or ID mods : None A string co...
[ "Apply", "the", "states", "defined", "by", "the", "specified", "SLS", "modules", "to", "the", "running", "container" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L6744-L6858
[ "def", "sls", "(", "name", ",", "mods", "=", "None", ",", "*", "*", "kwargs", ")", ":", "mods", "=", "[", "item", ".", "strip", "(", ")", "for", "item", "in", "mods", ".", "split", "(", "','", ")", "]", "if", "mods", "else", "[", "]", "# Figu...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sls_build
.. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arguments, rather than together in the (now deprecated) ``image`` argument. Build a Docker image using the specified SLS modules on top of base image .. versionadded::...
salt/modules/dockermod.py
def sls_build(repository, tag='latest', base='opensuse/python', mods=None, dryrun=False, **kwargs): ''' .. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arg...
def sls_build(repository, tag='latest', base='opensuse/python', mods=None, dryrun=False, **kwargs): ''' .. versionchanged:: 2018.3.0 The repository and tag must now be passed separately using the ``repository`` and ``tag`` arg...
[ "..", "versionchanged", "::", "2018", ".", "3", ".", "0", "The", "repository", "and", "tag", "must", "now", "be", "passed", "separately", "using", "the", "repository", "and", "tag", "arguments", "rather", "than", "together", "in", "the", "(", "now", "depre...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockermod.py#L6886-L6991
[ "def", "sls_build", "(", "repository", ",", "tag", "=", "'latest'", ",", "base", "=", "'opensuse/python'", ",", "mods", "=", "None", ",", "dryrun", "=", "False", ",", "*", "*", "kwargs", ")", ":", "create_kwargs", "=", "__utils__", "[", "'args.clean_kwargs...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_check
Checks whether the input is a valid list of peers and transforms domain names into IP Addresses
salt/states/netntp.py
def _check(peers): '''Checks whether the input is a valid list of peers and transforms domain names into IP Addresses''' if not isinstance(peers, list): return False for peer in peers: if not isinstance(peer, six.string_types): return False if not HAS_NETADDR: # if does ...
def _check(peers): '''Checks whether the input is a valid list of peers and transforms domain names into IP Addresses''' if not isinstance(peers, list): return False for peer in peers: if not isinstance(peer, six.string_types): return False if not HAS_NETADDR: # if does ...
[ "Checks", "whether", "the", "input", "is", "a", "valid", "list", "of", "peers", "and", "transforms", "domain", "names", "into", "IP", "Addresses" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netntp.py#L105-L142
[ "def", "_check", "(", "peers", ")", ":", "if", "not", "isinstance", "(", "peers", ",", "list", ")", ":", "return", "False", "for", "peer", "in", "peers", ":", "if", "not", "isinstance", "(", "peer", ",", "six", ".", "string_types", ")", ":", "return"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
managed
Manages the configuration of NTP peers and servers on the device, as specified in the state SLS file. NTP entities not specified in these lists will be removed whilst entities not configured on the device will be set. SLS Example: .. code-block:: yaml netntp_example: netntp.managed: ...
salt/states/netntp.py
def managed(name, peers=None, servers=None): ''' Manages the configuration of NTP peers and servers on the device, as specified in the state SLS file. NTP entities not specified in these lists will be removed whilst entities not configured on the device will be set. SLS Example: .. code-block:: y...
def managed(name, peers=None, servers=None): ''' Manages the configuration of NTP peers and servers on the device, as specified in the state SLS file. NTP entities not specified in these lists will be removed whilst entities not configured on the device will be set. SLS Example: .. code-block:: y...
[ "Manages", "the", "configuration", "of", "NTP", "peers", "and", "servers", "on", "the", "device", "as", "specified", "in", "the", "state", "SLS", "file", ".", "NTP", "entities", "not", "specified", "in", "these", "lists", "will", "be", "removed", "whilst", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netntp.py#L287-L409
[ "def", "managed", "(", "name", ",", "peers", "=", "None", ",", "servers", "=", "None", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "result", "=", "ret", ".", "get", "(", "'result'", ",", "False", ")", "comment", "=", "ret", ".", "get", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add_service
Add a virtual service. protocol The service protocol(only support tcp, udp and fwmark service). service_address The LVS service address. scheduler Algorithm for allocating TCP connections and UDP datagrams to real servers. CLI Example: .. code-block:: bash salt...
salt/modules/lvs.py
def add_service(protocol=None, service_address=None, scheduler='wlc'): ''' Add a virtual service. protocol The service protocol(only support tcp, udp and fwmark service). service_address The LVS service address. scheduler Algorithm for allocating TCP connections and UDP da...
def add_service(protocol=None, service_address=None, scheduler='wlc'): ''' Add a virtual service. protocol The service protocol(only support tcp, udp and fwmark service). service_address The LVS service address. scheduler Algorithm for allocating TCP connections and UDP da...
[ "Add", "a", "virtual", "service", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lvs.py#L88-L120
[ "def", "add_service", "(", "protocol", "=", "None", ",", "service_address", "=", "None", ",", "scheduler", "=", "'wlc'", ")", ":", "cmd", "=", "'{0} -A {1}'", ".", "format", "(", "__detect_os", "(", ")", ",", "_build_cmd", "(", "protocol", "=", "protocol",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure the kinesis stream is properly configured and scaled. name (string) Stream name retention_hours (int) Retain data for this many hours. AWS allows minimum 24 hours, maximum 168 hours. enhanced_monitoring (list of string) Turn on enhanced monitoring for the specified ...
salt/states/boto_kinesis.py
def present(name, retention_hours=None, enhanced_monitoring=None, num_shards=None, do_reshard=True, region=None, key=None, keyid=None, profile=None): ''' Ensure the kinesis stream is properly configured and scaled. ...
def present(name, retention_hours=None, enhanced_monitoring=None, num_shards=None, do_reshard=True, region=None, key=None, keyid=None, profile=None): ''' Ensure the kinesis stream is properly configured and scaled. ...
[ "Ensure", "the", "kinesis", "stream", "is", "properly", "configured", "and", "scaled", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_kinesis.py#L78-L384
[ "def", "present", "(", "name", ",", "retention_hours", "=", "None", ",", "enhanced_monitoring", "=", "None", ",", "num_shards", "=", "None", ",", "do_reshard", "=", "True", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
info
Return information for the specified user CLI Example: .. code-block:: bash salt '*' shadow.info someuser
salt/modules/bsd_shadow.py
def info(name): ''' Return information for the specified user CLI Example: .. code-block:: bash salt '*' shadow.info someuser ''' try: data = pwd.getpwnam(name) ret = { 'name': data.pw_name, 'passwd': data.pw_passwd} except KeyError: ...
def info(name): ''' Return information for the specified user CLI Example: .. code-block:: bash salt '*' shadow.info someuser ''' try: data = pwd.getpwnam(name) ret = { 'name': data.pw_name, 'passwd': data.pw_passwd} except KeyError: ...
[ "Return", "information", "for", "the", "specified", "user" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bsd_shadow.py#L49-L103
[ "def", "info", "(", "name", ")", ":", "try", ":", "data", "=", "pwd", ".", "getpwnam", "(", "name", ")", "ret", "=", "{", "'name'", ":", "data", ".", "pw_name", ",", "'passwd'", ":", "data", ".", "pw_passwd", "}", "except", "KeyError", ":", "return...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_change
Sets the time at which the password expires (in seconds since the UNIX epoch). See ``man 8 usermod`` on NetBSD and OpenBSD or ``man 8 pw`` on FreeBSD. A value of ``0`` sets the password to never expire. CLI Example: .. code-block:: bash salt '*' shadow.set_change username 1419980400
salt/modules/bsd_shadow.py
def set_change(name, change): ''' Sets the time at which the password expires (in seconds since the UNIX epoch). See ``man 8 usermod`` on NetBSD and OpenBSD or ``man 8 pw`` on FreeBSD. A value of ``0`` sets the password to never expire. CLI Example: .. code-block:: bash salt '*' ...
def set_change(name, change): ''' Sets the time at which the password expires (in seconds since the UNIX epoch). See ``man 8 usermod`` on NetBSD and OpenBSD or ``man 8 pw`` on FreeBSD. A value of ``0`` sets the password to never expire. CLI Example: .. code-block:: bash salt '*' ...
[ "Sets", "the", "time", "at", "which", "the", "password", "expires", "(", "in", "seconds", "since", "the", "UNIX", "epoch", ")", ".", "See", "man", "8", "usermod", "on", "NetBSD", "and", "OpenBSD", "or", "man", "8", "pw", "on", "FreeBSD", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bsd_shadow.py#L106-L130
[ "def", "set_change", "(", "name", ",", "change", ")", ":", "pre_info", "=", "info", "(", "name", ")", "if", "change", "==", "pre_info", "[", "'change'", "]", ":", "return", "True", "if", "__grains__", "[", "'kernel'", "]", "==", "'FreeBSD'", ":", "cmd"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_expire
Sets the time at which the account expires (in seconds since the UNIX epoch). See ``man 8 usermod`` on NetBSD and OpenBSD or ``man 8 pw`` on FreeBSD. A value of ``0`` sets the account to never expire. CLI Example: .. code-block:: bash salt '*' shadow.set_expire username 1419980400
salt/modules/bsd_shadow.py
def set_expire(name, expire): ''' Sets the time at which the account expires (in seconds since the UNIX epoch). See ``man 8 usermod`` on NetBSD and OpenBSD or ``man 8 pw`` on FreeBSD. A value of ``0`` sets the account to never expire. CLI Example: .. code-block:: bash salt '*' sh...
def set_expire(name, expire): ''' Sets the time at which the account expires (in seconds since the UNIX epoch). See ``man 8 usermod`` on NetBSD and OpenBSD or ``man 8 pw`` on FreeBSD. A value of ``0`` sets the account to never expire. CLI Example: .. code-block:: bash salt '*' sh...
[ "Sets", "the", "time", "at", "which", "the", "account", "expires", "(", "in", "seconds", "since", "the", "UNIX", "epoch", ")", ".", "See", "man", "8", "usermod", "on", "NetBSD", "and", "OpenBSD", "or", "man", "8", "pw", "on", "FreeBSD", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bsd_shadow.py#L133-L157
[ "def", "set_expire", "(", "name", ",", "expire", ")", ":", "pre_info", "=", "info", "(", "name", ")", "if", "expire", "==", "pre_info", "[", "'expire'", "]", ":", "return", "True", "if", "__grains__", "[", "'kernel'", "]", "==", "'FreeBSD'", ":", "cmd"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_password
Set the password for a named user. The password must be a properly defined hash. The password hash can be generated with this command: ``python -c "import crypt; print crypt.crypt('password', ciphersalt)"`` .. note:: When constructing the ``ciphersalt`` string, you must escape any dollar s...
salt/modules/bsd_shadow.py
def set_password(name, password): ''' Set the password for a named user. The password must be a properly defined hash. The password hash can be generated with this command: ``python -c "import crypt; print crypt.crypt('password', ciphersalt)"`` .. note:: When constructing the ``ciphersalt`...
def set_password(name, password): ''' Set the password for a named user. The password must be a properly defined hash. The password hash can be generated with this command: ``python -c "import crypt; print crypt.crypt('password', ciphersalt)"`` .. note:: When constructing the ``ciphersalt`...
[ "Set", "the", "password", "for", "a", "named", "user", ".", "The", "password", "must", "be", "a", "properly", "defined", "hash", ".", "The", "password", "hash", "can", "be", "generated", "with", "this", "command", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bsd_shadow.py#L178-L216
[ "def", "set_password", "(", "name", ",", "password", ")", ":", "if", "__grains__", ".", "get", "(", "'os'", ",", "''", ")", "==", "'FreeBSD'", ":", "cmd", "=", "[", "'pw'", ",", "'user'", ",", "'mod'", ",", "name", ",", "'-H'", ",", "'0'", "]", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
AllEventsHandler.get
Check the token, returns a 401 if the token is invalid. Else open the websocket connection
salt/netapi/rest_tornado/saltnado_websockets.py
def get(self, token): ''' Check the token, returns a 401 if the token is invalid. Else open the websocket connection ''' log.debug('In the websocket get method') self.token = token # close the connection, if not authenticated if not self.application.auth....
def get(self, token): ''' Check the token, returns a 401 if the token is invalid. Else open the websocket connection ''' log.debug('In the websocket get method') self.token = token # close the connection, if not authenticated if not self.application.auth....
[ "Check", "the", "token", "returns", "a", "401", "if", "the", "token", "is", "invalid", ".", "Else", "open", "the", "websocket", "connection" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado_websockets.py#L315-L328
[ "def", "get", "(", "self", ",", "token", ")", ":", "log", ".", "debug", "(", "'In the websocket get method'", ")", "self", ".", "token", "=", "token", "# close the connection, if not authenticated", "if", "not", "self", ".", "application", ".", "auth", ".", "g...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
AllEventsHandler.on_message
Listens for a "websocket client ready" message. Once that message is received an asynchronous job is stated that yields messages to the client. These messages make up salt's "real time" event stream.
salt/netapi/rest_tornado/saltnado_websockets.py
def on_message(self, message): """Listens for a "websocket client ready" message. Once that message is received an asynchronous job is stated that yields messages to the client. These messages make up salt's "real time" event stream. """ log.debug('Got websocket m...
def on_message(self, message): """Listens for a "websocket client ready" message. Once that message is received an asynchronous job is stated that yields messages to the client. These messages make up salt's "real time" event stream. """ log.debug('Got websocket m...
[ "Listens", "for", "a", "websocket", "client", "ready", "message", ".", "Once", "that", "message", "is", "received", "an", "asynchronous", "job", "is", "stated", "that", "yields", "messages", "to", "the", "client", ".", "These", "messages", "make", "up", "sal...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado_websockets.py#L338-L366
[ "def", "on_message", "(", "self", ",", "message", ")", ":", "log", ".", "debug", "(", "'Got websocket message %s'", ",", "message", ")", "if", "message", "==", "'websocket client ready'", ":", "if", "self", ".", "connected", ":", "# TBD: Add ability to run command...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
AllEventsHandler.check_origin
If cors is enabled, check that the origin is allowed
salt/netapi/rest_tornado/saltnado_websockets.py
def check_origin(self, origin): """ If cors is enabled, check that the origin is allowed """ mod_opts = self.application.mod_opts if mod_opts.get('cors_origin'): return bool(_check_cors_origin(origin, mod_opts['cors_origin'])) else: return super(...
def check_origin(self, origin): """ If cors is enabled, check that the origin is allowed """ mod_opts = self.application.mod_opts if mod_opts.get('cors_origin'): return bool(_check_cors_origin(origin, mod_opts['cors_origin'])) else: return super(...
[ "If", "cors", "is", "enabled", "check", "that", "the", "origin", "is", "allowed" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado_websockets.py#L375-L385
[ "def", "check_origin", "(", "self", ",", "origin", ")", ":", "mod_opts", "=", "self", ".", "application", ".", "mod_opts", "if", "mod_opts", ".", "get", "(", "'cors_origin'", ")", ":", "return", "bool", "(", "_check_cors_origin", "(", "origin", ",", "mod_o...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
FormattedEventsHandler.on_message
Listens for a "websocket client ready" message. Once that message is received an asynchronous job is stated that yields messages to the client. These messages make up salt's "real time" event stream.
salt/netapi/rest_tornado/saltnado_websockets.py
def on_message(self, message): """Listens for a "websocket client ready" message. Once that message is received an asynchronous job is stated that yields messages to the client. These messages make up salt's "real time" event stream. """ log.debug('Got websocket m...
def on_message(self, message): """Listens for a "websocket client ready" message. Once that message is received an asynchronous job is stated that yields messages to the client. These messages make up salt's "real time" event stream. """ log.debug('Got websocket m...
[ "Listens", "for", "a", "websocket", "client", "ready", "message", ".", "Once", "that", "message", "is", "received", "an", "asynchronous", "job", "is", "stated", "that", "yields", "messages", "to", "the", "client", ".", "These", "messages", "make", "up", "sal...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado_websockets.py#L391-L429
[ "def", "on_message", "(", "self", ",", "message", ")", ":", "log", ".", "debug", "(", "'Got websocket message %s'", ",", "message", ")", "if", "message", "==", "'websocket client ready'", ":", "if", "self", ".", "connected", ":", "# TBD: Add ability to run command...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_supervisorctl_bin
Return supervisorctl command to call, either from a virtualenv, an argument passed in, or from the global modules options
salt/modules/supervisord.py
def _get_supervisorctl_bin(bin_env): ''' Return supervisorctl command to call, either from a virtualenv, an argument passed in, or from the global modules options ''' cmd = 'supervisorctl' if not bin_env: which_result = __salt__['cmd.which_bin']([cmd]) if which_result is None: ...
def _get_supervisorctl_bin(bin_env): ''' Return supervisorctl command to call, either from a virtualenv, an argument passed in, or from the global modules options ''' cmd = 'supervisorctl' if not bin_env: which_result = __salt__['cmd.which_bin']([cmd]) if which_result is None: ...
[ "Return", "supervisorctl", "command", "to", "call", "either", "from", "a", "virtualenv", "an", "argument", "passed", "in", "or", "from", "the", "global", "modules", "options" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/supervisord.py#L28-L49
[ "def", "_get_supervisorctl_bin", "(", "bin_env", ")", ":", "cmd", "=", "'supervisorctl'", "if", "not", "bin_env", ":", "which_result", "=", "__salt__", "[", "'cmd.which_bin'", "]", "(", "[", "cmd", "]", ")", "if", "which_result", "is", "None", ":", "raise", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_ctl_cmd
Return the command list to use
salt/modules/supervisord.py
def _ctl_cmd(cmd, name, conf_file, bin_env): ''' Return the command list to use ''' ret = [_get_supervisorctl_bin(bin_env)] if conf_file is not None: ret += ['-c', conf_file] ret.append(cmd) if name: ret.append(name) return ret
def _ctl_cmd(cmd, name, conf_file, bin_env): ''' Return the command list to use ''' ret = [_get_supervisorctl_bin(bin_env)] if conf_file is not None: ret += ['-c', conf_file] ret.append(cmd) if name: ret.append(name) return ret
[ "Return", "the", "command", "list", "to", "use" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/supervisord.py#L52-L62
[ "def", "_ctl_cmd", "(", "cmd", ",", "name", ",", "conf_file", ",", "bin_env", ")", ":", "ret", "=", "[", "_get_supervisorctl_bin", "(", "bin_env", ")", "]", "if", "conf_file", "is", "not", "None", ":", "ret", "+=", "[", "'-c'", ",", "conf_file", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
start
Start the named service. Process group names should not include a trailing asterisk. user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed CLI Example: .. co...
salt/modules/supervisord.py
def start(name='all', user=None, conf_file=None, bin_env=None): ''' Start the named service. Process group names should not include a trailing asterisk. user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path ...
def start(name='all', user=None, conf_file=None, bin_env=None): ''' Start the named service. Process group names should not include a trailing asterisk. user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path ...
[ "Start", "the", "named", "service", ".", "Process", "group", "names", "should", "not", "include", "a", "trailing", "asterisk", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/supervisord.py#L72-L99
[ "def", "start", "(", "name", "=", "'all'", ",", "user", "=", "None", ",", "conf_file", "=", "None", ",", "bin_env", "=", "None", ")", ":", "if", "name", ".", "endswith", "(", "':*'", ")", ":", "name", "=", "name", "[", ":", "-", "1", "]", "ret"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
reread
Reload the daemon's configuration files user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed CLI Example: .. code-block:: bash salt '*' supervisord.rer...
salt/modules/supervisord.py
def reread(user=None, conf_file=None, bin_env=None): ''' Reload the daemon's configuration files user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed CLI Exa...
def reread(user=None, conf_file=None, bin_env=None): ''' Reload the daemon's configuration files user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed CLI Exa...
[ "Reload", "the", "daemon", "s", "configuration", "files" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/supervisord.py#L222-L245
[ "def", "reread", "(", "user", "=", "None", ",", "conf_file", "=", "None", ",", "bin_env", "=", "None", ")", ":", "ret", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "_ctl_cmd", "(", "'reread'", ",", "None", ",", "conf_file", ",", "bin_env", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update
Reload config and add/remove/update as necessary user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed name name of the process group to update. if none then u...
salt/modules/supervisord.py
def update(user=None, conf_file=None, bin_env=None, name=None): ''' Reload config and add/remove/update as necessary user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor in...
def update(user=None, conf_file=None, bin_env=None, name=None): ''' Reload config and add/remove/update as necessary user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor in...
[ "Reload", "config", "and", "add", "/", "remove", "/", "update", "as", "necessary" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/supervisord.py#L248-L281
[ "def", "update", "(", "user", "=", "None", ",", "conf_file", "=", "None", ",", "bin_env", "=", "None", ",", "name", "=", "None", ")", ":", "if", "isinstance", "(", "name", ",", "string_types", ")", ":", "if", "name", ".", "endswith", "(", "':'", ")...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
status
List programs and its state user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed CLI Example: .. code-block:: bash salt '*' supervisord.status
salt/modules/supervisord.py
def status(name=None, user=None, conf_file=None, bin_env=None): ''' List programs and its state user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed CLI Exam...
def status(name=None, user=None, conf_file=None, bin_env=None): ''' List programs and its state user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed CLI Exam...
[ "List", "programs", "and", "its", "state" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/supervisord.py#L284-L309
[ "def", "status", "(", "name", "=", "None", ",", "user", "=", "None", ",", "conf_file", "=", "None", ",", "bin_env", "=", "None", ")", ":", "all_process", "=", "{", "}", "for", "line", "in", "status_raw", "(", "name", ",", "user", ",", "conf_file", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
status_raw
Display the raw output of status user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed CLI Example: .. code-block:: bash salt '*' supervisord.status_raw
salt/modules/supervisord.py
def status_raw(name=None, user=None, conf_file=None, bin_env=None): ''' Display the raw output of status user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed ...
def status_raw(name=None, user=None, conf_file=None, bin_env=None): ''' Display the raw output of status user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed ...
[ "Display", "the", "raw", "output", "of", "status" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/supervisord.py#L312-L335
[ "def", "status_raw", "(", "name", "=", "None", ",", "user", "=", "None", ",", "conf_file", "=", "None", ",", "bin_env", "=", "None", ")", ":", "ret", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "_ctl_cmd", "(", "'status'", ",", "name", ",", "con...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
custom
Run any custom supervisord command user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed CLI Example: .. code-block:: bash salt '*' supervisord.custom "...
salt/modules/supervisord.py
def custom(command, user=None, conf_file=None, bin_env=None): ''' Run any custom supervisord command user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed CLI...
def custom(command, user=None, conf_file=None, bin_env=None): ''' Run any custom supervisord command user user to run supervisorctl as conf_file path to supervisord config file bin_env path to supervisorctl bin or path to virtualenv with supervisor installed CLI...
[ "Run", "any", "custom", "supervisord", "command" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/supervisord.py#L338-L361
[ "def", "custom", "(", "command", ",", "user", "=", "None", ",", "conf_file", "=", "None", ",", "bin_env", "=", "None", ")", ":", "ret", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "_ctl_cmd", "(", "command", ",", "None", ",", "conf_file", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_read_config
Reads the config file using configparser
salt/modules/supervisord.py
def _read_config(conf_file=None): ''' Reads the config file using configparser ''' if conf_file is None: paths = ('/etc/supervisor/supervisord.conf', '/etc/supervisord.conf') for path in paths: if os.path.exists(path): conf_file = path break ...
def _read_config(conf_file=None): ''' Reads the config file using configparser ''' if conf_file is None: paths = ('/etc/supervisor/supervisord.conf', '/etc/supervisord.conf') for path in paths: if os.path.exists(path): conf_file = path break ...
[ "Reads", "the", "config", "file", "using", "configparser" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/supervisord.py#L366-L385
[ "def", "_read_config", "(", "conf_file", "=", "None", ")", ":", "if", "conf_file", "is", "None", ":", "paths", "=", "(", "'/etc/supervisor/supervisord.conf'", ",", "'/etc/supervisord.conf'", ")", "for", "path", "in", "paths", ":", "if", "os", ".", "path", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
options
.. versionadded:: 2014.1.0 Read the config file and return the config options for a given process name Name of the configured process conf_file path to supervisord config file CLI Example: .. code-block:: bash salt '*' supervisord.options foo
salt/modules/supervisord.py
def options(name, conf_file=None): ''' .. versionadded:: 2014.1.0 Read the config file and return the config options for a given process name Name of the configured process conf_file path to supervisord config file CLI Example: .. code-block:: bash salt '*' super...
def options(name, conf_file=None): ''' .. versionadded:: 2014.1.0 Read the config file and return the config options for a given process name Name of the configured process conf_file path to supervisord config file CLI Example: .. code-block:: bash salt '*' super...
[ "..", "versionadded", "::", "2014", ".", "1", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/supervisord.py#L388-L420
[ "def", "options", "(", "name", ",", "conf_file", "=", "None", ")", ":", "config", "=", "_read_config", "(", "conf_file", ")", "section_name", "=", "'program:{0}'", ".", "format", "(", "name", ")", "if", "section_name", "not", "in", "config", ".", "sections...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rotate
Add a log to the logadm configuration name : string alias for entryname kwargs : boolean|string|int optional additional flags and parameters
salt/states/logadm.py
def rotate(name, **kwargs): ''' Add a log to the logadm configuration name : string alias for entryname kwargs : boolean|string|int optional additional flags and parameters ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} ...
def rotate(name, **kwargs): ''' Add a log to the logadm configuration name : string alias for entryname kwargs : boolean|string|int optional additional flags and parameters ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} ...
[ "Add", "a", "log", "to", "the", "logadm", "configuration" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/logadm.py#L48-L114
[ "def", "rotate", "(", "name", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "# cleanup kwargs", "kwargs", "=", "salt", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
remove
Remove a log from the logadm configuration name : string entryname log_file : string (optional) log file path .. note:: If log_file is specified it will be used instead of the entry name.
salt/states/logadm.py
def remove(name, log_file=None): ''' Remove a log from the logadm configuration name : string entryname log_file : string (optional) log file path .. note:: If log_file is specified it will be used instead of the entry name. ''' ret = {'name': name, 'cha...
def remove(name, log_file=None): ''' Remove a log from the logadm configuration name : string entryname log_file : string (optional) log file path .. note:: If log_file is specified it will be used instead of the entry name. ''' ret = {'name': name, 'cha...
[ "Remove", "a", "log", "from", "the", "logadm", "configuration" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/logadm.py#L117-L168
[ "def", "remove", "(", "name", ",", "log_file", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "# retrieve all log configuration", "config", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add_rule
Add a new inbound or outbound rule to the firewall policy Args: name (str): The name of the rule. Must be unique and cannot be "all". Required. localport (int): The port the rule applies to. Must be a number between 0 and 65535. Can be a range. Can specify multiple ports s...
salt/states/win_firewall.py
def add_rule(name, localport, protocol='tcp', action='allow', dir='in', remoteip='any'): ''' Add a new inbound or outbound rule to the firewall policy Args: name (str): The name of the rule. Must be unique and cannot be "all". ...
def add_rule(name, localport, protocol='tcp', action='allow', dir='in', remoteip='any'): ''' Add a new inbound or outbound rule to the firewall policy Args: name (str): The name of the rule. Must be unique and cannot be "all". ...
[ "Add", "a", "new", "inbound", "or", "outbound", "rule", "to", "the", "firewall", "policy" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_firewall.py#L94-L184
[ "def", "add_rule", "(", "name", ",", "localport", ",", "protocol", "=", "'tcp'", ",", "action", "=", "'allow'", ",", "dir", "=", "'in'", ",", "remoteip", "=", "'any'", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_rule
Delete an existing firewall rule identified by name and optionally by ports, protocols, direction, and remote IP. .. versionadded:: Neon Args: name (str): The name of the rule to delete. If the name ``all`` is used you must specify additional parameters. localport (Optional[s...
salt/states/win_firewall.py
def delete_rule(name, localport=None, protocol=None, dir=None, remoteip=None): ''' Delete an existing firewall rule identified by name and optionally by ports, protocols, direction, and remote IP. .. versionadded:: Neon Args: name (str):...
def delete_rule(name, localport=None, protocol=None, dir=None, remoteip=None): ''' Delete an existing firewall rule identified by name and optionally by ports, protocols, direction, and remote IP. .. versionadded:: Neon Args: name (str):...
[ "Delete", "an", "existing", "firewall", "rule", "identified", "by", "name", "and", "optionally", "by", "ports", "protocols", "direction", "and", "remote", "IP", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_firewall.py#L187-L246
[ "def", "delete_rule", "(", "name", ",", "localport", "=", "None", ",", "protocol", "=", "None", ",", "dir", "=", "None", ",", "remoteip", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'changes'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
enabled
Enable all the firewall profiles (Windows only) Args: profile (Optional[str]): The name of the profile to enable. Default is ``allprofiles``. Valid options are: - allprofiles - domainprofile - privateprofile - publicprofile Example: .. ...
salt/states/win_firewall.py
def enabled(name='allprofiles'): ''' Enable all the firewall profiles (Windows only) Args: profile (Optional[str]): The name of the profile to enable. Default is ``allprofiles``. Valid options are: - allprofiles - domainprofile - privateprofile ...
def enabled(name='allprofiles'): ''' Enable all the firewall profiles (Windows only) Args: profile (Optional[str]): The name of the profile to enable. Default is ``allprofiles``. Valid options are: - allprofiles - domainprofile - privateprofile ...
[ "Enable", "all", "the", "firewall", "profiles", "(", "Windows", "only", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_firewall.py#L249-L322
[ "def", "enabled", "(", "name", "=", "'allprofiles'", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", "}", "profile_map", "=", "{", "'domainprofile'", ":", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
post_message
Send a message to a Mattermost channel. :param channel: The channel name, either will work. :param username: The username of the poster. :param message: The message to send to the Mattermost channel. :param api_url: The Mattermost api url, if not specified in the configuration. :param...
salt/runners/mattermost.py
def post_message(message, channel=None, username=None, api_url=None, hook=None): ''' Send a message to a Mattermost channel. :param channel: The channel name, either will work. :param username: The username of the poster. :pa...
def post_message(message, channel=None, username=None, api_url=None, hook=None): ''' Send a message to a Mattermost channel. :param channel: The channel name, either will work. :param username: The username of the poster. :pa...
[ "Send", "a", "message", "to", "a", "Mattermost", "channel", ".", ":", "param", "channel", ":", "The", "channel", "name", "either", "will", "work", ".", ":", "param", "username", ":", "The", "username", "of", "the", "poster", ".", ":", "param", "message",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/mattermost.py#L95-L146
[ "def", "post_message", "(", "message", ",", "channel", "=", "None", ",", "username", "=", "None", ",", "api_url", "=", "None", ",", "hook", "=", "None", ")", ":", "if", "not", "api_url", ":", "api_url", "=", "_get_api_url", "(", ")", "if", "not", "ho...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
post_event
Send an event to a Mattermost channel. :param channel: The channel name, either will work. :param username: The username of the poster. :param event: The event to send to the Mattermost channel. :param api_url: The Mattermost api url, if not specified in the configuration. :param ho...
salt/runners/mattermost.py
def post_event(event, channel=None, username=None, api_url=None, hook=None): ''' Send an event to a Mattermost channel. :param channel: The channel name, either will work. :param username: The username of the poster. :param event: ...
def post_event(event, channel=None, username=None, api_url=None, hook=None): ''' Send an event to a Mattermost channel. :param channel: The channel name, either will work. :param username: The username of the poster. :param event: ...
[ "Send", "an", "event", "to", "a", "Mattermost", "channel", ".", ":", "param", "channel", ":", "The", "channel", "name", "either", "will", "work", ".", ":", "param", "username", ":", "The", "username", "of", "the", "poster", ".", ":", "param", "event", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/mattermost.py#L149-L188
[ "def", "post_event", "(", "event", ",", "channel", "=", "None", ",", "username", "=", "None", ",", "api_url", "=", "None", ",", "hook", "=", "None", ")", ":", "if", "not", "api_url", ":", "api_url", "=", "_get_api_url", "(", ")", "if", "not", "hook",...
e8541fd6e744ab0df786c0f76102e41631f45d46