partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | stop | Stop the specified service
CLI Example:
.. code-block:: bash
salt '*' service.stop <service name> | salt/modules/rh_service.py | def stop(name):
'''
Stop the specified service
CLI Example:
.. code-block:: bash
salt '*' service.stop <service name>
'''
if _service_is_upstart(name):
cmd = 'stop {0}'.format(name)
else:
cmd = '/sbin/service {0} stop'.format(name)
return not __salt__['cmd.retc... | def stop(name):
'''
Stop the specified service
CLI Example:
.. code-block:: bash
salt '*' service.stop <service name>
'''
if _service_is_upstart(name):
cmd = 'stop {0}'.format(name)
else:
cmd = '/sbin/service {0} stop'.format(name)
return not __salt__['cmd.retc... | [
"Stop",
"the",
"specified",
"service"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L427-L441 | [
"def",
"stop",
"(",
"name",
")",
":",
"if",
"_service_is_upstart",
"(",
"name",
")",
":",
"cmd",
"=",
"'stop {0}'",
".",
"format",
"(",
"name",
")",
"else",
":",
"cmd",
"=",
"'/sbin/service {0} stop'",
".",
"format",
"(",
"name",
")",
"return",
"not",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | restart | Restart the named service
CLI Example:
.. code-block:: bash
salt '*' service.restart <service name> | salt/modules/rh_service.py | def restart(name):
'''
Restart the named service
CLI Example:
.. code-block:: bash
salt '*' service.restart <service name>
'''
if _service_is_upstart(name):
cmd = 'restart {0}'.format(name)
else:
cmd = '/sbin/service {0} restart'.format(name)
return not __salt_... | def restart(name):
'''
Restart the named service
CLI Example:
.. code-block:: bash
salt '*' service.restart <service name>
'''
if _service_is_upstart(name):
cmd = 'restart {0}'.format(name)
else:
cmd = '/sbin/service {0} restart'.format(name)
return not __salt_... | [
"Restart",
"the",
"named",
"service"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L444-L458 | [
"def",
"restart",
"(",
"name",
")",
":",
"if",
"_service_is_upstart",
"(",
"name",
")",
":",
"cmd",
"=",
"'restart {0}'",
".",
"format",
"(",
"name",
")",
"else",
":",
"cmd",
"=",
"'/sbin/service {0} restart'",
".",
"format",
"(",
"name",
")",
"return",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | reload_ | Reload the named service
CLI Example:
.. code-block:: bash
salt '*' service.reload <service name> | salt/modules/rh_service.py | def reload_(name):
'''
Reload the named service
CLI Example:
.. code-block:: bash
salt '*' service.reload <service name>
'''
if _service_is_upstart(name):
cmd = 'reload {0}'.format(name)
else:
cmd = '/sbin/service {0} reload'.format(name)
return not __salt__['c... | def reload_(name):
'''
Reload the named service
CLI Example:
.. code-block:: bash
salt '*' service.reload <service name>
'''
if _service_is_upstart(name):
cmd = 'reload {0}'.format(name)
else:
cmd = '/sbin/service {0} reload'.format(name)
return not __salt__['c... | [
"Reload",
"the",
"named",
"service"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L461-L475 | [
"def",
"reload_",
"(",
"name",
")",
":",
"if",
"_service_is_upstart",
"(",
"name",
")",
":",
"cmd",
"=",
"'reload {0}'",
".",
"format",
"(",
"name",
")",
"else",
":",
"cmd",
"=",
"'/sbin/service {0} reload'",
".",
"format",
"(",
"name",
")",
"return",
"n... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_repo_sign_utils_support | Check for specified command name in search path | salt/modules/debuild_pkgbuild.py | def _check_repo_sign_utils_support(name):
'''
Check for specified command name in search path
'''
if salt.utils.path.which(name):
return True
else:
raise CommandExecutionError(
'utility \'{0}\' needs to be installed or made available in search path'.format(name)
) | def _check_repo_sign_utils_support(name):
'''
Check for specified command name in search path
'''
if salt.utils.path.which(name):
return True
else:
raise CommandExecutionError(
'utility \'{0}\' needs to be installed or made available in search path'.format(name)
) | [
"Check",
"for",
"specified",
"command",
"name",
"in",
"search",
"path"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L73-L82 | [
"def",
"_check_repo_sign_utils_support",
"(",
"name",
")",
":",
"if",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"name",
")",
":",
"return",
"True",
"else",
":",
"raise",
"CommandExecutionError",
"(",
"'utility \\'{0}\\' needs to be installed or made avai... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_build_env | Get build environment overrides dictionary to use in build process | salt/modules/debuild_pkgbuild.py | def _get_build_env(env):
'''
Get build environment overrides dictionary to use in build process
'''
env_override = ''
if env is None:
return env_override
if not isinstance(env, dict):
raise SaltInvocationError(
'\'env\' must be a Python dictionary'
)
for k... | def _get_build_env(env):
'''
Get build environment overrides dictionary to use in build process
'''
env_override = ''
if env is None:
return env_override
if not isinstance(env, dict):
raise SaltInvocationError(
'\'env\' must be a Python dictionary'
)
for k... | [
"Get",
"build",
"environment",
"overrides",
"dictionary",
"to",
"use",
"in",
"build",
"process"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L98-L112 | [
"def",
"_get_build_env",
"(",
"env",
")",
":",
"env_override",
"=",
"''",
"if",
"env",
"is",
"None",
":",
"return",
"env_override",
"if",
"not",
"isinstance",
"(",
"env",
",",
"dict",
")",
":",
"raise",
"SaltInvocationError",
"(",
"'\\'env\\' must be a Python ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_repo_options_env | Get repo environment overrides dictionary to use in repo options process
env
A dictionary of variables to define the repository options
Example:
.. code-block:: yaml
- env:
- OPTIONS : 'ask-passphrase'
.. warning::
The above illustrates a ... | salt/modules/debuild_pkgbuild.py | def _get_repo_options_env(env):
'''
Get repo environment overrides dictionary to use in repo options process
env
A dictionary of variables to define the repository options
Example:
.. code-block:: yaml
- env:
- OPTIONS : 'ask-passphrase'
.. war... | def _get_repo_options_env(env):
'''
Get repo environment overrides dictionary to use in repo options process
env
A dictionary of variables to define the repository options
Example:
.. code-block:: yaml
- env:
- OPTIONS : 'ask-passphrase'
.. war... | [
"Get",
"repo",
"environment",
"overrides",
"dictionary",
"to",
"use",
"in",
"repo",
"options",
"process"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L115-L147 | [
"def",
"_get_repo_options_env",
"(",
"env",
")",
":",
"env_options",
"=",
"''",
"if",
"env",
"is",
"None",
":",
"return",
"env_options",
"if",
"not",
"isinstance",
"(",
"env",
",",
"dict",
")",
":",
"raise",
"SaltInvocationError",
"(",
"'\\'env\\' must be a Py... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_repo_dists_env | Get repo environment overrides dictionary to use in repo distributions process
env
A dictionary of variables to define the repository distributions
Example:
.. code-block:: yaml
- env:
- ORIGIN : 'jessie'
- LABEL : 'salt debian'
... | salt/modules/debuild_pkgbuild.py | def _get_repo_dists_env(env):
'''
Get repo environment overrides dictionary to use in repo distributions process
env
A dictionary of variables to define the repository distributions
Example:
.. code-block:: yaml
- env:
- ORIGIN : 'jessie'
... | def _get_repo_dists_env(env):
'''
Get repo environment overrides dictionary to use in repo distributions process
env
A dictionary of variables to define the repository distributions
Example:
.. code-block:: yaml
- env:
- ORIGIN : 'jessie'
... | [
"Get",
"repo",
"environment",
"overrides",
"dictionary",
"to",
"use",
"in",
"repo",
"distributions",
"process"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L150-L231 | [
"def",
"_get_repo_dists_env",
"(",
"env",
")",
":",
"# env key with tuple of control information for handling input env dictionary",
"# 0 | M - Mandatory, O - Optional, I - Ignore",
"# 1 | 'text string for repo field'",
"# 2 | 'default value'",
"dflts_dict",
"=",
"{",
"'OPTIONS'",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _create_pbuilders | Create the .pbuilder family of files in user's home directory
env
A list or dictionary of environment variables to be set prior to execution.
Example:
.. code-block:: yaml
- env:
- DEB_BUILD_OPTIONS: 'nocheck'
.. warning::
The above illus... | salt/modules/debuild_pkgbuild.py | def _create_pbuilders(env, runas='root'):
'''
Create the .pbuilder family of files in user's home directory
env
A list or dictionary of environment variables to be set prior to execution.
Example:
.. code-block:: yaml
- env:
- DEB_BUILD_OPTIONS: 'noche... | def _create_pbuilders(env, runas='root'):
'''
Create the .pbuilder family of files in user's home directory
env
A list or dictionary of environment variables to be set prior to execution.
Example:
.. code-block:: yaml
- env:
- DEB_BUILD_OPTIONS: 'noche... | [
"Create",
"the",
".",
"pbuilder",
"family",
"of",
"files",
"in",
"user",
"s",
"home",
"directory"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L234-L283 | [
"def",
"_create_pbuilders",
"(",
"env",
",",
"runas",
"=",
"'root'",
")",
":",
"home",
"=",
"os",
".",
"path",
".",
"expanduser",
"(",
"'~{0}'",
".",
"format",
"(",
"runas",
")",
")",
"pbuilderrc",
"=",
"os",
".",
"path",
".",
"join",
"(",
"home",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_src | Get the named sources and place them into the tree_base | salt/modules/debuild_pkgbuild.py | def _get_src(tree_base, source, saltenv='base'):
'''
Get the named sources and place them into the tree_base
'''
parsed = _urlparse(source)
sbase = os.path.basename(source)
dest = os.path.join(tree_base, sbase)
if parsed.scheme:
__salt__['cp.get_url'](source, dest, saltenv=saltenv)
... | def _get_src(tree_base, source, saltenv='base'):
'''
Get the named sources and place them into the tree_base
'''
parsed = _urlparse(source)
sbase = os.path.basename(source)
dest = os.path.join(tree_base, sbase)
if parsed.scheme:
__salt__['cp.get_url'](source, dest, saltenv=saltenv)
... | [
"Get",
"the",
"named",
"sources",
"and",
"place",
"them",
"into",
"the",
"tree_base"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L305-L315 | [
"def",
"_get_src",
"(",
"tree_base",
",",
"source",
",",
"saltenv",
"=",
"'base'",
")",
":",
"parsed",
"=",
"_urlparse",
"(",
"source",
")",
"sbase",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"source",
")",
"dest",
"=",
"os",
".",
"path",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | make_src_pkg | Create a platform specific source package from the given platform spec/control file and sources
CLI Example:
**Debian**
.. code-block:: bash
salt '*' pkgbuild.make_src_pkg /var/www/html/
https://raw.githubusercontent.com/saltstack/libnacl/master/pkg/deb/python-libnacl.control.tar... | salt/modules/debuild_pkgbuild.py | def make_src_pkg(dest_dir, spec, sources, env=None, saltenv='base', runas='root'):
'''
Create a platform specific source package from the given platform spec/control file and sources
CLI Example:
**Debian**
.. code-block:: bash
salt '*' pkgbuild.make_src_pkg /var/www/html/
... | def make_src_pkg(dest_dir, spec, sources, env=None, saltenv='base', runas='root'):
'''
Create a platform specific source package from the given platform spec/control file and sources
CLI Example:
**Debian**
.. code-block:: bash
salt '*' pkgbuild.make_src_pkg /var/www/html/
... | [
"Create",
"a",
"platform",
"specific",
"source",
"package",
"from",
"the",
"given",
"platform",
"spec",
"/",
"control",
"file",
"and",
"sources"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L318-L476 | [
"def",
"make_src_pkg",
"(",
"dest_dir",
",",
"spec",
",",
"sources",
",",
"env",
"=",
"None",
",",
"saltenv",
"=",
"'base'",
",",
"runas",
"=",
"'root'",
")",
":",
"_create_pbuilders",
"(",
"env",
",",
"runas",
")",
"tree_base",
"=",
"_mk_tree",
"(",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | build | Given the package destination directory, the tarball containing debian files (e.g. control)
and package sources, use pbuilder to safely build the platform package
CLI Example:
**Debian**
.. code-block:: bash
salt '*' pkgbuild.make_src_pkg deb-8-x86_64 /var/www/html
https://ra... | salt/modules/debuild_pkgbuild.py | def build(runas,
tgt,
dest_dir,
spec,
sources,
deps,
env,
template,
saltenv='base',
log_dir='/var/log/salt/pkgbuild'): # pylint: disable=unused-argument
'''
Given the package destination directory, the tarball containing ... | def build(runas,
tgt,
dest_dir,
spec,
sources,
deps,
env,
template,
saltenv='base',
log_dir='/var/log/salt/pkgbuild'): # pylint: disable=unused-argument
'''
Given the package destination directory, the tarball containing ... | [
"Given",
"the",
"package",
"destination",
"directory",
"the",
"tarball",
"containing",
"debian",
"files",
"(",
"e",
".",
"g",
".",
"control",
")",
"and",
"package",
"sources",
"use",
"pbuilder",
"to",
"safely",
"build",
"the",
"platform",
"package"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L479-L591 | [
"def",
"build",
"(",
"runas",
",",
"tgt",
",",
"dest_dir",
",",
"spec",
",",
"sources",
",",
"deps",
",",
"env",
",",
"template",
",",
"saltenv",
"=",
"'base'",
",",
"log_dir",
"=",
"'/var/log/salt/pkgbuild'",
")",
":",
"# pylint: disable=unused-argument",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | make_repo | Make a package repository and optionally sign it and packages present
Given the repodir (directory to create repository in), create a Debian
repository and optionally sign it and packages present. This state is
best used with onchanges linked to your package building states.
repodir
The direct... | salt/modules/debuild_pkgbuild.py | def make_repo(repodir,
keyid=None,
env=None,
use_passphrase=False,
gnupghome='/etc/salt/gpgkeys',
runas='root',
timeout=15.0):
'''
Make a package repository and optionally sign it and packages present
Given the repodir (dir... | def make_repo(repodir,
keyid=None,
env=None,
use_passphrase=False,
gnupghome='/etc/salt/gpgkeys',
runas='root',
timeout=15.0):
'''
Make a package repository and optionally sign it and packages present
Given the repodir (dir... | [
"Make",
"a",
"package",
"repository",
"and",
"optionally",
"sign",
"it",
"and",
"packages",
"present"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L594-L945 | [
"def",
"make_repo",
"(",
"repodir",
",",
"keyid",
"=",
"None",
",",
"env",
"=",
"None",
",",
"use_passphrase",
"=",
"False",
",",
"gnupghome",
"=",
"'/etc/salt/gpgkeys'",
",",
"runas",
"=",
"'root'",
",",
"timeout",
"=",
"15.0",
")",
":",
"res",
"=",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | generate_token | Generate a Vault token for minion minion_id
minion_id
The id of the minion that requests a token
signature
Cryptographic signature which validates that the request is indeed sent
by the minion (or the master, see impersonated_by_master).
impersonated_by_master
If the maste... | salt/runners/vault.py | def generate_token(minion_id, signature, impersonated_by_master=False):
'''
Generate a Vault token for minion minion_id
minion_id
The id of the minion that requests a token
signature
Cryptographic signature which validates that the request is indeed sent
by the minion (or the m... | def generate_token(minion_id, signature, impersonated_by_master=False):
'''
Generate a Vault token for minion minion_id
minion_id
The id of the minion that requests a token
signature
Cryptographic signature which validates that the request is indeed sent
by the minion (or the m... | [
"Generate",
"a",
"Vault",
"token",
"for",
"minion",
"minion_id"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vault.py#L28-L96 | [
"def",
"generate_token",
"(",
"minion_id",
",",
"signature",
",",
"impersonated_by_master",
"=",
"False",
")",
":",
"log",
".",
"debug",
"(",
"'Token generation request for %s (impersonated by master: %s)'",
",",
"minion_id",
",",
"impersonated_by_master",
")",
"_validate... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | unseal | Unseal Vault server
This function uses the 'keys' from the 'vault' configuration to unseal vault server
vault:
keys:
- n63/TbrQuL3xaIW7ZZpuXj/tIfnK1/MbVxO4vT3wYD2A
- S9OwCvMRhErEA4NVVELYBs6w/Me6+urgUr24xGK44Uy3
- F1j4b7JKq850NS6Kboiy5laJ0xY8dWJvB3fcwA+SraYl
- 1cYtvjKJNDVa... | salt/runners/vault.py | def unseal():
'''
Unseal Vault server
This function uses the 'keys' from the 'vault' configuration to unseal vault server
vault:
keys:
- n63/TbrQuL3xaIW7ZZpuXj/tIfnK1/MbVxO4vT3wYD2A
- S9OwCvMRhErEA4NVVELYBs6w/Me6+urgUr24xGK44Uy3
- F1j4b7JKq850NS6Kboiy5laJ0xY8dWJvB3fcwA+Sr... | def unseal():
'''
Unseal Vault server
This function uses the 'keys' from the 'vault' configuration to unseal vault server
vault:
keys:
- n63/TbrQuL3xaIW7ZZpuXj/tIfnK1/MbVxO4vT3wYD2A
- S9OwCvMRhErEA4NVVELYBs6w/Me6+urgUr24xGK44Uy3
- F1j4b7JKq850NS6Kboiy5laJ0xY8dWJvB3fcwA+Sr... | [
"Unseal",
"Vault",
"server"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vault.py#L99-L126 | [
"def",
"unseal",
"(",
")",
":",
"for",
"key",
"in",
"__opts__",
"[",
"'vault'",
"]",
"[",
"'keys'",
"]",
":",
"ret",
"=",
"__utils__",
"[",
"'vault.make_request'",
"]",
"(",
"'PUT'",
",",
"'v1/sys/unseal'",
",",
"data",
"=",
"json",
".",
"dumps",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _validate_signature | Validate that either minion with id minion_id, or the master, signed the
request | salt/runners/vault.py | def _validate_signature(minion_id, signature, impersonated_by_master):
'''
Validate that either minion with id minion_id, or the master, signed the
request
'''
pki_dir = __opts__['pki_dir']
if impersonated_by_master:
public_key = '{0}/master.pub'.format(pki_dir)
else:
public_... | def _validate_signature(minion_id, signature, impersonated_by_master):
'''
Validate that either minion with id minion_id, or the master, signed the
request
'''
pki_dir = __opts__['pki_dir']
if impersonated_by_master:
public_key = '{0}/master.pub'.format(pki_dir)
else:
public_... | [
"Validate",
"that",
"either",
"minion",
"with",
"id",
"minion_id",
"or",
"the",
"master",
"signed",
"the",
"request"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vault.py#L146-L163 | [
"def",
"_validate_signature",
"(",
"minion_id",
",",
"signature",
",",
"impersonated_by_master",
")",
":",
"pki_dir",
"=",
"__opts__",
"[",
"'pki_dir'",
"]",
"if",
"impersonated_by_master",
":",
"public_key",
"=",
"'{0}/master.pub'",
".",
"format",
"(",
"pki_dir",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_policies | Get the policies that should be applied to a token for minion_id | salt/runners/vault.py | def _get_policies(minion_id, config):
'''
Get the policies that should be applied to a token for minion_id
'''
_, grains, _ = salt.utils.minions.get_minion_data(minion_id, __opts__)
policy_patterns = config.get(
'policies',
['saltstac... | def _get_policies(minion_id, config):
'''
Get the policies that should be applied to a token for minion_id
'''
_, grains, _ = salt.utils.minions.get_minion_data(minion_id, __opts__)
policy_patterns = config.get(
'policies',
['saltstac... | [
"Get",
"the",
"policies",
"that",
"should",
"be",
"applied",
"to",
"a",
"token",
"for",
"minion_id"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vault.py#L166-L189 | [
"def",
"_get_policies",
"(",
"minion_id",
",",
"config",
")",
":",
"_",
",",
"grains",
",",
"_",
"=",
"salt",
".",
"utils",
".",
"minions",
".",
"get_minion_data",
"(",
"minion_id",
",",
"__opts__",
")",
"policy_patterns",
"=",
"config",
".",
"get",
"(",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _expand_pattern_lists | Expands the pattern for any list-valued mappings, such that for any list of
length N in the mappings present in the pattern, N copies of the pattern are
returned, each with an element of the list substituted.
pattern:
A pattern to expand, for example ``by-role/{grains[roles]}``
mappings:
... | salt/runners/vault.py | def _expand_pattern_lists(pattern, **mappings):
'''
Expands the pattern for any list-valued mappings, such that for any list of
length N in the mappings present in the pattern, N copies of the pattern are
returned, each with an element of the list substituted.
pattern:
A pattern to expand, ... | def _expand_pattern_lists(pattern, **mappings):
'''
Expands the pattern for any list-valued mappings, such that for any list of
length N in the mappings present in the pattern, N copies of the pattern are
returned, each with an element of the list substituted.
pattern:
A pattern to expand, ... | [
"Expands",
"the",
"pattern",
"for",
"any",
"list",
"-",
"valued",
"mappings",
"such",
"that",
"for",
"any",
"list",
"of",
"length",
"N",
"in",
"the",
"mappings",
"present",
"in",
"the",
"pattern",
"N",
"copies",
"of",
"the",
"pattern",
"are",
"returned",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vault.py#L192-L239 | [
"def",
"_expand_pattern_lists",
"(",
"pattern",
",",
"*",
"*",
"mappings",
")",
":",
"expanded_patterns",
"=",
"[",
"]",
"f",
"=",
"string",
".",
"Formatter",
"(",
")",
"'''\n This function uses a string.Formatter to get all the formatting tokens from\n the pattern, t... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _selftoken_expired | Validate the current token exists and is still valid | salt/runners/vault.py | def _selftoken_expired():
'''
Validate the current token exists and is still valid
'''
try:
verify = __opts__['vault'].get('verify', None)
url = '{0}/v1/auth/token/lookup-self'.format(__opts__['vault']['url'])
if 'token' not in __opts__['vault']['auth']:
return True
... | def _selftoken_expired():
'''
Validate the current token exists and is still valid
'''
try:
verify = __opts__['vault'].get('verify', None)
url = '{0}/v1/auth/token/lookup-self'.format(__opts__['vault']['url'])
if 'token' not in __opts__['vault']['auth']:
return True
... | [
"Validate",
"the",
"current",
"token",
"exists",
"and",
"is",
"still",
"valid"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vault.py#L242-L259 | [
"def",
"_selftoken_expired",
"(",
")",
":",
"try",
":",
"verify",
"=",
"__opts__",
"[",
"'vault'",
"]",
".",
"get",
"(",
"'verify'",
",",
"None",
")",
"url",
"=",
"'{0}/v1/auth/token/lookup-self'",
".",
"format",
"(",
"__opts__",
"[",
"'vault'",
"]",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_token_create_url | Create Vault url for token creation | salt/runners/vault.py | def _get_token_create_url(config):
'''
Create Vault url for token creation
'''
role_name = config.get('role_name', None)
auth_path = '/v1/auth/token/create'
base_url = config['url']
return '/'.join(x.strip('/') for x in (base_url, auth_path, role_name) if x) | def _get_token_create_url(config):
'''
Create Vault url for token creation
'''
role_name = config.get('role_name', None)
auth_path = '/v1/auth/token/create'
base_url = config['url']
return '/'.join(x.strip('/') for x in (base_url, auth_path, role_name) if x) | [
"Create",
"Vault",
"url",
"for",
"token",
"creation"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vault.py#L262-L269 | [
"def",
"_get_token_create_url",
"(",
"config",
")",
":",
"role_name",
"=",
"config",
".",
"get",
"(",
"'role_name'",
",",
"None",
")",
"auth_path",
"=",
"'/v1/auth/token/create'",
"base_url",
"=",
"config",
"[",
"'url'",
"]",
"return",
"'/'",
".",
"join",
"(... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_function | Given function name, find and return matching Lambda information. | salt/modules/boto_lambda.py | def _find_function(name,
region=None, key=None, keyid=None, profile=None):
'''
Given function name, find and return matching Lambda information.
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
for funcs in __utils__['boto3.paged_call'](conn.list_functio... | def _find_function(name,
region=None, key=None, keyid=None, profile=None):
'''
Given function name, find and return matching Lambda information.
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
for funcs in __utils__['boto3.paged_call'](conn.list_functio... | [
"Given",
"function",
"name",
"find",
"and",
"return",
"matching",
"Lambda",
"information",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L138-L149 | [
"def",
"_find_function",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | function_exists | Given a function name, check to see if the given function name exists.
Returns True if the given function exists and returns False if the given
function does not exist.
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.function_exists myfunction | salt/modules/boto_lambda.py | def function_exists(FunctionName, region=None, key=None,
keyid=None, profile=None):
'''
Given a function name, check to see if the given function name exists.
Returns True if the given function exists and returns False if the given
function does not exist.
CLI Example:
.. ... | def function_exists(FunctionName, region=None, key=None,
keyid=None, profile=None):
'''
Given a function name, check to see if the given function name exists.
Returns True if the given function exists and returns False if the given
function does not exist.
CLI Example:
.. ... | [
"Given",
"a",
"function",
"name",
"check",
"to",
"see",
"if",
"the",
"given",
"function",
"name",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L152-L173 | [
"def",
"function_exists",
"(",
"FunctionName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"func",
"=",
"_find_function",
"(",
"FunctionName",
",",
"region",
"=",
"r... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_function | .. versionadded:: 2017.7.0
Given a valid config, create a function.
Environment
The parent object that contains your environment's configuration
settings. This is a dictionary of the form:
.. code-block:: python
{
'Variables': {
'Variab... | salt/modules/boto_lambda.py | def create_function(FunctionName, Runtime, Role, Handler, ZipFile=None,
S3Bucket=None, S3Key=None, S3ObjectVersion=None,
Description="", Timeout=3, MemorySize=128, Publish=False,
WaitForRole=False, RoleRetries=5,
region=None, key=None, keyi... | def create_function(FunctionName, Runtime, Role, Handler, ZipFile=None,
S3Bucket=None, S3Key=None, S3ObjectVersion=None,
Description="", Timeout=3, MemorySize=128, Publish=False,
WaitForRole=False, RoleRetries=5,
region=None, key=None, keyi... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L211-L308 | [
"def",
"create_function",
"(",
"FunctionName",
",",
"Runtime",
",",
"Role",
",",
"Handler",
",",
"ZipFile",
"=",
"None",
",",
"S3Bucket",
"=",
"None",
",",
"S3Key",
"=",
"None",
",",
"S3ObjectVersion",
"=",
"None",
",",
"Description",
"=",
"\"\"",
",",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_function | Given a function name and optional version qualifier, delete it.
Returns {deleted: true} if the function was deleted and returns
{deleted: false} if the function was not deleted.
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.delete_function myfunction | salt/modules/boto_lambda.py | def delete_function(FunctionName, Qualifier=None, region=None, key=None, keyid=None, profile=None):
'''
Given a function name and optional version qualifier, delete it.
Returns {deleted: true} if the function was deleted and returns
{deleted: false} if the function was not deleted.
CLI Example:
... | def delete_function(FunctionName, Qualifier=None, region=None, key=None, keyid=None, profile=None):
'''
Given a function name and optional version qualifier, delete it.
Returns {deleted: true} if the function was deleted and returns
{deleted: false} if the function was not deleted.
CLI Example:
... | [
"Given",
"a",
"function",
"name",
"and",
"optional",
"version",
"qualifier",
"delete",
"it",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L311-L335 | [
"def",
"delete_function",
"(",
"FunctionName",
",",
"Qualifier",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | describe_function | Given a function name describe its properties.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.describe_function myfunction | salt/modules/boto_lambda.py | def describe_function(FunctionName, region=None, key=None,
keyid=None, profile=None):
'''
Given a function name describe its properties.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.describe_function myf... | def describe_function(FunctionName, region=None, key=None,
keyid=None, profile=None):
'''
Given a function name describe its properties.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.describe_function myf... | [
"Given",
"a",
"function",
"name",
"describe",
"its",
"properties",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L338-L364 | [
"def",
"describe_function",
"(",
"FunctionName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"func",
"=",
"_find_function",
"(",
"FunctionName",
",",
"region",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_function_config | .. versionadded:: 2017.7.0
Update the named lambda function to the configuration.
Environment
The parent object that contains your environment's configuration
settings. This is a dictionary of the form:
.. code-block:: python
{
'Variables': {
... | salt/modules/boto_lambda.py | def update_function_config(FunctionName, Role=None, Handler=None,
Description=None, Timeout=None, MemorySize=None,
region=None, key=None, keyid=None, profile=None,
VpcConfig=None, WaitForRole=False, RoleRetries=5,
... | def update_function_config(FunctionName, Role=None, Handler=None,
Description=None, Timeout=None, MemorySize=None,
region=None, key=None, keyid=None, profile=None,
VpcConfig=None, WaitForRole=False, RoleRetries=5,
... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L367-L445 | [
"def",
"update_function_config",
"(",
"FunctionName",
",",
"Role",
"=",
"None",
",",
"Handler",
"=",
"None",
",",
"Description",
"=",
"None",
",",
"Timeout",
"=",
"None",
",",
"MemorySize",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_function_code | Upload the given code to the named lambda function.
Returns {updated: true} if the function was updated and returns
{updated: False} if the function was not updated.
CLI Example:
.. code-block:: bash
salt myminion boto_lamba.update_function_code my_function ZipFile=function.zip | salt/modules/boto_lambda.py | def update_function_code(FunctionName, ZipFile=None, S3Bucket=None, S3Key=None,
S3ObjectVersion=None, Publish=False,
region=None, key=None, keyid=None, profile=None):
'''
Upload the given code to the named lambda function.
Returns {updated: true} if the fun... | def update_function_code(FunctionName, ZipFile=None, S3Bucket=None, S3Key=None,
S3ObjectVersion=None, Publish=False,
region=None, key=None, keyid=None, profile=None):
'''
Upload the given code to the named lambda function.
Returns {updated: true} if the fun... | [
"Upload",
"the",
"given",
"code",
"to",
"the",
"named",
"lambda",
"function",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L448-L495 | [
"def",
"update_function_code",
"(",
"FunctionName",
",",
"ZipFile",
"=",
"None",
",",
"S3Bucket",
"=",
"None",
",",
"S3Key",
"=",
"None",
",",
"S3ObjectVersion",
"=",
"None",
",",
"Publish",
"=",
"False",
",",
"region",
"=",
"None",
",",
"key",
"=",
"Non... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add_permission | Add a permission to a lambda function.
Returns {added: true} if the permission was added and returns
{added: False} if the permission was not added.
CLI Example:
.. code-block:: bash
salt myminion boto_lamba.add_permission my_function my_id "lambda:*" \\
s3.amazona... | salt/modules/boto_lambda.py | def add_permission(FunctionName, StatementId, Action, Principal, SourceArn=None,
SourceAccount=None, Qualifier=None,
region=None, key=None, keyid=None, profile=None):
'''
Add a permission to a lambda function.
Returns {added: true} if the permission was added and retur... | def add_permission(FunctionName, StatementId, Action, Principal, SourceArn=None,
SourceAccount=None, Qualifier=None,
region=None, key=None, keyid=None, profile=None):
'''
Add a permission to a lambda function.
Returns {added: true} if the permission was added and retur... | [
"Add",
"a",
"permission",
"to",
"a",
"lambda",
"function",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L498-L528 | [
"def",
"add_permission",
"(",
"FunctionName",
",",
"StatementId",
",",
"Action",
",",
"Principal",
",",
"SourceArn",
"=",
"None",
",",
"SourceAccount",
"=",
"None",
",",
"Qualifier",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove_permission | Remove a permission from a lambda function.
Returns {removed: true} if the permission was removed and returns
{removed: False} if the permission was not removed.
CLI Example:
.. code-block:: bash
salt myminion boto_lamba.remove_permission my_function my_id | salt/modules/boto_lambda.py | def remove_permission(FunctionName, StatementId, Qualifier=None,
region=None, key=None, keyid=None, profile=None):
'''
Remove a permission from a lambda function.
Returns {removed: true} if the permission was removed and returns
{removed: False} if the permission was not removed.
... | def remove_permission(FunctionName, StatementId, Qualifier=None,
region=None, key=None, keyid=None, profile=None):
'''
Remove a permission from a lambda function.
Returns {removed: true} if the permission was removed and returns
{removed: False} if the permission was not removed.
... | [
"Remove",
"a",
"permission",
"from",
"a",
"lambda",
"function",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L531-L556 | [
"def",
"remove_permission",
"(",
"FunctionName",
",",
"StatementId",
",",
"Qualifier",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_co... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_permissions | Get resource permissions for the given lambda function
Returns dictionary of permissions, by statement ID
CLI Example:
.. code-block:: bash
salt myminion boto_lamba.get_permissions my_function
permissions: {...} | salt/modules/boto_lambda.py | def get_permissions(FunctionName, Qualifier=None,
region=None, key=None, keyid=None, profile=None):
'''
Get resource permissions for the given lambda function
Returns dictionary of permissions, by statement ID
CLI Example:
.. code-block:: bash
salt myminion boto_lamba... | def get_permissions(FunctionName, Qualifier=None,
region=None, key=None, keyid=None, profile=None):
'''
Get resource permissions for the given lambda function
Returns dictionary of permissions, by statement ID
CLI Example:
.. code-block:: bash
salt myminion boto_lamba... | [
"Get",
"resource",
"permissions",
"for",
"the",
"given",
"lambda",
"function"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L559-L613 | [
"def",
"get_permissions",
"(",
"FunctionName",
",",
"Qualifier",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_functions | List all Lambda functions visible in the current scope.
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.list_functions | salt/modules/boto_lambda.py | def list_functions(region=None, key=None, keyid=None, profile=None):
'''
List all Lambda functions visible in the current scope.
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.list_functions
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
... | def list_functions(region=None, key=None, keyid=None, profile=None):
'''
List all Lambda functions visible in the current scope.
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.list_functions
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
... | [
"List",
"all",
"Lambda",
"functions",
"visible",
"in",
"the",
"current",
"scope",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L616-L632 | [
"def",
"list_functions",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",
"=",
"keyi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_function_versions | List the versions available for the given function.
Returns list of function versions
CLI Example:
.. code-block:: yaml
versions:
- {...}
- {...} | salt/modules/boto_lambda.py | def list_function_versions(FunctionName,
region=None, key=None, keyid=None, profile=None):
'''
List the versions available for the given function.
Returns list of function versions
CLI Example:
.. code-block:: yaml
versions:
- {...}
- {...}
... | def list_function_versions(FunctionName,
region=None, key=None, keyid=None, profile=None):
'''
List the versions available for the given function.
Returns list of function versions
CLI Example:
.. code-block:: yaml
versions:
- {...}
- {...}
... | [
"List",
"the",
"versions",
"available",
"for",
"the",
"given",
"function",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L635-L661 | [
"def",
"list_function_versions",
"(",
"FunctionName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_alias | Given a valid config, create an alias to a function.
Returns {created: true} if the alias was created and returns
{created: False} if the alias was not created.
CLI Example:
.. code-block:: bash
salt myminion boto_lamba.create_alias my_function my_alias $LATEST "An alias" | salt/modules/boto_lambda.py | def create_alias(FunctionName, Name, FunctionVersion, Description="",
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, create an alias to a function.
Returns {created: true} if the alias was created and returns
{created: False} if the alias was not created.
... | def create_alias(FunctionName, Name, FunctionVersion, Description="",
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, create an alias to a function.
Returns {created: true} if the alias was created and returns
{created: False} if the alias was not created.
... | [
"Given",
"a",
"valid",
"config",
"create",
"an",
"alias",
"to",
"a",
"function",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L664-L691 | [
"def",
"create_alias",
"(",
"FunctionName",
",",
"Name",
",",
"FunctionVersion",
",",
"Description",
"=",
"\"\"",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_alias | Given function name and alias name, find and return matching alias information. | salt/modules/boto_lambda.py | def _find_alias(FunctionName, Name, FunctionVersion=None,
region=None, key=None, keyid=None, profile=None):
'''
Given function name and alias name, find and return matching alias information.
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
args = {
... | def _find_alias(FunctionName, Name, FunctionVersion=None,
region=None, key=None, keyid=None, profile=None):
'''
Given function name and alias name, find and return matching alias information.
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
args = {
... | [
"Given",
"function",
"name",
"and",
"alias",
"name",
"find",
"and",
"return",
"matching",
"alias",
"information",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L717-L734 | [
"def",
"_find_alias",
"(",
"FunctionName",
",",
"Name",
",",
"FunctionVersion",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | alias_exists | Given a function name and alias name, check to see if the given alias exists.
Returns True if the given alias exists and returns False if the given
alias does not exist.
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.alias_exists myfunction myalias | salt/modules/boto_lambda.py | def alias_exists(FunctionName, Name, region=None, key=None,
keyid=None, profile=None):
'''
Given a function name and alias name, check to see if the given alias exists.
Returns True if the given alias exists and returns False if the given
alias does not exist.
CLI Example:
..... | def alias_exists(FunctionName, Name, region=None, key=None,
keyid=None, profile=None):
'''
Given a function name and alias name, check to see if the given alias exists.
Returns True if the given alias exists and returns False if the given
alias does not exist.
CLI Example:
..... | [
"Given",
"a",
"function",
"name",
"and",
"alias",
"name",
"check",
"to",
"see",
"if",
"the",
"given",
"alias",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L737-L758 | [
"def",
"alias_exists",
"(",
"FunctionName",
",",
"Name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"alias",
"=",
"_find_alias",
"(",
"FunctionName",
",",
"Name",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | describe_alias | Given a function name and alias name describe the properties of the alias.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.describe_alias myalias | salt/modules/boto_lambda.py | def describe_alias(FunctionName, Name, region=None, key=None,
keyid=None, profile=None):
'''
Given a function name and alias name describe the properties of the alias.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_... | def describe_alias(FunctionName, Name, region=None, key=None,
keyid=None, profile=None):
'''
Given a function name and alias name describe the properties of the alias.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_... | [
"Given",
"a",
"function",
"name",
"and",
"alias",
"name",
"describe",
"the",
"properties",
"of",
"the",
"alias",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L761-L785 | [
"def",
"describe_alias",
"(",
"FunctionName",
",",
"Name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"alias",
"=",
"_find_alias",
"(",
"FunctionName",
",",
"Name",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_alias | Update the named alias to the configuration.
Returns {updated: true} if the alias was updated and returns
{updated: False} if the alias was not updated.
CLI Example:
.. code-block:: bash
salt myminion boto_lamba.update_alias my_lambda my_alias $LATEST | salt/modules/boto_lambda.py | def update_alias(FunctionName, Name, FunctionVersion=None, Description=None,
region=None, key=None, keyid=None, profile=None):
'''
Update the named alias to the configuration.
Returns {updated: true} if the alias was updated and returns
{updated: False} if the alias was not updated.
... | def update_alias(FunctionName, Name, FunctionVersion=None, Description=None,
region=None, key=None, keyid=None, profile=None):
'''
Update the named alias to the configuration.
Returns {updated: true} if the alias was updated and returns
{updated: False} if the alias was not updated.
... | [
"Update",
"the",
"named",
"alias",
"to",
"the",
"configuration",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L788-L819 | [
"def",
"update_alias",
"(",
"FunctionName",
",",
"Name",
",",
"FunctionVersion",
"=",
"None",
",",
"Description",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_event_source_mapping | Identifies a stream as an event source for a Lambda function. It can be
either an Amazon Kinesis stream or an Amazon DynamoDB stream. AWS Lambda
invokes the specified function when records are posted to the stream.
Returns {created: true} if the event source mapping was created and returns
{created: Fa... | salt/modules/boto_lambda.py | def create_event_source_mapping(EventSourceArn, FunctionName, StartingPosition,
Enabled=True, BatchSize=100,
region=None, key=None, keyid=None, profile=None):
'''
Identifies a stream as an event source for a Lambda function. It can be
either an... | def create_event_source_mapping(EventSourceArn, FunctionName, StartingPosition,
Enabled=True, BatchSize=100,
region=None, key=None, keyid=None, profile=None):
'''
Identifies a stream as an event source for a Lambda function. It can be
either an... | [
"Identifies",
"a",
"stream",
"as",
"an",
"event",
"source",
"for",
"a",
"Lambda",
"function",
".",
"It",
"can",
"be",
"either",
"an",
"Amazon",
"Kinesis",
"stream",
"or",
"an",
"Amazon",
"DynamoDB",
"stream",
".",
"AWS",
"Lambda",
"invokes",
"the",
"specif... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L822-L855 | [
"def",
"create_event_source_mapping",
"(",
"EventSourceArn",
",",
"FunctionName",
",",
"StartingPosition",
",",
"Enabled",
"=",
"True",
",",
"BatchSize",
"=",
"100",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profil... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_event_source_mapping_ids | Given an event source and function name, return a list of mapping IDs
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.get_event_source_mapping_ids arn:::: myfunction | salt/modules/boto_lambda.py | def get_event_source_mapping_ids(EventSourceArn, FunctionName,
region=None, key=None, keyid=None, profile=None):
'''
Given an event source and function name, return a list of mapping IDs
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.get_event_sou... | def get_event_source_mapping_ids(EventSourceArn, FunctionName,
region=None, key=None, keyid=None, profile=None):
'''
Given an event source and function name, return a list of mapping IDs
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.get_event_sou... | [
"Given",
"an",
"event",
"source",
"and",
"function",
"name",
"return",
"a",
"list",
"of",
"mapping",
"IDs"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L858-L881 | [
"def",
"get_event_source_mapping_ids",
"(",
"EventSourceArn",
",",
"FunctionName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_event_source_mapping | Given an event source mapping ID or an event source ARN and FunctionName,
delete the event source mapping
Returns {deleted: true} if the mapping was deleted and returns
{deleted: false} if the mapping was not deleted.
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.delete_eve... | salt/modules/boto_lambda.py | def delete_event_source_mapping(UUID=None, EventSourceArn=None, FunctionName=None,
region=None, key=None, keyid=None, profile=None):
'''
Given an event source mapping ID or an event source ARN and FunctionName,
delete the event source mapping
Returns {deleted: true} if t... | def delete_event_source_mapping(UUID=None, EventSourceArn=None, FunctionName=None,
region=None, key=None, keyid=None, profile=None):
'''
Given an event source mapping ID or an event source ARN and FunctionName,
delete the event source mapping
Returns {deleted: true} if t... | [
"Given",
"an",
"event",
"source",
"mapping",
"ID",
"or",
"an",
"event",
"source",
"ARN",
"and",
"FunctionName",
"delete",
"the",
"event",
"source",
"mapping"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L900-L924 | [
"def",
"delete_event_source_mapping",
"(",
"UUID",
"=",
"None",
",",
"EventSourceArn",
"=",
"None",
",",
"FunctionName",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | event_source_mapping_exists | Given an event source mapping ID or an event source ARN and FunctionName,
check whether the mapping exists.
Returns True if the given alias exists and returns False if the given
alias does not exist.
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.alias_exists myfunction myal... | salt/modules/boto_lambda.py | def event_source_mapping_exists(UUID=None, EventSourceArn=None,
FunctionName=None,
region=None, key=None, keyid=None, profile=None):
'''
Given an event source mapping ID or an event source ARN and FunctionName,
check whether the mapping exists.... | def event_source_mapping_exists(UUID=None, EventSourceArn=None,
FunctionName=None,
region=None, key=None, keyid=None, profile=None):
'''
Given an event source mapping ID or an event source ARN and FunctionName,
check whether the mapping exists.... | [
"Given",
"an",
"event",
"source",
"mapping",
"ID",
"or",
"an",
"event",
"source",
"ARN",
"and",
"FunctionName",
"check",
"whether",
"the",
"mapping",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L927-L952 | [
"def",
"event_source_mapping_exists",
"(",
"UUID",
"=",
"None",
",",
"EventSourceArn",
"=",
"None",
",",
"FunctionName",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | describe_event_source_mapping | Given an event source mapping ID or an event source ARN and FunctionName,
obtain the current settings of that mapping.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_lambda.describe_event_source_mapping uuid | salt/modules/boto_lambda.py | def describe_event_source_mapping(UUID=None, EventSourceArn=None,
FunctionName=None,
region=None, key=None, keyid=None, profile=None):
'''
Given an event source mapping ID or an event source ARN and FunctionName,
obtain the current settings... | def describe_event_source_mapping(UUID=None, EventSourceArn=None,
FunctionName=None,
region=None, key=None, keyid=None, profile=None):
'''
Given an event source mapping ID or an event source ARN and FunctionName,
obtain the current settings... | [
"Given",
"an",
"event",
"source",
"mapping",
"ID",
"or",
"an",
"event",
"source",
"ARN",
"and",
"FunctionName",
"obtain",
"the",
"current",
"settings",
"of",
"that",
"mapping",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L955-L989 | [
"def",
"describe_event_source_mapping",
"(",
"UUID",
"=",
"None",
",",
"EventSourceArn",
"=",
"None",
",",
"FunctionName",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_event_source_mapping | Update the event source mapping identified by the UUID.
Returns {updated: true} if the alias was updated and returns
{updated: False} if the alias was not updated.
CLI Example:
.. code-block:: bash
salt myminion boto_lamba.update_event_source_mapping uuid FunctionName=new_function | salt/modules/boto_lambda.py | def update_event_source_mapping(UUID,
FunctionName=None, Enabled=None, BatchSize=None,
region=None, key=None, keyid=None, profile=None):
'''
Update the event source mapping identified by the UUID.
Returns {updated: true} if the alias was updat... | def update_event_source_mapping(UUID,
FunctionName=None, Enabled=None, BatchSize=None,
region=None, key=None, keyid=None, profile=None):
'''
Update the event source mapping identified by the UUID.
Returns {updated: true} if the alias was updat... | [
"Update",
"the",
"event",
"source",
"mapping",
"identified",
"by",
"the",
"UUID",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L992-L1028 | [
"def",
"update_event_source_mapping",
"(",
"UUID",
",",
"FunctionName",
"=",
"None",
",",
"Enabled",
"=",
"None",
",",
"BatchSize",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update | Update the cache file for the bucket. | salt/fileserver/s3fs.py | def update():
'''
Update the cache file for the bucket.
'''
metadata = _init()
if S3_SYNC_ON_UPDATE:
# sync the buckets to the local cache
log.info('Syncing local cache from S3...')
for saltenv, env_meta in six.iteritems(metadata):
for bucket_files in _find_file... | def update():
'''
Update the cache file for the bucket.
'''
metadata = _init()
if S3_SYNC_ON_UPDATE:
# sync the buckets to the local cache
log.info('Syncing local cache from S3...')
for saltenv, env_meta in six.iteritems(metadata):
for bucket_files in _find_file... | [
"Update",
"the",
"cache",
"file",
"for",
"the",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L121-L141 | [
"def",
"update",
"(",
")",
":",
"metadata",
"=",
"_init",
"(",
")",
"if",
"S3_SYNC_ON_UPDATE",
":",
"# sync the buckets to the local cache",
"log",
".",
"info",
"(",
"'Syncing local cache from S3...'",
")",
"for",
"saltenv",
",",
"env_meta",
"in",
"six",
".",
"i... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | find_file | Look through the buckets cache file for a match.
If the field is found, it is retrieved from S3 only if its cached version
is missing, or if the MD5 does not match. | salt/fileserver/s3fs.py | def find_file(path, saltenv='base', **kwargs):
'''
Look through the buckets cache file for a match.
If the field is found, it is retrieved from S3 only if its cached version
is missing, or if the MD5 does not match.
'''
if 'env' in kwargs:
# "env" is not supported; Use "saltenv".
... | def find_file(path, saltenv='base', **kwargs):
'''
Look through the buckets cache file for a match.
If the field is found, it is retrieved from S3 only if its cached version
is missing, or if the MD5 does not match.
'''
if 'env' in kwargs:
# "env" is not supported; Use "saltenv".
... | [
"Look",
"through",
"the",
"buckets",
"cache",
"file",
"for",
"a",
"match",
".",
"If",
"the",
"field",
"is",
"found",
"it",
"is",
"retrieved",
"from",
"S3",
"only",
"if",
"its",
"cached",
"version",
"is",
"missing",
"or",
"if",
"the",
"MD5",
"does",
"no... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L144-L185 | [
"def",
"find_file",
"(",
"path",
",",
"saltenv",
"=",
"'base'",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'env'",
"in",
"kwargs",
":",
"# \"env\" is not supported; Use \"saltenv\".",
"kwargs",
".",
"pop",
"(",
"'env'",
")",
"fnd",
"=",
"{",
"'bucket'",
":"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | file_hash | Return an MD5 file hash | salt/fileserver/s3fs.py | def file_hash(load, fnd):
'''
Return an MD5 file hash
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
ret = {}
if 'saltenv' not in load:
return ret
if 'path' not in fnd or 'bucket' not in fnd or not fnd['path']:
return ret
... | def file_hash(load, fnd):
'''
Return an MD5 file hash
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
ret = {}
if 'saltenv' not in load:
return ret
if 'path' not in fnd or 'bucket' not in fnd or not fnd['path']:
return ret
... | [
"Return",
"an",
"MD5",
"file",
"hash"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L188-L213 | [
"def",
"file_hash",
"(",
"load",
",",
"fnd",
")",
":",
"if",
"'env'",
"in",
"load",
":",
"# \"env\" is not supported; Use \"saltenv\".",
"load",
".",
"pop",
"(",
"'env'",
")",
"ret",
"=",
"{",
"}",
"if",
"'saltenv'",
"not",
"in",
"load",
":",
"return",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | serve_file | Return a chunk from a file based on the data received | salt/fileserver/s3fs.py | def serve_file(load, fnd):
'''
Return a chunk from a file based on the data received
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
ret = {'data': '',
'dest': ''}
if 'path' not in load or 'loc' not in load or 'saltenv' not in load:
... | def serve_file(load, fnd):
'''
Return a chunk from a file based on the data received
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
ret = {'data': '',
'dest': ''}
if 'path' not in load or 'loc' not in load or 'saltenv' not in load:
... | [
"Return",
"a",
"chunk",
"from",
"a",
"file",
"based",
"on",
"the",
"data",
"received"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L216-L252 | [
"def",
"serve_file",
"(",
"load",
",",
"fnd",
")",
":",
"if",
"'env'",
"in",
"load",
":",
"# \"env\" is not supported; Use \"saltenv\".",
"load",
".",
"pop",
"(",
"'env'",
")",
"ret",
"=",
"{",
"'data'",
":",
"''",
",",
"'dest'",
":",
"''",
"}",
"if",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | file_list | Return a list of all files on the file server in a specified environment | salt/fileserver/s3fs.py | def file_list(load):
'''
Return a list of all files on the file server in a specified environment
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
ret = []
if 'saltenv' not in load:
return ret
saltenv = load['saltenv']
metadata = _... | def file_list(load):
'''
Return a list of all files on the file server in a specified environment
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
ret = []
if 'saltenv' not in load:
return ret
saltenv = load['saltenv']
metadata = _... | [
"Return",
"a",
"list",
"of",
"all",
"files",
"on",
"the",
"file",
"server",
"in",
"a",
"specified",
"environment"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L255-L278 | [
"def",
"file_list",
"(",
"load",
")",
":",
"if",
"'env'",
"in",
"load",
":",
"# \"env\" is not supported; Use \"saltenv\".",
"load",
".",
"pop",
"(",
"'env'",
")",
"ret",
"=",
"[",
"]",
"if",
"'saltenv'",
"not",
"in",
"load",
":",
"return",
"ret",
"saltenv... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | dir_list | Return a list of all directories on the master | salt/fileserver/s3fs.py | def dir_list(load):
'''
Return a list of all directories on the master
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
ret = []
if 'saltenv' not in load:
return ret
saltenv = load['saltenv']
metadata = _init()
if not metadata... | def dir_list(load):
'''
Return a list of all directories on the master
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
ret = []
if 'saltenv' not in load:
return ret
saltenv = load['saltenv']
metadata = _init()
if not metadata... | [
"Return",
"a",
"list",
"of",
"all",
"directories",
"on",
"the",
"master"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L291-L318 | [
"def",
"dir_list",
"(",
"load",
")",
":",
"if",
"'env'",
"in",
"load",
":",
"# \"env\" is not supported; Use \"saltenv\".",
"load",
".",
"pop",
"(",
"'env'",
")",
"ret",
"=",
"[",
"]",
"if",
"'saltenv'",
"not",
"in",
"load",
":",
"return",
"ret",
"saltenv"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_s3_key | Get AWS keys from pillar or config | salt/fileserver/s3fs.py | def _get_s3_key():
'''
Get AWS keys from pillar or config
'''
key = __opts__['s3.key'] if 's3.key' in __opts__ else None
keyid = __opts__['s3.keyid'] if 's3.keyid' in __opts__ else None
service_url = __opts__['s3.service_url'] \
if 's3.service_url' in __opts__ \
else None
ve... | def _get_s3_key():
'''
Get AWS keys from pillar or config
'''
key = __opts__['s3.key'] if 's3.key' in __opts__ else None
keyid = __opts__['s3.keyid'] if 's3.keyid' in __opts__ else None
service_url = __opts__['s3.service_url'] \
if 's3.service_url' in __opts__ \
else None
ve... | [
"Get",
"AWS",
"keys",
"from",
"pillar",
"or",
"config"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L321-L345 | [
"def",
"_get_s3_key",
"(",
")",
":",
"key",
"=",
"__opts__",
"[",
"'s3.key'",
"]",
"if",
"'s3.key'",
"in",
"__opts__",
"else",
"None",
"keyid",
"=",
"__opts__",
"[",
"'s3.keyid'",
"]",
"if",
"'s3.keyid'",
"in",
"__opts__",
"else",
"None",
"service_url",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _init | Connect to S3 and download the metadata for each file in all buckets
specified and cache the data to disk. | salt/fileserver/s3fs.py | def _init():
'''
Connect to S3 and download the metadata for each file in all buckets
specified and cache the data to disk.
'''
cache_file = _get_buckets_cache_filename()
exp = time.time() - S3_CACHE_EXPIRE
# check mtime of the buckets files cache
metadata = None
try:
if os.... | def _init():
'''
Connect to S3 and download the metadata for each file in all buckets
specified and cache the data to disk.
'''
cache_file = _get_buckets_cache_filename()
exp = time.time() - S3_CACHE_EXPIRE
# check mtime of the buckets files cache
metadata = None
try:
if os.... | [
"Connect",
"to",
"S3",
"and",
"download",
"the",
"metadata",
"for",
"each",
"file",
"in",
"all",
"buckets",
"specified",
"and",
"cache",
"the",
"data",
"to",
"disk",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L348-L368 | [
"def",
"_init",
"(",
")",
":",
"cache_file",
"=",
"_get_buckets_cache_filename",
"(",
")",
"exp",
"=",
"time",
".",
"time",
"(",
")",
"-",
"S3_CACHE_EXPIRE",
"# check mtime of the buckets files cache",
"metadata",
"=",
"None",
"try",
":",
"if",
"os",
".",
"pat... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_cached_file_name | Return the cached file name for a bucket path file | salt/fileserver/s3fs.py | def _get_cached_file_name(bucket_name, saltenv, path):
'''
Return the cached file name for a bucket path file
'''
file_path = os.path.join(_get_cache_dir(), saltenv, bucket_name, path)
# make sure bucket and saltenv directories exist
if not os.path.exists(os.path.dirname(file_path)):
o... | def _get_cached_file_name(bucket_name, saltenv, path):
'''
Return the cached file name for a bucket path file
'''
file_path = os.path.join(_get_cache_dir(), saltenv, bucket_name, path)
# make sure bucket and saltenv directories exist
if not os.path.exists(os.path.dirname(file_path)):
o... | [
"Return",
"the",
"cached",
"file",
"name",
"for",
"a",
"bucket",
"path",
"file"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L380-L391 | [
"def",
"_get_cached_file_name",
"(",
"bucket_name",
",",
"saltenv",
",",
"path",
")",
":",
"file_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"_get_cache_dir",
"(",
")",
",",
"saltenv",
",",
"bucket_name",
",",
"path",
")",
"# make sure bucket and saltenv ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_buckets_cache_filename | Return the filename of the cache for bucket contents.
Create the path if it does not exist. | salt/fileserver/s3fs.py | def _get_buckets_cache_filename():
'''
Return the filename of the cache for bucket contents.
Create the path if it does not exist.
'''
cache_dir = _get_cache_dir()
if not os.path.exists(cache_dir):
os.makedirs(cache_dir)
return os.path.join(cache_dir, 'buckets_files.cache') | def _get_buckets_cache_filename():
'''
Return the filename of the cache for bucket contents.
Create the path if it does not exist.
'''
cache_dir = _get_cache_dir()
if not os.path.exists(cache_dir):
os.makedirs(cache_dir)
return os.path.join(cache_dir, 'buckets_files.cache') | [
"Return",
"the",
"filename",
"of",
"the",
"cache",
"for",
"bucket",
"contents",
".",
"Create",
"the",
"path",
"if",
"it",
"does",
"not",
"exist",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L394-L404 | [
"def",
"_get_buckets_cache_filename",
"(",
")",
":",
"cache_dir",
"=",
"_get_cache_dir",
"(",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"cache_dir",
")",
":",
"os",
".",
"makedirs",
"(",
"cache_dir",
")",
"return",
"os",
".",
"path",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _refresh_buckets_cache_file | Retrieve the content of all buckets and cache the metadata to the buckets
cache file | salt/fileserver/s3fs.py | def _refresh_buckets_cache_file(cache_file):
'''
Retrieve the content of all buckets and cache the metadata to the buckets
cache file
'''
log.debug('Refreshing buckets cache file')
key, keyid, service_url, verify_ssl, kms_keyid, location, path_style, https_enable = _get_s3_key()
metadata =... | def _refresh_buckets_cache_file(cache_file):
'''
Retrieve the content of all buckets and cache the metadata to the buckets
cache file
'''
log.debug('Refreshing buckets cache file')
key, keyid, service_url, verify_ssl, kms_keyid, location, path_style, https_enable = _get_s3_key()
metadata =... | [
"Retrieve",
"the",
"content",
"of",
"all",
"buckets",
"and",
"cache",
"the",
"metadata",
"to",
"the",
"buckets",
"cache",
"file"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L407-L553 | [
"def",
"_refresh_buckets_cache_file",
"(",
"cache_file",
")",
":",
"log",
".",
"debug",
"(",
"'Refreshing buckets cache file'",
")",
"key",
",",
"keyid",
",",
"service_url",
",",
"verify_ssl",
",",
"kms_keyid",
",",
"location",
",",
"path_style",
",",
"https_enabl... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _read_buckets_cache_file | Return the contents of the buckets cache file | salt/fileserver/s3fs.py | def _read_buckets_cache_file(cache_file):
'''
Return the contents of the buckets cache file
'''
log.debug('Reading buckets cache file')
with salt.utils.files.fopen(cache_file, 'rb') as fp_:
try:
data = pickle.load(fp_)
except (pickle.UnpicklingError, AttributeError, EOF... | def _read_buckets_cache_file(cache_file):
'''
Return the contents of the buckets cache file
'''
log.debug('Reading buckets cache file')
with salt.utils.files.fopen(cache_file, 'rb') as fp_:
try:
data = pickle.load(fp_)
except (pickle.UnpicklingError, AttributeError, EOF... | [
"Return",
"the",
"contents",
"of",
"the",
"buckets",
"cache",
"file"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L556-L570 | [
"def",
"_read_buckets_cache_file",
"(",
"cache_file",
")",
":",
"log",
".",
"debug",
"(",
"'Reading buckets cache file'",
")",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"cache_file",
",",
"'rb'",
")",
"as",
"fp_",
":",
"try",
":",
"dat... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_files | Looks for all the files in the S3 bucket cache metadata | salt/fileserver/s3fs.py | def _find_files(metadata):
'''
Looks for all the files in the S3 bucket cache metadata
'''
ret = []
found = {}
for bucket_dict in metadata:
for bucket_name, data in six.iteritems(bucket_dict):
filepaths = [k['Key'] for k in data]
filepaths = [k for k in filepath... | def _find_files(metadata):
'''
Looks for all the files in the S3 bucket cache metadata
'''
ret = []
found = {}
for bucket_dict in metadata:
for bucket_name, data in six.iteritems(bucket_dict):
filepaths = [k['Key'] for k in data]
filepaths = [k for k in filepath... | [
"Looks",
"for",
"all",
"the",
"files",
"in",
"the",
"S3",
"bucket",
"cache",
"metadata"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L573-L593 | [
"def",
"_find_files",
"(",
"metadata",
")",
":",
"ret",
"=",
"[",
"]",
"found",
"=",
"{",
"}",
"for",
"bucket_dict",
"in",
"metadata",
":",
"for",
"bucket_name",
",",
"data",
"in",
"six",
".",
"iteritems",
"(",
"bucket_dict",
")",
":",
"filepaths",
"="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_dirs | Looks for all the directories in the S3 bucket cache metadata.
Supports trailing '/' keys (as created by S3 console) as well as
directories discovered in the path of file keys. | salt/fileserver/s3fs.py | def _find_dirs(metadata):
'''
Looks for all the directories in the S3 bucket cache metadata.
Supports trailing '/' keys (as created by S3 console) as well as
directories discovered in the path of file keys.
'''
ret = []
found = {}
for bucket_dict in metadata:
for bucket_name, ... | def _find_dirs(metadata):
'''
Looks for all the directories in the S3 bucket cache metadata.
Supports trailing '/' keys (as created by S3 console) as well as
directories discovered in the path of file keys.
'''
ret = []
found = {}
for bucket_dict in metadata:
for bucket_name, ... | [
"Looks",
"for",
"all",
"the",
"directories",
"in",
"the",
"S3",
"bucket",
"cache",
"metadata",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L596-L625 | [
"def",
"_find_dirs",
"(",
"metadata",
")",
":",
"ret",
"=",
"[",
"]",
"found",
"=",
"{",
"}",
"for",
"bucket_dict",
"in",
"metadata",
":",
"for",
"bucket_name",
",",
"data",
"in",
"six",
".",
"iteritems",
"(",
"bucket_dict",
")",
":",
"dirpaths",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_file_meta | Looks for a file's metadata in the S3 bucket cache file | salt/fileserver/s3fs.py | def _find_file_meta(metadata, bucket_name, saltenv, path):
'''
Looks for a file's metadata in the S3 bucket cache file
'''
env_meta = metadata[saltenv] if saltenv in metadata else {}
bucket_meta = {}
for bucket in env_meta:
if bucket_name in bucket:
bucket_meta = bucket[bucke... | def _find_file_meta(metadata, bucket_name, saltenv, path):
'''
Looks for a file's metadata in the S3 bucket cache file
'''
env_meta = metadata[saltenv] if saltenv in metadata else {}
bucket_meta = {}
for bucket in env_meta:
if bucket_name in bucket:
bucket_meta = bucket[bucke... | [
"Looks",
"for",
"a",
"file",
"s",
"metadata",
"in",
"the",
"S3",
"bucket",
"cache",
"file"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L628-L646 | [
"def",
"_find_file_meta",
"(",
"metadata",
",",
"bucket_name",
",",
"saltenv",
",",
"path",
")",
":",
"env_meta",
"=",
"metadata",
"[",
"saltenv",
"]",
"if",
"saltenv",
"in",
"metadata",
"else",
"{",
"}",
"bucket_meta",
"=",
"{",
"}",
"for",
"bucket",
"i... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_file_from_s3 | Checks the local cache for the file, if it's old or missing go grab the
file from S3 and update the cache | salt/fileserver/s3fs.py | def _get_file_from_s3(metadata, saltenv, bucket_name, path, cached_file_path):
'''
Checks the local cache for the file, if it's old or missing go grab the
file from S3 and update the cache
'''
key, keyid, service_url, verify_ssl, kms_keyid, location, path_style, https_enable = _get_s3_key()
# c... | def _get_file_from_s3(metadata, saltenv, bucket_name, path, cached_file_path):
'''
Checks the local cache for the file, if it's old or missing go grab the
file from S3 and update the cache
'''
key, keyid, service_url, verify_ssl, kms_keyid, location, path_style, https_enable = _get_s3_key()
# c... | [
"Checks",
"the",
"local",
"cache",
"for",
"the",
"file",
"if",
"it",
"s",
"old",
"or",
"missing",
"go",
"grab",
"the",
"file",
"from",
"S3",
"and",
"update",
"the",
"cache"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L657-L736 | [
"def",
"_get_file_from_s3",
"(",
"metadata",
",",
"saltenv",
",",
"bucket_name",
",",
"path",
",",
"cached_file_path",
")",
":",
"key",
",",
"keyid",
",",
"service_url",
",",
"verify_ssl",
",",
"kms_keyid",
",",
"location",
",",
"path_style",
",",
"https_enabl... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _trim_env_off_path | Return a list of file paths with the saltenv directory removed | salt/fileserver/s3fs.py | def _trim_env_off_path(paths, saltenv, trim_slash=False):
'''
Return a list of file paths with the saltenv directory removed
'''
env_len = None if _is_env_per_bucket() else len(saltenv) + 1
slash_len = -1 if trim_slash else None
return [d[env_len:slash_len] for d in paths] | def _trim_env_off_path(paths, saltenv, trim_slash=False):
'''
Return a list of file paths with the saltenv directory removed
'''
env_len = None if _is_env_per_bucket() else len(saltenv) + 1
slash_len = -1 if trim_slash else None
return [d[env_len:slash_len] for d in paths] | [
"Return",
"a",
"list",
"of",
"file",
"paths",
"with",
"the",
"saltenv",
"directory",
"removed"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L739-L746 | [
"def",
"_trim_env_off_path",
"(",
"paths",
",",
"saltenv",
",",
"trim_slash",
"=",
"False",
")",
":",
"env_len",
"=",
"None",
"if",
"_is_env_per_bucket",
"(",
")",
"else",
"len",
"(",
"saltenv",
")",
"+",
"1",
"slash_len",
"=",
"-",
"1",
"if",
"trim_slas... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _is_env_per_bucket | Return the configuration mode, either buckets per environment or a list of
buckets that have environment dirs in their root | salt/fileserver/s3fs.py | def _is_env_per_bucket():
'''
Return the configuration mode, either buckets per environment or a list of
buckets that have environment dirs in their root
'''
buckets = _get_buckets()
if isinstance(buckets, dict):
return True
elif isinstance(buckets, list):
return False
e... | def _is_env_per_bucket():
'''
Return the configuration mode, either buckets per environment or a list of
buckets that have environment dirs in their root
'''
buckets = _get_buckets()
if isinstance(buckets, dict):
return True
elif isinstance(buckets, list):
return False
e... | [
"Return",
"the",
"configuration",
"mode",
"either",
"buckets",
"per",
"environment",
"or",
"a",
"list",
"of",
"buckets",
"that",
"have",
"environment",
"dirs",
"in",
"their",
"root"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L749-L761 | [
"def",
"_is_env_per_bucket",
"(",
")",
":",
"buckets",
"=",
"_get_buckets",
"(",
")",
"if",
"isinstance",
"(",
"buckets",
",",
"dict",
")",
":",
"return",
"True",
"elif",
"isinstance",
"(",
"buckets",
",",
"list",
")",
":",
"return",
"False",
"else",
":"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | find_hosted_zone | Find a hosted zone with the given characteristics.
Id
The unique Zone Identifier for the Hosted Zone. Exclusive with Name.
Name
The domain name associated with the Hosted Zone. Exclusive with Id.
Note this has the potential to match more then one hosted zone (e.g. a public and a priv... | salt/modules/boto3_route53.py | def find_hosted_zone(Id=None, Name=None, PrivateZone=None,
region=None, key=None, keyid=None, profile=None):
'''
Find a hosted zone with the given characteristics.
Id
The unique Zone Identifier for the Hosted Zone. Exclusive with Name.
Name
The domain name associa... | def find_hosted_zone(Id=None, Name=None, PrivateZone=None,
region=None, key=None, keyid=None, profile=None):
'''
Find a hosted zone with the given characteristics.
Id
The unique Zone Identifier for the Hosted Zone. Exclusive with Name.
Name
The domain name associa... | [
"Find",
"a",
"hosted",
"zone",
"with",
"the",
"given",
"characteristics",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L132-L184 | [
"def",
"find_hosted_zone",
"(",
"Id",
"=",
"None",
",",
"Name",
"=",
"None",
",",
"PrivateZone",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"if",
"not",
"_exac... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_hosted_zone | Return detailed info about the given zone.
Id
The unique Zone Identifier for the Hosted Zone.
region
Region to connect to.
key
Secret key to be used.
keyid
Access key to be used.
profile
Dict, or pillar key pointing to a dict, containing AWS region/key/ke... | salt/modules/boto3_route53.py | def get_hosted_zone(Id, region=None, key=None, keyid=None, profile=None):
'''
Return detailed info about the given zone.
Id
The unique Zone Identifier for the Hosted Zone.
region
Region to connect to.
key
Secret key to be used.
keyid
Access key to be used.
... | def get_hosted_zone(Id, region=None, key=None, keyid=None, profile=None):
'''
Return detailed info about the given zone.
Id
The unique Zone Identifier for the Hosted Zone.
region
Region to connect to.
key
Secret key to be used.
keyid
Access key to be used.
... | [
"Return",
"detailed",
"info",
"about",
"the",
"given",
"zone",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L187-L215 | [
"def",
"get_hosted_zone",
"(",
"Id",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_hosted_zones_by_domain | Find any zones with the given domain name and return detailed info about them.
Note that this can return multiple Route53 zones, since a domain name can be used in
both public and private zones.
Name
The domain name associated with the Hosted Zone(s).
region
Region to connect to.
... | salt/modules/boto3_route53.py | def get_hosted_zones_by_domain(Name, region=None, key=None, keyid=None, profile=None):
'''
Find any zones with the given domain name and return detailed info about them.
Note that this can return multiple Route53 zones, since a domain name can be used in
both public and private zones.
Name
... | def get_hosted_zones_by_domain(Name, region=None, key=None, keyid=None, profile=None):
'''
Find any zones with the given domain name and return detailed info about them.
Note that this can return multiple Route53 zones, since a domain name can be used in
both public and private zones.
Name
... | [
"Find",
"any",
"zones",
"with",
"the",
"given",
"domain",
"name",
"and",
"return",
"detailed",
"info",
"about",
"them",
".",
"Note",
"that",
"this",
"can",
"return",
"multiple",
"Route53",
"zones",
"since",
"a",
"domain",
"name",
"can",
"be",
"used",
"in",... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L218-L252 | [
"def",
"get_hosted_zones_by_domain",
"(",
"Name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_hosted_zones | Return detailed info about all zones in the bound account.
DelegationSetId
If you're using reusable delegation sets and you want to list all of the hosted zones that
are associated with a reusable delegation set, specify the ID of that delegation set.
region
Region to connect to.
... | salt/modules/boto3_route53.py | def list_hosted_zones(DelegationSetId=None, region=None, key=None, keyid=None, profile=None):
'''
Return detailed info about all zones in the bound account.
DelegationSetId
If you're using reusable delegation sets and you want to list all of the hosted zones that
are associated with a reusa... | def list_hosted_zones(DelegationSetId=None, region=None, key=None, keyid=None, profile=None):
'''
Return detailed info about all zones in the bound account.
DelegationSetId
If you're using reusable delegation sets and you want to list all of the hosted zones that
are associated with a reusa... | [
"Return",
"detailed",
"info",
"about",
"all",
"zones",
"in",
"the",
"bound",
"account",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L255-L284 | [
"def",
"list_hosted_zones",
"(",
"DelegationSetId",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_hosted_zone | Create a new Route53 Hosted Zone. Returns a Python data structure with information about the
newly created Hosted Zone.
Name
The name of the domain. This should be a fully-specified domain, and should terminate with
a period. This is the name you have registered with your DNS registrar. It is a... | salt/modules/boto3_route53.py | def create_hosted_zone(Name, VPCId=None, VPCName=None, VPCRegion=None, CallerReference=None,
Comment='', PrivateZone=False, DelegationSetId=None,
region=None, key=None, keyid=None, profile=None):
'''
Create a new Route53 Hosted Zone. Returns a Python data structure ... | def create_hosted_zone(Name, VPCId=None, VPCName=None, VPCRegion=None, CallerReference=None,
Comment='', PrivateZone=False, DelegationSetId=None,
region=None, key=None, keyid=None, profile=None):
'''
Create a new Route53 Hosted Zone. Returns a Python data structure ... | [
"Create",
"a",
"new",
"Route53",
"Hosted",
"Zone",
".",
"Returns",
"a",
"Python",
"data",
"structure",
"with",
"information",
"about",
"the",
"newly",
"created",
"Hosted",
"Zone",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L287-L412 | [
"def",
"create_hosted_zone",
"(",
"Name",
",",
"VPCId",
"=",
"None",
",",
"VPCName",
"=",
"None",
",",
"VPCRegion",
"=",
"None",
",",
"CallerReference",
"=",
"None",
",",
"Comment",
"=",
"''",
",",
"PrivateZone",
"=",
"False",
",",
"DelegationSetId",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_hosted_zone_comment | Update the comment on an existing Route 53 hosted zone.
Id
The unique Zone Identifier for the Hosted Zone.
Name
The domain name associated with the Hosted Zone(s).
Comment
Any comments you want to include about the hosted zone.
PrivateZone
Boolean - Set to True if cha... | salt/modules/boto3_route53.py | def update_hosted_zone_comment(Id=None, Name=None, Comment=None, PrivateZone=None,
region=None, key=None, keyid=None, profile=None):
'''
Update the comment on an existing Route 53 hosted zone.
Id
The unique Zone Identifier for the Hosted Zone.
Name
The do... | def update_hosted_zone_comment(Id=None, Name=None, Comment=None, PrivateZone=None,
region=None, key=None, keyid=None, profile=None):
'''
Update the comment on an existing Route 53 hosted zone.
Id
The unique Zone Identifier for the Hosted Zone.
Name
The do... | [
"Update",
"the",
"comment",
"on",
"an",
"existing",
"Route",
"53",
"hosted",
"zone",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L415-L462 | [
"def",
"update_hosted_zone_comment",
"(",
"Id",
"=",
"None",
",",
"Name",
"=",
"None",
",",
"Comment",
"=",
"None",
",",
"PrivateZone",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | associate_vpc_with_hosted_zone | Associates an Amazon VPC with a private hosted zone.
To perform the association, the VPC and the private hosted zone must already exist. You can't
convert a public hosted zone into a private hosted zone. If you want to associate a VPC from
one AWS account with a zone from a another, the AWS account owning... | salt/modules/boto3_route53.py | def associate_vpc_with_hosted_zone(HostedZoneId=None, Name=None, VPCId=None,
VPCName=None, VPCRegion=None, Comment=None,
region=None, key=None, keyid=None, profile=None):
'''
Associates an Amazon VPC with a private hosted zone.
To perfor... | def associate_vpc_with_hosted_zone(HostedZoneId=None, Name=None, VPCId=None,
VPCName=None, VPCRegion=None, Comment=None,
region=None, key=None, keyid=None, profile=None):
'''
Associates an Amazon VPC with a private hosted zone.
To perfor... | [
"Associates",
"an",
"Amazon",
"VPC",
"with",
"a",
"private",
"hosted",
"zone",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L465-L567 | [
"def",
"associate_vpc_with_hosted_zone",
"(",
"HostedZoneId",
"=",
"None",
",",
"Name",
"=",
"None",
",",
"VPCId",
"=",
"None",
",",
"VPCName",
"=",
"None",
",",
"VPCRegion",
"=",
"None",
",",
"Comment",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_hosted_zone | Delete a Route53 hosted zone.
CLI Example::
salt myminion boto3_route53.delete_hosted_zone Z1234567890 | salt/modules/boto3_route53.py | def delete_hosted_zone(Id, region=None, key=None, keyid=None, profile=None):
'''
Delete a Route53 hosted zone.
CLI Example::
salt myminion boto3_route53.delete_hosted_zone Z1234567890
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
try:
r = conn.delet... | def delete_hosted_zone(Id, region=None, key=None, keyid=None, profile=None):
'''
Delete a Route53 hosted zone.
CLI Example::
salt myminion boto3_route53.delete_hosted_zone Z1234567890
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
try:
r = conn.delet... | [
"Delete",
"a",
"Route53",
"hosted",
"zone",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L686-L700 | [
"def",
"delete_hosted_zone",
"(",
"Id",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"key... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_hosted_zone_by_domain | Delete a Route53 hosted zone by domain name, and PrivateZone status if provided.
CLI Example::
salt myminion boto3_route53.delete_hosted_zone_by_domain example.org. | salt/modules/boto3_route53.py | def delete_hosted_zone_by_domain(Name, PrivateZone=None, region=None, key=None, keyid=None,
profile=None):
'''
Delete a Route53 hosted zone by domain name, and PrivateZone status if provided.
CLI Example::
salt myminion boto3_route53.delete_hosted_zone_by_domain ex... | def delete_hosted_zone_by_domain(Name, PrivateZone=None, region=None, key=None, keyid=None,
profile=None):
'''
Delete a Route53 hosted zone by domain name, and PrivateZone status if provided.
CLI Example::
salt myminion boto3_route53.delete_hosted_zone_by_domain ex... | [
"Delete",
"a",
"Route53",
"hosted",
"zone",
"by",
"domain",
"name",
"and",
"PrivateZone",
"status",
"if",
"provided",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L703-L721 | [
"def",
"delete_hosted_zone_by_domain",
"(",
"Name",
",",
"PrivateZone",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"args",
"=",
"{",
"'Name'",
":",
"Name",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | aws_encode | An implementation of the encoding required to suport AWS's domain name
rules defined here__:
.. __: http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html
While AWS's documentation specifies individual ASCII characters which need
to be encoded, we instead just try to force the ... | salt/modules/boto3_route53.py | def aws_encode(x):
'''
An implementation of the encoding required to suport AWS's domain name
rules defined here__:
.. __: http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html
While AWS's documentation specifies individual ASCII characters which need
to be encoded, we... | def aws_encode(x):
'''
An implementation of the encoding required to suport AWS's domain name
rules defined here__:
.. __: http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html
While AWS's documentation specifies individual ASCII characters which need
to be encoded, we... | [
"An",
"implementation",
"of",
"the",
"encoding",
"required",
"to",
"suport",
"AWS",
"s",
"domain",
"name",
"rules",
"defined",
"here__",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L724-L754 | [
"def",
"aws_encode",
"(",
"x",
")",
":",
"ret",
"=",
"None",
"try",
":",
"x",
".",
"encode",
"(",
"'ascii'",
")",
"ret",
"=",
"re",
".",
"sub",
"(",
"r'\\\\x([a-f0-8]{2})'",
",",
"_hexReplace",
",",
"x",
".",
"encode",
"(",
"'unicode_escape'",
")",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _aws_encode_changebatch | helper method to process a change batch & encode the bits which need encoding. | salt/modules/boto3_route53.py | def _aws_encode_changebatch(o):
'''
helper method to process a change batch & encode the bits which need encoding.
'''
change_idx = 0
while change_idx < len(o['Changes']):
o['Changes'][change_idx]['ResourceRecordSet']['Name'] = aws_encode(o['Changes'][change_idx]['ResourceRecordSet']['Name']... | def _aws_encode_changebatch(o):
'''
helper method to process a change batch & encode the bits which need encoding.
'''
change_idx = 0
while change_idx < len(o['Changes']):
o['Changes'][change_idx]['ResourceRecordSet']['Name'] = aws_encode(o['Changes'][change_idx]['ResourceRecordSet']['Name']... | [
"helper",
"method",
"to",
"process",
"a",
"change",
"batch",
"&",
"encode",
"the",
"bits",
"which",
"need",
"encoding",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L757-L772 | [
"def",
"_aws_encode_changebatch",
"(",
"o",
")",
":",
"change_idx",
"=",
"0",
"while",
"change_idx",
"<",
"len",
"(",
"o",
"[",
"'Changes'",
"]",
")",
":",
"o",
"[",
"'Changes'",
"]",
"[",
"change_idx",
"]",
"[",
"'ResourceRecordSet'",
"]",
"[",
"'Name'"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_resource_records | Get all resource records from a given zone matching the provided StartRecordName (if given) or all
records in the zone (if not), optionally filtered by a specific StartRecordType. This will return
any and all RRs matching, regardless of their special AWS flavors (weighted, geolocation, alias,
etc.) so your... | salt/modules/boto3_route53.py | def get_resource_records(HostedZoneId=None, Name=None, StartRecordName=None,
StartRecordType=None, PrivateZone=None,
region=None, key=None, keyid=None, profile=None):
'''
Get all resource records from a given zone matching the provided StartRecordName (if given)... | def get_resource_records(HostedZoneId=None, Name=None, StartRecordName=None,
StartRecordType=None, PrivateZone=None,
region=None, key=None, keyid=None, profile=None):
'''
Get all resource records from a given zone matching the provided StartRecordName (if given)... | [
"Get",
"all",
"resource",
"records",
"from",
"a",
"given",
"zone",
"matching",
"the",
"provided",
"StartRecordName",
"(",
"if",
"given",
")",
"or",
"all",
"records",
"in",
"the",
"zone",
"(",
"if",
"not",
")",
"optionally",
"filtered",
"by",
"a",
"specific... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L814-L901 | [
"def",
"get_resource_records",
"(",
"HostedZoneId",
"=",
"None",
",",
"Name",
"=",
"None",
",",
"StartRecordName",
"=",
"None",
",",
"StartRecordType",
"=",
"None",
",",
"PrivateZone",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | change_resource_record_sets | See the `AWS Route53 API docs`__ as well as the `Boto3 documentation`__ for all the details...
.. __: https://docs.aws.amazon.com/Route53/latest/APIReference/API_ChangeResourceRecordSets.html
.. __: http://boto3.readthedocs.io/en/latest/reference/services/route53.html#Route53.Client.change_resource_record_sets... | salt/modules/boto3_route53.py | def change_resource_record_sets(HostedZoneId=None, Name=None,
PrivateZone=None, ChangeBatch=None,
region=None, key=None, keyid=None, profile=None):
'''
See the `AWS Route53 API docs`__ as well as the `Boto3 documentation`__ for all the details...
... | def change_resource_record_sets(HostedZoneId=None, Name=None,
PrivateZone=None, ChangeBatch=None,
region=None, key=None, keyid=None, profile=None):
'''
See the `AWS Route53 API docs`__ as well as the `Boto3 documentation`__ for all the details...
... | [
"See",
"the",
"AWS",
"Route53",
"API",
"docs",
"__",
"as",
"well",
"as",
"the",
"Boto3",
"documentation",
"__",
"for",
"all",
"the",
"details",
"..."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L904-L1002 | [
"def",
"change_resource_record_sets",
"(",
"HostedZoneId",
"=",
"None",
",",
"Name",
"=",
"None",
",",
"PrivateZone",
"=",
"None",
",",
"ChangeBatch",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"prof... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mask_args_value | Mask a line in the data, which matches "mask".
This can be used for cases where values in your roster file may contain
sensitive data such as IP addresses, passwords, user names, etc.
Note that this works only when ``data`` is a single string (i.e. when the
data in the roster is formatted as ``key: va... | salt/utils/sanitizers.py | def mask_args_value(data, mask):
'''
Mask a line in the data, which matches "mask".
This can be used for cases where values in your roster file may contain
sensitive data such as IP addresses, passwords, user names, etc.
Note that this works only when ``data`` is a single string (i.e. when the
... | def mask_args_value(data, mask):
'''
Mask a line in the data, which matches "mask".
This can be used for cases where values in your roster file may contain
sensitive data such as IP addresses, passwords, user names, etc.
Note that this works only when ``data`` is a single string (i.e. when the
... | [
"Mask",
"a",
"line",
"in",
"the",
"data",
"which",
"matches",
"mask",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/sanitizers.py#L69-L95 | [
"def",
"mask_args_value",
"(",
"data",
",",
"mask",
")",
":",
"if",
"not",
"mask",
":",
"return",
"data",
"out",
"=",
"[",
"]",
"for",
"line",
"in",
"data",
".",
"split",
"(",
"os",
".",
"linesep",
")",
":",
"if",
"fnmatch",
".",
"fnmatch",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | InputSanitizer.trim | Raise an exception if value is empty. Otherwise strip it down.
:param value:
:return: | salt/utils/sanitizers.py | def trim(value):
'''
Raise an exception if value is empty. Otherwise strip it down.
:param value:
:return:
'''
value = (value or '').strip()
if not value:
raise CommandExecutionError("Empty value during sanitation")
return six.text_type(value) | def trim(value):
'''
Raise an exception if value is empty. Otherwise strip it down.
:param value:
:return:
'''
value = (value or '').strip()
if not value:
raise CommandExecutionError("Empty value during sanitation")
return six.text_type(value) | [
"Raise",
"an",
"exception",
"if",
"value",
"is",
"empty",
".",
"Otherwise",
"strip",
"it",
"down",
".",
":",
"param",
"value",
":",
":",
"return",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/sanitizers.py#L31-L41 | [
"def",
"trim",
"(",
"value",
")",
":",
"value",
"=",
"(",
"value",
"or",
"''",
")",
".",
"strip",
"(",
")",
"if",
"not",
"value",
":",
"raise",
"CommandExecutionError",
"(",
"\"Empty value during sanitation\"",
")",
"return",
"six",
".",
"text_type",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | InputSanitizer.filename | Remove everything that would affect paths in the filename
:param value:
:return: | salt/utils/sanitizers.py | def filename(value):
'''
Remove everything that would affect paths in the filename
:param value:
:return:
'''
return re.sub('[^a-zA-Z0-9.-_ ]', '', os.path.basename(InputSanitizer.trim(value))) | def filename(value):
'''
Remove everything that would affect paths in the filename
:param value:
:return:
'''
return re.sub('[^a-zA-Z0-9.-_ ]', '', os.path.basename(InputSanitizer.trim(value))) | [
"Remove",
"everything",
"that",
"would",
"affect",
"paths",
"in",
"the",
"filename"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/sanitizers.py#L44-L51 | [
"def",
"filename",
"(",
"value",
")",
":",
"return",
"re",
".",
"sub",
"(",
"'[^a-zA-Z0-9.-_ ]'",
",",
"''",
",",
"os",
".",
"path",
".",
"basename",
"(",
"InputSanitizer",
".",
"trim",
"(",
"value",
")",
")",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_all_eip_addresses | Get all EIP's associated with the current credentials.
addresses
(list) - Optional list of addresses. If provided, only those those in the
list will be returned.
allocation_ids
(list) - Optional list of allocation IDs. If provided, only the
addresses associated with the given ... | salt/modules/boto_ec2.py | def _get_all_eip_addresses(addresses=None, allocation_ids=None, region=None,
key=None, keyid=None, profile=None):
'''
Get all EIP's associated with the current credentials.
addresses
(list) - Optional list of addresses. If provided, only those those in the
list w... | def _get_all_eip_addresses(addresses=None, allocation_ids=None, region=None,
key=None, keyid=None, profile=None):
'''
Get all EIP's associated with the current credentials.
addresses
(list) - Optional list of addresses. If provided, only those those in the
list w... | [
"Get",
"all",
"EIP",
"s",
"associated",
"with",
"the",
"current",
"credentials",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L99-L120 | [
"def",
"_get_all_eip_addresses",
"(",
"addresses",
"=",
"None",
",",
"allocation_ids",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"r... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_all_eip_addresses | Get public addresses of some, or all EIPs associated with the current account.
addresses
(list) - Optional list of addresses. If provided, only the addresses
associated with those in the list will be returned.
allocation_ids
(list) - Optional list of allocation IDs. If provided, only ... | salt/modules/boto_ec2.py | def get_all_eip_addresses(addresses=None, allocation_ids=None, region=None,
key=None, keyid=None, profile=None):
'''
Get public addresses of some, or all EIPs associated with the current account.
addresses
(list) - Optional list of addresses. If provided, only the addres... | def get_all_eip_addresses(addresses=None, allocation_ids=None, region=None,
key=None, keyid=None, profile=None):
'''
Get public addresses of some, or all EIPs associated with the current account.
addresses
(list) - Optional list of addresses. If provided, only the addres... | [
"Get",
"public",
"addresses",
"of",
"some",
"or",
"all",
"EIPs",
"associated",
"with",
"the",
"current",
"account",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L123-L147 | [
"def",
"get_all_eip_addresses",
"(",
"addresses",
"=",
"None",
",",
"allocation_ids",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"return",
"[",
"x",
".",
"public_i... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_unassociated_eip_address | Return the first unassociated EIP
domain
Indicates whether the address is an EC2 address or a VPC address
(standard|vpc).
CLI Example:
.. code-block:: bash
salt-call boto_ec2.get_unassociated_eip_address
.. versionadded:: 2016.3.0 | salt/modules/boto_ec2.py | def get_unassociated_eip_address(domain='standard', region=None, key=None,
keyid=None, profile=None):
'''
Return the first unassociated EIP
domain
Indicates whether the address is an EC2 address or a VPC address
(standard|vpc).
CLI Example:
.. code... | def get_unassociated_eip_address(domain='standard', region=None, key=None,
keyid=None, profile=None):
'''
Return the first unassociated EIP
domain
Indicates whether the address is an EC2 address or a VPC address
(standard|vpc).
CLI Example:
.. code... | [
"Return",
"the",
"first",
"unassociated",
"EIP"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L150-L194 | [
"def",
"get_unassociated_eip_address",
"(",
"domain",
"=",
"'standard'",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"eip",
"=",
"None",
"for",
"address",
"in",
"get_all_eip_address... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_eip_address_info | Get 'interesting' info about some, or all EIPs associated with the current account.
addresses
(list) - Optional list of addresses. If provided, only the addresses
associated with those in the list will be returned.
allocation_ids
(list) - Optional list of allocation IDs. If provided, ... | salt/modules/boto_ec2.py | def get_eip_address_info(addresses=None, allocation_ids=None, region=None, key=None,
keyid=None, profile=None):
'''
Get 'interesting' info about some, or all EIPs associated with the current account.
addresses
(list) - Optional list of addresses. If provided, only the addr... | def get_eip_address_info(addresses=None, allocation_ids=None, region=None, key=None,
keyid=None, profile=None):
'''
Get 'interesting' info about some, or all EIPs associated with the current account.
addresses
(list) - Optional list of addresses. If provided, only the addr... | [
"Get",
"interesting",
"info",
"about",
"some",
"or",
"all",
"EIPs",
"associated",
"with",
"the",
"current",
"account",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L197-L232 | [
"def",
"get_eip_address_info",
"(",
"addresses",
"=",
"None",
",",
"allocation_ids",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"if",
"type",
"(",
"addresses",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | allocate_eip_address | Allocate a new Elastic IP address and associate it with your account.
domain
(string) Optional param - if set to exactly 'vpc', the address will be
allocated to the VPC. The default simply maps the EIP to your
account container.
returns
(dict) dict of 'interesting' information... | salt/modules/boto_ec2.py | def allocate_eip_address(domain=None, region=None, key=None, keyid=None, profile=None):
'''
Allocate a new Elastic IP address and associate it with your account.
domain
(string) Optional param - if set to exactly 'vpc', the address will be
allocated to the VPC. The default simply maps the ... | def allocate_eip_address(domain=None, region=None, key=None, keyid=None, profile=None):
'''
Allocate a new Elastic IP address and associate it with your account.
domain
(string) Optional param - if set to exactly 'vpc', the address will be
allocated to the VPC. The default simply maps the ... | [
"Allocate",
"a",
"new",
"Elastic",
"IP",
"address",
"and",
"associate",
"it",
"with",
"your",
"account",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L235-L272 | [
"def",
"allocate_eip_address",
"(",
"domain",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"if",
"domain",
"and",
"domain",
"!=",
"'vpc'",
":",
"raise",
"SaltInvocat... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | release_eip_address | Free an Elastic IP address. Pass either a public IP address to release an
EC2 Classic EIP, or an AllocationId to release a VPC EIP.
public_ip
(string) - The public IP address - for EC2 elastic IPs.
allocation_id
(string) - The Allocation ID - for VPC elastic IPs.
returns
(bool... | salt/modules/boto_ec2.py | def release_eip_address(public_ip=None, allocation_id=None, region=None, key=None,
keyid=None, profile=None):
'''
Free an Elastic IP address. Pass either a public IP address to release an
EC2 Classic EIP, or an AllocationId to release a VPC EIP.
public_ip
(string) - The... | def release_eip_address(public_ip=None, allocation_id=None, region=None, key=None,
keyid=None, profile=None):
'''
Free an Elastic IP address. Pass either a public IP address to release an
EC2 Classic EIP, or an AllocationId to release a VPC EIP.
public_ip
(string) - The... | [
"Free",
"an",
"Elastic",
"IP",
"address",
".",
"Pass",
"either",
"a",
"public",
"IP",
"address",
"to",
"release",
"an",
"EC2",
"Classic",
"EIP",
"or",
"an",
"AllocationId",
"to",
"release",
"a",
"VPC",
"EIP",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L275-L307 | [
"def",
"release_eip_address",
"(",
"public_ip",
"=",
"None",
",",
"allocation_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"if",
"not",
"salt",
".",
"utils",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | associate_eip_address | Associate an Elastic IP address with a currently running instance or a network interface.
This requires exactly one of either 'public_ip' or 'allocation_id', depending
on whether you’re associating a VPC address or a plain EC2 address.
instance_id
(string) – ID of the instance to associate with (ex... | salt/modules/boto_ec2.py | def associate_eip_address(instance_id=None, instance_name=None, public_ip=None,
allocation_id=None, network_interface_id=None,
network_interface_name=None, private_ip_address=None,
allow_reassociation=False, region=None, key=None,
... | def associate_eip_address(instance_id=None, instance_name=None, public_ip=None,
allocation_id=None, network_interface_id=None,
network_interface_name=None, private_ip_address=None,
allow_reassociation=False, region=None, key=None,
... | [
"Associate",
"an",
"Elastic",
"IP",
"address",
"with",
"a",
"currently",
"running",
"instance",
"or",
"a",
"network",
"interface",
".",
"This",
"requires",
"exactly",
"one",
"of",
"either",
"public_ip",
"or",
"allocation_id",
"depending",
"on",
"whether",
"you’r... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L310-L393 | [
"def",
"associate_eip_address",
"(",
"instance_id",
"=",
"None",
",",
"instance_name",
"=",
"None",
",",
"public_ip",
"=",
"None",
",",
"allocation_id",
"=",
"None",
",",
"network_interface_id",
"=",
"None",
",",
"network_interface_name",
"=",
"None",
",",
"priv... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | disassociate_eip_address | Disassociate an Elastic IP address from a currently running instance. This
requires exactly one of either 'association_id' or 'public_ip', depending
on whether you’re dealing with a VPC or EC2 Classic address.
public_ip
(string) – Public IP address, for EC2 Classic allocations.
association_id
... | salt/modules/boto_ec2.py | def disassociate_eip_address(public_ip=None, association_id=None, region=None,
key=None, keyid=None, profile=None):
'''
Disassociate an Elastic IP address from a currently running instance. This
requires exactly one of either 'association_id' or 'public_ip', depending
on whe... | def disassociate_eip_address(public_ip=None, association_id=None, region=None,
key=None, keyid=None, profile=None):
'''
Disassociate an Elastic IP address from a currently running instance. This
requires exactly one of either 'association_id' or 'public_ip', depending
on whe... | [
"Disassociate",
"an",
"Elastic",
"IP",
"address",
"from",
"a",
"currently",
"running",
"instance",
".",
"This",
"requires",
"exactly",
"one",
"of",
"either",
"association_id",
"or",
"public_ip",
"depending",
"on",
"whether",
"you’re",
"dealing",
"with",
"a",
"VP... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L396-L425 | [
"def",
"disassociate_eip_address",
"(",
"public_ip",
"=",
"None",
",",
"association_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | assign_private_ip_addresses | Assigns one or more secondary private IP addresses to a network interface.
network_interface_id
(string) - ID of the network interface to associate the IP with (exclusive with 'network_interface_name')
network_interface_name
(string) - Name of the network interface to associate the IP with (exc... | salt/modules/boto_ec2.py | def assign_private_ip_addresses(network_interface_name=None, network_interface_id=None,
private_ip_addresses=None, secondary_private_ip_address_count=None,
allow_reassignment=False, region=None, key=None,
keyid=None, profile... | def assign_private_ip_addresses(network_interface_name=None, network_interface_id=None,
private_ip_addresses=None, secondary_private_ip_address_count=None,
allow_reassignment=False, region=None, key=None,
keyid=None, profile... | [
"Assigns",
"one",
"or",
"more",
"secondary",
"private",
"IP",
"addresses",
"to",
"a",
"network",
"interface",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L428-L485 | [
"def",
"assign_private_ip_addresses",
"(",
"network_interface_name",
"=",
"None",
",",
"network_interface_id",
"=",
"None",
",",
"private_ip_addresses",
"=",
"None",
",",
"secondary_private_ip_address_count",
"=",
"None",
",",
"allow_reassignment",
"=",
"False",
",",
"r... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_zones | Get a list of AZs for the configured region.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_zones | salt/modules/boto_ec2.py | def get_zones(region=None, key=None, keyid=None, profile=None):
'''
Get a list of AZs for the configured region.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_zones
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
return [z.name for z in c... | def get_zones(region=None, key=None, keyid=None, profile=None):
'''
Get a list of AZs for the configured region.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_zones
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
return [z.name for z in c... | [
"Get",
"a",
"list",
"of",
"AZs",
"for",
"the",
"configured",
"region",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L540-L552 | [
"def",
"get_zones",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",
"=",
"keyid",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | find_instances | Given instance properties, find and return matching instance ids
CLI Examples:
.. code-block:: bash
salt myminion boto_ec2.find_instances # Lists all instances
salt myminion boto_ec2.find_instances name=myinstance
salt myminion boto_ec2.find_instances tags='{"mytag": "value"}'
... | salt/modules/boto_ec2.py | def find_instances(instance_id=None, name=None, tags=None, region=None,
key=None, keyid=None, profile=None, return_objs=False,
in_states=None, filters=None):
'''
Given instance properties, find and return matching instance ids
CLI Examples:
.. code-block:: bash
... | def find_instances(instance_id=None, name=None, tags=None, region=None,
key=None, keyid=None, profile=None, return_objs=False,
in_states=None, filters=None):
'''
Given instance properties, find and return matching instance ids
CLI Examples:
.. code-block:: bash
... | [
"Given",
"instance",
"properties",
"find",
"and",
"return",
"matching",
"instance",
"ids"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L555-L609 | [
"def",
"find_instances",
"(",
"instance_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"return_objs",
"=",
"False... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_image | Given instance properties that define exactly one instance, create AMI and return AMI-id.
CLI Examples:
.. code-block:: bash
salt myminion boto_ec2.create_image ami_name instance_name=myinstance
salt myminion boto_ec2.create_image another_ami_name tags='{"mytag": "value"}' description='this i... | salt/modules/boto_ec2.py | def create_image(ami_name, instance_id=None, instance_name=None, tags=None, region=None,
key=None, keyid=None, profile=None, description=None, no_reboot=False,
dry_run=False, filters=None):
'''
Given instance properties that define exactly one instance, create AMI and return AM... | def create_image(ami_name, instance_id=None, instance_name=None, tags=None, region=None,
key=None, keyid=None, profile=None, description=None, no_reboot=False,
dry_run=False, filters=None):
'''
Given instance properties that define exactly one instance, create AMI and return AM... | [
"Given",
"instance",
"properties",
"that",
"define",
"exactly",
"one",
"instance",
"create",
"AMI",
"and",
"return",
"AMI",
"-",
"id",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L612-L644 | [
"def",
"create_image",
"(",
"ami_name",
",",
"instance_id",
"=",
"None",
",",
"instance_name",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"d... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | find_images | Given image properties, find and return matching AMI ids
CLI Examples:
.. code-block:: bash
salt myminion boto_ec2.find_images tags='{"mytag": "value"}' | salt/modules/boto_ec2.py | def find_images(ami_name=None, executable_by=None, owners=None, image_ids=None, tags=None,
region=None, key=None, keyid=None, profile=None, return_objs=False):
'''
Given image properties, find and return matching AMI ids
CLI Examples:
.. code-block:: bash
salt myminion boto_e... | def find_images(ami_name=None, executable_by=None, owners=None, image_ids=None, tags=None,
region=None, key=None, keyid=None, profile=None, return_objs=False):
'''
Given image properties, find and return matching AMI ids
CLI Examples:
.. code-block:: bash
salt myminion boto_e... | [
"Given",
"image",
"properties",
"find",
"and",
"return",
"matching",
"AMI",
"ids"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L647-L693 | [
"def",
"find_images",
"(",
"ami_name",
"=",
"None",
",",
"executable_by",
"=",
"None",
",",
"owners",
"=",
"None",
",",
"image_ids",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | terminate | Terminate the instance described by instance_id or name.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.terminate name=myinstance
salt myminion boto_ec2.terminate instance_id=i-a46b9f | salt/modules/boto_ec2.py | def terminate(instance_id=None, name=None, region=None,
key=None, keyid=None, profile=None, filters=None):
'''
Terminate the instance described by instance_id or name.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.terminate name=myinstance
salt myminion boto_e... | def terminate(instance_id=None, name=None, region=None,
key=None, keyid=None, profile=None, filters=None):
'''
Terminate the instance described by instance_id or name.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.terminate name=myinstance
salt myminion boto_e... | [
"Terminate",
"the",
"instance",
"described",
"by",
"instance_id",
"or",
"name",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L696-L720 | [
"def",
"terminate",
"(",
"instance_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"filters",
"=",
"None",
")",
":",
"instances",
"=",
"fi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_id | Given instance properties, return the instance id if it exists.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_id myinstance | salt/modules/boto_ec2.py | def get_id(name=None, tags=None, region=None, key=None,
keyid=None, profile=None, in_states=None, filters=None):
'''
Given instance properties, return the instance id if it exists.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_id myinstance
'''
instance_ids... | def get_id(name=None, tags=None, region=None, key=None,
keyid=None, profile=None, in_states=None, filters=None):
'''
Given instance properties, return the instance id if it exists.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_id myinstance
'''
instance_ids... | [
"Given",
"instance",
"properties",
"return",
"the",
"instance",
"id",
"if",
"it",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L723-L748 | [
"def",
"get_id",
"(",
"name",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"in_states",
"=",
"None",
",",
"filters",
"=",
"None",
")",
":"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_tags | Given an instance_id, return a list of tags associated with that instance.
returns
(list) - list of tags as key/value pairs
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_tags instance_id | salt/modules/boto_ec2.py | def get_tags(instance_id=None, keyid=None, key=None, profile=None,
region=None):
'''
Given an instance_id, return a list of tags associated with that instance.
returns
(list) - list of tags as key/value pairs
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.g... | def get_tags(instance_id=None, keyid=None, key=None, profile=None,
region=None):
'''
Given an instance_id, return a list of tags associated with that instance.
returns
(list) - list of tags as key/value pairs
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.g... | [
"Given",
"an",
"instance_id",
"return",
"a",
"list",
"of",
"tags",
"associated",
"with",
"that",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L751-L773 | [
"def",
"get_tags",
"(",
"instance_id",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"key",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"region",
"=",
"None",
")",
":",
"tags",
"=",
"[",
"]",
"client",
"=",
"_get_conn",
"(",
"key",
"=",
"key",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | exists | Given an instance id, check to see if the given instance id exists.
Returns True if the given instance with the given id, name, or tags
exists; otherwise, False is returned.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.exists myinstance | salt/modules/boto_ec2.py | def exists(instance_id=None, name=None, tags=None, region=None, key=None,
keyid=None, profile=None, in_states=None, filters=None):
'''
Given an instance id, check to see if the given instance id exists.
Returns True if the given instance with the given id, name, or tags
exists; otherwise, Fa... | def exists(instance_id=None, name=None, tags=None, region=None, key=None,
keyid=None, profile=None, in_states=None, filters=None):
'''
Given an instance id, check to see if the given instance id exists.
Returns True if the given instance with the given id, name, or tags
exists; otherwise, Fa... | [
"Given",
"an",
"instance",
"id",
"check",
"to",
"see",
"if",
"the",
"given",
"instance",
"id",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L776-L798 | [
"def",
"exists",
"(",
"instance_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"in_states",
"=",
"None",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _to_blockdev_map | Convert a string, or a json payload, or a dict in the right
format, into a boto.ec2.blockdevicemapping.BlockDeviceMapping as
needed by instance_present(). The following YAML is a direct
representation of what is expected by the underlying boto EC2 code.
YAML example:
.. code-block:: yaml
... | salt/modules/boto_ec2.py | def _to_blockdev_map(thing):
'''
Convert a string, or a json payload, or a dict in the right
format, into a boto.ec2.blockdevicemapping.BlockDeviceMapping as
needed by instance_present(). The following YAML is a direct
representation of what is expected by the underlying boto EC2 code.
YAML ex... | def _to_blockdev_map(thing):
'''
Convert a string, or a json payload, or a dict in the right
format, into a boto.ec2.blockdevicemapping.BlockDeviceMapping as
needed by instance_present(). The following YAML is a direct
representation of what is expected by the underlying boto EC2 code.
YAML ex... | [
"Convert",
"a",
"string",
"or",
"a",
"json",
"payload",
"or",
"a",
"dict",
"in",
"the",
"right",
"format",
"into",
"a",
"boto",
".",
"ec2",
".",
"blockdevicemapping",
".",
"BlockDeviceMapping",
"as",
"needed",
"by",
"instance_present",
"()",
".",
"The",
"f... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L801-L851 | [
"def",
"_to_blockdev_map",
"(",
"thing",
")",
":",
"if",
"not",
"thing",
":",
"return",
"None",
"if",
"isinstance",
"(",
"thing",
",",
"BlockDeviceMapping",
")",
":",
"return",
"thing",
"if",
"isinstance",
"(",
"thing",
",",
"six",
".",
"string_types",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | run | Create and start an EC2 instance.
Returns True if the instance was created; otherwise False.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.run ami-b80c2b87 name=myinstance
image_id
(string) – The ID of the image to run.
name
(string) - The name of the instance... | salt/modules/boto_ec2.py | def run(image_id, name=None, tags=None, key_name=None, security_groups=None,
user_data=None, instance_type='m1.small', placement=None,
kernel_id=None, ramdisk_id=None, monitoring_enabled=None, vpc_id=None,
vpc_name=None, subnet_id=None, subnet_name=None, private_ip_address=None,
block_de... | def run(image_id, name=None, tags=None, key_name=None, security_groups=None,
user_data=None, instance_type='m1.small', placement=None,
kernel_id=None, ramdisk_id=None, monitoring_enabled=None, vpc_id=None,
vpc_name=None, subnet_id=None, subnet_name=None, private_ip_address=None,
block_de... | [
"Create",
"and",
"start",
"an",
"EC2",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L854-L1081 | [
"def",
"run",
"(",
"image_id",
",",
"name",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"key_name",
"=",
"None",
",",
"security_groups",
"=",
"None",
",",
"user_data",
"=",
"None",
",",
"instance_type",
"=",
"'m1.small'",
",",
"placement",
"=",
"None",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_key | Check to see if a key exists. Returns fingerprint and name if
it does and False if it doesn't
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_key mykey | salt/modules/boto_ec2.py | def get_key(key_name, region=None, key=None, keyid=None, profile=None):
'''
Check to see if a key exists. Returns fingerprint and name if
it does and False if it doesn't
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_key mykey
'''
conn = _get_conn(region=region, key=k... | def get_key(key_name, region=None, key=None, keyid=None, profile=None):
'''
Check to see if a key exists. Returns fingerprint and name if
it does and False if it doesn't
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_key mykey
'''
conn = _get_conn(region=region, key=k... | [
"Check",
"to",
"see",
"if",
"a",
"key",
"exists",
".",
"Returns",
"fingerprint",
"and",
"name",
"if",
"it",
"does",
"and",
"False",
"if",
"it",
"doesn",
"t",
"CLI",
"Example",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1084-L1104 | [
"def",
"get_key",
"(",
"key_name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_key | Creates a key and saves it to a given path.
Returns the private key.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.create_key mykey /root/ | salt/modules/boto_ec2.py | def create_key(key_name, save_path, region=None, key=None, keyid=None,
profile=None):
'''
Creates a key and saves it to a given path.
Returns the private key.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.create_key mykey /root/
'''
conn = _get_conn(regio... | def create_key(key_name, save_path, region=None, key=None, keyid=None,
profile=None):
'''
Creates a key and saves it to a given path.
Returns the private key.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.create_key mykey /root/
'''
conn = _get_conn(regio... | [
"Creates",
"a",
"key",
"and",
"saves",
"it",
"to",
"a",
"given",
"path",
".",
"Returns",
"the",
"private",
"key",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1107-L1128 | [
"def",
"create_key",
"(",
"key_name",
",",
"save_path",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | import_key | Imports the public key from an RSA key pair that you created with a third-party tool.
Supported formats:
- OpenSSH public key format (e.g., the format in ~/.ssh/authorized_keys)
- Base64 encoded DER format
- SSH public key file format as specified in RFC4716
- DSA keys are not supported. Make sure y... | salt/modules/boto_ec2.py | def import_key(key_name, public_key_material, region=None, key=None,
keyid=None, profile=None):
'''
Imports the public key from an RSA key pair that you created with a third-party tool.
Supported formats:
- OpenSSH public key format (e.g., the format in ~/.ssh/authorized_keys)
- Base6... | def import_key(key_name, public_key_material, region=None, key=None,
keyid=None, profile=None):
'''
Imports the public key from an RSA key pair that you created with a third-party tool.
Supported formats:
- OpenSSH public key format (e.g., the format in ~/.ssh/authorized_keys)
- Base6... | [
"Imports",
"the",
"public",
"key",
"from",
"an",
"RSA",
"key",
"pair",
"that",
"you",
"created",
"with",
"a",
"third",
"-",
"party",
"tool",
".",
"Supported",
"formats",
":",
"-",
"OpenSSH",
"public",
"key",
"format",
"(",
"e",
".",
"g",
".",
"the",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1131-L1156 | [
"def",
"import_key",
"(",
"key_name",
",",
"public_key_material",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_key | Deletes a key. Always returns True
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.delete_key mykey | salt/modules/boto_ec2.py | def delete_key(key_name, region=None, key=None, keyid=None, profile=None):
'''
Deletes a key. Always returns True
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.delete_key mykey
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
try:
key ... | def delete_key(key_name, region=None, key=None, keyid=None, profile=None):
'''
Deletes a key. Always returns True
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.delete_key mykey
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
try:
key ... | [
"Deletes",
"a",
"key",
".",
"Always",
"returns",
"True"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1159-L1177 | [
"def",
"delete_key",
"(",
"key_name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_keys | Gets all keys or filters them by name and returns a list.
keynames (list):: A list of the names of keypairs to retrieve.
If not provided, all key pairs will be returned.
filters (dict) :: Optional filters that can be used to limit the
results returned. Filters are provided in the form of a dictionary
... | salt/modules/boto_ec2.py | def get_keys(keynames=None, filters=None, region=None, key=None,
keyid=None, profile=None):
'''
Gets all keys or filters them by name and returns a list.
keynames (list):: A list of the names of keypairs to retrieve.
If not provided, all key pairs will be returned.
filters (dict) :: Opt... | def get_keys(keynames=None, filters=None, region=None, key=None,
keyid=None, profile=None):
'''
Gets all keys or filters them by name and returns a list.
keynames (list):: A list of the names of keypairs to retrieve.
If not provided, all key pairs will be returned.
filters (dict) :: Opt... | [
"Gets",
"all",
"keys",
"or",
"filters",
"them",
"by",
"name",
"and",
"returns",
"a",
"list",
".",
"keynames",
"(",
"list",
")",
"::",
"A",
"list",
"of",
"the",
"names",
"of",
"keypairs",
"to",
"retrieve",
".",
"If",
"not",
"provided",
"all",
"key",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1180-L1210 | [
"def",
"get_keys",
"(",
"keynames",
"=",
"None",
",",
"filters",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"regi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.