id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
33,400 | saltstack/salt | salt/cloud/__init__.py | CloudClient.profile | def profile(self, profile, names, vm_overrides=None, **kwargs):
'''
Pass in a profile to create, names is a list of vm names to allocate
vm_overrides is a special dict that will be per node options
overrides
Example:
.. code-block:: python
>>> clie... | python | def profile(self, profile, names, vm_overrides=None, **kwargs):
'''
Pass in a profile to create, names is a list of vm names to allocate
vm_overrides is a special dict that will be per node options
overrides
Example:
.. code-block:: python
>>> clie... | [
"def",
"profile",
"(",
"self",
",",
"profile",
",",
"names",
",",
"vm_overrides",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"vm_overrides",
":",
"vm_overrides",
"=",
"{",
"}",
"kwargs",
"[",
"'profile'",
"]",
"=",
"profile",
"mapper"... | Pass in a profile to create, names is a list of vm names to allocate
vm_overrides is a special dict that will be per node options
overrides
Example:
.. code-block:: python
>>> client= salt.cloud.CloudClient(path='/etc/salt/cloud')
>>> client.profile('d... | [
"Pass",
"in",
"a",
"profile",
"to",
"create",
"names",
"is",
"a",
"list",
"of",
"vm",
"names",
"to",
"allocate"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L326-L366 |
33,401 | saltstack/salt | salt/cloud/__init__.py | CloudClient.map_run | def map_run(self, path=None, **kwargs):
'''
To execute a map
'''
kwarg = {}
if path:
kwarg['map'] = path
kwarg.update(kwargs)
mapper = salt.cloud.Map(self._opts_defaults(**kwarg))
dmap = mapper.map_data()
return salt.utils.data.simple_t... | python | def map_run(self, path=None, **kwargs):
'''
To execute a map
'''
kwarg = {}
if path:
kwarg['map'] = path
kwarg.update(kwargs)
mapper = salt.cloud.Map(self._opts_defaults(**kwarg))
dmap = mapper.map_data()
return salt.utils.data.simple_t... | [
"def",
"map_run",
"(",
"self",
",",
"path",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"kwarg",
"=",
"{",
"}",
"if",
"path",
":",
"kwarg",
"[",
"'map'",
"]",
"=",
"path",
"kwarg",
".",
"update",
"(",
"kwargs",
")",
"mapper",
"=",
"salt",
"... | To execute a map | [
"To",
"execute",
"a",
"map"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L368-L380 |
33,402 | saltstack/salt | salt/cloud/__init__.py | CloudClient.create | def create(self, provider, names, **kwargs):
'''
Create the named VMs, without using a profile
Example:
.. code-block:: python
client.create(provider='my-ec2-config', names=['myinstance'],
image='ami-1624987f', size='t1.micro', ssh_username='ec2-user',
... | python | def create(self, provider, names, **kwargs):
'''
Create the named VMs, without using a profile
Example:
.. code-block:: python
client.create(provider='my-ec2-config', names=['myinstance'],
image='ami-1624987f', size='t1.micro', ssh_username='ec2-user',
... | [
"def",
"create",
"(",
"self",
",",
"provider",
",",
"names",
",",
"*",
"*",
"kwargs",
")",
":",
"mapper",
"=",
"salt",
".",
"cloud",
".",
"Map",
"(",
"self",
".",
"_opts_defaults",
"(",
")",
")",
"providers",
"=",
"self",
".",
"opts",
"[",
"'provid... | Create the named VMs, without using a profile
Example:
.. code-block:: python
client.create(provider='my-ec2-config', names=['myinstance'],
image='ami-1624987f', size='t1.micro', ssh_username='ec2-user',
securitygroup='default', delvol_on_destroy=True) | [
"Create",
"the",
"named",
"VMs",
"without",
"using",
"a",
"profile"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L393-L430 |
33,403 | saltstack/salt | salt/cloud/__init__.py | CloudClient.extra_action | def extra_action(self, names, provider, action, **kwargs):
'''
Perform actions with block storage devices
Example:
.. code-block:: python
client.extra_action(names=['myblock'], action='volume_create',
provider='my-nova', kwargs={'voltype': 'SSD', 'size': 10... | python | def extra_action(self, names, provider, action, **kwargs):
'''
Perform actions with block storage devices
Example:
.. code-block:: python
client.extra_action(names=['myblock'], action='volume_create',
provider='my-nova', kwargs={'voltype': 'SSD', 'size': 10... | [
"def",
"extra_action",
"(",
"self",
",",
"names",
",",
"provider",
",",
"action",
",",
"*",
"*",
"kwargs",
")",
":",
"mapper",
"=",
"salt",
".",
"cloud",
".",
"Map",
"(",
"self",
".",
"_opts_defaults",
"(",
")",
")",
"providers",
"=",
"mapper",
".",
... | Perform actions with block storage devices
Example:
.. code-block:: python
client.extra_action(names=['myblock'], action='volume_create',
provider='my-nova', kwargs={'voltype': 'SSD', 'size': 1000}
)
client.extra_action(names=['salt-net'], action='n... | [
"Perform",
"actions",
"with",
"block",
"storage",
"devices"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L432-L466 |
33,404 | saltstack/salt | salt/cloud/__init__.py | CloudClient.action | def action(
self,
fun=None,
cloudmap=None,
names=None,
provider=None,
instance=None,
kwargs=None
):
'''
Execute a single action via the cloud plugin backend
Examples:
.. code-block:: python
client.action(fun='show... | python | def action(
self,
fun=None,
cloudmap=None,
names=None,
provider=None,
instance=None,
kwargs=None
):
'''
Execute a single action via the cloud plugin backend
Examples:
.. code-block:: python
client.action(fun='show... | [
"def",
"action",
"(",
"self",
",",
"fun",
"=",
"None",
",",
"cloudmap",
"=",
"None",
",",
"names",
"=",
"None",
",",
"provider",
"=",
"None",
",",
"instance",
"=",
"None",
",",
"kwargs",
"=",
"None",
")",
":",
"if",
"kwargs",
"is",
"None",
":",
"... | Execute a single action via the cloud plugin backend
Examples:
.. code-block:: python
client.action(fun='show_instance', names=['myinstance'])
client.action(fun='show_image', provider='my-ec2-config',
kwargs={'image': 'ami-10314d79'}
) | [
"Execute",
"a",
"single",
"action",
"via",
"the",
"cloud",
"plugin",
"backend"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L468-L518 |
33,405 | saltstack/salt | salt/cloud/__init__.py | Cloud.get_configured_providers | def get_configured_providers(self):
'''
Return the configured providers
'''
providers = set()
for alias, drivers in six.iteritems(self.opts['providers']):
if len(drivers) > 1:
for driver in drivers:
providers.add('{0}:{1}'.format(al... | python | def get_configured_providers(self):
'''
Return the configured providers
'''
providers = set()
for alias, drivers in six.iteritems(self.opts['providers']):
if len(drivers) > 1:
for driver in drivers:
providers.add('{0}:{1}'.format(al... | [
"def",
"get_configured_providers",
"(",
"self",
")",
":",
"providers",
"=",
"set",
"(",
")",
"for",
"alias",
",",
"drivers",
"in",
"six",
".",
"iteritems",
"(",
"self",
".",
"opts",
"[",
"'providers'",
"]",
")",
":",
"if",
"len",
"(",
"drivers",
")",
... | Return the configured providers | [
"Return",
"the",
"configured",
"providers"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L532-L543 |
33,406 | saltstack/salt | salt/cloud/__init__.py | Cloud.lookup_providers | def lookup_providers(self, lookup):
'''
Get a dict describing the configured providers
'''
if lookup is None:
lookup = 'all'
if lookup == 'all':
providers = set()
for alias, drivers in six.iteritems(self.opts['providers']):
for ... | python | def lookup_providers(self, lookup):
'''
Get a dict describing the configured providers
'''
if lookup is None:
lookup = 'all'
if lookup == 'all':
providers = set()
for alias, drivers in six.iteritems(self.opts['providers']):
for ... | [
"def",
"lookup_providers",
"(",
"self",
",",
"lookup",
")",
":",
"if",
"lookup",
"is",
"None",
":",
"lookup",
"=",
"'all'",
"if",
"lookup",
"==",
"'all'",
":",
"providers",
"=",
"set",
"(",
")",
"for",
"alias",
",",
"drivers",
"in",
"six",
".",
"iter... | Get a dict describing the configured providers | [
"Get",
"a",
"dict",
"describing",
"the",
"configured",
"providers"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L545-L587 |
33,407 | saltstack/salt | salt/cloud/__init__.py | Cloud.lookup_profiles | def lookup_profiles(self, provider, lookup):
'''
Return a dictionary describing the configured profiles
'''
if provider is None:
provider = 'all'
if lookup is None:
lookup = 'all'
if lookup == 'all':
profiles = set()
provid... | python | def lookup_profiles(self, provider, lookup):
'''
Return a dictionary describing the configured profiles
'''
if provider is None:
provider = 'all'
if lookup is None:
lookup = 'all'
if lookup == 'all':
profiles = set()
provid... | [
"def",
"lookup_profiles",
"(",
"self",
",",
"provider",
",",
"lookup",
")",
":",
"if",
"provider",
"is",
"None",
":",
"provider",
"=",
"'all'",
"if",
"lookup",
"is",
"None",
":",
"lookup",
"=",
"'all'",
"if",
"lookup",
"==",
"'all'",
":",
"profiles",
"... | Return a dictionary describing the configured profiles | [
"Return",
"a",
"dictionary",
"describing",
"the",
"configured",
"profiles"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L589-L621 |
33,408 | saltstack/salt | salt/cloud/__init__.py | Cloud._optimize_providers | def _optimize_providers(self, providers):
'''
Return an optimized mapping of available providers
'''
new_providers = {}
provider_by_driver = {}
for alias, driver in six.iteritems(providers):
for name, data in six.iteritems(driver):
if name not... | python | def _optimize_providers(self, providers):
'''
Return an optimized mapping of available providers
'''
new_providers = {}
provider_by_driver = {}
for alias, driver in six.iteritems(providers):
for name, data in six.iteritems(driver):
if name not... | [
"def",
"_optimize_providers",
"(",
"self",
",",
"providers",
")",
":",
"new_providers",
"=",
"{",
"}",
"provider_by_driver",
"=",
"{",
"}",
"for",
"alias",
",",
"driver",
"in",
"six",
".",
"iteritems",
"(",
"providers",
")",
":",
"for",
"name",
",",
"dat... | Return an optimized mapping of available providers | [
"Return",
"an",
"optimized",
"mapping",
"of",
"available",
"providers"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L763-L795 |
33,409 | saltstack/salt | salt/cloud/__init__.py | Cloud.profile_list | def profile_list(self, provider, lookup='all'):
'''
Return a mapping of all configured profiles
'''
data = {}
lookups = self.lookup_profiles(provider, lookup)
if not lookups:
return data
for alias, driver in lookups:
if alias not in data:... | python | def profile_list(self, provider, lookup='all'):
'''
Return a mapping of all configured profiles
'''
data = {}
lookups = self.lookup_profiles(provider, lookup)
if not lookups:
return data
for alias, driver in lookups:
if alias not in data:... | [
"def",
"profile_list",
"(",
"self",
",",
"provider",
",",
"lookup",
"=",
"'all'",
")",
":",
"data",
"=",
"{",
"}",
"lookups",
"=",
"self",
".",
"lookup_profiles",
"(",
"provider",
",",
"lookup",
")",
"if",
"not",
"lookups",
":",
"return",
"data",
"for"... | Return a mapping of all configured profiles | [
"Return",
"a",
"mapping",
"of",
"all",
"configured",
"profiles"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L928-L943 |
33,410 | saltstack/salt | salt/cloud/__init__.py | Cloud.reboot | def reboot(self, names):
'''
Reboot the named VMs
'''
ret = []
pmap = self.map_providers_parallel()
acts = {}
for prov, nodes in six.iteritems(pmap):
acts[prov] = []
for node in nodes:
if node in names:
a... | python | def reboot(self, names):
'''
Reboot the named VMs
'''
ret = []
pmap = self.map_providers_parallel()
acts = {}
for prov, nodes in six.iteritems(pmap):
acts[prov] = []
for node in nodes:
if node in names:
a... | [
"def",
"reboot",
"(",
"self",
",",
"names",
")",
":",
"ret",
"=",
"[",
"]",
"pmap",
"=",
"self",
".",
"map_providers_parallel",
"(",
")",
"acts",
"=",
"{",
"}",
"for",
"prov",
",",
"nodes",
"in",
"six",
".",
"iteritems",
"(",
"pmap",
")",
":",
"a... | Reboot the named VMs | [
"Reboot",
"the",
"named",
"VMs"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1140-L1159 |
33,411 | saltstack/salt | salt/cloud/__init__.py | Cloud.vm_config | def vm_config(name, main, provider, profile, overrides):
'''
Create vm config.
:param str name: The name of the vm
:param dict main: The main cloud config
:param dict provider: The provider config
:param dict profile: The profile config
:param dict overrides: The... | python | def vm_config(name, main, provider, profile, overrides):
'''
Create vm config.
:param str name: The name of the vm
:param dict main: The main cloud config
:param dict provider: The provider config
:param dict profile: The profile config
:param dict overrides: The... | [
"def",
"vm_config",
"(",
"name",
",",
"main",
",",
"provider",
",",
"profile",
",",
"overrides",
")",
":",
"vm",
"=",
"main",
".",
"copy",
"(",
")",
"vm",
"=",
"salt",
".",
"utils",
".",
"dictupdate",
".",
"update",
"(",
"vm",
",",
"provider",
")",... | Create vm config.
:param str name: The name of the vm
:param dict main: The main cloud config
:param dict provider: The provider config
:param dict profile: The profile config
:param dict overrides: The vm's config overrides | [
"Create",
"vm",
"config",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1319-L1334 |
33,412 | saltstack/salt | salt/cloud/__init__.py | Cloud.run_profile | def run_profile(self, profile, names, vm_overrides=None):
'''
Parse over the options passed on the command line and determine how to
handle them
'''
if profile not in self.opts['profiles']:
msg = 'Profile {0} is not defined'.format(profile)
log.error(msg)
... | python | def run_profile(self, profile, names, vm_overrides=None):
'''
Parse over the options passed on the command line and determine how to
handle them
'''
if profile not in self.opts['profiles']:
msg = 'Profile {0} is not defined'.format(profile)
log.error(msg)
... | [
"def",
"run_profile",
"(",
"self",
",",
"profile",
",",
"names",
",",
"vm_overrides",
"=",
"None",
")",
":",
"if",
"profile",
"not",
"in",
"self",
".",
"opts",
"[",
"'profiles'",
"]",
":",
"msg",
"=",
"'Profile {0} is not defined'",
".",
"format",
"(",
"... | Parse over the options passed on the command line and determine how to
handle them | [
"Parse",
"over",
"the",
"options",
"passed",
"on",
"the",
"command",
"line",
"and",
"determine",
"how",
"to",
"handle",
"them"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1366-L1453 |
33,413 | saltstack/salt | salt/cloud/__init__.py | Cloud.do_action | def do_action(self, names, kwargs):
'''
Perform an action on a VM which may be specific to this cloud provider
'''
ret = {}
invalid_functions = {}
names = set(names)
for alias, drivers in six.iteritems(self.map_providers_parallel()):
if not names:
... | python | def do_action(self, names, kwargs):
'''
Perform an action on a VM which may be specific to this cloud provider
'''
ret = {}
invalid_functions = {}
names = set(names)
for alias, drivers in six.iteritems(self.map_providers_parallel()):
if not names:
... | [
"def",
"do_action",
"(",
"self",
",",
"names",
",",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"invalid_functions",
"=",
"{",
"}",
"names",
"=",
"set",
"(",
"names",
")",
"for",
"alias",
",",
"drivers",
"in",
"six",
".",
"iteritems",
"(",
"self",
".... | Perform an action on a VM which may be specific to this cloud provider | [
"Perform",
"an",
"action",
"on",
"a",
"VM",
"which",
"may",
"be",
"specific",
"to",
"this",
"cloud",
"provider"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1455-L1547 |
33,414 | saltstack/salt | salt/cloud/__init__.py | Cloud.do_function | def do_function(self, prov, func, kwargs):
'''
Perform a function against a cloud provider
'''
matches = self.lookup_providers(prov)
if len(matches) > 1:
raise SaltCloudSystemExit(
'More than one results matched \'{0}\'. Please specify '
... | python | def do_function(self, prov, func, kwargs):
'''
Perform a function against a cloud provider
'''
matches = self.lookup_providers(prov)
if len(matches) > 1:
raise SaltCloudSystemExit(
'More than one results matched \'{0}\'. Please specify '
... | [
"def",
"do_function",
"(",
"self",
",",
"prov",
",",
"func",
",",
"kwargs",
")",
":",
"matches",
"=",
"self",
".",
"lookup_providers",
"(",
"prov",
")",
"if",
"len",
"(",
"matches",
")",
">",
"1",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'More than one... | Perform a function against a cloud provider | [
"Perform",
"a",
"function",
"against",
"a",
"cloud",
"provider"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1549-L1595 |
33,415 | saltstack/salt | salt/cloud/__init__.py | Cloud.__filter_non_working_providers | def __filter_non_working_providers(self):
'''
Remove any mis-configured cloud providers from the available listing
'''
for alias, drivers in six.iteritems(self.opts['providers'].copy()):
for driver in drivers.copy():
fun = '{0}.get_configured_provider'.format(... | python | def __filter_non_working_providers(self):
'''
Remove any mis-configured cloud providers from the available listing
'''
for alias, drivers in six.iteritems(self.opts['providers'].copy()):
for driver in drivers.copy():
fun = '{0}.get_configured_provider'.format(... | [
"def",
"__filter_non_working_providers",
"(",
"self",
")",
":",
"for",
"alias",
",",
"drivers",
"in",
"six",
".",
"iteritems",
"(",
"self",
".",
"opts",
"[",
"'providers'",
"]",
".",
"copy",
"(",
")",
")",
":",
"for",
"driver",
"in",
"drivers",
".",
"c... | Remove any mis-configured cloud providers from the available listing | [
"Remove",
"any",
"mis",
"-",
"configured",
"cloud",
"providers",
"from",
"the",
"available",
"listing"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1597-L1643 |
33,416 | saltstack/salt | salt/modules/gpg.py | _get_user_info | def _get_user_info(user=None):
'''
Wrapper for user.info Salt function
'''
if not user:
# Get user Salt runnining as
user = __salt__['config.option']('user')
userinfo = __salt__['user.info'](user)
if not userinfo:
if user == 'salt':
# Special case with `salt... | python | def _get_user_info(user=None):
'''
Wrapper for user.info Salt function
'''
if not user:
# Get user Salt runnining as
user = __salt__['config.option']('user')
userinfo = __salt__['user.info'](user)
if not userinfo:
if user == 'salt':
# Special case with `salt... | [
"def",
"_get_user_info",
"(",
"user",
"=",
"None",
")",
":",
"if",
"not",
"user",
":",
"# Get user Salt runnining as",
"user",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"'user'",
")",
"userinfo",
"=",
"__salt__",
"[",
"'user.info'",
"]",
"(",
"user"... | Wrapper for user.info Salt function | [
"Wrapper",
"for",
"user",
".",
"info",
"Salt",
"function"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L104-L122 |
33,417 | saltstack/salt | salt/modules/gpg.py | _get_user_gnupghome | def _get_user_gnupghome(user):
'''
Return default GnuPG home directory path for a user
'''
if user == 'salt':
gnupghome = os.path.join(__salt__['config.get']('config_dir'), 'gpgkeys')
else:
gnupghome = os.path.join(_get_user_info(user)['home'], '.gnupg')
return gnupghome | python | def _get_user_gnupghome(user):
'''
Return default GnuPG home directory path for a user
'''
if user == 'salt':
gnupghome = os.path.join(__salt__['config.get']('config_dir'), 'gpgkeys')
else:
gnupghome = os.path.join(_get_user_info(user)['home'], '.gnupg')
return gnupghome | [
"def",
"_get_user_gnupghome",
"(",
"user",
")",
":",
"if",
"user",
"==",
"'salt'",
":",
"gnupghome",
"=",
"os",
".",
"path",
".",
"join",
"(",
"__salt__",
"[",
"'config.get'",
"]",
"(",
"'config_dir'",
")",
",",
"'gpgkeys'",
")",
"else",
":",
"gnupghome"... | Return default GnuPG home directory path for a user | [
"Return",
"default",
"GnuPG",
"home",
"directory",
"path",
"for",
"a",
"user"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L125-L134 |
33,418 | saltstack/salt | salt/modules/gpg.py | _create_gpg | def _create_gpg(user=None, gnupghome=None):
'''
Create the GPG object
'''
if not gnupghome:
gnupghome = _get_user_gnupghome(user)
if GPG_1_3_1:
gpg = gnupg.GPG(homedir=gnupghome)
else:
gpg = gnupg.GPG(gnupghome=gnupghome)
return gpg | python | def _create_gpg(user=None, gnupghome=None):
'''
Create the GPG object
'''
if not gnupghome:
gnupghome = _get_user_gnupghome(user)
if GPG_1_3_1:
gpg = gnupg.GPG(homedir=gnupghome)
else:
gpg = gnupg.GPG(gnupghome=gnupghome)
return gpg | [
"def",
"_create_gpg",
"(",
"user",
"=",
"None",
",",
"gnupghome",
"=",
"None",
")",
":",
"if",
"not",
"gnupghome",
":",
"gnupghome",
"=",
"_get_user_gnupghome",
"(",
"user",
")",
"if",
"GPG_1_3_1",
":",
"gpg",
"=",
"gnupg",
".",
"GPG",
"(",
"homedir",
... | Create the GPG object | [
"Create",
"the",
"GPG",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L176-L188 |
33,419 | saltstack/salt | salt/modules/gpg.py | _list_keys | def _list_keys(user=None, gnupghome=None, secret=False):
'''
Helper function for Listing keys
'''
gpg = _create_gpg(user, gnupghome)
_keys = gpg.list_keys(secret)
return _keys | python | def _list_keys(user=None, gnupghome=None, secret=False):
'''
Helper function for Listing keys
'''
gpg = _create_gpg(user, gnupghome)
_keys = gpg.list_keys(secret)
return _keys | [
"def",
"_list_keys",
"(",
"user",
"=",
"None",
",",
"gnupghome",
"=",
"None",
",",
"secret",
"=",
"False",
")",
":",
"gpg",
"=",
"_create_gpg",
"(",
"user",
",",
"gnupghome",
")",
"_keys",
"=",
"gpg",
".",
"list_keys",
"(",
"secret",
")",
"return",
"... | Helper function for Listing keys | [
"Helper",
"function",
"for",
"Listing",
"keys"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L191-L197 |
33,420 | saltstack/salt | salt/modules/gpg.py | _search_keys | def _search_keys(text, keyserver, user=None):
'''
Helper function for searching keys from keyserver
'''
gpg = _create_gpg(user)
if keyserver:
_keys = gpg.search_keys(text, keyserver)
else:
_keys = gpg.search_keys(text)
return _keys | python | def _search_keys(text, keyserver, user=None):
'''
Helper function for searching keys from keyserver
'''
gpg = _create_gpg(user)
if keyserver:
_keys = gpg.search_keys(text, keyserver)
else:
_keys = gpg.search_keys(text)
return _keys | [
"def",
"_search_keys",
"(",
"text",
",",
"keyserver",
",",
"user",
"=",
"None",
")",
":",
"gpg",
"=",
"_create_gpg",
"(",
"user",
")",
"if",
"keyserver",
":",
"_keys",
"=",
"gpg",
".",
"search_keys",
"(",
"text",
",",
"keyserver",
")",
"else",
":",
"... | Helper function for searching keys from keyserver | [
"Helper",
"function",
"for",
"searching",
"keys",
"from",
"keyserver"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L200-L209 |
33,421 | saltstack/salt | salt/modules/gpg.py | search_keys | def search_keys(text, keyserver=None, user=None):
'''
Search keys from keyserver
text
Text to search the keyserver for, e.g. email address, keyID or fingerprint.
keyserver
Keyserver to use for searching for GPG keys, defaults to pgp.mit.edu.
user
Which user's keychain to a... | python | def search_keys(text, keyserver=None, user=None):
'''
Search keys from keyserver
text
Text to search the keyserver for, e.g. email address, keyID or fingerprint.
keyserver
Keyserver to use for searching for GPG keys, defaults to pgp.mit.edu.
user
Which user's keychain to a... | [
"def",
"search_keys",
"(",
"text",
",",
"keyserver",
"=",
"None",
",",
"user",
"=",
"None",
")",
":",
"if",
"GPG_1_3_1",
":",
"raise",
"SaltInvocationError",
"(",
"'The search_keys function is not support with this version of python-gnupg.'",
")",
"else",
":",
"if",
... | Search keys from keyserver
text
Text to search the keyserver for, e.g. email address, keyID or fingerprint.
keyserver
Keyserver to use for searching for GPG keys, defaults to pgp.mit.edu.
user
Which user's keychain to access, defaults to user Salt is running as.
Passing th... | [
"Search",
"keys",
"from",
"keyserver"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L212-L262 |
33,422 | saltstack/salt | salt/modules/gpg.py | list_keys | def list_keys(user=None, gnupghome=None):
'''
List keys in GPG keychain
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
``/etc/salt/gpgkeys``.
gnupghome
Specify the location... | python | def list_keys(user=None, gnupghome=None):
'''
List keys in GPG keychain
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
``/etc/salt/gpgkeys``.
gnupghome
Specify the location... | [
"def",
"list_keys",
"(",
"user",
"=",
"None",
",",
"gnupghome",
"=",
"None",
")",
":",
"_keys",
"=",
"[",
"]",
"for",
"_key",
"in",
"_list_keys",
"(",
"user",
",",
"gnupghome",
")",
":",
"tmp",
"=",
"{",
"'keyid'",
":",
"_key",
"[",
"'keyid'",
"]",... | List keys in GPG keychain
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
``/etc/salt/gpgkeys``.
gnupghome
Specify the location where GPG keyring and related files are stored.
... | [
"List",
"keys",
"in",
"GPG",
"keychain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L265-L309 |
33,423 | saltstack/salt | salt/modules/gpg.py | create_key | def create_key(key_type='RSA',
key_length=1024,
name_real='Autogenerated Key',
name_comment='Generated by SaltStack',
name_email=None,
subkey_type=None,
subkey_length=None,
expire_date=None,
use_passp... | python | def create_key(key_type='RSA',
key_length=1024,
name_real='Autogenerated Key',
name_comment='Generated by SaltStack',
name_email=None,
subkey_type=None,
subkey_length=None,
expire_date=None,
use_passp... | [
"def",
"create_key",
"(",
"key_type",
"=",
"'RSA'",
",",
"key_length",
"=",
"1024",
",",
"name_real",
"=",
"'Autogenerated Key'",
",",
"name_comment",
"=",
"'Generated by SaltStack'",
",",
"name_email",
"=",
"None",
",",
"subkey_type",
"=",
"None",
",",
"subkey_... | Create a key in the GPG keychain
.. note::
GPG key generation requires *a lot* of entropy and randomness.
Difficult to do over a remote connection, consider having
another process available which is generating randomness for
the machine. Also especially difficult on virtual machin... | [
"Create",
"a",
"key",
"in",
"the",
"GPG",
"keychain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L360-L477 |
33,424 | saltstack/salt | salt/modules/gpg.py | import_key | def import_key(text=None,
filename=None,
user=None,
gnupghome=None):
r'''
Import a key from text or file
text
The text containing to import.
filename
The filename containing the key to import.
user
Which user's keychain to acces... | python | def import_key(text=None,
filename=None,
user=None,
gnupghome=None):
r'''
Import a key from text or file
text
The text containing to import.
filename
The filename containing the key to import.
user
Which user's keychain to acces... | [
"def",
"import_key",
"(",
"text",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"user",
"=",
"None",
",",
"gnupghome",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'res'",
":",
"True",
",",
"'message'",
":",
"''",
"}",
"gpg",
"=",
"_create_gpg",
"(",... | r'''
Import a key from text or file
text
The text containing to import.
filename
The filename containing the key to import.
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
... | [
"r",
"Import",
"a",
"key",
"from",
"text",
"or",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L683-L755 |
33,425 | saltstack/salt | salt/modules/gpg.py | export_key | def export_key(keyids=None, secret=False, user=None, gnupghome=None):
'''
Export a key from the GPG keychain
keyids
The key ID(s) of the key(s) to be exported. Can be specified as a comma
separated string or a list. Anything which GnuPG itself accepts to
identify a key - for example... | python | def export_key(keyids=None, secret=False, user=None, gnupghome=None):
'''
Export a key from the GPG keychain
keyids
The key ID(s) of the key(s) to be exported. Can be specified as a comma
separated string or a list. Anything which GnuPG itself accepts to
identify a key - for example... | [
"def",
"export_key",
"(",
"keyids",
"=",
"None",
",",
"secret",
"=",
"False",
",",
"user",
"=",
"None",
",",
"gnupghome",
"=",
"None",
")",
":",
"gpg",
"=",
"_create_gpg",
"(",
"user",
",",
"gnupghome",
")",
"if",
"isinstance",
"(",
"keyids",
",",
"s... | Export a key from the GPG keychain
keyids
The key ID(s) of the key(s) to be exported. Can be specified as a comma
separated string or a list. Anything which GnuPG itself accepts to
identify a key - for example, the key ID or the fingerprint could be
used.
secret
Export ... | [
"Export",
"a",
"key",
"from",
"the",
"GPG",
"keychain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L758-L794 |
33,426 | saltstack/salt | salt/modules/gpg.py | trust_key | def trust_key(keyid=None,
fingerprint=None,
trust_level=None,
user=None):
'''
Set the trust level for a key in GPG keychain
keyid
The keyid of the key to set the trust level for.
fingerprint
The fingerprint of the key to set the trust level for... | python | def trust_key(keyid=None,
fingerprint=None,
trust_level=None,
user=None):
'''
Set the trust level for a key in GPG keychain
keyid
The keyid of the key to set the trust level for.
fingerprint
The fingerprint of the key to set the trust level for... | [
"def",
"trust_key",
"(",
"keyid",
"=",
"None",
",",
"fingerprint",
"=",
"None",
",",
"trust_level",
"=",
"None",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'res'",
":",
"True",
",",
"'message'",
":",
"''",
"}",
"_VALID_TRUST_LEVELS",
"=",
... | Set the trust level for a key in GPG keychain
keyid
The keyid of the key to set the trust level for.
fingerprint
The fingerprint of the key to set the trust level for.
trust_level
The trust level to set for the specified key, must be one
of the following:
expired, ... | [
"Set",
"the",
"trust",
"level",
"for",
"a",
"key",
"in",
"GPG",
"keychain"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L854-L951 |
33,427 | saltstack/salt | salt/modules/gpg.py | sign | def sign(user=None,
keyid=None,
text=None,
filename=None,
output=None,
use_passphrase=False,
gnupghome=None):
'''
Sign message or file
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`... | python | def sign(user=None,
keyid=None,
text=None,
filename=None,
output=None,
use_passphrase=False,
gnupghome=None):
'''
Sign message or file
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`... | [
"def",
"sign",
"(",
"user",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"text",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"output",
"=",
"None",
",",
"use_passphrase",
"=",
"False",
",",
"gnupghome",
"=",
"None",
")",
":",
"gpg",
"=",
"_crea... | Sign message or file
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
``/etc/salt/gpgkeys``.
keyid
The keyid of the key to set the trust level for, defaults to
first key in t... | [
"Sign",
"message",
"or",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L954-L1027 |
33,428 | saltstack/salt | salt/modules/gpg.py | verify | def verify(text=None,
user=None,
filename=None,
gnupghome=None,
signature=None,
trustmodel=None):
'''
Verify a message or file
text
The text to verify.
filename
The filename to verify.
user
Which user's keychain to acc... | python | def verify(text=None,
user=None,
filename=None,
gnupghome=None,
signature=None,
trustmodel=None):
'''
Verify a message or file
text
The text to verify.
filename
The filename to verify.
user
Which user's keychain to acc... | [
"def",
"verify",
"(",
"text",
"=",
"None",
",",
"user",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"gnupghome",
"=",
"None",
",",
"signature",
"=",
"None",
",",
"trustmodel",
"=",
"None",
")",
":",
"gpg",
"=",
"_create_gpg",
"(",
"user",
")",
... | Verify a message or file
text
The text to verify.
filename
The filename to verify.
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
``/etc/salt/gpgkeys``.
gnupghome... | [
"Verify",
"a",
"message",
"or",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L1030-L1117 |
33,429 | saltstack/salt | salt/modules/gpg.py | encrypt | def encrypt(user=None,
recipients=None,
text=None,
filename=None,
output=None,
sign=None,
use_passphrase=False,
gnupghome=None,
bare=False):
'''
Encrypt a message or file
user
Which user's keychain to ac... | python | def encrypt(user=None,
recipients=None,
text=None,
filename=None,
output=None,
sign=None,
use_passphrase=False,
gnupghome=None,
bare=False):
'''
Encrypt a message or file
user
Which user's keychain to ac... | [
"def",
"encrypt",
"(",
"user",
"=",
"None",
",",
"recipients",
"=",
"None",
",",
"text",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"output",
"=",
"None",
",",
"sign",
"=",
"None",
",",
"use_passphrase",
"=",
"False",
",",
"gnupghome",
"=",
"Non... | Encrypt a message or file
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
``/etc/salt/gpgkeys``.
recipients
The fingerprints for those recipient whom the data is being encrypted for... | [
"Encrypt",
"a",
"message",
"or",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L1120-L1223 |
33,430 | saltstack/salt | salt/modules/gpg.py | decrypt | def decrypt(user=None,
text=None,
filename=None,
output=None,
use_passphrase=False,
gnupghome=None,
bare=False):
'''
Decrypt a message or file
user
Which user's keychain to access, defaults to user Salt is running as.
P... | python | def decrypt(user=None,
text=None,
filename=None,
output=None,
use_passphrase=False,
gnupghome=None,
bare=False):
'''
Decrypt a message or file
user
Which user's keychain to access, defaults to user Salt is running as.
P... | [
"def",
"decrypt",
"(",
"user",
"=",
"None",
",",
"text",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"output",
"=",
"None",
",",
"use_passphrase",
"=",
"False",
",",
"gnupghome",
"=",
"None",
",",
"bare",
"=",
"False",
")",
":",
"ret",
"=",
"{"... | Decrypt a message or file
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG home directory to the
``/etc/salt/gpgkeys``.
text
The encrypted text to decrypt.
filename
The encrypted filename to ... | [
"Decrypt",
"a",
"message",
"or",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L1226-L1311 |
33,431 | saltstack/salt | salt/modules/gem.py | _gem | def _gem(command, ruby=None, runas=None, gem_bin=None):
'''
Run the actual gem command. If rvm or rbenv is installed, run the command
using the corresponding module. rbenv is not available on windows, so don't
try.
:param command: string
Command to run
:param ruby: string : None
If RVM ... | python | def _gem(command, ruby=None, runas=None, gem_bin=None):
'''
Run the actual gem command. If rvm or rbenv is installed, run the command
using the corresponding module. rbenv is not available on windows, so don't
try.
:param command: string
Command to run
:param ruby: string : None
If RVM ... | [
"def",
"_gem",
"(",
"command",
",",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"cmdline",
"=",
"[",
"gem_bin",
"or",
"'gem'",
"]",
"+",
"command",
"# If a custom gem is given, use that and don't check for rvm/rbenv. Us... | Run the actual gem command. If rvm or rbenv is installed, run the command
using the corresponding module. rbenv is not available on windows, so don't
try.
:param command: string
Command to run
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Igno... | [
"Run",
"the",
"actual",
"gem",
"command",
".",
"If",
"rvm",
"or",
"rbenv",
"is",
"installed",
"run",
"the",
"command",
"using",
"the",
"corresponding",
"module",
".",
"rbenv",
"is",
"not",
"available",
"on",
"windows",
"so",
"don",
"t",
"try",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L23-L64 |
33,432 | saltstack/salt | salt/modules/gem.py | install | def install(gems, # pylint: disable=C0103
ruby=None,
gem_bin=None,
runas=None,
version=None,
rdoc=False,
ri=False,
pre_releases=False,
proxy=None,
source=None): # pylint: disable=C0103
'''
... | python | def install(gems, # pylint: disable=C0103
ruby=None,
gem_bin=None,
runas=None,
version=None,
rdoc=False,
ri=False,
pre_releases=False,
proxy=None,
source=None): # pylint: disable=C0103
'''
... | [
"def",
"install",
"(",
"gems",
",",
"# pylint: disable=C0103",
"ruby",
"=",
"None",
",",
"gem_bin",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"version",
"=",
"None",
",",
"rdoc",
"=",
"False",
",",
"ri",
"=",
"False",
",",
"pre_releases",
"=",
"Fals... | Installs one or several gems.
:param gems: string
The gems to install
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
:par... | [
"Installs",
"one",
"or",
"several",
"gems",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L67-L146 |
33,433 | saltstack/salt | salt/modules/gem.py | uninstall | def uninstall(gems, ruby=None, runas=None, gem_bin=None):
'''
Uninstall one or several gems.
:param gems: string
The gems to uninstall.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby versio... | python | def uninstall(gems, ruby=None, runas=None, gem_bin=None):
'''
Uninstall one or several gems.
:param gems: string
The gems to uninstall.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby versio... | [
"def",
"uninstall",
"(",
"gems",
",",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"try",
":",
"gems",
"=",
"gems",
".",
"split",
"(",
")",
"except",
"AttributeError",
":",
"pass",
"return",
"_gem",
"(",
"[... | Uninstall one or several gems.
:param gems: string
The gems to uninstall.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
... | [
"Uninstall",
"one",
"or",
"several",
"gems",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L149-L177 |
33,434 | saltstack/salt | salt/modules/gem.py | update | def update(gems, ruby=None, runas=None, gem_bin=None):
'''
Update one or several gems.
:param gems: string
The gems to update.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gem... | python | def update(gems, ruby=None, runas=None, gem_bin=None):
'''
Update one or several gems.
:param gems: string
The gems to update.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gem... | [
"def",
"update",
"(",
"gems",
",",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"try",
":",
"gems",
"=",
"gems",
".",
"split",
"(",
")",
"except",
"AttributeError",
":",
"pass",
"return",
"_gem",
"(",
"[",
... | Update one or several gems.
:param gems: string
The gems to update.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
:param... | [
"Update",
"one",
"or",
"several",
"gems",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L180-L208 |
33,435 | saltstack/salt | salt/modules/gem.py | update_system | def update_system(version='', ruby=None, runas=None, gem_bin=None):
'''
Update rubygems.
:param version: string : (newest)
The version of rubygems to install.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are ins... | python | def update_system(version='', ruby=None, runas=None, gem_bin=None):
'''
Update rubygems.
:param version: string : (newest)
The version of rubygems to install.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are ins... | [
"def",
"update_system",
"(",
"version",
"=",
"''",
",",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"return",
"_gem",
"(",
"[",
"'update'",
",",
"'--system'",
",",
"version",
"]",
",",
"ruby",
",",
"gem_bin"... | Update rubygems.
:param version: string : (newest)
The version of rubygems to install.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is sp... | [
"Update",
"rubygems",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L211-L234 |
33,436 | saltstack/salt | salt/modules/gem.py | version | def version(ruby=None, runas=None, gem_bin=None):
'''
Print out the version of gem
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.... | python | def version(ruby=None, runas=None, gem_bin=None):
'''
Print out the version of gem
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.... | [
"def",
"version",
"(",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"cmd",
"=",
"[",
"'--version'",
"]",
"stdout",
"=",
"_gem",
"(",
"cmd",
",",
"ruby",
",",
"gem_bin",
"=",
"gem_bin",
",",
"runas",
"=",
... | Print out the version of gem
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
:param runas: string : None
The user to run gem a... | [
"Print",
"out",
"the",
"version",
"of",
"gem"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L237-L266 |
33,437 | saltstack/salt | salt/modules/gem.py | list_ | def list_(prefix='', ruby=None, runas=None, gem_bin=None):
'''
List locally installed gems.
:param prefix: string :
Only list gems when the name matches this prefix.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv ... | python | def list_(prefix='', ruby=None, runas=None, gem_bin=None):
'''
List locally installed gems.
:param prefix: string :
Only list gems when the name matches this prefix.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv ... | [
"def",
"list_",
"(",
"prefix",
"=",
"''",
",",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"cmd",
"=",
"[",
"'list'",
"]",
"if",
"prefix",
":",
"cmd",
".",
"append",
"(",
"prefix",
")",
"stdout",
"=",
... | List locally installed gems.
:param prefix: string :
Only list gems when the name matches this prefix.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if `... | [
"List",
"locally",
"installed",
"gems",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L276-L310 |
33,438 | saltstack/salt | salt/modules/gem.py | sources_add | def sources_add(source_uri, ruby=None, runas=None, gem_bin=None):
'''
Add a gem source.
:param source_uri: string
The source URI to add.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby versi... | python | def sources_add(source_uri, ruby=None, runas=None, gem_bin=None):
'''
Add a gem source.
:param source_uri: string
The source URI to add.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby versi... | [
"def",
"sources_add",
"(",
"source_uri",
",",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"return",
"_gem",
"(",
"[",
"'sources'",
",",
"'--add'",
",",
"source_uri",
"]",
",",
"ruby",
",",
"gem_bin",
"=",
"g... | Add a gem source.
:param source_uri: string
The source URI to add.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
:param ... | [
"Add",
"a",
"gem",
"source",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L351-L374 |
33,439 | saltstack/salt | salt/modules/gem.py | sources_remove | def sources_remove(source_uri, ruby=None, runas=None, gem_bin=None):
'''
Remove a gem source.
:param source_uri: string
The source URI to remove.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the r... | python | def sources_remove(source_uri, ruby=None, runas=None, gem_bin=None):
'''
Remove a gem source.
:param source_uri: string
The source URI to remove.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the r... | [
"def",
"sources_remove",
"(",
"source_uri",
",",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"return",
"_gem",
"(",
"[",
"'sources'",
",",
"'--remove'",
",",
"source_uri",
"]",
",",
"ruby",
",",
"gem_bin",
"="... | Remove a gem source.
:param source_uri: string
The source URI to remove.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
:... | [
"Remove",
"a",
"gem",
"source",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L377-L400 |
33,440 | saltstack/salt | salt/modules/gem.py | sources_list | def sources_list(ruby=None, runas=None, gem_bin=None):
'''
List the configured gem sources.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is s... | python | def sources_list(ruby=None, runas=None, gem_bin=None):
'''
List the configured gem sources.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is s... | [
"def",
"sources_list",
"(",
"ruby",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"gem_bin",
"=",
"None",
")",
":",
"ret",
"=",
"_gem",
"(",
"[",
"'sources'",
"]",
",",
"ruby",
",",
"gem_bin",
"=",
"gem_bin",
",",
"runas",
"=",
"runas",
")",
"return... | List the configured gem sources.
:param gem_bin: string : None
Full path to ``gem`` binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
:param runas: string : None
The user to run g... | [
"List",
"the",
"configured",
"gem",
"sources",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L403-L422 |
33,441 | saltstack/salt | salt/states/icinga2.py | generate_cert | def generate_cert(name):
'''
Generate an icinga2 certificate and key on the client.
name
The domain name for which this certificate and key will be generated
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': ''}
cert = "{0}{1}.crt".forma... | python | def generate_cert(name):
'''
Generate an icinga2 certificate and key on the client.
name
The domain name for which this certificate and key will be generated
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': ''}
cert = "{0}{1}.crt".forma... | [
"def",
"generate_cert",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"cert",
"=",
"\"{0}{1}.crt\"",
".",
"format",
"(",
"get_certs_path",... | Generate an icinga2 certificate and key on the client.
name
The domain name for which this certificate and key will be generated | [
"Generate",
"an",
"icinga2",
"certificate",
"and",
"key",
"on",
"the",
"client",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L134-L163 |
33,442 | saltstack/salt | salt/states/icinga2.py | save_cert | def save_cert(name, master):
'''
Save the certificate on master icinga2 node.
name
The domain name for which this certificate will be saved
master
Icinga2 master node for which this certificate will be saved
'''
ret = {'name': name,
'changes': {},
'result'... | python | def save_cert(name, master):
'''
Save the certificate on master icinga2 node.
name
The domain name for which this certificate will be saved
master
Icinga2 master node for which this certificate will be saved
'''
ret = {'name': name,
'changes': {},
'result'... | [
"def",
"save_cert",
"(",
"name",
",",
"master",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"cert",
"=",
"\"{0}trusted-master.crt\"",
".",
"format",
... | Save the certificate on master icinga2 node.
name
The domain name for which this certificate will be saved
master
Icinga2 master node for which this certificate will be saved | [
"Save",
"the",
"certificate",
"on",
"master",
"icinga2",
"node",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L166-L196 |
33,443 | saltstack/salt | salt/states/icinga2.py | request_cert | def request_cert(name, master, ticket, port="5665"):
'''
Request CA certificate from master icinga2 node.
name
The domain name for which this certificate will be saved
master
Icinga2 master node for which this certificate will be saved
ticket
Authentication ticket generate... | python | def request_cert(name, master, ticket, port="5665"):
'''
Request CA certificate from master icinga2 node.
name
The domain name for which this certificate will be saved
master
Icinga2 master node for which this certificate will be saved
ticket
Authentication ticket generate... | [
"def",
"request_cert",
"(",
"name",
",",
"master",
",",
"ticket",
",",
"port",
"=",
"\"5665\"",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"cert... | Request CA certificate from master icinga2 node.
name
The domain name for which this certificate will be saved
master
Icinga2 master node for which this certificate will be saved
ticket
Authentication ticket generated on icinga2 master
port
Icinga2 port, defaults to 5... | [
"Request",
"CA",
"certificate",
"from",
"master",
"icinga2",
"node",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L199-L239 |
33,444 | saltstack/salt | salt/cloud/clouds/linode.py | avail_images | def avail_images(call=None):
'''
Return available Linode images.
CLI Example:
.. code-block:: bash
salt-cloud --list-images my-linode-config
salt-cloud -f avail_images my-linode-config
'''
if call == 'action':
raise SaltCloudException(
'The avail_images fun... | python | def avail_images(call=None):
'''
Return available Linode images.
CLI Example:
.. code-block:: bash
salt-cloud --list-images my-linode-config
salt-cloud -f avail_images my-linode-config
'''
if call == 'action':
raise SaltCloudException(
'The avail_images fun... | [
"def",
"avail_images",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The avail_images function must be called with -f or --function.'",
")",
"response",
"=",
"_query",
"(",
"'avail'",
",",
"'distribution... | Return available Linode images.
CLI Example:
.. code-block:: bash
salt-cloud --list-images my-linode-config
salt-cloud -f avail_images my-linode-config | [
"Return",
"available",
"Linode",
"images",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L110-L133 |
33,445 | saltstack/salt | salt/cloud/clouds/linode.py | avail_locations | def avail_locations(call=None):
'''
Return available Linode datacenter locations.
CLI Example:
.. code-block:: bash
salt-cloud --list-locations my-linode-config
salt-cloud -f avail_locations my-linode-config
'''
if call == 'action':
raise SaltCloudException(
... | python | def avail_locations(call=None):
'''
Return available Linode datacenter locations.
CLI Example:
.. code-block:: bash
salt-cloud --list-locations my-linode-config
salt-cloud -f avail_locations my-linode-config
'''
if call == 'action':
raise SaltCloudException(
... | [
"def",
"avail_locations",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The avail_locations function must be called with -f or --function.'",
")",
"response",
"=",
"_query",
"(",
"'avail'",
",",
"'datace... | Return available Linode datacenter locations.
CLI Example:
.. code-block:: bash
salt-cloud --list-locations my-linode-config
salt-cloud -f avail_locations my-linode-config | [
"Return",
"available",
"Linode",
"datacenter",
"locations",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L136-L159 |
33,446 | saltstack/salt | salt/cloud/clouds/linode.py | avail_sizes | def avail_sizes(call=None):
'''
Return available Linode sizes.
CLI Example:
.. code-block:: bash
salt-cloud --list-sizes my-linode-config
salt-cloud -f avail_sizes my-linode-config
'''
if call == 'action':
raise SaltCloudException(
'The avail_locations func... | python | def avail_sizes(call=None):
'''
Return available Linode sizes.
CLI Example:
.. code-block:: bash
salt-cloud --list-sizes my-linode-config
salt-cloud -f avail_sizes my-linode-config
'''
if call == 'action':
raise SaltCloudException(
'The avail_locations func... | [
"def",
"avail_sizes",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The avail_locations function must be called with -f or --function.'",
")",
"response",
"=",
"_query",
"(",
"'avail'",
",",
"'LinodePlan... | Return available Linode sizes.
CLI Example:
.. code-block:: bash
salt-cloud --list-sizes my-linode-config
salt-cloud -f avail_sizes my-linode-config | [
"Return",
"available",
"Linode",
"sizes",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L162-L185 |
33,447 | saltstack/salt | salt/cloud/clouds/linode.py | boot | def boot(name=None, kwargs=None, call=None):
'''
Boot a Linode.
name
The name of the Linode to boot. Can be used instead of ``linode_id``.
linode_id
The ID of the Linode to boot. If provided, will be used as an
alternative to ``name`` and reduces the number of API calls to
... | python | def boot(name=None, kwargs=None, call=None):
'''
Boot a Linode.
name
The name of the Linode to boot. Can be used instead of ``linode_id``.
linode_id
The ID of the Linode to boot. If provided, will be used as an
alternative to ``name`` and reduces the number of API calls to
... | [
"def",
"boot",
"(",
"name",
"=",
"None",
",",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"name",
"is",
"None",
"and",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The boot action requires a \\'name\\'.'",
")",
... | Boot a Linode.
name
The name of the Linode to boot. Can be used instead of ``linode_id``.
linode_id
The ID of the Linode to boot. If provided, will be used as an
alternative to ``name`` and reduces the number of API calls to
Linode by one. Will be preferred over ``name``.
... | [
"Boot",
"a",
"Linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L188-L272 |
33,448 | saltstack/salt | salt/cloud/clouds/linode.py | clone | def clone(kwargs=None, call=None):
'''
Clone a Linode.
linode_id
The ID of the Linode to clone. Required.
datacenter_id
The ID of the Datacenter where the Linode will be placed. Required.
plan_id
The ID of the plan (size) of the Linode. Required.
CLI Example:
.. ... | python | def clone(kwargs=None, call=None):
'''
Clone a Linode.
linode_id
The ID of the Linode to clone. Required.
datacenter_id
The ID of the Datacenter where the Linode will be placed. Required.
plan_id
The ID of the plan (size) of the Linode. Required.
CLI Example:
.. ... | [
"def",
"clone",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The clone function must be called with -f or --function.'",
")",
"if",
"kwargs",
"is",
"None",
":",
"kwarg... | Clone a Linode.
linode_id
The ID of the Linode to clone. Required.
datacenter_id
The ID of the Datacenter where the Linode will be placed. Required.
plan_id
The ID of the plan (size) of the Linode. Required.
CLI Example:
.. code-block:: bash
salt-cloud -f clone ... | [
"Clone",
"a",
"Linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L275-L320 |
33,449 | saltstack/salt | salt/cloud/clouds/linode.py | create_config | def create_config(kwargs=None, call=None):
'''
Creates a Linode Configuration Profile.
name
The name of the VM to create the config for.
linode_id
The ID of the Linode to create the configuration for.
root_disk_id
The Root Disk ID to be used for this config.
swap_disk... | python | def create_config(kwargs=None, call=None):
'''
Creates a Linode Configuration Profile.
name
The name of the VM to create the config for.
linode_id
The ID of the Linode to create the configuration for.
root_disk_id
The Root Disk ID to be used for this config.
swap_disk... | [
"def",
"create_config",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_config function must be called with -f or --function.'",
")",
"if",
"kwargs",
"is",
"None",... | Creates a Linode Configuration Profile.
name
The name of the VM to create the config for.
linode_id
The ID of the Linode to create the configuration for.
root_disk_id
The Root Disk ID to be used for this config.
swap_disk_id
The Swap Disk ID to be used for this config... | [
"Creates",
"a",
"Linode",
"Configuration",
"Profile",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L540-L603 |
33,450 | saltstack/salt | salt/cloud/clouds/linode.py | create_disk_from_distro | def create_disk_from_distro(vm_, linode_id, swap_size=None):
r'''
Creates the disk for the Linode from the distribution.
vm\_
The VM profile to create the disk for.
linode_id
The ID of the Linode to create the distribution disk for. Required.
swap_size
The size of the disk... | python | def create_disk_from_distro(vm_, linode_id, swap_size=None):
r'''
Creates the disk for the Linode from the distribution.
vm\_
The VM profile to create the disk for.
linode_id
The ID of the Linode to create the distribution disk for. Required.
swap_size
The size of the disk... | [
"def",
"create_disk_from_distro",
"(",
"vm_",
",",
"linode_id",
",",
"swap_size",
"=",
"None",
")",
":",
"kwargs",
"=",
"{",
"}",
"if",
"swap_size",
"is",
"None",
":",
"swap_size",
"=",
"get_swap_size",
"(",
"vm_",
")",
"pub_key",
"=",
"get_pub_key",
"(",
... | r'''
Creates the disk for the Linode from the distribution.
vm\_
The VM profile to create the disk for.
linode_id
The ID of the Linode to create the distribution disk for. Required.
swap_size
The size of the disk, in MB. | [
"r",
"Creates",
"the",
"disk",
"for",
"the",
"Linode",
"from",
"the",
"distribution",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L606-L644 |
33,451 | saltstack/salt | salt/cloud/clouds/linode.py | create_swap_disk | def create_swap_disk(vm_, linode_id, swap_size=None):
r'''
Creates the disk for the specified Linode.
vm\_
The VM profile to create the swap disk for.
linode_id
The ID of the Linode to create the swap disk for.
swap_size
The size of the disk, in MB.
'''
kwargs = {}... | python | def create_swap_disk(vm_, linode_id, swap_size=None):
r'''
Creates the disk for the specified Linode.
vm\_
The VM profile to create the swap disk for.
linode_id
The ID of the Linode to create the swap disk for.
swap_size
The size of the disk, in MB.
'''
kwargs = {}... | [
"def",
"create_swap_disk",
"(",
"vm_",
",",
"linode_id",
",",
"swap_size",
"=",
"None",
")",
":",
"kwargs",
"=",
"{",
"}",
"if",
"not",
"swap_size",
":",
"swap_size",
"=",
"get_swap_size",
"(",
"vm_",
")",
"kwargs",
".",
"update",
"(",
"{",
"'LinodeID'",... | r'''
Creates the disk for the specified Linode.
vm\_
The VM profile to create the swap disk for.
linode_id
The ID of the Linode to create the swap disk for.
swap_size
The size of the disk, in MB. | [
"r",
"Creates",
"the",
"disk",
"for",
"the",
"specified",
"Linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L647-L673 |
33,452 | saltstack/salt | salt/cloud/clouds/linode.py | create_private_ip | def create_private_ip(linode_id):
r'''
Creates a private IP for the specified Linode.
linode_id
The ID of the Linode to create the IP address for.
'''
kwargs = {'LinodeID': linode_id}
result = _query('linode', 'ip.addprivate', args=kwargs)
return _clean_data(result) | python | def create_private_ip(linode_id):
r'''
Creates a private IP for the specified Linode.
linode_id
The ID of the Linode to create the IP address for.
'''
kwargs = {'LinodeID': linode_id}
result = _query('linode', 'ip.addprivate', args=kwargs)
return _clean_data(result) | [
"def",
"create_private_ip",
"(",
"linode_id",
")",
":",
"kwargs",
"=",
"{",
"'LinodeID'",
":",
"linode_id",
"}",
"result",
"=",
"_query",
"(",
"'linode'",
",",
"'ip.addprivate'",
",",
"args",
"=",
"kwargs",
")",
"return",
"_clean_data",
"(",
"result",
")"
] | r'''
Creates a private IP for the specified Linode.
linode_id
The ID of the Linode to create the IP address for. | [
"r",
"Creates",
"a",
"private",
"IP",
"for",
"the",
"specified",
"Linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L704-L714 |
33,453 | saltstack/salt | salt/cloud/clouds/linode.py | get_config_id | def get_config_id(kwargs=None, call=None):
'''
Returns a config_id for a given linode.
.. versionadded:: 2015.8.0
name
The name of the Linode for which to get the config_id. Can be used instead
of ``linode_id``.h
linode_id
The ID of the Linode for which to get the config_i... | python | def get_config_id(kwargs=None, call=None):
'''
Returns a config_id for a given linode.
.. versionadded:: 2015.8.0
name
The name of the Linode for which to get the config_id. Can be used instead
of ``linode_id``.h
linode_id
The ID of the Linode for which to get the config_i... | [
"def",
"get_config_id",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The get_config_id function must be called with -f or --function.'",
")",
"if",
"kwargs",
"is",
"None",
... | Returns a config_id for a given linode.
.. versionadded:: 2015.8.0
name
The name of the Linode for which to get the config_id. Can be used instead
of ``linode_id``.h
linode_id
The ID of the Linode for which to get the config_id. Can be used instead
of ``name``.
CLI Ex... | [
"Returns",
"a",
"config_id",
"for",
"a",
"given",
"linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L764-L806 |
33,454 | saltstack/salt | salt/cloud/clouds/linode.py | get_disk_size | def get_disk_size(vm_, swap, linode_id):
r'''
Returns the size of of the root disk in MB.
vm\_
The VM to get the disk size for.
'''
disk_size = get_linode(kwargs={'linode_id': linode_id})['TOTALHD']
return config.get_cloud_config_value(
'disk_size', vm_, __opts__, default=disk_s... | python | def get_disk_size(vm_, swap, linode_id):
r'''
Returns the size of of the root disk in MB.
vm\_
The VM to get the disk size for.
'''
disk_size = get_linode(kwargs={'linode_id': linode_id})['TOTALHD']
return config.get_cloud_config_value(
'disk_size', vm_, __opts__, default=disk_s... | [
"def",
"get_disk_size",
"(",
"vm_",
",",
"swap",
",",
"linode_id",
")",
":",
"disk_size",
"=",
"get_linode",
"(",
"kwargs",
"=",
"{",
"'linode_id'",
":",
"linode_id",
"}",
")",
"[",
"'TOTALHD'",
"]",
"return",
"config",
".",
"get_cloud_config_value",
"(",
... | r'''
Returns the size of of the root disk in MB.
vm\_
The VM to get the disk size for. | [
"r",
"Returns",
"the",
"size",
"of",
"of",
"the",
"root",
"disk",
"in",
"MB",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L820-L830 |
33,455 | saltstack/salt | salt/cloud/clouds/linode.py | get_data_disk_size | def get_data_disk_size(vm_, swap, linode_id):
'''
Return the size of of the data disk in MB
.. versionadded:: 2016.3.0
'''
disk_size = get_linode(kwargs={'linode_id': linode_id})['TOTALHD']
root_disk_size = config.get_cloud_config_value(
'disk_size', vm_, __opts__, default=disk_size - s... | python | def get_data_disk_size(vm_, swap, linode_id):
'''
Return the size of of the data disk in MB
.. versionadded:: 2016.3.0
'''
disk_size = get_linode(kwargs={'linode_id': linode_id})['TOTALHD']
root_disk_size = config.get_cloud_config_value(
'disk_size', vm_, __opts__, default=disk_size - s... | [
"def",
"get_data_disk_size",
"(",
"vm_",
",",
"swap",
",",
"linode_id",
")",
":",
"disk_size",
"=",
"get_linode",
"(",
"kwargs",
"=",
"{",
"'linode_id'",
":",
"linode_id",
"}",
")",
"[",
"'TOTALHD'",
"]",
"root_disk_size",
"=",
"config",
".",
"get_cloud_conf... | Return the size of of the data disk in MB
.. versionadded:: 2016.3.0 | [
"Return",
"the",
"size",
"of",
"of",
"the",
"data",
"disk",
"in",
"MB"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L833-L843 |
33,456 | saltstack/salt | salt/cloud/clouds/linode.py | get_distribution_id | def get_distribution_id(vm_):
r'''
Returns the distribution ID for a VM
vm\_
The VM to get the distribution ID for
'''
distributions = _query('avail', 'distributions')['DATA']
vm_image_name = config.get_cloud_config_value('image', vm_, __opts__)
distro_id = ''
for distro in di... | python | def get_distribution_id(vm_):
r'''
Returns the distribution ID for a VM
vm\_
The VM to get the distribution ID for
'''
distributions = _query('avail', 'distributions')['DATA']
vm_image_name = config.get_cloud_config_value('image', vm_, __opts__)
distro_id = ''
for distro in di... | [
"def",
"get_distribution_id",
"(",
"vm_",
")",
":",
"distributions",
"=",
"_query",
"(",
"'avail'",
",",
"'distributions'",
")",
"[",
"'DATA'",
"]",
"vm_image_name",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'image'",
",",
"vm_",
",",
"__opts__",
")"... | r'''
Returns the distribution ID for a VM
vm\_
The VM to get the distribution ID for | [
"r",
"Returns",
"the",
"distribution",
"ID",
"for",
"a",
"VM"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L846-L872 |
33,457 | saltstack/salt | salt/cloud/clouds/linode.py | get_ips | def get_ips(linode_id=None):
'''
Returns public and private IP addresses.
linode_id
Limits the IP addresses returned to the specified Linode ID.
'''
if linode_id:
ips = _query('linode', 'ip.list', args={'LinodeID': linode_id})
else:
ips = _query('linode', 'ip.list')
... | python | def get_ips(linode_id=None):
'''
Returns public and private IP addresses.
linode_id
Limits the IP addresses returned to the specified Linode ID.
'''
if linode_id:
ips = _query('linode', 'ip.list', args={'LinodeID': linode_id})
else:
ips = _query('linode', 'ip.list')
... | [
"def",
"get_ips",
"(",
"linode_id",
"=",
"None",
")",
":",
"if",
"linode_id",
":",
"ips",
"=",
"_query",
"(",
"'linode'",
",",
"'ip.list'",
",",
"args",
"=",
"{",
"'LinodeID'",
":",
"linode_id",
"}",
")",
"else",
":",
"ips",
"=",
"_query",
"(",
"'lin... | Returns public and private IP addresses.
linode_id
Limits the IP addresses returned to the specified Linode ID. | [
"Returns",
"public",
"and",
"private",
"IP",
"addresses",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L875-L912 |
33,458 | saltstack/salt | salt/cloud/clouds/linode.py | get_linode | def get_linode(kwargs=None, call=None):
'''
Returns data for a single named Linode.
name
The name of the Linode for which to get data. Can be used instead
``linode_id``. Note this will induce an additional API call
compared to using ``linode_id``.
linode_id
The ID of th... | python | def get_linode(kwargs=None, call=None):
'''
Returns data for a single named Linode.
name
The name of the Linode for which to get data. Can be used instead
``linode_id``. Note this will induce an additional API call
compared to using ``linode_id``.
linode_id
The ID of th... | [
"def",
"get_linode",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The get_linode function must be called with -f or --function.'",
")",
"if",
"kwargs",
"is",
"None",
":"... | Returns data for a single named Linode.
name
The name of the Linode for which to get data. Can be used instead
``linode_id``. Note this will induce an additional API call
compared to using ``linode_id``.
linode_id
The ID of the Linode for which to get data. Can be used instead ... | [
"Returns",
"data",
"for",
"a",
"single",
"named",
"Linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L915-L955 |
33,459 | saltstack/salt | salt/cloud/clouds/linode.py | get_linode_id_from_name | def get_linode_id_from_name(name):
'''
Returns the Linode ID for a VM from the provided name.
name
The name of the Linode from which to get the Linode ID. Required.
'''
nodes = _query('linode', 'list')['DATA']
linode_id = ''
for node in nodes:
if name == node['LABEL']:
... | python | def get_linode_id_from_name(name):
'''
Returns the Linode ID for a VM from the provided name.
name
The name of the Linode from which to get the Linode ID. Required.
'''
nodes = _query('linode', 'list')['DATA']
linode_id = ''
for node in nodes:
if name == node['LABEL']:
... | [
"def",
"get_linode_id_from_name",
"(",
"name",
")",
":",
"nodes",
"=",
"_query",
"(",
"'linode'",
",",
"'list'",
")",
"[",
"'DATA'",
"]",
"linode_id",
"=",
"''",
"for",
"node",
"in",
"nodes",
":",
"if",
"name",
"==",
"node",
"[",
"'LABEL'",
"]",
":",
... | Returns the Linode ID for a VM from the provided name.
name
The name of the Linode from which to get the Linode ID. Required. | [
"Returns",
"the",
"Linode",
"ID",
"for",
"a",
"VM",
"from",
"the",
"provided",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L958-L976 |
33,460 | saltstack/salt | salt/cloud/clouds/linode.py | get_password | def get_password(vm_):
r'''
Return the password to use for a VM.
vm\_
The configuration to obtain the password from.
'''
return config.get_cloud_config_value(
'password', vm_, __opts__,
default=config.get_cloud_config_value(
'passwd', vm_, __opts__,
s... | python | def get_password(vm_):
r'''
Return the password to use for a VM.
vm\_
The configuration to obtain the password from.
'''
return config.get_cloud_config_value(
'password', vm_, __opts__,
default=config.get_cloud_config_value(
'passwd', vm_, __opts__,
s... | [
"def",
"get_password",
"(",
"vm_",
")",
":",
"return",
"config",
".",
"get_cloud_config_value",
"(",
"'password'",
",",
"vm_",
",",
"__opts__",
",",
"default",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'passwd'",
",",
"vm_",
",",
"__opts__",
",",
"... | r'''
Return the password to use for a VM.
vm\_
The configuration to obtain the password from. | [
"r",
"Return",
"the",
"password",
"to",
"use",
"for",
"a",
"VM",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L979-L993 |
33,461 | saltstack/salt | salt/cloud/clouds/linode.py | _decode_linode_plan_label | def _decode_linode_plan_label(label):
'''
Attempts to decode a user-supplied Linode plan label
into the format in Linode API output
label
The label, or name, of the plan to decode.
Example:
`Linode 2048` will decode to `Linode 2GB`
'''
sizes = avail_sizes()
if label no... | python | def _decode_linode_plan_label(label):
'''
Attempts to decode a user-supplied Linode plan label
into the format in Linode API output
label
The label, or name, of the plan to decode.
Example:
`Linode 2048` will decode to `Linode 2GB`
'''
sizes = avail_sizes()
if label no... | [
"def",
"_decode_linode_plan_label",
"(",
"label",
")",
":",
"sizes",
"=",
"avail_sizes",
"(",
")",
"if",
"label",
"not",
"in",
"sizes",
":",
"if",
"'GB'",
"in",
"label",
":",
"raise",
"SaltCloudException",
"(",
"'Invalid Linode plan ({}) specified - call avail_sizes... | Attempts to decode a user-supplied Linode plan label
into the format in Linode API output
label
The label, or name, of the plan to decode.
Example:
`Linode 2048` will decode to `Linode 2GB` | [
"Attempts",
"to",
"decode",
"a",
"user",
"-",
"supplied",
"Linode",
"plan",
"label",
"into",
"the",
"format",
"in",
"Linode",
"API",
"output"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L996-L1049 |
33,462 | saltstack/salt | salt/cloud/clouds/linode.py | get_plan_id | def get_plan_id(kwargs=None, call=None):
'''
Returns the Linode Plan ID.
label
The label, or name, of the plan to get the ID from.
CLI Example:
.. code-block:: bash
salt-cloud -f get_plan_id linode label="Linode 1024"
'''
if call == 'action':
raise SaltCloudExcept... | python | def get_plan_id(kwargs=None, call=None):
'''
Returns the Linode Plan ID.
label
The label, or name, of the plan to get the ID from.
CLI Example:
.. code-block:: bash
salt-cloud -f get_plan_id linode label="Linode 1024"
'''
if call == 'action':
raise SaltCloudExcept... | [
"def",
"get_plan_id",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The show_instance action must be called with -f or --function.'",
")",
"if",
"kwargs",
"is",
"None",
":... | Returns the Linode Plan ID.
label
The label, or name, of the plan to get the ID from.
CLI Example:
.. code-block:: bash
salt-cloud -f get_plan_id linode label="Linode 1024" | [
"Returns",
"the",
"Linode",
"Plan",
"ID",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1052-L1081 |
33,463 | saltstack/salt | salt/cloud/clouds/linode.py | get_vm_size | def get_vm_size(vm_):
r'''
Returns the VM's size.
vm\_
The VM to get the size for.
'''
vm_size = config.get_cloud_config_value('size', vm_, __opts__)
ram = avail_sizes()[vm_size]['RAM']
if vm_size.startswith('Linode'):
vm_size = vm_size.replace('Linode ', '')
if ram ==... | python | def get_vm_size(vm_):
r'''
Returns the VM's size.
vm\_
The VM to get the size for.
'''
vm_size = config.get_cloud_config_value('size', vm_, __opts__)
ram = avail_sizes()[vm_size]['RAM']
if vm_size.startswith('Linode'):
vm_size = vm_size.replace('Linode ', '')
if ram ==... | [
"def",
"get_vm_size",
"(",
"vm_",
")",
":",
"vm_size",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'size'",
",",
"vm_",
",",
"__opts__",
")",
"ram",
"=",
"avail_sizes",
"(",
")",
"[",
"vm_size",
"]",
"[",
"'RAM'",
"]",
"if",
"vm_size",
".",
"st... | r'''
Returns the VM's size.
vm\_
The VM to get the size for. | [
"r",
"Returns",
"the",
"VM",
"s",
"size",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1128-L1146 |
33,464 | saltstack/salt | salt/cloud/clouds/linode.py | reboot | def reboot(name, call=None):
'''
Reboot a linode.
.. versionadded:: 2015.8.0
name
The name of the VM to reboot.
CLI Example:
.. code-block:: bash
salt-cloud -a reboot vm_name
'''
if call != 'action':
raise SaltCloudException(
'The show_instance ac... | python | def reboot(name, call=None):
'''
Reboot a linode.
.. versionadded:: 2015.8.0
name
The name of the VM to reboot.
CLI Example:
.. code-block:: bash
salt-cloud -a reboot vm_name
'''
if call != 'action':
raise SaltCloudException(
'The show_instance ac... | [
"def",
"reboot",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The show_instance action must be called with -a or --action.'",
")",
"node_id",
"=",
"get_linode_id_from_name",
"(",
"name",
... | Reboot a linode.
.. versionadded:: 2015.8.0
name
The name of the VM to reboot.
CLI Example:
.. code-block:: bash
salt-cloud -a reboot vm_name | [
"Reboot",
"a",
"linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1243-L1272 |
33,465 | saltstack/salt | salt/cloud/clouds/linode.py | show_instance | def show_instance(name, call=None):
'''
Displays details about a particular Linode VM. Either a name or a linode_id must
be provided.
.. versionadded:: 2015.8.0
name
The name of the VM for which to display details.
CLI Example:
.. code-block:: bash
salt-cloud -a show_ins... | python | def show_instance(name, call=None):
'''
Displays details about a particular Linode VM. Either a name or a linode_id must
be provided.
.. versionadded:: 2015.8.0
name
The name of the VM for which to display details.
CLI Example:
.. code-block:: bash
salt-cloud -a show_ins... | [
"def",
"show_instance",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The show_instance action must be called with -a or --action.'",
")",
"node_id",
"=",
"get_linode_id_from_name",
"(",
"na... | Displays details about a particular Linode VM. Either a name or a linode_id must
be provided.
.. versionadded:: 2015.8.0
name
The name of the VM for which to display details.
CLI Example:
.. code-block:: bash
salt-cloud -a show_instance vm_name
.. note::
The ``imag... | [
"Displays",
"details",
"about",
"a",
"particular",
"Linode",
"VM",
".",
"Either",
"a",
"name",
"or",
"a",
"linode_id",
"must",
"be",
"provided",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1275-L1315 |
33,466 | saltstack/salt | salt/cloud/clouds/linode.py | start | def start(name, call=None):
'''
Start a VM in Linode.
name
The name of the VM to start.
CLI Example:
.. code-block:: bash
salt-cloud -a stop vm_name
'''
if call != 'action':
raise SaltCloudException(
'The start action must be called with -a or --action... | python | def start(name, call=None):
'''
Start a VM in Linode.
name
The name of the VM to start.
CLI Example:
.. code-block:: bash
salt-cloud -a stop vm_name
'''
if call != 'action':
raise SaltCloudException(
'The start action must be called with -a or --action... | [
"def",
"start",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudException",
"(",
"'The start action must be called with -a or --action.'",
")",
"node_id",
"=",
"get_linode_id_from_name",
"(",
"name",
")",
"n... | Start a VM in Linode.
name
The name of the VM to start.
CLI Example:
.. code-block:: bash
salt-cloud -a stop vm_name | [
"Start",
"a",
"VM",
"in",
"Linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1363-L1398 |
33,467 | saltstack/salt | salt/cloud/clouds/linode.py | update_linode | def update_linode(linode_id, update_args=None):
'''
Updates a Linode's properties.
linode_id
The ID of the Linode to shutdown. Required.
update_args
The args to update the Linode with. Must be in dictionary form.
'''
update_args.update({'LinodeID': linode_id})
result = _qu... | python | def update_linode(linode_id, update_args=None):
'''
Updates a Linode's properties.
linode_id
The ID of the Linode to shutdown. Required.
update_args
The args to update the Linode with. Must be in dictionary form.
'''
update_args.update({'LinodeID': linode_id})
result = _qu... | [
"def",
"update_linode",
"(",
"linode_id",
",",
"update_args",
"=",
"None",
")",
":",
"update_args",
".",
"update",
"(",
"{",
"'LinodeID'",
":",
"linode_id",
"}",
")",
"result",
"=",
"_query",
"(",
"'linode'",
",",
"'update'",
",",
"args",
"=",
"update_args... | Updates a Linode's properties.
linode_id
The ID of the Linode to shutdown. Required.
update_args
The args to update the Linode with. Must be in dictionary form. | [
"Updates",
"a",
"Linode",
"s",
"properties",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1438-L1452 |
33,468 | saltstack/salt | salt/cloud/clouds/linode.py | _clean_data | def _clean_data(api_response):
'''
Returns the DATA response from a Linode API query as a single pre-formatted dictionary
api_response
The query to be cleaned.
'''
data = {}
data.update(api_response['DATA'])
if not data:
response_data = api_response['DATA']
data.upd... | python | def _clean_data(api_response):
'''
Returns the DATA response from a Linode API query as a single pre-formatted dictionary
api_response
The query to be cleaned.
'''
data = {}
data.update(api_response['DATA'])
if not data:
response_data = api_response['DATA']
data.upd... | [
"def",
"_clean_data",
"(",
"api_response",
")",
":",
"data",
"=",
"{",
"}",
"data",
".",
"update",
"(",
"api_response",
"[",
"'DATA'",
"]",
")",
"if",
"not",
"data",
":",
"response_data",
"=",
"api_response",
"[",
"'DATA'",
"]",
"data",
".",
"update",
... | Returns the DATA response from a Linode API query as a single pre-formatted dictionary
api_response
The query to be cleaned. | [
"Returns",
"the",
"DATA",
"response",
"from",
"a",
"Linode",
"API",
"query",
"as",
"a",
"single",
"pre",
"-",
"formatted",
"dictionary"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1455-L1469 |
33,469 | saltstack/salt | salt/cloud/clouds/linode.py | _list_linodes | def _list_linodes(full=False):
'''
Helper function to format and parse linode data
'''
nodes = _query('linode', 'list')['DATA']
ips = get_ips()
ret = {}
for node in nodes:
this_node = {}
linode_id = six.text_type(node['LINODEID'])
this_node['id'] = linode_id
... | python | def _list_linodes(full=False):
'''
Helper function to format and parse linode data
'''
nodes = _query('linode', 'list')['DATA']
ips = get_ips()
ret = {}
for node in nodes:
this_node = {}
linode_id = six.text_type(node['LINODEID'])
this_node['id'] = linode_id
... | [
"def",
"_list_linodes",
"(",
"full",
"=",
"False",
")",
":",
"nodes",
"=",
"_query",
"(",
"'linode'",
",",
"'list'",
")",
"[",
"'DATA'",
"]",
"ips",
"=",
"get_ips",
"(",
")",
"ret",
"=",
"{",
"}",
"for",
"node",
"in",
"nodes",
":",
"this_node",
"="... | Helper function to format and parse linode data | [
"Helper",
"function",
"to",
"format",
"and",
"parse",
"linode",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1472-L1502 |
33,470 | saltstack/salt | salt/cloud/clouds/linode.py | _query | def _query(action=None,
command=None,
args=None,
method='GET',
header_dict=None,
data=None,
url='https://api.linode.com/'):
'''
Make a web call to the Linode API.
'''
global LASTCALL
vm_ = get_configured_provider()
ratelimit_slee... | python | def _query(action=None,
command=None,
args=None,
method='GET',
header_dict=None,
data=None,
url='https://api.linode.com/'):
'''
Make a web call to the Linode API.
'''
global LASTCALL
vm_ = get_configured_provider()
ratelimit_slee... | [
"def",
"_query",
"(",
"action",
"=",
"None",
",",
"command",
"=",
"None",
",",
"args",
"=",
"None",
",",
"method",
"=",
"'GET'",
",",
"header_dict",
"=",
"None",
",",
"data",
"=",
"None",
",",
"url",
"=",
"'https://api.linode.com/'",
")",
":",
"global"... | Make a web call to the Linode API. | [
"Make",
"a",
"web",
"call",
"to",
"the",
"Linode",
"API",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1505-L1582 |
33,471 | saltstack/salt | salt/cloud/clouds/linode.py | _wait_for_job | def _wait_for_job(linode_id, job_id, timeout=300, quiet=True):
'''
Wait for a Job to return.
linode_id
The ID of the Linode to wait on. Required.
job_id
The ID of the job to wait for.
timeout
The amount of time to wait for a status to update.
quiet
Log status ... | python | def _wait_for_job(linode_id, job_id, timeout=300, quiet=True):
'''
Wait for a Job to return.
linode_id
The ID of the Linode to wait on. Required.
job_id
The ID of the job to wait for.
timeout
The amount of time to wait for a status to update.
quiet
Log status ... | [
"def",
"_wait_for_job",
"(",
"linode_id",
",",
"job_id",
",",
"timeout",
"=",
"300",
",",
"quiet",
"=",
"True",
")",
":",
"interval",
"=",
"5",
"iterations",
"=",
"int",
"(",
"timeout",
"/",
"interval",
")",
"for",
"i",
"in",
"range",
"(",
"0",
",",
... | Wait for a Job to return.
linode_id
The ID of the Linode to wait on. Required.
job_id
The ID of the job to wait for.
timeout
The amount of time to wait for a status to update.
quiet
Log status updates to debug logs when True. Otherwise, logs to info. | [
"Wait",
"for",
"a",
"Job",
"to",
"return",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1585-L1616 |
33,472 | saltstack/salt | salt/cloud/clouds/linode.py | _wait_for_status | def _wait_for_status(linode_id, status=None, timeout=300, quiet=True):
'''
Wait for a certain status from Linode.
linode_id
The ID of the Linode to wait on. Required.
status
The status to look for to update.
timeout
The amount of time to wait for a status to update.
q... | python | def _wait_for_status(linode_id, status=None, timeout=300, quiet=True):
'''
Wait for a certain status from Linode.
linode_id
The ID of the Linode to wait on. Required.
status
The status to look for to update.
timeout
The amount of time to wait for a status to update.
q... | [
"def",
"_wait_for_status",
"(",
"linode_id",
",",
"status",
"=",
"None",
",",
"timeout",
"=",
"300",
",",
"quiet",
"=",
"True",
")",
":",
"if",
"status",
"is",
"None",
":",
"status",
"=",
"_get_status_id_by_name",
"(",
"'brand_new'",
")",
"status_desc_waitin... | Wait for a certain status from Linode.
linode_id
The ID of the Linode to wait on. Required.
status
The status to look for to update.
timeout
The amount of time to wait for a status to update.
quiet
Log status updates to debug logs when False. Otherwise, logs to info. | [
"Wait",
"for",
"a",
"certain",
"status",
"from",
"Linode",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1619-L1658 |
33,473 | saltstack/salt | salt/cloud/clouds/linode.py | _get_status_descr_by_id | def _get_status_descr_by_id(status_id):
'''
Return linode status by ID
status_id
linode VM status ID
'''
for status_name, status_data in six.iteritems(LINODE_STATUS):
if status_data['code'] == int(status_id):
return status_data['descr']
return LINODE_STATUS.get(statu... | python | def _get_status_descr_by_id(status_id):
'''
Return linode status by ID
status_id
linode VM status ID
'''
for status_name, status_data in six.iteritems(LINODE_STATUS):
if status_data['code'] == int(status_id):
return status_data['descr']
return LINODE_STATUS.get(statu... | [
"def",
"_get_status_descr_by_id",
"(",
"status_id",
")",
":",
"for",
"status_name",
",",
"status_data",
"in",
"six",
".",
"iteritems",
"(",
"LINODE_STATUS",
")",
":",
"if",
"status_data",
"[",
"'code'",
"]",
"==",
"int",
"(",
"status_id",
")",
":",
"return",... | Return linode status by ID
status_id
linode VM status ID | [
"Return",
"linode",
"status",
"by",
"ID"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1661-L1671 |
33,474 | saltstack/salt | salt/cloud/clouds/linode.py | _validate_name | def _validate_name(name):
'''
Checks if the provided name fits Linode's labeling parameters.
.. versionadded:: 2015.5.6
name
The VM name to validate
'''
name = six.text_type(name)
name_length = len(name)
regex = re.compile(r'^[a-zA-Z0-9][A-Za-z0-9_-]*[a-zA-Z0-9]$')
if name... | python | def _validate_name(name):
'''
Checks if the provided name fits Linode's labeling parameters.
.. versionadded:: 2015.5.6
name
The VM name to validate
'''
name = six.text_type(name)
name_length = len(name)
regex = re.compile(r'^[a-zA-Z0-9][A-Za-z0-9_-]*[a-zA-Z0-9]$')
if name... | [
"def",
"_validate_name",
"(",
"name",
")",
":",
"name",
"=",
"six",
".",
"text_type",
"(",
"name",
")",
"name_length",
"=",
"len",
"(",
"name",
")",
"regex",
"=",
"re",
".",
"compile",
"(",
"r'^[a-zA-Z0-9][A-Za-z0-9_-]*[a-zA-Z0-9]$'",
")",
"if",
"name_length... | Checks if the provided name fits Linode's labeling parameters.
.. versionadded:: 2015.5.6
name
The VM name to validate | [
"Checks",
"if",
"the",
"provided",
"name",
"fits",
"Linode",
"s",
"labeling",
"parameters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1684-L1711 |
33,475 | saltstack/salt | salt/modules/napalm_netacl.py | load_term_config | def load_term_config(filter_name,
term_name,
filter_options=None,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=True,
revision_id=None,
r... | python | def load_term_config(filter_name,
term_name,
filter_options=None,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=True,
revision_id=None,
r... | [
"def",
"load_term_config",
"(",
"filter_name",
",",
"term_name",
",",
"filter_options",
"=",
"None",
",",
"pillar_key",
"=",
"'acl'",
",",
"pillarenv",
"=",
"None",
",",
"saltenv",
"=",
"None",
",",
"merge_pillar",
"=",
"True",
",",
"revision_id",
"=",
"None... | Generate and load the configuration of a policy term.
filter_name
The name of the policy filter.
term_name
The name of the term.
filter_options
Additional filter options. These options are platform-specific.
See the complete list of options_.
.. _options: https://... | [
"Generate",
"and",
"load",
"the",
"configuration",
"of",
"a",
"policy",
"term",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L116-L451 |
33,476 | saltstack/salt | salt/modules/napalm_netacl.py | load_policy_config | def load_policy_config(filters=None,
prepend=True,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=True,
only_lower_merge=False,
revision_id=None,... | python | def load_policy_config(filters=None,
prepend=True,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=True,
only_lower_merge=False,
revision_id=None,... | [
"def",
"load_policy_config",
"(",
"filters",
"=",
"None",
",",
"prepend",
"=",
"True",
",",
"pillar_key",
"=",
"'acl'",
",",
"pillarenv",
"=",
"None",
",",
"saltenv",
"=",
"None",
",",
"merge_pillar",
"=",
"True",
",",
"only_lower_merge",
"=",
"False",
","... | Generate and load the configuration of the whole policy.
.. note::
The order of the filters and their terms is very important.
The configuration loaded on the device respects the order
defined in the ``filters`` and/or inside the pillar.
When merging the ``filters`` with the pilla... | [
"Generate",
"and",
"load",
"the",
"configuration",
"of",
"the",
"whole",
"policy",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L669-L855 |
33,477 | saltstack/salt | salt/modules/purefb.py | _get_blade | def _get_blade():
'''
Get Pure Storage FlasBlade configuration
1) From the minion config
pure_tags:
fb:
san_ip: management vip or hostname for the FlashBlade
api_token: A valid api token for the FlashBlade being managed
2) From environment (PUREFB_IP and PUREFB... | python | def _get_blade():
'''
Get Pure Storage FlasBlade configuration
1) From the minion config
pure_tags:
fb:
san_ip: management vip or hostname for the FlashBlade
api_token: A valid api token for the FlashBlade being managed
2) From environment (PUREFB_IP and PUREFB... | [
"def",
"_get_blade",
"(",
")",
":",
"try",
":",
"blade_name",
"=",
"__opts__",
"[",
"'pure_tags'",
"]",
"[",
"'fb'",
"]",
".",
"get",
"(",
"'san_ip'",
")",
"api_token",
"=",
"__opts__",
"[",
"'pure_tags'",
"]",
"[",
"'fb'",
"]",
".",
"get",
"(",
"'ap... | Get Pure Storage FlasBlade configuration
1) From the minion config
pure_tags:
fb:
san_ip: management vip or hostname for the FlashBlade
api_token: A valid api token for the FlashBlade being managed
2) From environment (PUREFB_IP and PUREFB_API)
3) From the pillar (... | [
"Get",
"Pure",
"Storage",
"FlasBlade",
"configuration"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefb.py#L85-L123 |
33,478 | saltstack/salt | salt/modules/purefb.py | _get_fs | def _get_fs(name, blade):
'''
Private function to
check for existance of a filesystem
'''
_fs = []
_fs.append(name)
try:
res = blade.file_systems.list_file_systems(names=_fs)
return res.items[0]
except rest.ApiException:
return None | python | def _get_fs(name, blade):
'''
Private function to
check for existance of a filesystem
'''
_fs = []
_fs.append(name)
try:
res = blade.file_systems.list_file_systems(names=_fs)
return res.items[0]
except rest.ApiException:
return None | [
"def",
"_get_fs",
"(",
"name",
",",
"blade",
")",
":",
"_fs",
"=",
"[",
"]",
"_fs",
".",
"append",
"(",
"name",
")",
"try",
":",
"res",
"=",
"blade",
".",
"file_systems",
".",
"list_file_systems",
"(",
"names",
"=",
"_fs",
")",
"return",
"res",
"."... | Private function to
check for existance of a filesystem | [
"Private",
"function",
"to",
"check",
"for",
"existance",
"of",
"a",
"filesystem"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefb.py#L126-L137 |
33,479 | saltstack/salt | salt/modules/purefb.py | _get_snapshot | def _get_snapshot(name, suffix, blade):
'''
Return name of Snapshot
or None
'''
try:
filt = 'source=\'{}\' and suffix=\'{}\''.format(name, suffix)
res = blade.file_system_snapshots.list_file_system_snapshots(filter=filt)
return res.items[0]
except rest.ApiException:
... | python | def _get_snapshot(name, suffix, blade):
'''
Return name of Snapshot
or None
'''
try:
filt = 'source=\'{}\' and suffix=\'{}\''.format(name, suffix)
res = blade.file_system_snapshots.list_file_system_snapshots(filter=filt)
return res.items[0]
except rest.ApiException:
... | [
"def",
"_get_snapshot",
"(",
"name",
",",
"suffix",
",",
"blade",
")",
":",
"try",
":",
"filt",
"=",
"'source=\\'{}\\' and suffix=\\'{}\\''",
".",
"format",
"(",
"name",
",",
"suffix",
")",
"res",
"=",
"blade",
".",
"file_system_snapshots",
".",
"list_file_sys... | Return name of Snapshot
or None | [
"Return",
"name",
"of",
"Snapshot",
"or",
"None"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefb.py#L140-L150 |
33,480 | saltstack/salt | salt/modules/purefb.py | _get_deleted_fs | def _get_deleted_fs(name, blade):
'''
Private function to check
if a file systeem has already been deleted
'''
try:
_fs = _get_fs(name, blade)
if _fs and _fs.destroyed:
return _fs
except rest.ApiException:
return None | python | def _get_deleted_fs(name, blade):
'''
Private function to check
if a file systeem has already been deleted
'''
try:
_fs = _get_fs(name, blade)
if _fs and _fs.destroyed:
return _fs
except rest.ApiException:
return None | [
"def",
"_get_deleted_fs",
"(",
"name",
",",
"blade",
")",
":",
"try",
":",
"_fs",
"=",
"_get_fs",
"(",
"name",
",",
"blade",
")",
"if",
"_fs",
"and",
"_fs",
".",
"destroyed",
":",
"return",
"_fs",
"except",
"rest",
".",
"ApiException",
":",
"return",
... | Private function to check
if a file systeem has already been deleted | [
"Private",
"function",
"to",
"check",
"if",
"a",
"file",
"systeem",
"has",
"already",
"been",
"deleted"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefb.py#L153-L163 |
33,481 | saltstack/salt | salt/states/syslog_ng.py | started | def started(name=None,
user=None,
group=None,
chroot=None,
caps=None,
no_caps=False,
pidfile=None,
enable_core=False,
fd_limit=None,
verbose=False,
debug=False,
trace=False,
yy... | python | def started(name=None,
user=None,
group=None,
chroot=None,
caps=None,
no_caps=False,
pidfile=None,
enable_core=False,
fd_limit=None,
verbose=False,
debug=False,
trace=False,
yy... | [
"def",
"started",
"(",
"name",
"=",
"None",
",",
"user",
"=",
"None",
",",
"group",
"=",
"None",
",",
"chroot",
"=",
"None",
",",
"caps",
"=",
"None",
",",
"no_caps",
"=",
"False",
",",
"pidfile",
"=",
"None",
",",
"enable_core",
"=",
"False",
",",... | Ensures, that syslog-ng is started via the given parameters.
Users shouldn't use this function, if the service module is available on
their system. | [
"Ensures",
"that",
"syslog",
"-",
"ng",
"is",
"started",
"via",
"the",
"given",
"parameters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/syslog_ng.py#L76-L115 |
33,482 | saltstack/salt | salt/client/ssh/client.py | SSHClient._prep_ssh | def _prep_ssh(
self,
tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
kwarg=None,
**kwargs):
'''
Prepare the arguments
'''
opts = copy.deepcopy(self.opts)
opts.update(kwargs)
i... | python | def _prep_ssh(
self,
tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
kwarg=None,
**kwargs):
'''
Prepare the arguments
'''
opts = copy.deepcopy(self.opts)
opts.update(kwargs)
i... | [
"def",
"_prep_ssh",
"(",
"self",
",",
"tgt",
",",
"fun",
",",
"arg",
"=",
"(",
")",
",",
"timeout",
"=",
"None",
",",
"tgt_type",
"=",
"'glob'",
",",
"kwarg",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"opts",
"=",
"copy",
".",
"deepcopy",
... | Prepare the arguments | [
"Prepare",
"the",
"arguments"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/client.py#L43-L64 |
33,483 | saltstack/salt | salt/client/ssh/client.py | SSHClient.cmd_iter | def cmd_iter(
self,
tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
ret='',
kwarg=None,
**kwargs):
'''
Execute a single command via the salt-ssh subsystem and return a
generator
... | python | def cmd_iter(
self,
tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
ret='',
kwarg=None,
**kwargs):
'''
Execute a single command via the salt-ssh subsystem and return a
generator
... | [
"def",
"cmd_iter",
"(",
"self",
",",
"tgt",
",",
"fun",
",",
"arg",
"=",
"(",
")",
",",
"timeout",
"=",
"None",
",",
"tgt_type",
"=",
"'glob'",
",",
"ret",
"=",
"''",
",",
"kwarg",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ssh",
"=",
"... | Execute a single command via the salt-ssh subsystem and return a
generator
.. versionadded:: 2015.5.0 | [
"Execute",
"a",
"single",
"command",
"via",
"the",
"salt",
"-",
"ssh",
"subsystem",
"and",
"return",
"a",
"generator"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/client.py#L66-L91 |
33,484 | saltstack/salt | salt/client/ssh/client.py | SSHClient.cmd | def cmd(self,
tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
kwarg=None,
**kwargs):
'''
Execute a single command via the salt-ssh subsystem and return all
routines at once
.. versionadded:: 2015.5.0
... | python | def cmd(self,
tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
kwarg=None,
**kwargs):
'''
Execute a single command via the salt-ssh subsystem and return all
routines at once
.. versionadded:: 2015.5.0
... | [
"def",
"cmd",
"(",
"self",
",",
"tgt",
",",
"fun",
",",
"arg",
"=",
"(",
")",
",",
"timeout",
"=",
"None",
",",
"tgt_type",
"=",
"'glob'",
",",
"kwarg",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ssh",
"=",
"self",
".",
"_prep_ssh",
"(",
... | Execute a single command via the salt-ssh subsystem and return all
routines at once
.. versionadded:: 2015.5.0 | [
"Execute",
"a",
"single",
"command",
"via",
"the",
"salt",
"-",
"ssh",
"subsystem",
"and",
"return",
"all",
"routines",
"at",
"once"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/client.py#L93-L118 |
33,485 | saltstack/salt | salt/client/ssh/client.py | SSHClient.cmd_sync | def cmd_sync(self, low):
'''
Execute a salt-ssh call synchronously.
.. versionadded:: 2015.5.0
WARNING: Eauth is **NOT** respected
.. code-block:: python
client.cmd_sync({
'tgt': 'silver',
'fun': 'test.ping',
'arg': ... | python | def cmd_sync(self, low):
'''
Execute a salt-ssh call synchronously.
.. versionadded:: 2015.5.0
WARNING: Eauth is **NOT** respected
.. code-block:: python
client.cmd_sync({
'tgt': 'silver',
'fun': 'test.ping',
'arg': ... | [
"def",
"cmd_sync",
"(",
"self",
",",
"low",
")",
":",
"kwargs",
"=",
"copy",
".",
"deepcopy",
"(",
"low",
")",
"for",
"ignore",
"in",
"[",
"'tgt'",
",",
"'fun'",
",",
"'arg'",
",",
"'timeout'",
",",
"'tgt_type'",
",",
"'kwarg'",
"]",
":",
"if",
"ig... | Execute a salt-ssh call synchronously.
.. versionadded:: 2015.5.0
WARNING: Eauth is **NOT** respected
.. code-block:: python
client.cmd_sync({
'tgt': 'silver',
'fun': 'test.ping',
'arg': (),
'tgt_type'='glob',
... | [
"Execute",
"a",
"salt",
"-",
"ssh",
"call",
"synchronously",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/client.py#L120-L152 |
33,486 | saltstack/salt | salt/states/eselect.py | set_ | def set_(name, target, module_parameter=None, action_parameter=None):
'''
Verify that the given module is set to the given target
name
The name of the module
target
The target to be set for this module
module_parameter
additional params passed to the defined module
ac... | python | def set_(name, target, module_parameter=None, action_parameter=None):
'''
Verify that the given module is set to the given target
name
The name of the module
target
The target to be set for this module
module_parameter
additional params passed to the defined module
ac... | [
"def",
"set_",
"(",
"name",
",",
"target",
",",
"module_parameter",
"=",
"None",
",",
"action_parameter",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'name'",
":",
"name",
",",
"'result'",
":... | Verify that the given module is set to the given target
name
The name of the module
target
The target to be set for this module
module_parameter
additional params passed to the defined module
action_parameter
additional params passed to the defined action
.. code... | [
"Verify",
"that",
"the",
"given",
"module",
"is",
"set",
"to",
"the",
"given",
"target"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/eselect.py#L26-L85 |
33,487 | saltstack/salt | salt/modules/napalm_network.py | _filter_list | def _filter_list(input_list, search_key, search_value):
'''
Filters a list of dictionary by a set of key-value pair.
:param input_list: is a list of dictionaries
:param search_key: is the key we are looking for
:param search_value: is the value we are looking for the key specified in search_ke... | python | def _filter_list(input_list, search_key, search_value):
'''
Filters a list of dictionary by a set of key-value pair.
:param input_list: is a list of dictionaries
:param search_key: is the key we are looking for
:param search_value: is the value we are looking for the key specified in search_ke... | [
"def",
"_filter_list",
"(",
"input_list",
",",
"search_key",
",",
"search_value",
")",
":",
"output_list",
"=",
"list",
"(",
")",
"for",
"dictionary",
"in",
"input_list",
":",
"if",
"dictionary",
".",
"get",
"(",
"search_key",
")",
"==",
"search_value",
":",... | Filters a list of dictionary by a set of key-value pair.
:param input_list: is a list of dictionaries
:param search_key: is the key we are looking for
:param search_value: is the value we are looking for the key specified in search_key
:return: filered list of dictionaries | [
"Filters",
"a",
"list",
"of",
"dictionary",
"by",
"a",
"set",
"of",
"key",
"-",
"value",
"pair",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L70-L87 |
33,488 | saltstack/salt | salt/modules/napalm_network.py | _filter_dict | def _filter_dict(input_dict, search_key, search_value):
'''
Filters a dictionary of dictionaries by a key-value pair.
:param input_dict: is a dictionary whose values are lists of dictionaries
:param search_key: is the key in the leaf dictionaries
:param search_values: is the value in the lea... | python | def _filter_dict(input_dict, search_key, search_value):
'''
Filters a dictionary of dictionaries by a key-value pair.
:param input_dict: is a dictionary whose values are lists of dictionaries
:param search_key: is the key in the leaf dictionaries
:param search_values: is the value in the lea... | [
"def",
"_filter_dict",
"(",
"input_dict",
",",
"search_key",
",",
"search_value",
")",
":",
"output_dict",
"=",
"dict",
"(",
")",
"for",
"key",
",",
"key_list",
"in",
"six",
".",
"iteritems",
"(",
"input_dict",
")",
":",
"key_list_filtered",
"=",
"_filter_li... | Filters a dictionary of dictionaries by a key-value pair.
:param input_dict: is a dictionary whose values are lists of dictionaries
:param search_key: is the key in the leaf dictionaries
:param search_values: is the value in the leaf dictionaries
:return: filtered dictionary | [
"Filters",
"a",
"dictionary",
"of",
"dictionaries",
"by",
"a",
"key",
"-",
"value",
"pair",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L90-L108 |
33,489 | saltstack/salt | salt/modules/napalm_network.py | _explicit_close | def _explicit_close(napalm_device):
'''
Will explicily close the config session with the network device,
when running in a now-always-alive proxy minion or regular minion.
This helper must be used in configuration-related functions,
as the session is preserved and not closed before making any change... | python | def _explicit_close(napalm_device):
'''
Will explicily close the config session with the network device,
when running in a now-always-alive proxy minion or regular minion.
This helper must be used in configuration-related functions,
as the session is preserved and not closed before making any change... | [
"def",
"_explicit_close",
"(",
"napalm_device",
")",
":",
"if",
"salt",
".",
"utils",
".",
"napalm",
".",
"not_always_alive",
"(",
"__opts__",
")",
":",
"# force closing the configuration session",
"# when running in a non-always-alive proxy",
"# or regular minion",
"try",
... | Will explicily close the config session with the network device,
when running in a now-always-alive proxy minion or regular minion.
This helper must be used in configuration-related functions,
as the session is preserved and not closed before making any changes. | [
"Will",
"explicily",
"close",
"the",
"config",
"session",
"with",
"the",
"network",
"device",
"when",
"running",
"in",
"a",
"now",
"-",
"always",
"-",
"alive",
"proxy",
"minion",
"or",
"regular",
"minion",
".",
"This",
"helper",
"must",
"be",
"used",
"in",... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L142-L158 |
33,490 | saltstack/salt | salt/modules/napalm_network.py | traceroute | def traceroute(destination, source=None, ttl=None, timeout=None, vrf=None, **kwargs): # pylint: disable=unused-argument
'''
Calls the method traceroute from the NAPALM driver object and returns a dictionary with the result of the traceroute
command executed on the device.
destination
Hostname... | python | def traceroute(destination, source=None, ttl=None, timeout=None, vrf=None, **kwargs): # pylint: disable=unused-argument
'''
Calls the method traceroute from the NAPALM driver object and returns a dictionary with the result of the traceroute
command executed on the device.
destination
Hostname... | [
"def",
"traceroute",
"(",
"destination",
",",
"source",
"=",
"None",
",",
"ttl",
"=",
"None",
",",
"timeout",
"=",
"None",
",",
"vrf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"return",
"salt",
".",
"utils",
".... | Calls the method traceroute from the NAPALM driver object and returns a dictionary with the result of the traceroute
command executed on the device.
destination
Hostname or address of remote host
source
Source address to use in outgoing traceroute packets
ttl
IP maximum time-t... | [
"Calls",
"the",
"method",
"traceroute",
"from",
"the",
"NAPALM",
"driver",
"object",
"and",
"returns",
"a",
"dictionary",
"with",
"the",
"result",
"of",
"the",
"traceroute",
"command",
"executed",
"on",
"the",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L787-L828 |
33,491 | saltstack/salt | salt/modules/napalm_network.py | ping | def ping(destination, source=None, ttl=None, timeout=None, size=None, count=None, vrf=None, **kwargs): # pylint: disable=unused-argument
'''
Executes a ping on the network device and returns a dictionary as a result.
destination
Hostname or IP address of remote host
source
Source add... | python | def ping(destination, source=None, ttl=None, timeout=None, size=None, count=None, vrf=None, **kwargs): # pylint: disable=unused-argument
'''
Executes a ping on the network device and returns a dictionary as a result.
destination
Hostname or IP address of remote host
source
Source add... | [
"def",
"ping",
"(",
"destination",
",",
"source",
"=",
"None",
",",
"ttl",
"=",
"None",
",",
"timeout",
"=",
"None",
",",
"size",
"=",
"None",
",",
"count",
"=",
"None",
",",
"vrf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable... | Executes a ping on the network device and returns a dictionary as a result.
destination
Hostname or IP address of remote host
source
Source address of echo request
ttl
IP time-to-live value (IPv6 hop-limit value) (1..255 hops)
timeout
Maximum wait time after sending f... | [
"Executes",
"a",
"ping",
"on",
"the",
"network",
"device",
"and",
"returns",
"a",
"dictionary",
"as",
"a",
"result",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L832-L881 |
33,492 | saltstack/salt | salt/modules/napalm_network.py | arp | def arp(interface='', ipaddr='', macaddr='', **kwargs): # pylint: disable=unused-argument
'''
NAPALM returns a list of dictionaries with details of the ARP entries.
:param interface: interface name to filter on
:param ipaddr: IP address to filter on
:param macaddr: MAC address to filter on
:r... | python | def arp(interface='', ipaddr='', macaddr='', **kwargs): # pylint: disable=unused-argument
'''
NAPALM returns a list of dictionaries with details of the ARP entries.
:param interface: interface name to filter on
:param ipaddr: IP address to filter on
:param macaddr: MAC address to filter on
:r... | [
"def",
"arp",
"(",
"interface",
"=",
"''",
",",
"ipaddr",
"=",
"''",
",",
"macaddr",
"=",
"''",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"proxy_output",
"=",
"salt",
".",
"utils",
".",
"napalm",
".",
"call",
"(",
"napalm_de... | NAPALM returns a list of dictionaries with details of the ARP entries.
:param interface: interface name to filter on
:param ipaddr: IP address to filter on
:param macaddr: MAC address to filter on
:return: List of the entries in the ARP table
CLI Example:
.. code-block:: bash
salt '*... | [
"NAPALM",
"returns",
"a",
"list",
"of",
"dictionaries",
"with",
"details",
"of",
"the",
"ARP",
"entries",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L885-L947 |
33,493 | saltstack/salt | salt/modules/napalm_network.py | lldp | def lldp(interface='', **kwargs): # pylint: disable=unused-argument
'''
Returns a detailed view of the LLDP neighbors.
:param interface: interface name to filter on
:return: A dictionary with the LLDL neighbors. The keys are the
interfaces with LLDP activated on.
CLI Example:
... | python | def lldp(interface='', **kwargs): # pylint: disable=unused-argument
'''
Returns a detailed view of the LLDP neighbors.
:param interface: interface name to filter on
:return: A dictionary with the LLDL neighbors. The keys are the
interfaces with LLDP activated on.
CLI Example:
... | [
"def",
"lldp",
"(",
"interface",
"=",
"''",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"proxy_output",
"=",
"salt",
".",
"utils",
".",
"napalm",
".",
"call",
"(",
"napalm_device",
",",
"# pylint: disable=undefined-variable",
"'get_lldp... | Returns a detailed view of the LLDP neighbors.
:param interface: interface name to filter on
:return: A dictionary with the LLDL neighbors. The keys are the
interfaces with LLDP activated on.
CLI Example:
.. code-block:: bash
salt '*' net.lldp
salt '*' net.lldp inte... | [
"Returns",
"a",
"detailed",
"view",
"of",
"the",
"LLDP",
"neighbors",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L1058-L1117 |
33,494 | saltstack/salt | salt/modules/napalm_network.py | mac | def mac(address='', interface='', vlan=0, **kwargs): # pylint: disable=unused-argument
'''
Returns the MAC Address Table on the device.
:param address: MAC address to filter on
:param interface: Interface name to filter on
:param vlan: VLAN identifier
:return: A list of dictio... | python | def mac(address='', interface='', vlan=0, **kwargs): # pylint: disable=unused-argument
'''
Returns the MAC Address Table on the device.
:param address: MAC address to filter on
:param interface: Interface name to filter on
:param vlan: VLAN identifier
:return: A list of dictio... | [
"def",
"mac",
"(",
"address",
"=",
"''",
",",
"interface",
"=",
"''",
",",
"vlan",
"=",
"0",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"proxy_output",
"=",
"salt",
".",
"utils",
".",
"napalm",
".",
"call",
"(",
"napalm_devic... | Returns the MAC Address Table on the device.
:param address: MAC address to filter on
:param interface: Interface name to filter on
:param vlan: VLAN identifier
:return: A list of dictionaries representing the entries in the MAC Address Table
CLI Example:
.. code-block:: bash
... | [
"Returns",
"the",
"MAC",
"Address",
"Table",
"on",
"the",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L1121-L1190 |
33,495 | saltstack/salt | salt/modules/napalm_network.py | load_config | def load_config(filename=None,
text=None,
test=False,
commit=True,
debug=False,
replace=False,
commit_in=None,
commit_at=None,
revert_in=None,
revert_at=None,
c... | python | def load_config(filename=None,
text=None,
test=False,
commit=True,
debug=False,
replace=False,
commit_in=None,
commit_at=None,
revert_in=None,
revert_at=None,
c... | [
"def",
"load_config",
"(",
"filename",
"=",
"None",
",",
"text",
"=",
"None",
",",
"test",
"=",
"False",
",",
"commit",
"=",
"True",
",",
"debug",
"=",
"False",
",",
"replace",
"=",
"False",
",",
"commit_in",
"=",
"None",
",",
"commit_at",
"=",
"None... | Applies configuration changes on the device. It can be loaded from a file or from inline string.
If you send both a filename and a string containing the configuration, the file has higher precedence.
By default this function will commit the changes. If there are no changes, it does not commit and
the flag ... | [
"Applies",
"configuration",
"changes",
"on",
"the",
"device",
".",
"It",
"can",
"be",
"loaded",
"from",
"a",
"file",
"or",
"from",
"inline",
"string",
".",
"If",
"you",
"send",
"both",
"a",
"filename",
"and",
"a",
"string",
"containing",
"the",
"configurat... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L1296-L1551 |
33,496 | saltstack/salt | salt/modules/napalm_network.py | config_changed | def config_changed(inherit_napalm_device=None, **kwargs): # pylint: disable=unused-argument
'''
Will prompt if the configuration has been changed.
:return: A tuple with a boolean that specifies if the config was changed on the device.\
And a string that provides more details of the reason why the con... | python | def config_changed(inherit_napalm_device=None, **kwargs): # pylint: disable=unused-argument
'''
Will prompt if the configuration has been changed.
:return: A tuple with a boolean that specifies if the config was changed on the device.\
And a string that provides more details of the reason why the con... | [
"def",
"config_changed",
"(",
"inherit_napalm_device",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"is_config_changed",
"=",
"False",
"reason",
"=",
"''",
"try_compare",
"=",
"compare_config",
"(",
"inherit_napalm_device",
"=",... | Will prompt if the configuration has been changed.
:return: A tuple with a boolean that specifies if the config was changed on the device.\
And a string that provides more details of the reason why the configuration was not changed.
CLI Example:
.. code-block:: bash
salt '*' net.config_chang... | [
"Will",
"prompt",
"if",
"the",
"configuration",
"has",
"been",
"changed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L2166-L2193 |
33,497 | saltstack/salt | salt/modules/napalm_network.py | config_control | def config_control(inherit_napalm_device=None, **kwargs): # pylint: disable=unused-argument
'''
Will check if the configuration was changed.
If differences found, will try to commit.
In case commit unsuccessful, will try to rollback.
:return: A tuple with a boolean that specifies if the config wa... | python | def config_control(inherit_napalm_device=None, **kwargs): # pylint: disable=unused-argument
'''
Will check if the configuration was changed.
If differences found, will try to commit.
In case commit unsuccessful, will try to rollback.
:return: A tuple with a boolean that specifies if the config wa... | [
"def",
"config_control",
"(",
"inherit_napalm_device",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"result",
"=",
"True",
"comment",
"=",
"''",
"changed",
",",
"not_changed_rsn",
"=",
"config_changed",
"(",
"inherit_napalm_de... | Will check if the configuration was changed.
If differences found, will try to commit.
In case commit unsuccessful, will try to rollback.
:return: A tuple with a boolean that specifies if the config was changed/committed/rollbacked on the device.\
And a string that provides more details of the reason w... | [
"Will",
"check",
"if",
"the",
"configuration",
"was",
"changed",
".",
"If",
"differences",
"found",
"will",
"try",
"to",
"commit",
".",
"In",
"case",
"commit",
"unsuccessful",
"will",
"try",
"to",
"rollback",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L2197-L2235 |
33,498 | saltstack/salt | salt/cli/run.py | SaltRun.run | def run(self):
'''
Execute salt-run
'''
import salt.runner
self.parse_args()
# Setup file logging!
self.setup_logfile_logger()
verify_log(self.config)
profiling_enabled = self.options.profiling_enabled
runner = salt.runner.Runner(self.con... | python | def run(self):
'''
Execute salt-run
'''
import salt.runner
self.parse_args()
# Setup file logging!
self.setup_logfile_logger()
verify_log(self.config)
profiling_enabled = self.options.profiling_enabled
runner = salt.runner.Runner(self.con... | [
"def",
"run",
"(",
"self",
")",
":",
"import",
"salt",
".",
"runner",
"self",
".",
"parse_args",
"(",
")",
"# Setup file logging!",
"self",
".",
"setup_logfile_logger",
"(",
")",
"verify_log",
"(",
"self",
".",
"config",
")",
"profiling_enabled",
"=",
"self"... | Execute salt-run | [
"Execute",
"salt",
"-",
"run"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/run.py#L17-L58 |
33,499 | saltstack/salt | salt/states/dellchassis.py | _firmware_update | def _firmware_update(firmwarefile='', host='',
directory=''):
'''
Update firmware for a single host
'''
dest = os.path.join(directory, firmwarefile[7:])
__salt__['cp.get_file'](firmwarefile, dest)
username = __pillar__['proxy']['admin_user']
password = __pillar__['prox... | python | def _firmware_update(firmwarefile='', host='',
directory=''):
'''
Update firmware for a single host
'''
dest = os.path.join(directory, firmwarefile[7:])
__salt__['cp.get_file'](firmwarefile, dest)
username = __pillar__['proxy']['admin_user']
password = __pillar__['prox... | [
"def",
"_firmware_update",
"(",
"firmwarefile",
"=",
"''",
",",
"host",
"=",
"''",
",",
"directory",
"=",
"''",
")",
":",
"dest",
"=",
"os",
".",
"path",
".",
"join",
"(",
"directory",
",",
"firmwarefile",
"[",
"7",
":",
"]",
")",
"__salt__",
"[",
... | Update firmware for a single host | [
"Update",
"firmware",
"for",
"a",
"single",
"host"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/dellchassis.py#L667-L681 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.