id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
35,400
saltstack/salt
salt/modules/napalm_ntp.py
servers
def servers(**kwargs): # pylint: disable=unused-argument ''' Returns a list of the configured NTP servers on the device. CLI Example: .. code-block:: bash salt '*' ntp.servers Example output: .. code-block:: python [ '192.168.0.1', '172.17.17.1', ...
python
def servers(**kwargs): # pylint: disable=unused-argument ''' Returns a list of the configured NTP servers on the device. CLI Example: .. code-block:: bash salt '*' ntp.servers Example output: .. code-block:: python [ '192.168.0.1', '172.17.17.1', ...
[ "def", "servers", "(", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "ntp_servers", "=", "salt", ".", "utils", ".", "napalm", ".", "call", "(", "napalm_device", ",", "# pylint: disable=undefined-variable", "'get_ntp_servers'", ",", "*", "*", "...
Returns a list of the configured NTP servers on the device. CLI Example: .. code-block:: bash salt '*' ntp.servers Example output: .. code-block:: python [ '192.168.0.1', '172.17.17.1', '172.17.17.2', '2400:cb00:6:1024::c71b:840a' ...
[ "Returns", "a", "list", "of", "the", "configured", "NTP", "servers", "on", "the", "device", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_ntp.py#L107-L144
35,401
saltstack/salt
salt/modules/napalm_ntp.py
stats
def stats(peer=None, **kwargs): # pylint: disable=unused-argument ''' Returns a dictionary containing synchronization details of the NTP peers. :param peer: Returns only the details of a specific NTP peer. :return: a list of dictionaries, with the following keys: * remote * reference...
python
def stats(peer=None, **kwargs): # pylint: disable=unused-argument ''' Returns a dictionary containing synchronization details of the NTP peers. :param peer: Returns only the details of a specific NTP peer. :return: a list of dictionaries, with the following keys: * remote * reference...
[ "def", "stats", "(", "peer", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "proxy_output", "=", "salt", ".", "utils", ".", "napalm", ".", "call", "(", "napalm_device", ",", "# pylint: disable=undefined-variable", "'get_ntp_st...
Returns a dictionary containing synchronization details of the NTP peers. :param peer: Returns only the details of a specific NTP peer. :return: a list of dictionaries, with the following keys: * remote * referenceid * synchronized * stratum * type * when ...
[ "Returns", "a", "dictionary", "containing", "synchronization", "details", "of", "the", "NTP", "peers", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_ntp.py#L148-L214
35,402
saltstack/salt
salt/modules/napalm_ntp.py
set_peers
def set_peers(*peers, **options): ''' Configures a list of NTP peers on the device. :param peers: list of IP Addresses/Domain Names :param test (bool): discard loaded config. By default ``test`` is False (will not dicard the changes) :commit commit (bool): commit loaded config. By default ...
python
def set_peers(*peers, **options): ''' Configures a list of NTP peers on the device. :param peers: list of IP Addresses/Domain Names :param test (bool): discard loaded config. By default ``test`` is False (will not dicard the changes) :commit commit (bool): commit loaded config. By default ...
[ "def", "set_peers", "(", "*", "peers", ",", "*", "*", "options", ")", ":", "test", "=", "options", ".", "pop", "(", "'test'", ",", "False", ")", "commit", "=", "options", ".", "pop", "(", "'commit'", ",", "True", ")", "return", "__salt__", "[", "'n...
Configures a list of NTP peers on the device. :param peers: list of IP Addresses/Domain Names :param test (bool): discard loaded config. By default ``test`` is False (will not dicard the changes) :commit commit (bool): commit loaded config. By default ``commit`` is True (will commit the cha...
[ "Configures", "a", "list", "of", "NTP", "peers", "on", "the", "device", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_ntp.py#L218-L249
35,403
saltstack/salt
salt/modules/napalm_ntp.py
delete_servers
def delete_servers(*servers, **options): ''' Removes NTP servers configured on the device. :param servers: list of IP Addresses/Domain Names to be removed as NTP servers :param test (bool): discard loaded config. By default ``test`` is False (will not dicard the changes) :param com...
python
def delete_servers(*servers, **options): ''' Removes NTP servers configured on the device. :param servers: list of IP Addresses/Domain Names to be removed as NTP servers :param test (bool): discard loaded config. By default ``test`` is False (will not dicard the changes) :param com...
[ "def", "delete_servers", "(", "*", "servers", ",", "*", "*", "options", ")", ":", "test", "=", "options", ".", "pop", "(", "'test'", ",", "False", ")", "commit", "=", "options", ".", "pop", "(", "'commit'", ",", "True", ")", "return", "__salt__", "["...
Removes NTP servers configured on the device. :param servers: list of IP Addresses/Domain Names to be removed as NTP servers :param test (bool): discard loaded config. By default ``test`` is False (will not dicard the changes) :param commit (bool): commit loaded config. By default ``commit`...
[ "Removes", "NTP", "servers", "configured", "on", "the", "device", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_ntp.py#L323-L356
35,404
saltstack/salt
salt/returners/elasticsearch_return.py
event_return
def event_return(events): ''' Return events to Elasticsearch Requires that the `event_return` configuration be set in master config. ''' options = _get_options() index = options['master_event_index'] doc_type = options['master_event_doc_type'] if options['index_date']: index =...
python
def event_return(events): ''' Return events to Elasticsearch Requires that the `event_return` configuration be set in master config. ''' options = _get_options() index = options['master_event_index'] doc_type = options['master_event_doc_type'] if options['index_date']: index =...
[ "def", "event_return", "(", "events", ")", ":", "options", "=", "_get_options", "(", ")", "index", "=", "options", "[", "'master_event_index'", "]", "doc_type", "=", "options", "[", "'master_event_doc_type'", "]", "if", "options", "[", "'index_date'", "]", ":"...
Return events to Elasticsearch Requires that the `event_return` configuration be set in master config.
[ "Return", "events", "to", "Elasticsearch" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/elasticsearch_return.py#L334-L360
35,405
saltstack/salt
salt/runners/manage.py
key_regen
def key_regen(): ''' This routine is used to regenerate all keys in an environment. This is invasive! ALL KEYS IN THE SALT ENVIRONMENT WILL BE REGENERATED!! The key_regen routine sends a command out to minions to revoke the master key and remove all minion keys, it then removes all keys from the ma...
python
def key_regen(): ''' This routine is used to regenerate all keys in an environment. This is invasive! ALL KEYS IN THE SALT ENVIRONMENT WILL BE REGENERATED!! The key_regen routine sends a command out to minions to revoke the master key and remove all minion keys, it then removes all keys from the ma...
[ "def", "key_regen", "(", ")", ":", "client", "=", "salt", ".", "client", ".", "get_local_client", "(", "__opts__", "[", "'conf_file'", "]", ")", "try", ":", "client", ".", "cmd", "(", "'*'", ",", "'saltutil.regen_keys'", ")", "except", "SaltClientError", "...
This routine is used to regenerate all keys in an environment. This is invasive! ALL KEYS IN THE SALT ENVIRONMENT WILL BE REGENERATED!! The key_regen routine sends a command out to minions to revoke the master key and remove all minion keys, it then removes all keys from the master and prompts the user...
[ "This", "routine", "is", "used", "to", "regenerate", "all", "keys", "in", "an", "environment", ".", "This", "is", "invasive!", "ALL", "KEYS", "IN", "THE", "SALT", "ENVIRONMENT", "WILL", "BE", "REGENERATED!!" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L99-L148
35,406
saltstack/salt
salt/runners/manage.py
versions
def versions(): ''' Check the version of active minions CLI Example: .. code-block:: bash salt-run manage.versions ''' ret = {} client = salt.client.get_local_client(__opts__['conf_file']) try: minions = client.cmd('*', 'test.version', timeout=__opts__['timeout']) ...
python
def versions(): ''' Check the version of active minions CLI Example: .. code-block:: bash salt-run manage.versions ''' ret = {} client = salt.client.get_local_client(__opts__['conf_file']) try: minions = client.cmd('*', 'test.version', timeout=__opts__['timeout']) ...
[ "def", "versions", "(", ")", ":", "ret", "=", "{", "}", "client", "=", "salt", ".", "client", ".", "get_local_client", "(", "__opts__", "[", "'conf_file'", "]", ")", "try", ":", "minions", "=", "client", ".", "cmd", "(", "'*'", ",", "'test.version'", ...
Check the version of active minions CLI Example: .. code-block:: bash salt-run manage.versions
[ "Check", "the", "version", "of", "active", "minions" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L605-L659
35,407
saltstack/salt
salt/runners/manage.py
bootstrap
def bootstrap(version='develop', script=None, hosts='', script_args='', roster='flat', ssh_user=None, ssh_password=None, ssh_priv_key=None, tmp_dir='/tmp/.bootstrap', http_backend='tornado'): ...
python
def bootstrap(version='develop', script=None, hosts='', script_args='', roster='flat', ssh_user=None, ssh_password=None, ssh_priv_key=None, tmp_dir='/tmp/.bootstrap', http_backend='tornado'): ...
[ "def", "bootstrap", "(", "version", "=", "'develop'", ",", "script", "=", "None", ",", "hosts", "=", "''", ",", "script_args", "=", "''", ",", "roster", "=", "'flat'", ",", "ssh_user", "=", "None", ",", "ssh_password", "=", "None", ",", "ssh_priv_key", ...
Bootstrap minions with salt-bootstrap version : develop Git tag of version to install script : https://bootstrap.saltstack.com URL containing the script to execute hosts Comma-separated hosts [example: hosts='host1.local,host2.local']. These hosts need to exist in the spec...
[ "Bootstrap", "minions", "with", "salt", "-", "bootstrap" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L662-L784
35,408
saltstack/salt
salt/runners/manage.py
bootstrap_psexec
def bootstrap_psexec(hosts='', master=None, version=None, arch='win32', installer_url=None, username=None, password=None): ''' Bootstrap Windows minions via PsExec. hosts Comma separated list of hosts to deploy the Windows Salt minion. master Address of the Salt ma...
python
def bootstrap_psexec(hosts='', master=None, version=None, arch='win32', installer_url=None, username=None, password=None): ''' Bootstrap Windows minions via PsExec. hosts Comma separated list of hosts to deploy the Windows Salt minion. master Address of the Salt ma...
[ "def", "bootstrap_psexec", "(", "hosts", "=", "''", ",", "master", "=", "None", ",", "version", "=", "None", ",", "arch", "=", "'win32'", ",", "installer_url", "=", "None", ",", "username", "=", "None", ",", "password", "=", "None", ")", ":", "if", "...
Bootstrap Windows minions via PsExec. hosts Comma separated list of hosts to deploy the Windows Salt minion. master Address of the Salt master passed as an argument to the installer. version Point release of installer to download. Defaults to the most recent. arch Arc...
[ "Bootstrap", "Windows", "minions", "via", "PsExec", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L787-L922
35,409
saltstack/salt
salt/modules/launchctl_service.py
_available_services
def _available_services(): ''' Return a dictionary of all available services on the system ''' available_services = dict() for launch_dir in _launchd_paths(): for root, dirs, files in salt.utils.path.os_walk(launch_dir): for filename in files: file_path = os.path....
python
def _available_services(): ''' Return a dictionary of all available services on the system ''' available_services = dict() for launch_dir in _launchd_paths(): for root, dirs, files in salt.utils.path.os_walk(launch_dir): for filename in files: file_path = os.path....
[ "def", "_available_services", "(", ")", ":", "available_services", "=", "dict", "(", ")", "for", "launch_dir", "in", "_launchd_paths", "(", ")", ":", "for", "root", ",", "dirs", ",", "files", "in", "salt", ".", "utils", ".", "path", ".", "os_walk", "(", ...
Return a dictionary of all available services on the system
[ "Return", "a", "dictionary", "of", "all", "available", "services", "on", "the", "system" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/launchctl_service.py#L77-L125
35,410
saltstack/salt
salt/modules/launchctl_service.py
_service_by_name
def _service_by_name(name): ''' Return the service info for a service by label, filename or path ''' services = _available_services() name = name.lower() if name in services: # Match on label return services[name] for service in six.itervalues(services): if service[...
python
def _service_by_name(name): ''' Return the service info for a service by label, filename or path ''' services = _available_services() name = name.lower() if name in services: # Match on label return services[name] for service in six.itervalues(services): if service[...
[ "def", "_service_by_name", "(", "name", ")", ":", "services", "=", "_available_services", "(", ")", "name", "=", "name", ".", "lower", "(", ")", "if", "name", "in", "services", ":", "# Match on label", "return", "services", "[", "name", "]", "for", "servic...
Return the service info for a service by label, filename or path
[ "Return", "the", "service", "info", "for", "a", "service", "by", "label", "filename", "or", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/launchctl_service.py#L128-L148
35,411
saltstack/salt
salt/modules/mandrill.py
_get_url
def _get_url(method, api_url, api_version): ''' Build the API URL. ''' return '{url}/{version}/{method}.json'.format(url=api_url, version=float(api_version), method=method)
python
def _get_url(method, api_url, api_version): ''' Build the API URL. ''' return '{url}/{version}/{method}.json'.format(url=api_url, version=float(api_version), method=method)
[ "def", "_get_url", "(", "method", ",", "api_url", ",", "api_version", ")", ":", "return", "'{url}/{version}/{method}.json'", ".", "format", "(", "url", "=", "api_url", ",", "version", "=", "float", "(", "api_version", ")", ",", "method", "=", "method", ")" ]
Build the API URL.
[ "Build", "the", "API", "URL", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mandrill.py#L80-L88
35,412
saltstack/salt
salt/modules/mandrill.py
send
def send(message, asynchronous=False, ip_pool=None, send_at=None, api_url=None, api_version=None, api_key=None, **kwargs): ''' Send out the email using the details from the ``message`` argument. message The information on the message to...
python
def send(message, asynchronous=False, ip_pool=None, send_at=None, api_url=None, api_version=None, api_key=None, **kwargs): ''' Send out the email using the details from the ``message`` argument. message The information on the message to...
[ "def", "send", "(", "message", ",", "asynchronous", "=", "False", ",", "ip_pool", "=", "None", ",", "send_at", "=", "None", ",", "api_url", "=", "None", ",", "api_version", "=", "None", ",", "api_key", "=", "None", ",", "*", "*", "kwargs", ")", ":", ...
Send out the email using the details from the ``message`` argument. message The information on the message to send. This argument must be sent as dictionary with at fields as specified in the Mandrill API documentation. asynchronous: ``False`` Enable a background sending mode t...
[ "Send", "out", "the", "email", "using", "the", "details", "from", "the", "message", "argument", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mandrill.py#L140-L252
35,413
saltstack/salt
salt/states/modjk_worker.py
_send_command
def _send_command(cmd, worker, lbn, target, profile='default', tgt_type='glob'): ''' Send a command to the modjk loadbalancer The minion need to be able to publish the commands to the load balancer cmd: wo...
python
def _send_command(cmd, worker, lbn, target, profile='default', tgt_type='glob'): ''' Send a command to the modjk loadbalancer The minion need to be able to publish the commands to the load balancer cmd: wo...
[ "def", "_send_command", "(", "cmd", ",", "worker", ",", "lbn", ",", "target", ",", "profile", "=", "'default'", ",", "tgt_type", "=", "'glob'", ")", ":", "ret", "=", "{", "'code'", ":", "False", ",", "'msg'", ":", "'OK'", ",", "'minions'", ":", "[", ...
Send a command to the modjk loadbalancer The minion need to be able to publish the commands to the load balancer cmd: worker_stop - won't get any traffic from the lbn worker_activate - activate the worker worker_disable - will get traffic only for current sessions
[ "Send", "a", "command", "to", "the", "modjk", "loadbalancer", "The", "minion", "need", "to", "be", "able", "to", "publish", "the", "commands", "to", "the", "load", "balancer" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/modjk_worker.py#L31-L80
35,414
saltstack/salt
salt/states/modjk_worker.py
_worker_status
def _worker_status(target, worker, activation, profile='default', tgt_type='glob'): ''' Check if the worker is in `activation` state in the targeted load balancers The function will return the following dictionary: result -...
python
def _worker_status(target, worker, activation, profile='default', tgt_type='glob'): ''' Check if the worker is in `activation` state in the targeted load balancers The function will return the following dictionary: result -...
[ "def", "_worker_status", "(", "target", ",", "worker", ",", "activation", ",", "profile", "=", "'default'", ",", "tgt_type", "=", "'glob'", ")", ":", "ret", "=", "{", "'result'", ":", "True", ",", "'errors'", ":", "[", "]", ",", "'wrong_state'", ":", "...
Check if the worker is in `activation` state in the targeted load balancers The function will return the following dictionary: result - False if no server returned from the published command errors - list of servers that couldn't find the worker wrong_state - list of servers that the worker...
[ "Check", "if", "the", "worker", "is", "in", "activation", "state", "in", "the", "targeted", "load", "balancers" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/modjk_worker.py#L83-L121
35,415
saltstack/salt
salt/grains/metadata.py
_search
def _search(prefix="latest/"): ''' Recursively look up all grains in the metadata server ''' ret = {} linedata = http.query(os.path.join(HOST, prefix), headers=True) if 'body' not in linedata: return ret body = salt.utils.stringutils.to_unicode(linedata['body']) if linedata['head...
python
def _search(prefix="latest/"): ''' Recursively look up all grains in the metadata server ''' ret = {} linedata = http.query(os.path.join(HOST, prefix), headers=True) if 'body' not in linedata: return ret body = salt.utils.stringutils.to_unicode(linedata['body']) if linedata['head...
[ "def", "_search", "(", "prefix", "=", "\"latest/\"", ")", ":", "ret", "=", "{", "}", "linedata", "=", "http", ".", "query", "(", "os", ".", "path", ".", "join", "(", "HOST", ",", "prefix", ")", ",", "headers", "=", "True", ")", "if", "'body'", "n...
Recursively look up all grains in the metadata server
[ "Recursively", "look", "up", "all", "grains", "in", "the", "metadata", "server" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/metadata.py#L49-L84
35,416
saltstack/salt
salt/client/ssh/wrapper/grains.py
has_value
def has_value(key): ''' Determine whether a named value exists in the grains dictionary. Given a grains dictionary that contains the following structure:: {'pkg': {'apache': 'httpd'}} One would determine if the apache key in the pkg dict exists by:: pkg:apache CLI Example: ...
python
def has_value(key): ''' Determine whether a named value exists in the grains dictionary. Given a grains dictionary that contains the following structure:: {'pkg': {'apache': 'httpd'}} One would determine if the apache key in the pkg dict exists by:: pkg:apache CLI Example: ...
[ "def", "has_value", "(", "key", ")", ":", "return", "True", "if", "salt", ".", "utils", ".", "data", ".", "traverse_dict_and_list", "(", "__grains__", ",", "key", ",", "False", ")", "else", "False" ]
Determine whether a named value exists in the grains dictionary. Given a grains dictionary that contains the following structure:: {'pkg': {'apache': 'httpd'}} One would determine if the apache key in the pkg dict exists by:: pkg:apache CLI Example: .. code-block:: bash sa...
[ "Determine", "whether", "a", "named", "value", "exists", "in", "the", "grains", "dictionary", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/grains.py#L85-L105
35,417
saltstack/salt
salt/states/boto_vpc.py
present
def present(name, cidr_block, instance_tenancy=None, dns_support=None, dns_hostnames=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure VPC exists. name Name of the VPC. cidr_block The range of IPs in CIDR format, for example: 10.0.0.0...
python
def present(name, cidr_block, instance_tenancy=None, dns_support=None, dns_hostnames=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure VPC exists. name Name of the VPC. cidr_block The range of IPs in CIDR format, for example: 10.0.0.0...
[ "def", "present", "(", "name", ",", "cidr_block", ",", "instance_tenancy", "=", "None", ",", "dns_support", "=", "None", ",", "dns_hostnames", "=", "None", ",", "tags", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "="...
Ensure VPC exists. name Name of the VPC. cidr_block The range of IPs in CIDR format, for example: 10.0.0.0/24. Block size must be between /16 and /28 netmask. instance_tenancy Instances launched in this VPC will be ingle-tenant or dedicated hardware. dns_suppo...
[ "Ensure", "VPC", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L172-L245
35,418
saltstack/salt
salt/states/boto_vpc.py
absent
def absent(name, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure VPC with passed properties is absent. name Name of the VPC. tags A list of tags. All tags must match. region Region to connect to. key Secret key to be used. keyid ...
python
def absent(name, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure VPC with passed properties is absent. name Name of the VPC. tags A list of tags. All tags must match. region Region to connect to. key Secret key to be used. keyid ...
[ "def", "absent", "(", "name", ",", "tags", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ...
Ensure VPC with passed properties is absent. name Name of the VPC. tags A list of tags. All tags must match. region Region to connect to. key Secret key to be used. keyid Access key to be used. profile A dict with region, key and keyid, or a ...
[ "Ensure", "VPC", "with", "passed", "properties", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L248-L304
35,419
saltstack/salt
salt/states/boto_vpc.py
dhcp_options_absent
def dhcp_options_absent(name=None, dhcp_options_id=None, region=None, key=None, keyid=None, profile=None): ''' Ensure a set of DHCP options with the given settings exist. name (string) Name of the DHCP options set. dhcp_options_id (string) Id of the DHCP options set. ...
python
def dhcp_options_absent(name=None, dhcp_options_id=None, region=None, key=None, keyid=None, profile=None): ''' Ensure a set of DHCP options with the given settings exist. name (string) Name of the DHCP options set. dhcp_options_id (string) Id of the DHCP options set. ...
[ "def", "dhcp_options_absent", "(", "name", "=", "None", ",", "dhcp_options_id", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name"...
Ensure a set of DHCP options with the given settings exist. name (string) Name of the DHCP options set. dhcp_options_id (string) Id of the DHCP options set. region (string) Region to connect to. key (string) Secret key to be used. ...
[ "Ensure", "a", "set", "of", "DHCP", "options", "with", "the", "given", "settings", "exist", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L431-L497
35,420
saltstack/salt
salt/states/boto_vpc.py
_verify_subnet_association
def _verify_subnet_association(route_table_desc, subnet_id): ''' Helper function verify a subnet's route table association route_table_desc the description of a route table, as returned from boto_vpc.describe_route_table subnet_id the subnet id to verify .. versionadded:: 2016.11....
python
def _verify_subnet_association(route_table_desc, subnet_id): ''' Helper function verify a subnet's route table association route_table_desc the description of a route table, as returned from boto_vpc.describe_route_table subnet_id the subnet id to verify .. versionadded:: 2016.11....
[ "def", "_verify_subnet_association", "(", "route_table_desc", ",", "subnet_id", ")", ":", "if", "route_table_desc", ":", "if", "'associations'", "in", "route_table_desc", ":", "for", "association", "in", "route_table_desc", "[", "'associations'", "]", ":", "if", "as...
Helper function verify a subnet's route table association route_table_desc the description of a route table, as returned from boto_vpc.describe_route_table subnet_id the subnet id to verify .. versionadded:: 2016.11.0
[ "Helper", "function", "verify", "a", "subnet", "s", "route", "table", "association" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L674-L691
35,421
saltstack/salt
salt/states/boto_vpc.py
subnet_absent
def subnet_absent(name=None, subnet_id=None, region=None, key=None, keyid=None, profile=None): ''' Ensure subnet with passed properties is absent. name Name of the subnet. region Region to connect to. key Secret key to be used. keyid Access key to be used. ...
python
def subnet_absent(name=None, subnet_id=None, region=None, key=None, keyid=None, profile=None): ''' Ensure subnet with passed properties is absent. name Name of the subnet. region Region to connect to. key Secret key to be used. keyid Access key to be used. ...
[ "def", "subnet_absent", "(", "name", "=", "None", ",", "subnet_id", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "...
Ensure subnet with passed properties is absent. name Name of the subnet. region Region to connect to. key Secret key to be used. keyid Access key to be used. profile A dict with region, key and keyid, or a pillar key (string) that contains a dict ...
[ "Ensure", "subnet", "with", "passed", "properties", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L694-L751
35,422
saltstack/salt
salt/states/boto_vpc.py
internet_gateway_present
def internet_gateway_present(name, vpc_name=None, vpc_id=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure an internet gateway exists. name Name of the internet gateway. vpc_name Name of the VPC to wh...
python
def internet_gateway_present(name, vpc_name=None, vpc_id=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure an internet gateway exists. name Name of the internet gateway. vpc_name Name of the VPC to wh...
[ "def", "internet_gateway_present", "(", "name", ",", "vpc_name", "=", "None", ",", "vpc_id", "=", "None", ",", "tags", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":",...
Ensure an internet gateway exists. name Name of the internet gateway. vpc_name Name of the VPC to which the internet gateway should be attached. vpc_id Id of the VPC to which the internet_gateway should be attached. Only one of vpc_name or vpc_id may be provided. tags...
[ "Ensure", "an", "internet", "gateway", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L754-L821
35,423
saltstack/salt
salt/states/boto_vpc.py
internet_gateway_absent
def internet_gateway_absent(name, detach=False, region=None, key=None, keyid=None, profile=None): ''' Ensure the named internet gateway is absent. name Name of the internet gateway. detach First detach the internet gateway from a VPC, if attached. regio...
python
def internet_gateway_absent(name, detach=False, region=None, key=None, keyid=None, profile=None): ''' Ensure the named internet gateway is absent. name Name of the internet gateway. detach First detach the internet gateway from a VPC, if attached. regio...
[ "def", "internet_gateway_absent", "(", "name", ",", "detach", "=", "False", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'"...
Ensure the named internet gateway is absent. name Name of the internet gateway. detach First detach the internet gateway from a VPC, if attached. region Region to connect to. key Secret key to be used. keyid Access key to be used. profile A d...
[ "Ensure", "the", "named", "internet", "gateway", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L824-L883
35,424
saltstack/salt
salt/states/boto_vpc.py
route_table_present
def route_table_present(name, vpc_name=None, vpc_id=None, routes=None, subnet_ids=None, subnet_names=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure route table with routes exists and is associated to a VPC. This function require...
python
def route_table_present(name, vpc_name=None, vpc_id=None, routes=None, subnet_ids=None, subnet_names=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure route table with routes exists and is associated to a VPC. This function require...
[ "def", "route_table_present", "(", "name", ",", "vpc_name", "=", "None", ",", "vpc_id", "=", "None", ",", "routes", "=", "None", ",", "subnet_ids", "=", "None", ",", "subnet_names", "=", "None", ",", "tags", "=", "None", ",", "region", "=", "None", ","...
Ensure route table with routes exists and is associated to a VPC. This function requires boto3 to be installed if nat gatewyas are specified. Example: .. code-block:: yaml boto_vpc.route_table_present: - name: my_route_table - vpc_id: vpc-123456 - routes: ...
[ "Ensure", "route", "table", "with", "routes", "exists", "and", "is", "associated", "to", "a", "VPC", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L886-L983
35,425
saltstack/salt
salt/states/boto_vpc.py
route_table_absent
def route_table_absent(name, region=None, key=None, keyid=None, profile=None): ''' Ensure the named route table is absent. name Name of the route table. region Region to connect to. key Secret key to be used. keyid Access key to be used....
python
def route_table_absent(name, region=None, key=None, keyid=None, profile=None): ''' Ensure the named route table is absent. name Name of the route table. region Region to connect to. key Secret key to be used. keyid Access key to be used....
[ "def", "route_table_absent", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ...
Ensure the named route table is absent. name Name of the route table. region Region to connect to. key Secret key to be used. keyid Access key to be used. profile A dict with region, key and keyid, or a pillar key (string) that contains a dict wit...
[ "Ensure", "the", "named", "route", "table", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L1235-L1293
35,426
saltstack/salt
salt/states/boto_vpc.py
nat_gateway_present
def nat_gateway_present(name, subnet_name=None, subnet_id=None, region=None, key=None, keyid=None, profile=None, allocation_id=None): ''' Ensure a nat gateway exists within the specified subnet This function requires boto3. .. versionadded:: 2016.11.0 Example: .. code...
python
def nat_gateway_present(name, subnet_name=None, subnet_id=None, region=None, key=None, keyid=None, profile=None, allocation_id=None): ''' Ensure a nat gateway exists within the specified subnet This function requires boto3. .. versionadded:: 2016.11.0 Example: .. code...
[ "def", "nat_gateway_present", "(", "name", ",", "subnet_name", "=", "None", ",", "subnet_id", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "allocation_id", "=", "None", "...
Ensure a nat gateway exists within the specified subnet This function requires boto3. .. versionadded:: 2016.11.0 Example: .. code-block:: yaml boto_vpc.nat_gateway_present: - subnet_name: my-subnet name Name of the state subnet_name Name of the subnet wi...
[ "Ensure", "a", "nat", "gateway", "exists", "within", "the", "specified", "subnet" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L1296-L1374
35,427
saltstack/salt
salt/states/boto_vpc.py
nat_gateway_absent
def nat_gateway_absent(name=None, subnet_name=None, subnet_id=None, region=None, key=None, keyid=None, profile=None, wait_for_delete_retries=0): ''' Ensure the nat gateway in the named subnet is absent. This function requires boto3. .. versionadded:: 2016....
python
def nat_gateway_absent(name=None, subnet_name=None, subnet_id=None, region=None, key=None, keyid=None, profile=None, wait_for_delete_retries=0): ''' Ensure the nat gateway in the named subnet is absent. This function requires boto3. .. versionadded:: 2016....
[ "def", "nat_gateway_absent", "(", "name", "=", "None", ",", "subnet_name", "=", "None", ",", "subnet_id", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "wait_for_delete_retr...
Ensure the nat gateway in the named subnet is absent. This function requires boto3. .. versionadded:: 2016.11.0 name Name of the state. subnet_name Name of the subnet within which the nat gateway should exist subnet_id Id of the subnet within which the nat gateway should...
[ "Ensure", "the", "nat", "gateway", "in", "the", "named", "subnet", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L1377-L1454
35,428
saltstack/salt
salt/states/boto_vpc.py
accept_vpc_peering_connection
def accept_vpc_peering_connection(name=None, conn_id=None, conn_name=None, region=None, key=None, keyid=None, profile=None): ''' Accept a VPC pending requested peering connection between two VPCs. name Name of this state conn_id The connection ID to ac...
python
def accept_vpc_peering_connection(name=None, conn_id=None, conn_name=None, region=None, key=None, keyid=None, profile=None): ''' Accept a VPC pending requested peering connection between two VPCs. name Name of this state conn_id The connection ID to ac...
[ "def", "accept_vpc_peering_connection", "(", "name", "=", "None", ",", "conn_id", "=", "None", ",", "conn_name", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "log", ...
Accept a VPC pending requested peering connection between two VPCs. name Name of this state conn_id The connection ID to accept. Exclusive with conn_name. String type. conn_name The name of the VPC peering connection to accept. Exclusive with conn_id. String type. region ...
[ "Accept", "a", "VPC", "pending", "requested", "peering", "connection", "between", "two", "VPCs", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L1458-L1534
35,429
saltstack/salt
salt/modules/ceph.py
zap
def zap(target=None, **kwargs): ''' Destroy the partition table and content of a given disk. .. code-block:: bash salt '*' ceph.osd_prepare 'dev'='/dev/vdc' \\ 'cluster_name'='ceph' \\ 'cluster_uuid'='cluster_uuid' dev The block device to format. c...
python
def zap(target=None, **kwargs): ''' Destroy the partition table and content of a given disk. .. code-block:: bash salt '*' ceph.osd_prepare 'dev'='/dev/vdc' \\ 'cluster_name'='ceph' \\ 'cluster_uuid'='cluster_uuid' dev The block device to format. c...
[ "def", "zap", "(", "target", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "target", "is", "not", "None", ":", "log", ".", "warning", "(", "\"Depricated use of function, use kwargs\"", ")", "target", "=", "kwargs", ".", "get", "(", "\"dev\"", ","...
Destroy the partition table and content of a given disk. .. code-block:: bash salt '*' ceph.osd_prepare 'dev'='/dev/vdc' \\ 'cluster_name'='ceph' \\ 'cluster_uuid'='cluster_uuid' dev The block device to format. cluster_name The cluster name. Defaul...
[ "Destroy", "the", "partition", "table", "and", "content", "of", "a", "given", "disk", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ceph.py#L98-L121
35,430
saltstack/salt
salt/runners/f5.py
F5Mgmt._connect
def _connect(self): ''' Connect to F5 ''' try: self.bigIP = f5.BIGIP(hostname=self.lb, username=self.username, password=self.password, fromurl=True, ...
python
def _connect(self): ''' Connect to F5 ''' try: self.bigIP = f5.BIGIP(hostname=self.lb, username=self.username, password=self.password, fromurl=True, ...
[ "def", "_connect", "(", "self", ")", ":", "try", ":", "self", ".", "bigIP", "=", "f5", ".", "BIGIP", "(", "hostname", "=", "self", ".", "lb", ",", "username", "=", "self", ".", "username", ",", "password", "=", "self", ".", "password", ",", "fromur...
Connect to F5
[ "Connect", "to", "F5" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L45-L61
35,431
saltstack/salt
salt/runners/f5.py
F5Mgmt.check_virtualserver
def check_virtualserver(self, name): ''' Check to see if a virtual server exists ''' vs = self.bigIP.LocalLB.VirtualServer for v in vs.get_list(): if v.split('/')[-1] == name: return True return False
python
def check_virtualserver(self, name): ''' Check to see if a virtual server exists ''' vs = self.bigIP.LocalLB.VirtualServer for v in vs.get_list(): if v.split('/')[-1] == name: return True return False
[ "def", "check_virtualserver", "(", "self", ",", "name", ")", ":", "vs", "=", "self", ".", "bigIP", ".", "LocalLB", ".", "VirtualServer", "for", "v", "in", "vs", ".", "get_list", "(", ")", ":", "if", "v", ".", "split", "(", "'/'", ")", "[", "-", "...
Check to see if a virtual server exists
[ "Check", "to", "see", "if", "a", "virtual", "server", "exists" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L205-L213
35,432
saltstack/salt
salt/runners/f5.py
F5Mgmt.lbmethods
def lbmethods(self): ''' List all the load balancer methods ''' methods = self.bigIP.LocalLB.Pool.typefactory.create( 'LocalLB.LBMethod' ) return [method[0].split('_', 2)[-1] for method in methods]
python
def lbmethods(self): ''' List all the load balancer methods ''' methods = self.bigIP.LocalLB.Pool.typefactory.create( 'LocalLB.LBMethod' ) return [method[0].split('_', 2)[-1] for method in methods]
[ "def", "lbmethods", "(", "self", ")", ":", "methods", "=", "self", ".", "bigIP", ".", "LocalLB", ".", "Pool", ".", "typefactory", ".", "create", "(", "'LocalLB.LBMethod'", ")", "return", "[", "method", "[", "0", "]", ".", "split", "(", "'_'", ",", "2...
List all the load balancer methods
[ "List", "all", "the", "load", "balancer", "methods" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L225-L232
35,433
saltstack/salt
salt/cloud/clouds/softlayer.py
avail_sizes
def avail_sizes(call=None): ''' Return a dict of all available VM sizes on the cloud provider with relevant data. This data is provided in three dicts. ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --functio...
python
def avail_sizes(call=None): ''' Return a dict of all available VM sizes on the cloud provider with relevant data. This data is provided in three dicts. ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --functio...
[ "def", "avail_sizes", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_sizes function must be called with '", "'-f or --function, or with the --list-sizes option'", ")", "ret", "=", "{", "'block devi...
Return a dict of all available VM sizes on the cloud provider with relevant data. This data is provided in three dicts.
[ "Return", "a", "dict", "of", "all", "available", "VM", "sizes", "on", "the", "cloud", "provider", "with", "relevant", "data", ".", "This", "data", "is", "provided", "in", "three", "dicts", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer.py#L141-L176
35,434
saltstack/salt
salt/cloud/clouds/softlayer.py
list_custom_images
def list_custom_images(call=None): ''' Return a dict of all custom VM images on the cloud provider. ''' if call != 'function': raise SaltCloudSystemExit( 'The list_vlans function must be called with -f or --function.' ) ret = {} conn = get_conn('SoftLayer_Account') ...
python
def list_custom_images(call=None): ''' Return a dict of all custom VM images on the cloud provider. ''' if call != 'function': raise SaltCloudSystemExit( 'The list_vlans function must be called with -f or --function.' ) ret = {} conn = get_conn('SoftLayer_Account') ...
[ "def", "list_custom_images", "(", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_vlans function must be called with -f or --function.'", ")", "ret", "=", "{", "}", "conn", "=", "get_conn", "(", ...
Return a dict of all custom VM images on the cloud provider.
[ "Return", "a", "dict", "of", "all", "custom", "VM", "images", "on", "the", "cloud", "provider", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer.py#L200-L222
35,435
saltstack/salt
salt/modules/ipset.py
check_set
def check_set(set=None, family='ipv4'): ''' Check that given ipset set exists. .. versionadded:: 2014.7.0 CLI Example: .. code-block:: bash salt '*' ipset.check_set setname ''' if not set: return 'Error: Set needs to be specified' setinfo = _find_set_info(set) i...
python
def check_set(set=None, family='ipv4'): ''' Check that given ipset set exists. .. versionadded:: 2014.7.0 CLI Example: .. code-block:: bash salt '*' ipset.check_set setname ''' if not set: return 'Error: Set needs to be specified' setinfo = _find_set_info(set) i...
[ "def", "check_set", "(", "set", "=", "None", ",", "family", "=", "'ipv4'", ")", ":", "if", "not", "set", ":", "return", "'Error: Set needs to be specified'", "setinfo", "=", "_find_set_info", "(", "set", ")", "if", "not", "setinfo", ":", "return", "False", ...
Check that given ipset set exists. .. versionadded:: 2014.7.0 CLI Example: .. code-block:: bash salt '*' ipset.check_set setname
[ "Check", "that", "given", "ipset", "set", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L298-L317
35,436
saltstack/salt
salt/modules/ipset.py
add
def add(setname=None, entry=None, family='ipv4', **kwargs): ''' Append an entry to the specified set. CLI Example: .. code-block:: bash salt '*' ipset.add setname 192.168.1.26 salt '*' ipset.add setname 192.168.0.3,AA:BB:CC:DD:EE:FF ''' if not setname: return 'Error:...
python
def add(setname=None, entry=None, family='ipv4', **kwargs): ''' Append an entry to the specified set. CLI Example: .. code-block:: bash salt '*' ipset.add setname 192.168.1.26 salt '*' ipset.add setname 192.168.0.3,AA:BB:CC:DD:EE:FF ''' if not setname: return 'Error:...
[ "def", "add", "(", "setname", "=", "None", ",", "entry", "=", "None", ",", "family", "=", "'ipv4'", ",", "*", "*", "kwargs", ")", ":", "if", "not", "setname", ":", "return", "'Error: Set needs to be specified'", "if", "not", "entry", ":", "return", "'Err...
Append an entry to the specified set. CLI Example: .. code-block:: bash salt '*' ipset.add setname 192.168.1.26 salt '*' ipset.add setname 192.168.0.3,AA:BB:CC:DD:EE:FF
[ "Append", "an", "entry", "to", "the", "specified", "set", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L320-L378
35,437
saltstack/salt
salt/modules/ipset.py
check
def check(set=None, entry=None, family='ipv4'): ''' Check that an entry exists in the specified set. set The ipset name entry An entry in the ipset. This parameter can be a single IP address, a range of IP addresses, or a subnet block. Example: .. code-block:: cfg ...
python
def check(set=None, entry=None, family='ipv4'): ''' Check that an entry exists in the specified set. set The ipset name entry An entry in the ipset. This parameter can be a single IP address, a range of IP addresses, or a subnet block. Example: .. code-block:: cfg ...
[ "def", "check", "(", "set", "=", "None", ",", "entry", "=", "None", ",", "family", "=", "'ipv4'", ")", ":", "if", "not", "set", ":", "return", "'Error: Set needs to be specified'", "if", "not", "entry", ":", "return", "'Error: Entry needs to be specified'", "s...
Check that an entry exists in the specified set. set The ipset name entry An entry in the ipset. This parameter can be a single IP address, a range of IP addresses, or a subnet block. Example: .. code-block:: cfg 192.168.0.1 192.168.0.2-192.168.0.19 ...
[ "Check", "that", "an", "entry", "exists", "in", "the", "specified", "set", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L410-L461
35,438
saltstack/salt
salt/modules/ipset.py
flush
def flush(set=None, family='ipv4'): ''' Flush entries in the specified set, Flush all sets if set is not specified. CLI Example: .. code-block:: bash salt '*' ipset.flush salt '*' ipset.flush set IPv6: salt '*' ipset.flush salt '*' ipset.flush set ''...
python
def flush(set=None, family='ipv4'): ''' Flush entries in the specified set, Flush all sets if set is not specified. CLI Example: .. code-block:: bash salt '*' ipset.flush salt '*' ipset.flush set IPv6: salt '*' ipset.flush salt '*' ipset.flush set ''...
[ "def", "flush", "(", "set", "=", "None", ",", "family", "=", "'ipv4'", ")", ":", "settype", "=", "_find_set_type", "(", "set", ")", "if", "not", "settype", ":", "return", "'Error: Set {0} does not exist'", ".", "format", "(", "set", ")", "ipset_family", "=...
Flush entries in the specified set, Flush all sets if set is not specified. CLI Example: .. code-block:: bash salt '*' ipset.flush salt '*' ipset.flush set IPv6: salt '*' ipset.flush salt '*' ipset.flush set
[ "Flush", "entries", "in", "the", "specified", "set", "Flush", "all", "sets", "if", "set", "is", "not", "specified", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L496-L526
35,439
saltstack/salt
salt/modules/ipset.py
_find_set_members
def _find_set_members(set): ''' Return list of members for a set ''' cmd = '{0} list {1}'.format(_ipset_cmd(), set) out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] > 0: # Set doesn't exist return false return False _tmp = out['stdout'].split('\n') ...
python
def _find_set_members(set): ''' Return list of members for a set ''' cmd = '{0} list {1}'.format(_ipset_cmd(), set) out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] > 0: # Set doesn't exist return false return False _tmp = out['stdout'].split('\n') ...
[ "def", "_find_set_members", "(", "set", ")", ":", "cmd", "=", "'{0} list {1}'", ".", "format", "(", "_ipset_cmd", "(", ")", ",", "set", ")", "out", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "if", "o...
Return list of members for a set
[ "Return", "list", "of", "members", "for", "a", "set" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L529-L549
35,440
saltstack/salt
salt/modules/ipset.py
_find_set_info
def _find_set_info(set): ''' Return information about the set ''' cmd = '{0} list -t {1}'.format(_ipset_cmd(), set) out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] > 0: # Set doesn't exist return false return False setinfo = {} _tmp = out['stdo...
python
def _find_set_info(set): ''' Return information about the set ''' cmd = '{0} list -t {1}'.format(_ipset_cmd(), set) out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] > 0: # Set doesn't exist return false return False setinfo = {} _tmp = out['stdo...
[ "def", "_find_set_info", "(", "set", ")", ":", "cmd", "=", "'{0} list -t {1}'", ".", "format", "(", "_ipset_cmd", "(", ")", ",", "set", ")", "out", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "if", "o...
Return information about the set
[ "Return", "information", "about", "the", "set" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L552-L571
35,441
saltstack/salt
salt/modules/saltcloudmod.py
create
def create(name, profile): ''' Create the named vm CLI Example: .. code-block:: bash salt <minion-id> saltcloud.create webserver rackspace_centos_512 ''' cmd = 'salt-cloud --out json -p {0} {1}'.format(profile, name) out = __salt__['cmd.run_stdout'](cmd, python_shell=False) tr...
python
def create(name, profile): ''' Create the named vm CLI Example: .. code-block:: bash salt <minion-id> saltcloud.create webserver rackspace_centos_512 ''' cmd = 'salt-cloud --out json -p {0} {1}'.format(profile, name) out = __salt__['cmd.run_stdout'](cmd, python_shell=False) tr...
[ "def", "create", "(", "name", ",", "profile", ")", ":", "cmd", "=", "'salt-cloud --out json -p {0} {1}'", ".", "format", "(", "profile", ",", "name", ")", "out", "=", "__salt__", "[", "'cmd.run_stdout'", "]", "(", "cmd", ",", "python_shell", "=", "False", ...
Create the named vm CLI Example: .. code-block:: bash salt <minion-id> saltcloud.create webserver rackspace_centos_512
[ "Create", "the", "named", "vm" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltcloudmod.py#L32-L48
35,442
saltstack/salt
salt/modules/rbac_solaris.py
profile_list
def profile_list(default_only=False): ''' List all available profiles default_only : boolean return only default profile CLI Example: .. code-block:: bash salt '*' rbac.profile_list ''' profiles = {} default_profiles = ['All'] ## lookup default profile(s) wit...
python
def profile_list(default_only=False): ''' List all available profiles default_only : boolean return only default profile CLI Example: .. code-block:: bash salt '*' rbac.profile_list ''' profiles = {} default_profiles = ['All'] ## lookup default profile(s) wit...
[ "def", "profile_list", "(", "default_only", "=", "False", ")", ":", "profiles", "=", "{", "}", "default_profiles", "=", "[", "'All'", "]", "## lookup default profile(s)", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "'/etc/security/policy.conf'...
List all available profiles default_only : boolean return only default profile CLI Example: .. code-block:: bash salt '*' rbac.profile_list
[ "List", "all", "available", "profiles" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L34-L76
35,443
saltstack/salt
salt/modules/rbac_solaris.py
profile_get
def profile_get(user, default_hidden=True): ''' List profiles for user user : string username default_hidden : boolean hide default profiles CLI Example: .. code-block:: bash salt '*' rbac.profile_get leo salt '*' rbac.profile_get leo default_hidden=False ...
python
def profile_get(user, default_hidden=True): ''' List profiles for user user : string username default_hidden : boolean hide default profiles CLI Example: .. code-block:: bash salt '*' rbac.profile_get leo salt '*' rbac.profile_get leo default_hidden=False ...
[ "def", "profile_get", "(", "user", ",", "default_hidden", "=", "True", ")", ":", "user_profiles", "=", "[", "]", "## read user_attr file (user:qualifier:res1:res2:attr)", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "'/etc/user_attr'", ",", "'r'"...
List profiles for user user : string username default_hidden : boolean hide default profiles CLI Example: .. code-block:: bash salt '*' rbac.profile_get leo salt '*' rbac.profile_get leo default_hidden=False
[ "List", "profiles", "for", "user" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L79-L128
35,444
saltstack/salt
salt/modules/rbac_solaris.py
profile_add
def profile_add(user, profile): ''' Add profile to user user : string username profile : string profile name CLI Example: .. code-block:: bash salt '*' rbac.profile_add martine 'Primary Administrator' salt '*' rbac.profile_add martine 'User Management,User Sec...
python
def profile_add(user, profile): ''' Add profile to user user : string username profile : string profile name CLI Example: .. code-block:: bash salt '*' rbac.profile_add martine 'Primary Administrator' salt '*' rbac.profile_add martine 'User Management,User Sec...
[ "def", "profile_add", "(", "user", ",", "profile", ")", ":", "ret", "=", "{", "}", "## validate profiles", "profiles", "=", "profile", ".", "split", "(", "','", ")", "known_profiles", "=", "profile_list", "(", ")", ".", "keys", "(", ")", "valid_profiles", ...
Add profile to user user : string username profile : string profile name CLI Example: .. code-block:: bash salt '*' rbac.profile_add martine 'Primary Administrator' salt '*' rbac.profile_add martine 'User Management,User Security'
[ "Add", "profile", "to", "user" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L131-L183
35,445
saltstack/salt
salt/modules/rbac_solaris.py
role_list
def role_list(): ''' List all available roles CLI Example: .. code-block:: bash salt '*' rbac.role_list ''' roles = {} ## read user_attr file (user:qualifier:res1:res2:attr) with salt.utils.files.fopen('/etc/user_attr', 'r') as user_attr: for role in user_attr: ...
python
def role_list(): ''' List all available roles CLI Example: .. code-block:: bash salt '*' rbac.role_list ''' roles = {} ## read user_attr file (user:qualifier:res1:res2:attr) with salt.utils.files.fopen('/etc/user_attr', 'r') as user_attr: for role in user_attr: ...
[ "def", "role_list", "(", ")", ":", "roles", "=", "{", "}", "## read user_attr file (user:qualifier:res1:res2:attr)", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "'/etc/user_attr'", ",", "'r'", ")", "as", "user_attr", ":", "for", "role", "in"...
List all available roles CLI Example: .. code-block:: bash salt '*' rbac.role_list
[ "List", "all", "available", "roles" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L241-L278
35,446
saltstack/salt
salt/modules/rbac_solaris.py
role_get
def role_get(user): ''' List roles for user user : string username CLI Example: .. code-block:: bash salt '*' rbac.role_get leo ''' user_roles = [] ## read user_attr file (user:qualifier:res1:res2:attr) with salt.utils.files.fopen('/etc/user_attr', 'r') as user_a...
python
def role_get(user): ''' List roles for user user : string username CLI Example: .. code-block:: bash salt '*' rbac.role_get leo ''' user_roles = [] ## read user_attr file (user:qualifier:res1:res2:attr) with salt.utils.files.fopen('/etc/user_attr', 'r') as user_a...
[ "def", "role_get", "(", "user", ")", ":", "user_roles", "=", "[", "]", "## read user_attr file (user:qualifier:res1:res2:attr)", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "'/etc/user_attr'", ",", "'r'", ")", "as", "user_attr", ":", "for", ...
List roles for user user : string username CLI Example: .. code-block:: bash salt '*' rbac.role_get leo
[ "List", "roles", "for", "user" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L281-L321
35,447
saltstack/salt
salt/modules/rbac_solaris.py
auth_list
def auth_list(): ''' List all available authorization CLI Example: .. code-block:: bash salt '*' rbac.auth_list ''' auths = {} ## read auth_attr file (name:res1:res2:short_desc:long_desc:attr) with salt.utils.files.fopen('/etc/security/auth_attr', 'r') as auth_attr: f...
python
def auth_list(): ''' List all available authorization CLI Example: .. code-block:: bash salt '*' rbac.auth_list ''' auths = {} ## read auth_attr file (name:res1:res2:short_desc:long_desc:attr) with salt.utils.files.fopen('/etc/security/auth_attr', 'r') as auth_attr: f...
[ "def", "auth_list", "(", ")", ":", "auths", "=", "{", "}", "## read auth_attr file (name:res1:res2:short_desc:long_desc:attr)", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "'/etc/security/auth_attr'", ",", "'r'", ")", "as", "auth_attr", ":", "fo...
List all available authorization CLI Example: .. code-block:: bash salt '*' rbac.auth_list
[ "List", "all", "available", "authorization" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L434-L461
35,448
saltstack/salt
salt/modules/rbac_solaris.py
auth_get
def auth_get(user, computed=True): ''' List authorization for user user : string username computed : boolean merge results from `auths` command into data from user_attr CLI Example: .. code-block:: bash salt '*' rbac.auth_get leo ''' user_auths = [] ## re...
python
def auth_get(user, computed=True): ''' List authorization for user user : string username computed : boolean merge results from `auths` command into data from user_attr CLI Example: .. code-block:: bash salt '*' rbac.auth_get leo ''' user_auths = [] ## re...
[ "def", "auth_get", "(", "user", ",", "computed", "=", "True", ")", ":", "user_auths", "=", "[", "]", "## read user_attr file (user:qualifier:res1:res2:attr)", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "'/etc/user_attr'", ",", "'r'", ")", "...
List authorization for user user : string username computed : boolean merge results from `auths` command into data from user_attr CLI Example: .. code-block:: bash salt '*' rbac.auth_get leo
[ "List", "authorization", "for", "user" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L464-L516
35,449
saltstack/salt
salt/modules/rbac_solaris.py
auth_add
def auth_add(user, auth): ''' Add authorization to user user : string username auth : string authorization name CLI Example: .. code-block:: bash salt '*' rbac.auth_add martine solaris.zone.manage salt '*' rbac.auth_add martine solaris.zone.manage,solaris.mail...
python
def auth_add(user, auth): ''' Add authorization to user user : string username auth : string authorization name CLI Example: .. code-block:: bash salt '*' rbac.auth_add martine solaris.zone.manage salt '*' rbac.auth_add martine solaris.zone.manage,solaris.mail...
[ "def", "auth_add", "(", "user", ",", "auth", ")", ":", "ret", "=", "{", "}", "## validate auths", "auths", "=", "auth", ".", "split", "(", "','", ")", "known_auths", "=", "auth_list", "(", ")", ".", "keys", "(", ")", "valid_auths", "=", "[", "r", "...
Add authorization to user user : string username auth : string authorization name CLI Example: .. code-block:: bash salt '*' rbac.auth_add martine solaris.zone.manage salt '*' rbac.auth_add martine solaris.zone.manage,solaris.mail.mailq
[ "Add", "authorization", "to", "user" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L519-L571
35,450
saltstack/salt
salt/states/netacl.py
term
def term(name, filter_name, term_name, filter_options=None, pillar_key='acl', pillarenv=None, saltenv=None, merge_pillar=False, revision_id=None, revision_no=None, revision_date=True, revision_date_format='%Y/%m/%d', ...
python
def term(name, filter_name, term_name, filter_options=None, pillar_key='acl', pillarenv=None, saltenv=None, merge_pillar=False, revision_id=None, revision_no=None, revision_date=True, revision_date_format='%Y/%m/%d', ...
[ "def", "term", "(", "name", ",", "filter_name", ",", "term_name", ",", "filter_options", "=", "None", ",", "pillar_key", "=", "'acl'", ",", "pillarenv", "=", "None", ",", "saltenv", "=", "None", ",", "merge_pillar", "=", "False", ",", "revision_id", "=", ...
Manage the configuration of a specific policy term. filter_name The name of the policy filter. term_name The name of the term. filter_options Additional filter options. These options are platform-specific. See the complete list of options_. .. _options: https://gi...
[ "Manage", "the", "configuration", "of", "a", "specific", "policy", "term", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netacl.py#L89-L441
35,451
saltstack/salt
salt/modules/keyboard.py
get_sys
def get_sys(): ''' Get current system keyboard setting CLI Example: .. code-block:: bash salt '*' keyboard.get_sys ''' cmd = '' if salt.utils.path.which('localectl'): cmd = 'localectl | grep Keymap | sed -e"s/: /=/" -e"s/^[ \t]*//"' elif 'RedHat' in __grains__['os_fami...
python
def get_sys(): ''' Get current system keyboard setting CLI Example: .. code-block:: bash salt '*' keyboard.get_sys ''' cmd = '' if salt.utils.path.which('localectl'): cmd = 'localectl | grep Keymap | sed -e"s/: /=/" -e"s/^[ \t]*//"' elif 'RedHat' in __grains__['os_fami...
[ "def", "get_sys", "(", ")", ":", "cmd", "=", "''", "if", "salt", ".", "utils", ".", "path", ".", "which", "(", "'localectl'", ")", ":", "cmd", "=", "'localectl | grep Keymap | sed -e\"s/: /=/\" -e\"s/^[ \\t]*//\"'", "elif", "'RedHat'", "in", "__grains__", "[", ...
Get current system keyboard setting CLI Example: .. code-block:: bash salt '*' keyboard.get_sys
[ "Get", "current", "system", "keyboard", "setting" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keyboard.py#L28-L49
35,452
saltstack/salt
salt/modules/keyboard.py
set_sys
def set_sys(layout): ''' Set current system keyboard setting CLI Example: .. code-block:: bash salt '*' keyboard.set_sys dvorak ''' if salt.utils.path.which('localectl'): __salt__['cmd.run']('localectl set-keymap {0}'.format(layout)) elif 'RedHat' in __grains__['os_family'...
python
def set_sys(layout): ''' Set current system keyboard setting CLI Example: .. code-block:: bash salt '*' keyboard.set_sys dvorak ''' if salt.utils.path.which('localectl'): __salt__['cmd.run']('localectl set-keymap {0}'.format(layout)) elif 'RedHat' in __grains__['os_family'...
[ "def", "set_sys", "(", "layout", ")", ":", "if", "salt", ".", "utils", ".", "path", ".", "which", "(", "'localectl'", ")", ":", "__salt__", "[", "'cmd.run'", "]", "(", "'localectl set-keymap {0}'", ".", "format", "(", "layout", ")", ")", "elif", "'RedHat...
Set current system keyboard setting CLI Example: .. code-block:: bash salt '*' keyboard.set_sys dvorak
[ "Set", "current", "system", "keyboard", "setting" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keyboard.py#L52-L76
35,453
saltstack/salt
salt/modules/keyboard.py
get_x
def get_x(): ''' Get current X keyboard setting CLI Example: .. code-block:: bash salt '*' keyboard.get_x ''' cmd = 'setxkbmap -query | grep layout' out = __salt__['cmd.run'](cmd, python_shell=True).split(':') return out[1].strip()
python
def get_x(): ''' Get current X keyboard setting CLI Example: .. code-block:: bash salt '*' keyboard.get_x ''' cmd = 'setxkbmap -query | grep layout' out = __salt__['cmd.run'](cmd, python_shell=True).split(':') return out[1].strip()
[ "def", "get_x", "(", ")", ":", "cmd", "=", "'setxkbmap -query | grep layout'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "True", ")", ".", "split", "(", "':'", ")", "return", "out", "[", "1", "]", ".", "strip"...
Get current X keyboard setting CLI Example: .. code-block:: bash salt '*' keyboard.get_x
[ "Get", "current", "X", "keyboard", "setting" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keyboard.py#L79-L91
35,454
saltstack/salt
salt/utils/pycrypto.py
secure_password
def secure_password(length=20, use_random=True): ''' Generate a secure password. ''' try: length = int(length) pw = '' while len(pw) < length: if HAS_RANDOM and use_random: while True: try: char = salt.utils....
python
def secure_password(length=20, use_random=True): ''' Generate a secure password. ''' try: length = int(length) pw = '' while len(pw) < length: if HAS_RANDOM and use_random: while True: try: char = salt.utils....
[ "def", "secure_password", "(", "length", "=", "20", ",", "use_random", "=", "True", ")", ":", "try", ":", "length", "=", "int", "(", "length", ")", "pw", "=", "''", "while", "len", "(", "pw", ")", "<", "length", ":", "if", "HAS_RANDOM", "and", "use...
Generate a secure password.
[ "Generate", "a", "secure", "password", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pycrypto.py#L41-L66
35,455
saltstack/salt
salt/states/elasticsearch_index.py
absent
def absent(name): ''' Ensure that the named index is absent. name Name of the index to remove ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} try: index = __salt__['elasticsearch.index_get'](index=name) if index and name in index: if ...
python
def absent(name): ''' Ensure that the named index is absent. name Name of the index to remove ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} try: index = __salt__['elasticsearch.index_get'](index=name) if index and name in index: if ...
[ "def", "absent", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "try", ":", "index", "=", "__salt__", "[", "'elasticsearch.index_get'", "...
Ensure that the named index is absent. name Name of the index to remove
[ "Ensure", "that", "the", "named", "index", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch_index.py#L19-L49
35,456
saltstack/salt
salt/modules/freebsdservice.py
_cmd
def _cmd(jail=None): ''' Return full path to service command .. versionchanged:: 2016.3.4 Support for jail (representing jid or jail name) keyword argument in kwargs ''' service = salt.utils.path.which('service') if not service: raise CommandNotFoundError('\'service\' command not f...
python
def _cmd(jail=None): ''' Return full path to service command .. versionchanged:: 2016.3.4 Support for jail (representing jid or jail name) keyword argument in kwargs ''' service = salt.utils.path.which('service') if not service: raise CommandNotFoundError('\'service\' command not f...
[ "def", "_cmd", "(", "jail", "=", "None", ")", ":", "service", "=", "salt", ".", "utils", ".", "path", ".", "which", "(", "'service'", ")", "if", "not", "service", ":", "raise", "CommandNotFoundError", "(", "'\\'service\\' command not found'", ")", "if", "j...
Return full path to service command .. versionchanged:: 2016.3.4 Support for jail (representing jid or jail name) keyword argument in kwargs
[ "Return", "full", "path", "to", "service", "command" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdservice.py#L46-L62
35,457
saltstack/salt
salt/modules/freebsdservice.py
_get_rcscript
def _get_rcscript(name, jail=None): ''' Return full path to service rc script .. versionchanged:: 2016.3.4 Support for jail (representing jid or jail name) keyword argument in kwargs ''' cmd = '{0} -r'.format(_cmd(jail)) prf = _get_jail_path(jail) if jail else '' for line in __salt__['...
python
def _get_rcscript(name, jail=None): ''' Return full path to service rc script .. versionchanged:: 2016.3.4 Support for jail (representing jid or jail name) keyword argument in kwargs ''' cmd = '{0} -r'.format(_cmd(jail)) prf = _get_jail_path(jail) if jail else '' for line in __salt__['...
[ "def", "_get_rcscript", "(", "name", ",", "jail", "=", "None", ")", ":", "cmd", "=", "'{0} -r'", ".", "format", "(", "_cmd", "(", "jail", ")", ")", "prf", "=", "_get_jail_path", "(", "jail", ")", "if", "jail", "else", "''", "for", "line", "in", "__...
Return full path to service rc script .. versionchanged:: 2016.3.4 Support for jail (representing jid or jail name) keyword argument in kwargs
[ "Return", "full", "path", "to", "service", "rc", "script" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdservice.py#L86-L99
35,458
saltstack/salt
salt/modules/freebsdservice.py
get_enabled
def get_enabled(jail=None): ''' Return what services are set to run on boot .. versionchanged:: 2016.3.4 Support for jail (representing jid or jail name) keyword argument in kwargs CLI Example: .. code-block:: bash salt '*' service.get_enabled ''' ret = [] service = _cmd...
python
def get_enabled(jail=None): ''' Return what services are set to run on boot .. versionchanged:: 2016.3.4 Support for jail (representing jid or jail name) keyword argument in kwargs CLI Example: .. code-block:: bash salt '*' service.get_enabled ''' ret = [] service = _cmd...
[ "def", "get_enabled", "(", "jail", "=", "None", ")", ":", "ret", "=", "[", "]", "service", "=", "_cmd", "(", "jail", ")", "prf", "=", "_get_jail_path", "(", "jail", ")", "if", "jail", "else", "''", "for", "svc", "in", "__salt__", "[", "'cmd.run'", ...
Return what services are set to run on boot .. versionchanged:: 2016.3.4 Support for jail (representing jid or jail name) keyword argument in kwargs CLI Example: .. code-block:: bash salt '*' service.get_enabled
[ "Return", "what", "services", "are", "set", "to", "run", "on", "boot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdservice.py#L125-L154
35,459
saltstack/salt
salt/modules/freebsdservice.py
get_disabled
def get_disabled(jail=None): ''' Return what services are available but not enabled to start at boot .. versionchanged:: 2016.3.4 Support for jail (representing jid or jail name) keyword argument in kwargs CLI Example: .. code-block:: bash salt '*' service.get_disabled ''' e...
python
def get_disabled(jail=None): ''' Return what services are available but not enabled to start at boot .. versionchanged:: 2016.3.4 Support for jail (representing jid or jail name) keyword argument in kwargs CLI Example: .. code-block:: bash salt '*' service.get_disabled ''' e...
[ "def", "get_disabled", "(", "jail", "=", "None", ")", ":", "en_", "=", "get_enabled", "(", "jail", ")", "all_", "=", "get_all", "(", "jail", ")", "return", "sorted", "(", "set", "(", "all_", ")", "-", "set", "(", "en_", ")", ")" ]
Return what services are available but not enabled to start at boot .. versionchanged:: 2016.3.4 Support for jail (representing jid or jail name) keyword argument in kwargs CLI Example: .. code-block:: bash salt '*' service.get_disabled
[ "Return", "what", "services", "are", "available", "but", "not", "enabled", "to", "start", "at", "boot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdservice.py#L157-L173
35,460
saltstack/salt
salt/states/pyenv.py
_python_installed
def _python_installed(ret, python, user=None): ''' Check to see if given python is installed. ''' default = __salt__['pyenv.default'](runas=user) for version in __salt__['pyenv.versions'](user): if version == python: ret['result'] = True ret['comment'] = 'Requested py...
python
def _python_installed(ret, python, user=None): ''' Check to see if given python is installed. ''' default = __salt__['pyenv.default'](runas=user) for version in __salt__['pyenv.versions'](user): if version == python: ret['result'] = True ret['comment'] = 'Requested py...
[ "def", "_python_installed", "(", "ret", ",", "python", ",", "user", "=", "None", ")", ":", "default", "=", "__salt__", "[", "'pyenv.default'", "]", "(", "runas", "=", "user", ")", "for", "version", "in", "__salt__", "[", "'pyenv.versions'", "]", "(", "us...
Check to see if given python is installed.
[ "Check", "to", "see", "if", "given", "python", "is", "installed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyenv.py#L67-L79
35,461
saltstack/salt
salt/states/pyenv.py
_check_and_install_python
def _check_and_install_python(ret, python, default=False, user=None): ''' Verify that python is installed, install if unavailable ''' ret = _python_installed(ret, python, user=user) if not ret['result']: if __salt__['pyenv.install_python'](python, runas=user): ret['result'] = Tru...
python
def _check_and_install_python(ret, python, default=False, user=None): ''' Verify that python is installed, install if unavailable ''' ret = _python_installed(ret, python, user=user) if not ret['result']: if __salt__['pyenv.install_python'](python, runas=user): ret['result'] = Tru...
[ "def", "_check_and_install_python", "(", "ret", ",", "python", ",", "default", "=", "False", ",", "user", "=", "None", ")", ":", "ret", "=", "_python_installed", "(", "ret", ",", "python", ",", "user", "=", "user", ")", "if", "not", "ret", "[", "'resul...
Verify that python is installed, install if unavailable
[ "Verify", "that", "python", "is", "installed", "install", "if", "unavailable" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyenv.py#L82-L101
35,462
saltstack/salt
salt/states/pyenv.py
installed
def installed(name, default=False, user=None): ''' Verify that the specified python is installed with pyenv. pyenv is installed if necessary. name The version of python to install default : False Whether to make this python the default. user: None The user to run pyenv...
python
def installed(name, default=False, user=None): ''' Verify that the specified python is installed with pyenv. pyenv is installed if necessary. name The version of python to install default : False Whether to make this python the default. user: None The user to run pyenv...
[ "def", "installed", "(", "name", ",", "default", "=", "False", ",", "user", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "if", "nam...
Verify that the specified python is installed with pyenv. pyenv is installed if necessary. name The version of python to install default : False Whether to make this python the default. user: None The user to run pyenv as. .. versionadded:: 0.17.0 .. versionadded...
[ "Verify", "that", "the", "specified", "python", "is", "installed", "with", "pyenv", ".", "pyenv", "is", "installed", "if", "necessary", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyenv.py#L104-L139
35,463
saltstack/salt
salt/states/pyenv.py
_check_and_uninstall_python
def _check_and_uninstall_python(ret, python, user=None): ''' Verify that python is uninstalled ''' ret = _python_installed(ret, python, user=user) if ret['result']: if ret['default']: __salt__['pyenv.default']('system', runas=user) if __salt__['pyenv.uninstall_python'](p...
python
def _check_and_uninstall_python(ret, python, user=None): ''' Verify that python is uninstalled ''' ret = _python_installed(ret, python, user=user) if ret['result']: if ret['default']: __salt__['pyenv.default']('system', runas=user) if __salt__['pyenv.uninstall_python'](p...
[ "def", "_check_and_uninstall_python", "(", "ret", ",", "python", ",", "user", "=", "None", ")", ":", "ret", "=", "_python_installed", "(", "ret", ",", "python", ",", "user", "=", "user", ")", "if", "ret", "[", "'result'", "]", ":", "if", "ret", "[", ...
Verify that python is uninstalled
[ "Verify", "that", "python", "is", "uninstalled" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyenv.py#L142-L164
35,464
saltstack/salt
salt/states/pyenv.py
absent
def absent(name, user=None): ''' Verify that the specified python is not installed with pyenv. pyenv is installed if necessary. name The version of python to uninstall user: None The user to run pyenv as. .. versionadded:: 0.17.0 .. versionadded:: 0.16.0 ''' r...
python
def absent(name, user=None): ''' Verify that the specified python is not installed with pyenv. pyenv is installed if necessary. name The version of python to uninstall user: None The user to run pyenv as. .. versionadded:: 0.17.0 .. versionadded:: 0.16.0 ''' r...
[ "def", "absent", "(", "name", ",", "user", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "if", "name", ".", "startswith", "(", "'pyt...
Verify that the specified python is not installed with pyenv. pyenv is installed if necessary. name The version of python to uninstall user: None The user to run pyenv as. .. versionadded:: 0.17.0 .. versionadded:: 0.16.0
[ "Verify", "that", "the", "specified", "python", "is", "not", "installed", "with", "pyenv", ".", "pyenv", "is", "installed", "if", "necessary", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyenv.py#L167-L197
35,465
saltstack/salt
salt/states/pyenv.py
install_pyenv
def install_pyenv(name, user=None): ''' Install pyenv if not installed. Allows you to require pyenv be installed prior to installing the plugins. Useful if you want to install pyenv plugins via the git or file modules and need them installed before installing any rubies. Use the pyenv.root conf...
python
def install_pyenv(name, user=None): ''' Install pyenv if not installed. Allows you to require pyenv be installed prior to installing the plugins. Useful if you want to install pyenv plugins via the git or file modules and need them installed before installing any rubies. Use the pyenv.root conf...
[ "def", "install_pyenv", "(", "name", ",", "user", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "if", "__opts__", "[", "'test'", "]", ...
Install pyenv if not installed. Allows you to require pyenv be installed prior to installing the plugins. Useful if you want to install pyenv plugins via the git or file modules and need them installed before installing any rubies. Use the pyenv.root configuration option to set the path for pyenv if yo...
[ "Install", "pyenv", "if", "not", "installed", ".", "Allows", "you", "to", "require", "pyenv", "be", "installed", "prior", "to", "installing", "the", "plugins", ".", "Useful", "if", "you", "want", "to", "install", "pyenv", "plugins", "via", "the", "git", "o...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyenv.py#L200-L219
35,466
saltstack/salt
salt/states/smtp.py
send_msg
def send_msg(name, recipient, subject, sender=None, profile=None, use_ssl='True', attachments=None): ''' Send a message via SMTP .. code-block:: yaml server-warning-message: smtp.send_msg: - name: '...
python
def send_msg(name, recipient, subject, sender=None, profile=None, use_ssl='True', attachments=None): ''' Send a message via SMTP .. code-block:: yaml server-warning-message: smtp.send_msg: - name: '...
[ "def", "send_msg", "(", "name", ",", "recipient", ",", "subject", ",", "sender", "=", "None", ",", "profile", "=", "None", ",", "use_ssl", "=", "'True'", ",", "attachments", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'change...
Send a message via SMTP .. code-block:: yaml server-warning-message: smtp.send_msg: - name: 'This is a server warning message' - profile: my-smtp-account - subject: 'Message from Salt' - recipient: admin@example.com - sender: admin@exam...
[ "Send", "a", "message", "via", "SMTP" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/smtp.py#L30-L94
35,467
saltstack/salt
salt/modules/debconfmod.py
set_
def set_(package, question, type, value, *extra): ''' Set answers to debconf questions for a package. CLI Example: .. code-block:: bash salt '*' debconf.set <package> <question> <type> <value> [<value> ...] ''' if extra: value = ' '.join((value,) + tuple(extra)) fd_, fna...
python
def set_(package, question, type, value, *extra): ''' Set answers to debconf questions for a package. CLI Example: .. code-block:: bash salt '*' debconf.set <package> <question> <type> <value> [<value> ...] ''' if extra: value = ' '.join((value,) + tuple(extra)) fd_, fna...
[ "def", "set_", "(", "package", ",", "question", ",", "type", ",", "value", ",", "*", "extra", ")", ":", "if", "extra", ":", "value", "=", "' '", ".", "join", "(", "(", "value", ",", ")", "+", "tuple", "(", "extra", ")", ")", "fd_", ",", "fname"...
Set answers to debconf questions for a package. CLI Example: .. code-block:: bash salt '*' debconf.set <package> <question> <type> <value> [<value> ...]
[ "Set", "answers", "to", "debconf", "questions", "for", "a", "package", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debconfmod.py#L115-L139
35,468
saltstack/salt
salt/modules/debconfmod.py
set_template
def set_template(path, template, context, defaults, saltenv='base', **kwargs): ''' Set answers to debconf questions from a template. path location of the file containing the package selections template template format context variables to add to the template environment ...
python
def set_template(path, template, context, defaults, saltenv='base', **kwargs): ''' Set answers to debconf questions from a template. path location of the file containing the package selections template template format context variables to add to the template environment ...
[ "def", "set_template", "(", "path", ",", "template", ",", "context", ",", "defaults", ",", "saltenv", "=", "'base'", ",", "*", "*", "kwargs", ")", ":", "path", "=", "__salt__", "[", "'cp.get_template'", "]", "(", "path", "=", "path", ",", "dest", "=", ...
Set answers to debconf questions from a template. path location of the file containing the package selections template template format context variables to add to the template environment default default values for the template environment CLI Example: .. co...
[ "Set", "answers", "to", "debconf", "questions", "from", "a", "template", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debconfmod.py#L142-L175
35,469
saltstack/salt
salt/modules/debconfmod.py
set_file
def set_file(path, saltenv='base', **kwargs): ''' Set answers to debconf questions from a file. CLI Example: .. code-block:: bash salt '*' debconf.set_file salt://pathto/pkg.selections ''' if '__env__' in kwargs: # "env" is not supported; Use "saltenv". kwargs.pop('__e...
python
def set_file(path, saltenv='base', **kwargs): ''' Set answers to debconf questions from a file. CLI Example: .. code-block:: bash salt '*' debconf.set_file salt://pathto/pkg.selections ''' if '__env__' in kwargs: # "env" is not supported; Use "saltenv". kwargs.pop('__e...
[ "def", "set_file", "(", "path", ",", "saltenv", "=", "'base'", ",", "*", "*", "kwargs", ")", ":", "if", "'__env__'", "in", "kwargs", ":", "# \"env\" is not supported; Use \"saltenv\".", "kwargs", ".", "pop", "(", "'__env__'", ")", "path", "=", "__salt__", "[...
Set answers to debconf questions from a file. CLI Example: .. code-block:: bash salt '*' debconf.set_file salt://pathto/pkg.selections
[ "Set", "answers", "to", "debconf", "questions", "from", "a", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debconfmod.py#L178-L197
35,470
saltstack/salt
salt/returners/multi_returner.py
prep_jid
def prep_jid(nocache=False, passed_jid=None): ''' Call both with prep_jid on all returners in multi_returner TODO: finish this, what do do when you get different jids from 2 returners... since our jids are time based, this make this problem hard, because they aren't unique, meaning that we have to ...
python
def prep_jid(nocache=False, passed_jid=None): ''' Call both with prep_jid on all returners in multi_returner TODO: finish this, what do do when you get different jids from 2 returners... since our jids are time based, this make this problem hard, because they aren't unique, meaning that we have to ...
[ "def", "prep_jid", "(", "nocache", "=", "False", ",", "passed_jid", "=", "None", ")", ":", "jid", "=", "passed_jid", "for", "returner_", "in", "__opts__", "[", "CONFIG_KEY", "]", ":", "if", "jid", "is", "None", ":", "jid", "=", "_mminion", "(", ")", ...
Call both with prep_jid on all returners in multi_returner TODO: finish this, what do do when you get different jids from 2 returners... since our jids are time based, this make this problem hard, because they aren't unique, meaning that we have to make sure that no one else got the jid and if they did...
[ "Call", "both", "with", "prep_jid", "on", "all", "returners", "in", "multi_returner" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/multi_returner.py#L34-L53
35,471
saltstack/salt
salt/returners/multi_returner.py
returner
def returner(load): ''' Write return to all returners in multi_returner ''' for returner_ in __opts__[CONFIG_KEY]: _mminion().returners['{0}.returner'.format(returner_)](load)
python
def returner(load): ''' Write return to all returners in multi_returner ''' for returner_ in __opts__[CONFIG_KEY]: _mminion().returners['{0}.returner'.format(returner_)](load)
[ "def", "returner", "(", "load", ")", ":", "for", "returner_", "in", "__opts__", "[", "CONFIG_KEY", "]", ":", "_mminion", "(", ")", ".", "returners", "[", "'{0}.returner'", ".", "format", "(", "returner_", ")", "]", "(", "load", ")" ]
Write return to all returners in multi_returner
[ "Write", "return", "to", "all", "returners", "in", "multi_returner" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/multi_returner.py#L56-L61
35,472
saltstack/salt
salt/returners/multi_returner.py
save_load
def save_load(jid, clear_load, minions=None): ''' Write load to all returners in multi_returner ''' for returner_ in __opts__[CONFIG_KEY]: _mminion().returners['{0}.save_load'.format(returner_)](jid, clear_load)
python
def save_load(jid, clear_load, minions=None): ''' Write load to all returners in multi_returner ''' for returner_ in __opts__[CONFIG_KEY]: _mminion().returners['{0}.save_load'.format(returner_)](jid, clear_load)
[ "def", "save_load", "(", "jid", ",", "clear_load", ",", "minions", "=", "None", ")", ":", "for", "returner_", "in", "__opts__", "[", "CONFIG_KEY", "]", ":", "_mminion", "(", ")", ".", "returners", "[", "'{0}.save_load'", ".", "format", "(", "returner_", ...
Write load to all returners in multi_returner
[ "Write", "load", "to", "all", "returners", "in", "multi_returner" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/multi_returner.py#L64-L69
35,473
saltstack/salt
salt/returners/multi_returner.py
get_load
def get_load(jid): ''' Merge the load data from all returners ''' ret = {} for returner_ in __opts__[CONFIG_KEY]: ret.update(_mminion().returners['{0}.get_load'.format(returner_)](jid)) return ret
python
def get_load(jid): ''' Merge the load data from all returners ''' ret = {} for returner_ in __opts__[CONFIG_KEY]: ret.update(_mminion().returners['{0}.get_load'.format(returner_)](jid)) return ret
[ "def", "get_load", "(", "jid", ")", ":", "ret", "=", "{", "}", "for", "returner_", "in", "__opts__", "[", "CONFIG_KEY", "]", ":", "ret", ".", "update", "(", "_mminion", "(", ")", ".", "returners", "[", "'{0}.get_load'", ".", "format", "(", "returner_",...
Merge the load data from all returners
[ "Merge", "the", "load", "data", "from", "all", "returners" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/multi_returner.py#L79-L87
35,474
saltstack/salt
salt/returners/multi_returner.py
get_jids
def get_jids(): ''' Return all job data from all returners ''' ret = {} for returner_ in __opts__[CONFIG_KEY]: ret.update(_mminion().returners['{0}.get_jids'.format(returner_)]()) return ret
python
def get_jids(): ''' Return all job data from all returners ''' ret = {} for returner_ in __opts__[CONFIG_KEY]: ret.update(_mminion().returners['{0}.get_jids'.format(returner_)]()) return ret
[ "def", "get_jids", "(", ")", ":", "ret", "=", "{", "}", "for", "returner_", "in", "__opts__", "[", "CONFIG_KEY", "]", ":", "ret", ".", "update", "(", "_mminion", "(", ")", ".", "returners", "[", "'{0}.get_jids'", ".", "format", "(", "returner_", ")", ...
Return all job data from all returners
[ "Return", "all", "job", "data", "from", "all", "returners" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/multi_returner.py#L101-L109
35,475
saltstack/salt
salt/states/keystone_domain.py
absent
def absent(name, auth=None): ''' Ensure domain does not exist name Name of the domain ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} __salt__['keystoneng.setup_clouds'](auth) domain = __salt__['keystoneng.domain_get'](name=n...
python
def absent(name, auth=None): ''' Ensure domain does not exist name Name of the domain ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} __salt__['keystoneng.setup_clouds'](auth) domain = __salt__['keystoneng.domain_get'](name=n...
[ "def", "absent", "(", "name", ",", "auth", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "__salt__", "[", "'keystoneng.setup_clouds'", "...
Ensure domain does not exist name Name of the domain
[ "Ensure", "domain", "does", "not", "exist" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_domain.py#L94-L121
35,476
saltstack/salt
salt/states/marathon_app.py
config
def config(name, config): ''' Ensure that the marathon app with the given id is present and is configured to match the given config values. :param name: The app name/id :param config: The configuration to apply (dict) :return: A standard Salt changes dictionary ''' # setup return struct...
python
def config(name, config): ''' Ensure that the marathon app with the given id is present and is configured to match the given config values. :param name: The app name/id :param config: The configuration to apply (dict) :return: A standard Salt changes dictionary ''' # setup return struct...
[ "def", "config", "(", "name", ",", "config", ")", ":", "# setup return structure", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", ",", "}", "# get existing config if app ...
Ensure that the marathon app with the given id is present and is configured to match the given config values. :param name: The app name/id :param config: The configuration to apply (dict) :return: A standard Salt changes dictionary
[ "Ensure", "that", "the", "marathon", "app", "with", "the", "given", "id", "is", "present", "and", "is", "configured", "to", "match", "the", "given", "config", "values", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/marathon_app.py#L27-L89
35,477
saltstack/salt
salt/states/marathon_app.py
running
def running(name, restart=False, force=True): ''' Ensure that the marathon app with the given id is present and restart if set. :param name: The app name/id :param restart: Restart the app :param force: Override the current deployment :return: A standard Salt changes dictionary ''' ret ...
python
def running(name, restart=False, force=True): ''' Ensure that the marathon app with the given id is present and restart if set. :param name: The app name/id :param restart: Restart the app :param force: Override the current deployment :return: A standard Salt changes dictionary ''' ret ...
[ "def", "running", "(", "name", ",", "restart", "=", "False", ",", "force", "=", "True", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "if", "not...
Ensure that the marathon app with the given id is present and restart if set. :param name: The app name/id :param restart: Restart the app :param force: Override the current deployment :return: A standard Salt changes dictionary
[ "Ensure", "that", "the", "marathon", "app", "with", "the", "given", "id", "is", "present", "and", "restart", "if", "set", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/marathon_app.py#L122-L157
35,478
saltstack/salt
salt/states/boto_cfn.py
absent
def absent(name, region=None, key=None, keyid=None, profile=None): ''' Ensure cloud formation stack is absent. name (string) – The name of the stack to delete. region (string) - Region to connect to. key (string) - Secret key to be used. keyid (string) - Access key to be used. profile (...
python
def absent(name, region=None, key=None, keyid=None, profile=None): ''' Ensure cloud formation stack is absent. name (string) – The name of the stack to delete. region (string) - Region to connect to. key (string) - Secret key to be used. keyid (string) - Access key to be used. profile (...
[ "def", "absent", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''"...
Ensure cloud formation stack is absent. name (string) – The name of the stack to delete. region (string) - Region to connect to. key (string) - Secret key to be used. keyid (string) - Access key to be used. profile (dict) - A dict with region, key and keyid, or a pillar key (string) that contai...
[ "Ensure", "cloud", "formation", "stack", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cfn.py#L206-L240
35,479
saltstack/salt
salt/states/influxdb_continuous_query.py
present
def present(name, database, query, resample_time=None, coverage_period=None, **client_args): ''' Ensure that given continuous query is present. name Name of the continuous query to create. database Database to create continuous query on. query The query content resamp...
python
def present(name, database, query, resample_time=None, coverage_period=None, **client_args): ''' Ensure that given continuous query is present. name Name of the continuous query to create. database Database to create continuous query on. query The query content resamp...
[ "def", "present", "(", "name", ",", "database", ",", "query", ",", "resample_time", "=", "None", ",", "coverage_period", "=", "None", ",", "*", "*", "client_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ","...
Ensure that given continuous query is present. name Name of the continuous query to create. database Database to create continuous query on. query The query content resample_time : None Duration between continuous query resampling. coverage_period : None ...
[ "Ensure", "that", "given", "continuous", "query", "is", "present", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/influxdb_continuous_query.py#L24-L69
35,480
saltstack/salt
salt/states/timezone.py
system
def system(name, utc=True): ''' Set the timezone for the system. name The name of the timezone to use (e.g.: America/Denver) utc Whether or not to set the hardware clock to UTC (default is True) ''' ret = {'name': name, 'changes': {}, 'result': None, ...
python
def system(name, utc=True): ''' Set the timezone for the system. name The name of the timezone to use (e.g.: America/Denver) utc Whether or not to set the hardware clock to UTC (default is True) ''' ret = {'name': name, 'changes': {}, 'result': None, ...
[ "def", "system", "(", "name", ",", "utc", "=", "True", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "# Set up metadata", "do_utc", "=", "False", "...
Set the timezone for the system. name The name of the timezone to use (e.g.: America/Denver) utc Whether or not to set the hardware clock to UTC (default is True)
[ "Set", "the", "timezone", "for", "the", "system", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/timezone.py#L43-L127
35,481
saltstack/salt
salt/modules/nova.py
volume_list
def volume_list(search_opts=None, profile=None, **kwargs): ''' List storage volumes search_opts Dictionary of search options profile Profile to use CLI Example: .. code-block:: bash salt '*' nova.volume_list search_opts='{"display_name": "myblock"}' profile=openstack...
python
def volume_list(search_opts=None, profile=None, **kwargs): ''' List storage volumes search_opts Dictionary of search options profile Profile to use CLI Example: .. code-block:: bash salt '*' nova.volume_list search_opts='{"display_name": "myblock"}' profile=openstack...
[ "def", "volume_list", "(", "search_opts", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "_auth", "(", "profile", ",", "*", "*", "kwargs", ")", "return", "conn", ".", "volume_list", "(", "search_opts", "=", ...
List storage volumes search_opts Dictionary of search options profile Profile to use CLI Example: .. code-block:: bash salt '*' nova.volume_list search_opts='{"display_name": "myblock"}' profile=openstack
[ "List", "storage", "volumes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L250-L268
35,482
saltstack/salt
salt/modules/nova.py
volume_delete
def volume_delete(name, profile=None, **kwargs): ''' Destroy the volume name Name of the volume profile Profile to build on CLI Example: .. code-block:: bash salt '*' nova.volume_delete myblock profile=openstack ''' conn = _auth(profile, **kwargs) return...
python
def volume_delete(name, profile=None, **kwargs): ''' Destroy the volume name Name of the volume profile Profile to build on CLI Example: .. code-block:: bash salt '*' nova.volume_delete myblock profile=openstack ''' conn = _auth(profile, **kwargs) return...
[ "def", "volume_delete", "(", "name", ",", "profile", "=", "None", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "_auth", "(", "profile", ",", "*", "*", "kwargs", ")", "return", "conn", ".", "volume_delete", "(", "name", ")" ]
Destroy the volume name Name of the volume profile Profile to build on CLI Example: .. code-block:: bash salt '*' nova.volume_delete myblock profile=openstack
[ "Destroy", "the", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L327-L345
35,483
saltstack/salt
salt/modules/nova.py
suspend
def suspend(instance_id, profile=None, **kwargs): ''' Suspend an instance instance_id ID of the instance to be suspended CLI Example: .. code-block:: bash salt '*' nova.suspend 1138 ''' conn = _auth(profile, **kwargs) return conn.suspend(instance_id)
python
def suspend(instance_id, profile=None, **kwargs): ''' Suspend an instance instance_id ID of the instance to be suspended CLI Example: .. code-block:: bash salt '*' nova.suspend 1138 ''' conn = _auth(profile, **kwargs) return conn.suspend(instance_id)
[ "def", "suspend", "(", "instance_id", ",", "profile", "=", "None", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "_auth", "(", "profile", ",", "*", "*", "kwargs", ")", "return", "conn", ".", "suspend", "(", "instance_id", ")" ]
Suspend an instance instance_id ID of the instance to be suspended CLI Example: .. code-block:: bash salt '*' nova.suspend 1138
[ "Suspend", "an", "instance" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L412-L427
35,484
saltstack/salt
salt/modules/nova.py
resume
def resume(instance_id, profile=None, **kwargs): ''' Resume an instance instance_id ID of the instance to be resumed CLI Example: .. code-block:: bash salt '*' nova.resume 1138 ''' conn = _auth(profile, **kwargs) return conn.resume(instance_id)
python
def resume(instance_id, profile=None, **kwargs): ''' Resume an instance instance_id ID of the instance to be resumed CLI Example: .. code-block:: bash salt '*' nova.resume 1138 ''' conn = _auth(profile, **kwargs) return conn.resume(instance_id)
[ "def", "resume", "(", "instance_id", ",", "profile", "=", "None", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "_auth", "(", "profile", ",", "*", "*", "kwargs", ")", "return", "conn", ".", "resume", "(", "instance_id", ")" ]
Resume an instance instance_id ID of the instance to be resumed CLI Example: .. code-block:: bash salt '*' nova.resume 1138
[ "Resume", "an", "instance" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L430-L445
35,485
saltstack/salt
salt/modules/nova.py
server_show
def server_show(server_id, profile=None, **kwargs): ''' Return detailed information for an active server CLI Example: .. code-block:: bash salt '*' nova.server_show <server_id> ''' conn = _auth(profile, **kwargs) return conn.server_show(server_id)
python
def server_show(server_id, profile=None, **kwargs): ''' Return detailed information for an active server CLI Example: .. code-block:: bash salt '*' nova.server_show <server_id> ''' conn = _auth(profile, **kwargs) return conn.server_show(server_id)
[ "def", "server_show", "(", "server_id", ",", "profile", "=", "None", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "_auth", "(", "profile", ",", "*", "*", "kwargs", ")", "return", "conn", ".", "server_show", "(", "server_id", ")" ]
Return detailed information for an active server CLI Example: .. code-block:: bash salt '*' nova.server_show <server_id>
[ "Return", "detailed", "information", "for", "an", "active", "server" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L760-L771
35,486
saltstack/salt
salt/modules/nova.py
server_by_name
def server_by_name(name, profile=None, **kwargs): ''' Return information about a server name Server Name CLI Example: .. code-block:: bash salt '*' nova.server_by_name myserver profile=openstack ''' conn = _auth(profile, **kwargs) return conn.server_by_name(name)
python
def server_by_name(name, profile=None, **kwargs): ''' Return information about a server name Server Name CLI Example: .. code-block:: bash salt '*' nova.server_by_name myserver profile=openstack ''' conn = _auth(profile, **kwargs) return conn.server_by_name(name)
[ "def", "server_by_name", "(", "name", ",", "profile", "=", "None", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "_auth", "(", "profile", ",", "*", "*", "kwargs", ")", "return", "conn", ".", "server_by_name", "(", "name", ")" ]
Return information about a server name Server Name CLI Example: .. code-block:: bash salt '*' nova.server_by_name myserver profile=openstack
[ "Return", "information", "about", "a", "server" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nova.py#L816-L830
35,487
saltstack/salt
salt/modules/napalm_yang_mod.py
diff
def diff(candidate, running, *models): ''' Returns the difference between two configuration entities structured according to the YANG model. .. note:: This function is recommended to be used mostly as a state helper. candidate First model to compare. running Second mod...
python
def diff(candidate, running, *models): ''' Returns the difference between two configuration entities structured according to the YANG model. .. note:: This function is recommended to be used mostly as a state helper. candidate First model to compare. running Second mod...
[ "def", "diff", "(", "candidate", ",", "running", ",", "*", "models", ")", ":", "if", "isinstance", "(", "models", ",", "tuple", ")", "and", "isinstance", "(", "models", "[", "0", "]", ",", "list", ")", ":", "models", "=", "models", "[", "0", "]", ...
Returns the difference between two configuration entities structured according to the YANG model. .. note:: This function is recommended to be used mostly as a state helper. candidate First model to compare. running Second model to compare. models A list of models...
[ "Returns", "the", "difference", "between", "two", "configuration", "entities", "structured", "according", "to", "the", "YANG", "model", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_yang_mod.py#L72-L129
35,488
saltstack/salt
salt/modules/napalm_yang_mod.py
parse
def parse(*models, **kwargs): ''' Parse configuration from the device. models A list of models to be used when parsing. config: ``False`` Parse config. state: ``False`` Parse state. profiles: ``None`` Use certain profiles to parse. If not specified, will use t...
python
def parse(*models, **kwargs): ''' Parse configuration from the device. models A list of models to be used when parsing. config: ``False`` Parse config. state: ``False`` Parse state. profiles: ``None`` Use certain profiles to parse. If not specified, will use t...
[ "def", "parse", "(", "*", "models", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "models", ",", "tuple", ")", "and", "isinstance", "(", "models", "[", "0", "]", ",", "list", ")", ":", "models", "=", "models", "[", "0", "]", "config...
Parse configuration from the device. models A list of models to be used when parsing. config: ``False`` Parse config. state: ``False`` Parse state. profiles: ``None`` Use certain profiles to parse. If not specified, will use the device default profile(s). ...
[ "Parse", "configuration", "from", "the", "device", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_yang_mod.py#L133-L364
35,489
saltstack/salt
salt/modules/napalm_yang_mod.py
get_config
def get_config(data, *models, **kwargs): ''' Return the native config. data Dictionary structured with respect to the models referenced. models A list of models to be used when generating the config. profiles: ``None`` Use certain profiles to generate the config. I...
python
def get_config(data, *models, **kwargs): ''' Return the native config. data Dictionary structured with respect to the models referenced. models A list of models to be used when generating the config. profiles: ``None`` Use certain profiles to generate the config. I...
[ "def", "get_config", "(", "data", ",", "*", "models", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "models", ",", "tuple", ")", "and", "isinstance", "(", "models", "[", "0", "]", ",", "list", ")", ":", "models", "=", "models", "[", ...
Return the native config. data Dictionary structured with respect to the models referenced. models A list of models to be used when generating the config. profiles: ``None`` Use certain profiles to generate the config. If not specified, will use the platform default profil...
[ "Return", "the", "native", "config", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_yang_mod.py#L368-L416
35,490
saltstack/salt
salt/modules/napalm_yang_mod.py
load_config
def load_config(data, *models, **kwargs): ''' Generate and load the config on the device using the OpenConfig or IETF models and device profiles. data Dictionary structured with respect to the models referenced. models A list of models to be used when generating the config. pr...
python
def load_config(data, *models, **kwargs): ''' Generate and load the config on the device using the OpenConfig or IETF models and device profiles. data Dictionary structured with respect to the models referenced. models A list of models to be used when generating the config. pr...
[ "def", "load_config", "(", "data", ",", "*", "models", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "models", ",", "tuple", ")", "and", "isinstance", "(", "models", "[", "0", "]", ",", "list", ")", ":", "models", "=", "models", "[", ...
Generate and load the config on the device using the OpenConfig or IETF models and device profiles. data Dictionary structured with respect to the models referenced. models A list of models to be used when generating the config. profiles: ``None`` Use certain profiles to gener...
[ "Generate", "and", "load", "the", "config", "on", "the", "device", "using", "the", "OpenConfig", "or", "IETF", "models", "and", "device", "profiles", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_yang_mod.py#L420-L567
35,491
saltstack/salt
salt/modules/napalm_yang_mod.py
compliance_report
def compliance_report(data, *models, **kwargs): ''' Return the compliance report using YANG objects. data Dictionary structured with respect to the models referenced. models A list of models to be used when generating the config. filepath The absolute path to the validatio...
python
def compliance_report(data, *models, **kwargs): ''' Return the compliance report using YANG objects. data Dictionary structured with respect to the models referenced. models A list of models to be used when generating the config. filepath The absolute path to the validatio...
[ "def", "compliance_report", "(", "data", ",", "*", "models", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "models", ",", "tuple", ")", "and", "isinstance", "(", "models", "[", "0", "]", ",", "list", ")", ":", "models", "=", "models", ...
Return the compliance report using YANG objects. data Dictionary structured with respect to the models referenced. models A list of models to be used when generating the config. filepath The absolute path to the validation file. CLI Example: .. code-block:: bash ...
[ "Return", "the", "compliance", "report", "using", "YANG", "objects", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_yang_mod.py#L571-L615
35,492
saltstack/salt
salt/states/cisconso.py
value_present
def value_present(name, datastore, path, config): ''' Ensure a specific value exists at a given path :param name: The name for this rule :type name: ``str`` :param datastore: The datastore, e.g. running, operational. One of the NETCONF store IETF types :type datastore: :class:`Datast...
python
def value_present(name, datastore, path, config): ''' Ensure a specific value exists at a given path :param name: The name for this rule :type name: ``str`` :param datastore: The datastore, e.g. running, operational. One of the NETCONF store IETF types :type datastore: :class:`Datast...
[ "def", "value_present", "(", "name", ",", "datastore", ",", "path", ",", "config", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", "}", "existing", "=", ...
Ensure a specific value exists at a given path :param name: The name for this rule :type name: ``str`` :param datastore: The datastore, e.g. running, operational. One of the NETCONF store IETF types :type datastore: :class:`DatastoreType` (``str`` enum). :param path: The device path to ...
[ "Ensure", "a", "specific", "value", "exists", "at", "a", "given", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cisconso.py#L22-L83
35,493
saltstack/salt
salt/modules/match.py
pillar
def pillar(tgt, delimiter=DEFAULT_TARGET_DELIM): ''' Return True if the minion matches the given pillar target. The ``delimiter`` argument can be used to specify a different delimiter. CLI Example: .. code-block:: bash salt '*' match.pillar 'cheese:foo' salt '*' match.pillar 'clon...
python
def pillar(tgt, delimiter=DEFAULT_TARGET_DELIM): ''' Return True if the minion matches the given pillar target. The ``delimiter`` argument can be used to specify a different delimiter. CLI Example: .. code-block:: bash salt '*' match.pillar 'cheese:foo' salt '*' match.pillar 'clon...
[ "def", "pillar", "(", "tgt", ",", "delimiter", "=", "DEFAULT_TARGET_DELIM", ")", ":", "matchers", "=", "salt", ".", "loader", ".", "matchers", "(", "__opts__", ")", "try", ":", "return", "matchers", "[", "'pillar_match.match'", "]", "(", "tgt", ",", "delim...
Return True if the minion matches the given pillar target. The ``delimiter`` argument can be used to specify a different delimiter. CLI Example: .. code-block:: bash salt '*' match.pillar 'cheese:foo' salt '*' match.pillar 'clone_url|https://github.com/saltstack/salt.git' delimiter='|' ...
[ "Return", "True", "if", "the", "minion", "matches", "the", "given", "pillar", "target", ".", "The", "delimiter", "argument", "can", "be", "used", "to", "specify", "a", "different", "delimiter", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/match.py#L117-L145
35,494
saltstack/salt
salt/modules/match.py
data
def data(tgt): ''' Return True if the minion matches the given data target CLI Example: .. code-block:: bash salt '*' match.data 'spam:eggs' ''' matchers = salt.loader.matchers(__opts__) try: return matchers['data_match.match'](tgt, opts=__opts__) except Exception as e...
python
def data(tgt): ''' Return True if the minion matches the given data target CLI Example: .. code-block:: bash salt '*' match.data 'spam:eggs' ''' matchers = salt.loader.matchers(__opts__) try: return matchers['data_match.match'](tgt, opts=__opts__) except Exception as e...
[ "def", "data", "(", "tgt", ")", ":", "matchers", "=", "salt", ".", "loader", ".", "matchers", "(", "__opts__", ")", "try", ":", "return", "matchers", "[", "'data_match.match'", "]", "(", "tgt", ",", "opts", "=", "__opts__", ")", "except", "Exception", ...
Return True if the minion matches the given data target CLI Example: .. code-block:: bash salt '*' match.data 'spam:eggs'
[ "Return", "True", "if", "the", "minion", "matches", "the", "given", "data", "target" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/match.py#L148-L163
35,495
saltstack/salt
salt/modules/match.py
pcre
def pcre(tgt, minion_id=None): ''' Return True if the minion ID matches the given pcre target minion_id Specify the minion ID to match against the target expression .. versionadded:: 2014.7.0 CLI Example: .. code-block:: bash salt '*' match.pcre '.*' ''' if minio...
python
def pcre(tgt, minion_id=None): ''' Return True if the minion ID matches the given pcre target minion_id Specify the minion ID to match against the target expression .. versionadded:: 2014.7.0 CLI Example: .. code-block:: bash salt '*' match.pcre '.*' ''' if minio...
[ "def", "pcre", "(", "tgt", ",", "minion_id", "=", "None", ")", ":", "if", "minion_id", "is", "not", "None", ":", "opts", "=", "copy", ".", "copy", "(", "__opts__", ")", "if", "not", "isinstance", "(", "minion_id", ",", "six", ".", "string_types", ")"...
Return True if the minion ID matches the given pcre target minion_id Specify the minion ID to match against the target expression .. versionadded:: 2014.7.0 CLI Example: .. code-block:: bash salt '*' match.pcre '.*'
[ "Return", "True", "if", "the", "minion", "ID", "matches", "the", "given", "pcre", "target" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/match.py#L258-L285
35,496
saltstack/salt
salt/modules/match.py
filter_by
def filter_by(lookup, tgt_type='compound', minion_id=None, merge=None, merge_lists=False, default='default'): ''' Return the first match in a dictionary of target patterns .. versionadded:: 2014.7.0 CLI Example: .. code-block::...
python
def filter_by(lookup, tgt_type='compound', minion_id=None, merge=None, merge_lists=False, default='default'): ''' Return the first match in a dictionary of target patterns .. versionadded:: 2014.7.0 CLI Example: .. code-block::...
[ "def", "filter_by", "(", "lookup", ",", "tgt_type", "=", "'compound'", ",", "minion_id", "=", "None", ",", "merge", "=", "None", ",", "merge_lists", "=", "False", ",", "default", "=", "'default'", ")", ":", "expr_funcs", "=", "dict", "(", "inspect", ".",...
Return the first match in a dictionary of target patterns .. versionadded:: 2014.7.0 CLI Example: .. code-block:: bash salt '*' match.filter_by '{foo*: Foo!, bar*: Bar!}' minion_id=bar03 Pillar Example: .. code-block:: jinja # Filter the data for the current minion into a vari...
[ "Return", "the", "first", "match", "in", "a", "dictionary", "of", "target", "patterns" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/match.py#L319-L367
35,497
saltstack/salt
salt/modules/match.py
search_by
def search_by(lookup, tgt_type='compound', minion_id=None): ''' Search a dictionary of target strings for matching targets This is the inverse of :py:func:`match.filter_by <salt.modules.match.filter_by>` and allows matching values instead of matching keys. A minion can be matched by multiple entrie...
python
def search_by(lookup, tgt_type='compound', minion_id=None): ''' Search a dictionary of target strings for matching targets This is the inverse of :py:func:`match.filter_by <salt.modules.match.filter_by>` and allows matching values instead of matching keys. A minion can be matched by multiple entrie...
[ "def", "search_by", "(", "lookup", ",", "tgt_type", "=", "'compound'", ",", "minion_id", "=", "None", ")", ":", "expr_funcs", "=", "dict", "(", "inspect", ".", "getmembers", "(", "sys", ".", "modules", "[", "__name__", "]", ",", "predicate", "=", "inspec...
Search a dictionary of target strings for matching targets This is the inverse of :py:func:`match.filter_by <salt.modules.match.filter_by>` and allows matching values instead of matching keys. A minion can be matched by multiple entries. .. versionadded:: 2017.7.0 CLI Example: .. code-block:...
[ "Search", "a", "dictionary", "of", "target", "strings", "for", "matching", "targets" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/match.py#L370-L409
35,498
saltstack/salt
salt/modules/varnish.py
_run_varnishadm
def _run_varnishadm(cmd, params=(), **kwargs): ''' Execute varnishadm command return the output of the command cmd The command to run in varnishadm params Any additional args to add to the command line kwargs Additional options to pass to the salt cmd.run_all function ...
python
def _run_varnishadm(cmd, params=(), **kwargs): ''' Execute varnishadm command return the output of the command cmd The command to run in varnishadm params Any additional args to add to the command line kwargs Additional options to pass to the salt cmd.run_all function ...
[ "def", "_run_varnishadm", "(", "cmd", ",", "params", "=", "(", ")", ",", "*", "*", "kwargs", ")", ":", "cmd", "=", "[", "'varnishadm'", ",", "cmd", "]", "cmd", ".", "extend", "(", "[", "param", "for", "param", "in", "params", "if", "param", "is", ...
Execute varnishadm command return the output of the command cmd The command to run in varnishadm params Any additional args to add to the command line kwargs Additional options to pass to the salt cmd.run_all function
[ "Execute", "varnishadm", "command", "return", "the", "output", "of", "the", "command" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/varnish.py#L37-L54
35,499
saltstack/salt
salt/modules/varnish.py
version
def version(): ''' Return server version from varnishd -V CLI Example: .. code-block:: bash salt '*' varnish.version ''' cmd = ['varnishd', '-V'] out = __salt__['cmd.run'](cmd, python_shell=False) ret = re.search(r'\(varnish-([^\)]+)\)', out).group(1) return ret
python
def version(): ''' Return server version from varnishd -V CLI Example: .. code-block:: bash salt '*' varnish.version ''' cmd = ['varnishd', '-V'] out = __salt__['cmd.run'](cmd, python_shell=False) ret = re.search(r'\(varnish-([^\)]+)\)', out).group(1) return ret
[ "def", "version", "(", ")", ":", "cmd", "=", "[", "'varnishd'", ",", "'-V'", "]", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "ret", "=", "re", ".", "search", "(", "r'\\(varnish-([^\\)]+)\\)'", ","...
Return server version from varnishd -V CLI Example: .. code-block:: bash salt '*' varnish.version
[ "Return", "server", "version", "from", "varnishd", "-", "V" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/varnish.py#L57-L70