repository_name stringclasses 316
values | func_path_in_repository stringlengths 6 223 | func_name stringlengths 1 134 | language stringclasses 1
value | func_code_string stringlengths 57 65.5k | func_documentation_string stringlengths 1 46.3k | split_name stringclasses 1
value | func_code_url stringlengths 91 315 | called_functions listlengths 1 156 ⌀ | enclosing_scope stringlengths 2 1.48M |
|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/cloud/__init__.py | Cloud.image_list | python | def image_list(self, lookup='all'):
'''
Return a mapping of all image data for available providers
'''
data = {}
lookups = self.lookup_providers(lookup)
if not lookups:
return data
for alias, driver in lookups:
fun = '{0}.avail_images'.fo... | Return a mapping of all image data for available providers | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L836-L872 | [
"def lookup_providers(self, lookup):\n '''\n Get a dict describing the configured providers\n '''\n if lookup is None:\n lookup = 'all'\n if lookup == 'all':\n providers = set()\n for alias, drivers in six.iteritems(self.opts['providers']):\n for driver in drivers:\n ... | class Cloud(object):
'''
An object for the creation of new VMs
'''
def __init__(self, opts):
self.opts = opts
self.client = CloudClient(opts=self.opts)
self.clouds = salt.loader.clouds(self.opts)
self.__filter_non_working_providers()
self.__cached_provider_queries... |
saltstack/salt | salt/cloud/__init__.py | Cloud.provider_list | python | def provider_list(self, lookup='all'):
'''
Return a mapping of all image data for available providers
'''
data = {}
lookups = self.lookup_providers(lookup)
if not lookups:
return data
for alias, driver in lookups:
if alias not in data:
... | Return a mapping of all image data for available providers | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L912-L926 | [
"def lookup_providers(self, lookup):\n '''\n Get a dict describing the configured providers\n '''\n if lookup is None:\n lookup = 'all'\n if lookup == 'all':\n providers = set()\n for alias, drivers in six.iteritems(self.opts['providers']):\n for driver in drivers:\n ... | class Cloud(object):
'''
An object for the creation of new VMs
'''
def __init__(self, opts):
self.opts = opts
self.client = CloudClient(opts=self.opts)
self.clouds = salt.loader.clouds(self.opts)
self.__filter_non_working_providers()
self.__cached_provider_queries... |
saltstack/salt | salt/cloud/__init__.py | Cloud.profile_list | 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:... | Return a mapping of all configured profiles | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L928-L943 | [
"def lookup_profiles(self, provider, lookup):\n '''\n Return a dictionary describing the configured profiles\n '''\n if provider is None:\n provider = 'all'\n if lookup is None:\n lookup = 'all'\n\n if lookup == 'all':\n profiles = set()\n provider_profiles = set()\n ... | class Cloud(object):
'''
An object for the creation of new VMs
'''
def __init__(self, opts):
self.opts = opts
self.client = CloudClient(opts=self.opts)
self.clouds = salt.loader.clouds(self.opts)
self.__filter_non_working_providers()
self.__cached_provider_queries... |
saltstack/salt | salt/cloud/__init__.py | Cloud.create_all | python | def create_all(self):
'''
Create/Verify the VMs in the VM data
'''
ret = []
for vm_name, vm_details in six.iteritems(self.opts['profiles']):
ret.append(
{vm_name: self.create(vm_details)}
)
return ret | Create/Verify the VMs in the VM data | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L945-L956 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def create(self, vm_, local_master=True):\n '''\n Create a single VM\n '''\n output = {}\n\n minion_dict = salt.config.get_cloud_config_value(\n 'minion', vm_, self.opts, default={}\n )\n\n alias, driver = vm_['provider'].spli... | class Cloud(object):
'''
An object for the creation of new VMs
'''
def __init__(self, opts):
self.opts = opts
self.client = CloudClient(opts=self.opts)
self.clouds = salt.loader.clouds(self.opts)
self.__filter_non_working_providers()
self.__cached_provider_queries... |
saltstack/salt | salt/cloud/__init__.py | Cloud.destroy | python | def destroy(self, names, cached=False):
'''
Destroy the named VMs
'''
processed = {}
names = set(names)
matching = self.get_running_by_names(names, cached=cached)
vms_to_destroy = set()
parallel_data = []
for alias, drivers in six.iteritems(matchin... | Destroy the named VMs | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L958-L1138 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def enter_mainloop(target,\n mapped_args=None,\n args=None,\n kwargs=None,\n pool=None,\n pool_size=None,\n callback=None,\n que... | class Cloud(object):
'''
An object for the creation of new VMs
'''
def __init__(self, opts):
self.opts = opts
self.client = CloudClient(opts=self.opts)
self.clouds = salt.loader.clouds(self.opts)
self.__filter_non_working_providers()
self.__cached_provider_queries... |
saltstack/salt | salt/cloud/__init__.py | Cloud.reboot | 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... | Reboot the named VMs | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1140-L1159 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def map_providers_parallel(self, query='list_nodes', cached=False):\n '''\n Return a mapping of what named VMs are running on what VM providers\n based on what providers are defined in the configuration and VMs\n\n Same as map_providers but q... | class Cloud(object):
'''
An object for the creation of new VMs
'''
def __init__(self, opts):
self.opts = opts
self.client = CloudClient(opts=self.opts)
self.clouds = salt.loader.clouds(self.opts)
self.__filter_non_working_providers()
self.__cached_provider_queries... |
saltstack/salt | salt/cloud/__init__.py | Cloud.create | python | def create(self, vm_, local_master=True):
'''
Create a single VM
'''
output = {}
minion_dict = salt.config.get_cloud_config_value(
'minion', vm_, self.opts, default={}
)
alias, driver = vm_['provider'].split(':')
fun = '{0}.create'.format(dri... | Create a single VM | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1161-L1316 | [
"def u(s):\n return unicode(s.replace(r'\\\\', r'\\\\\\\\'), \"unicode_escape\")\n",
"def get_local_client(\n c_path=os.path.join(syspaths.CONFIG_DIR, 'master'),\n mopts=None,\n skip_perm_errors=False,\n io_loop=None,\n auto_reconnect=False):\n '''\n .. versionadded:: 2... | class Cloud(object):
'''
An object for the creation of new VMs
'''
def __init__(self, opts):
self.opts = opts
self.client = CloudClient(opts=self.opts)
self.clouds = salt.loader.clouds(self.opts)
self.__filter_non_working_providers()
self.__cached_provider_queries... |
saltstack/salt | salt/cloud/__init__.py | Cloud.vm_config | 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... | 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 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1319-L1334 | [
"def update(dest, upd, recursive_update=True, merge_lists=False):\n '''\n Recursive version of the default dict.update\n\n Merges upd recursively into dest\n\n If recursive_update=False, will use the classic dict.update, or fall back\n on a manual merge (helpful for non-dict types like FunctionWrappe... | class Cloud(object):
'''
An object for the creation of new VMs
'''
def __init__(self, opts):
self.opts = opts
self.client = CloudClient(opts=self.opts)
self.clouds = salt.loader.clouds(self.opts)
self.__filter_non_working_providers()
self.__cached_provider_queries... |
saltstack/salt | salt/cloud/__init__.py | Cloud.extras | python | def extras(self, extra_):
'''
Extra actions
'''
output = {}
alias, driver = extra_['provider'].split(':')
fun = '{0}.{1}'.format(driver, extra_['action'])
if fun not in self.clouds:
log.error(
'Creating \'%s\' using \'%s\' as the provi... | Extra actions | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1336-L1364 | null | class Cloud(object):
'''
An object for the creation of new VMs
'''
def __init__(self, opts):
self.opts = opts
self.client = CloudClient(opts=self.opts)
self.clouds = salt.loader.clouds(self.opts)
self.__filter_non_working_providers()
self.__cached_provider_queries... |
saltstack/salt | salt/cloud/__init__.py | Cloud.run_profile | 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)
... | Parse over the options passed on the command line and determine how to
handle them | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1366-L1453 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as ... | class Cloud(object):
'''
An object for the creation of new VMs
'''
def __init__(self, opts):
self.opts = opts
self.client = CloudClient(opts=self.opts)
self.clouds = salt.loader.clouds(self.opts)
self.__filter_non_working_providers()
self.__cached_provider_queries... |
saltstack/salt | salt/cloud/__init__.py | Cloud.do_action | 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:
... | Perform an action on a VM which may be specific to this cloud provider | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1455-L1547 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def clean_kwargs(**kwargs):\n '''\n Return a dict without any of the __pub* keys (or any other keys starting\n with a dunder) from the kwargs dict passed into the execution module\n functions. These keys are useful for tracking what was used ... | class Cloud(object):
'''
An object for the creation of new VMs
'''
def __init__(self, opts):
self.opts = opts
self.client = CloudClient(opts=self.opts)
self.clouds = salt.loader.clouds(self.opts)
self.__filter_non_working_providers()
self.__cached_provider_queries... |
saltstack/salt | salt/cloud/__init__.py | Cloud.do_function | 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 '
... | Perform a function against a cloud provider | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1549-L1595 | [
"def lookup_providers(self, lookup):\n '''\n Get a dict describing the configured providers\n '''\n if lookup is None:\n lookup = 'all'\n if lookup == 'all':\n providers = set()\n for alias, drivers in six.iteritems(self.opts['providers']):\n for driver in drivers:\n ... | class Cloud(object):
'''
An object for the creation of new VMs
'''
def __init__(self, opts):
self.opts = opts
self.client = CloudClient(opts=self.opts)
self.clouds = salt.loader.clouds(self.opts)
self.__filter_non_working_providers()
self.__cached_provider_queries... |
saltstack/salt | salt/cloud/__init__.py | Cloud.__filter_non_working_providers | 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(... | Remove any mis-configured cloud providers from the available listing | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1597-L1643 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n"
] | class Cloud(object):
'''
An object for the creation of new VMs
'''
def __init__(self, opts):
self.opts = opts
self.client = CloudClient(opts=self.opts)
self.clouds = salt.loader.clouds(self.opts)
self.__filter_non_working_providers()
self.__cached_provider_queries... |
saltstack/salt | salt/cloud/__init__.py | Map.read | python | def read(self):
'''
Read in the specified map and return the map structure
'''
map_ = None
if self.opts.get('map', None) is None:
if self.opts.get('map_data', None) is None:
if self.opts.get('map_pillar', None) is None:
pass
... | Read in the specified map and return the map structure | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1742-L1857 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def compile_template(template,\n renderers,\n default,\n blacklist,\n whitelist,\n saltenv='base',\n sls='',\n inp... | class Map(Cloud):
'''
Create a VM stateful map execution object
'''
def __init__(self, opts):
Cloud.__init__(self, opts)
self.rendered_map = self.read()
def interpolated_map(self, query='list_nodes', cached=False):
rendered_map = self.read().copy()
interpolated_map =... |
saltstack/salt | salt/cloud/__init__.py | Map.map_data | python | def map_data(self, cached=False):
'''
Create a data map of what to execute on
'''
ret = {'create': {}}
pmap = self.map_providers_parallel(cached=cached)
exist = set()
defined = set()
rendered_map = copy.deepcopy(self.rendered_map)
for profile_name,... | Create a data map of what to execute on | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L1905-L2029 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def update(dest, upd, recursive_update=True, merge_lists=False):\n '''\n Recursive version of the default dict.update\n\n Merges upd recursively into dest\n\n If recursive_update=False, will use the classic dict.update, or fall back\n on a... | class Map(Cloud):
'''
Create a VM stateful map execution object
'''
def __init__(self, opts):
Cloud.__init__(self, opts)
self.rendered_map = self.read()
def interpolated_map(self, query='list_nodes', cached=False):
rendered_map = self.read().copy()
interpolated_map =... |
saltstack/salt | salt/cloud/__init__.py | Map.run_map | python | def run_map(self, dmap):
'''
Execute the contents of the VM map
'''
if self._has_loop(dmap):
msg = 'Uh-oh, that cloud map has a dependency loop!'
log.error(msg)
raise SaltCloudException(msg)
# Go through the create list and calc dependencies
... | Execute the contents of the VM map | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/__init__.py#L2031-L2293 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n ... | class Map(Cloud):
'''
Create a VM stateful map execution object
'''
def __init__(self, opts):
Cloud.__init__(self, opts)
self.rendered_map = self.read()
def interpolated_map(self, query='list_nodes', cached=False):
rendered_map = self.read().copy()
interpolated_map =... |
saltstack/salt | salt/modules/gpg.py | _get_user_info | 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... | Wrapper for user.info Salt function | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L104-L122 | [
"def _get_user_info(user=None):\n '''\n Wrapper for user.info Salt function\n '''\n if not user:\n # Get user Salt runnining as\n user = __salt__['config.option']('user')\n\n userinfo = __salt__['user.info'](user)\n\n if not userinfo:\n if user == 'salt':\n # Specia... | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | _get_user_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 | Return default GnuPG home directory path for a user | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L125-L134 | [
"def _get_user_info(user=None):\n '''\n Wrapper for user.info Salt function\n '''\n if not user:\n # Get user Salt runnining as\n user = __salt__['config.option']('user')\n\n userinfo = __salt__['user.info'](user)\n\n if not userinfo:\n if user == 'salt':\n # Specia... | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | _create_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 | Create the GPG object | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L176-L188 | [
"def _get_user_gnupghome(user):\n '''\n Return default GnuPG home directory path for a user\n '''\n if user == 'salt':\n gnupghome = os.path.join(__salt__['config.get']('config_dir'), 'gpgkeys')\n else:\n gnupghome = os.path.join(_get_user_info(user)['home'], '.gnupg')\n\n return gnu... | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | _list_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 | Helper function for Listing keys | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L191-L197 | [
"def _create_gpg(user=None, gnupghome=None):\n '''\n Create the GPG object\n '''\n if not gnupghome:\n gnupghome = _get_user_gnupghome(user)\n\n if GPG_1_3_1:\n gpg = gnupg.GPG(homedir=gnupghome)\n else:\n gpg = gnupg.GPG(gnupghome=gnupghome)\n\n return gpg\n"
] | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | _search_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 | Helper function for searching keys from keyserver | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L200-L209 | [
"def _create_gpg(user=None, gnupghome=None):\n '''\n Create the GPG object\n '''\n if not gnupghome:\n gnupghome = _get_user_gnupghome(user)\n\n if GPG_1_3_1:\n gpg = gnupg.GPG(homedir=gnupghome)\n else:\n gpg = gnupg.GPG(gnupghome=gnupghome)\n\n return gpg\n"
] | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | search_keys | 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... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L212-L262 | [
"def _search_keys(text, keyserver, user=None):\n '''\n Helper function for searching keys from keyserver\n '''\n gpg = _create_gpg(user)\n if keyserver:\n _keys = gpg.search_keys(text, keyserver)\n else:\n _keys = gpg.search_keys(text)\n return _keys\n"
] | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | list_keys | 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... | 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.
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L265-L309 | [
"def _list_keys(user=None, gnupghome=None, secret=False):\n '''\n Helper function for Listing keys\n '''\n gpg = _create_gpg(user, gnupghome)\n _keys = gpg.list_keys(secret)\n return _keys\n"
] | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | create_key | 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... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L360-L477 | [
"def _create_gpg(user=None, gnupghome=None):\n '''\n Create the GPG object\n '''\n if not gnupghome:\n gnupghome = _get_user_gnupghome(user)\n\n if GPG_1_3_1:\n gpg = gnupg.GPG(homedir=gnupghome)\n else:\n gpg = gnupg.GPG(gnupghome=gnupghome)\n\n return gpg\n"
] | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | delete_key | python | def delete_key(keyid=None,
fingerprint=None,
delete_secret=False,
user=None,
gnupghome=None):
'''
Get a key from the GPG keychain
keyid
The keyid of the key to be deleted.
fingerprint
The fingerprint of the key to be deleted.
... | Get a key from the GPG keychain
keyid
The keyid of the key to be deleted.
fingerprint
The fingerprint of the key to be deleted.
delete_secret
Whether to delete a corresponding secret key prior to deleting the public key.
Secret keys must be deleted before deleting any corr... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L480-L555 | [
"def get_key(keyid=None, fingerprint=None, user=None, gnupghome=None):\n '''\n Get a key from the GPG keychain\n\n keyid\n The key ID (short or long) of the key to be retrieved.\n\n fingerprint\n The fingerprint of the key to be retrieved.\n\n user\n Which user's keychain to acce... | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | get_key | python | def get_key(keyid=None, fingerprint=None, user=None, gnupghome=None):
'''
Get a key from the GPG keychain
keyid
The key ID (short or long) of the key to be retrieved.
fingerprint
The fingerprint of the key to be retrieved.
user
Which user's keychain to access, defaults to ... | Get a key from the GPG keychain
keyid
The key ID (short or long) of the key to be retrieved.
fingerprint
The fingerprint of the key to be retrieved.
user
Which user's keychain to access, defaults to user Salt is running as.
Passing the user as ``salt`` will set the GnuPG h... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L558-L617 | [
"def _list_keys(user=None, gnupghome=None, secret=False):\n '''\n Helper function for Listing keys\n '''\n gpg = _create_gpg(user, gnupghome)\n _keys = gpg.list_keys(secret)\n return _keys\n"
] | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | import_key | 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... | 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
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L683-L755 | [
"def _create_gpg(user=None, gnupghome=None):\n '''\n Create the GPG object\n '''\n if not gnupghome:\n gnupghome = _get_user_gnupghome(user)\n\n if GPG_1_3_1:\n gpg = gnupg.GPG(homedir=gnupghome)\n else:\n gpg = gnupg.GPG(gnupghome=gnupghome)\n\n return gpg\n"
] | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | export_key | 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... | 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 ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L758-L794 | [
"def _create_gpg(user=None, gnupghome=None):\n '''\n Create the GPG object\n '''\n if not gnupghome:\n gnupghome = _get_user_gnupghome(user)\n\n if GPG_1_3_1:\n gpg = gnupg.GPG(homedir=gnupghome)\n else:\n gpg = gnupg.GPG(gnupghome=gnupghome)\n\n return gpg\n"
] | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | receive_keys | python | def receive_keys(keyserver=None, keys=None, user=None, gnupghome=None):
'''
Receive key(s) from keyserver and add them to keychain
keyserver
Keyserver to use for searching for GPG keys, defaults to pgp.mit.edu
keys
The keyID(s) to retrieve from the keyserver. Can be specified as a com... | Receive key(s) from keyserver and add them to keychain
keyserver
Keyserver to use for searching for GPG keys, defaults to pgp.mit.edu
keys
The keyID(s) to retrieve from the keyserver. Can be specified as a comma
separated string or a list.
user
Which user's keychain to ac... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L798-L851 | [
"def _create_gpg(user=None, gnupghome=None):\n '''\n Create the GPG object\n '''\n if not gnupghome:\n gnupghome = _get_user_gnupghome(user)\n\n if GPG_1_3_1:\n gpg = gnupg.GPG(homedir=gnupghome)\n else:\n gpg = gnupg.GPG(gnupghome=gnupghome)\n\n return gpg\n"
] | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | trust_key | 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... | 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, ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L854-L951 | [
"def get_key(keyid=None, fingerprint=None, user=None, gnupghome=None):\n '''\n Get a key from the GPG keychain\n\n keyid\n The key ID (short or long) of the key to be retrieved.\n\n fingerprint\n The fingerprint of the key to be retrieved.\n\n user\n Which user's keychain to acce... | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | sign | 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`... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L954-L1027 | [
"def _create_gpg(user=None, gnupghome=None):\n '''\n Create the GPG object\n '''\n if not gnupghome:\n gnupghome = _get_user_gnupghome(user)\n\n if GPG_1_3_1:\n gpg = gnupg.GPG(homedir=gnupghome)\n else:\n gpg = gnupg.GPG(gnupghome=gnupghome)\n\n return gpg\n"
] | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | verify | 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... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L1030-L1117 | [
"def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ... | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | encrypt | 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... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L1120-L1223 | [
"def _create_gpg(user=None, gnupghome=None):\n '''\n Create the GPG object\n '''\n if not gnupghome:\n gnupghome = _get_user_gnupghome(user)\n\n if GPG_1_3_1:\n gpg = gnupg.GPG(homedir=gnupghome)\n else:\n gpg = gnupg.GPG(gnupghome=gnupghome)\n\n return gpg\n"
] | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/modules/gpg.py | decrypt | 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... | 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 ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gpg.py#L1226-L1311 | [
"def _create_gpg(user=None, gnupghome=None):\n '''\n Create the GPG object\n '''\n if not gnupghome:\n gnupghome = _get_user_gnupghome(user)\n\n if GPG_1_3_1:\n gpg = gnupg.GPG(homedir=gnupghome)\n else:\n gpg = gnupg.GPG(gnupghome=gnupghome)\n\n return gpg\n"
] | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... |
saltstack/salt | salt/utils/msgpack.py | pack | python | def pack(o, stream, **kwargs):
'''
.. versionadded:: 2018.3.4
Wraps msgpack.pack and ensures that the passed object is unwrapped if it is
a proxy.
By default, this function uses the msgpack module and falls back to
msgpack_pure, if the msgpack is not available. You can pass an alternate
ms... | .. versionadded:: 2018.3.4
Wraps msgpack.pack and ensures that the passed object is unwrapped if it is
a proxy.
By default, this function uses the msgpack module and falls back to
msgpack_pure, if the msgpack is not available. You can pass an alternate
msgpack module using the _msgpack_module argu... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msgpack.py#L20-L38 | null | # -*- coding: utf-8 -*-
'''
Functions to work with MessagePack
'''
from __future__ import absolute_import
# Import Python libs
try:
# Attempt to import msgpack
import msgpack
except ImportError:
# Fall back to msgpack_pure
import msgpack_pure as msgpack # pylint: disable=import-error
# Import Salt l... |
saltstack/salt | salt/utils/msgpack.py | unpack | python | def unpack(stream, **kwargs):
'''
.. versionadded:: 2018.3.4
Wraps msgpack.unpack.
By default, this function uses the msgpack module and falls back to
msgpack_pure, if the msgpack is not available. You can pass an alternate
msgpack module using the _msgpack_module argument.
'''
msgpack... | .. versionadded:: 2018.3.4
Wraps msgpack.unpack.
By default, this function uses the msgpack module and falls back to
msgpack_pure, if the msgpack is not available. You can pass an alternate
msgpack module using the _msgpack_module argument. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msgpack.py#L62-L73 | null | # -*- coding: utf-8 -*-
'''
Functions to work with MessagePack
'''
from __future__ import absolute_import
# Import Python libs
try:
# Attempt to import msgpack
import msgpack
except ImportError:
# Fall back to msgpack_pure
import msgpack_pure as msgpack # pylint: disable=import-error
# Import Salt l... |
saltstack/salt | salt/utils/msgpack.py | unpackb | python | def unpackb(packed, **kwargs):
'''
.. versionadded:: 2018.3.4
Wraps msgpack.unpack.
By default, this function uses the msgpack module and falls back to
msgpack_pure, if the msgpack is not available. You can pass an alternate
msgpack module using the _msgpack_module argument.
'''
msgpac... | .. versionadded:: 2018.3.4
Wraps msgpack.unpack.
By default, this function uses the msgpack module and falls back to
msgpack_pure, if the msgpack is not available. You can pass an alternate
msgpack module using the _msgpack_module argument. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msgpack.py#L76-L87 | null | # -*- coding: utf-8 -*-
'''
Functions to work with MessagePack
'''
from __future__ import absolute_import
# Import Python libs
try:
# Attempt to import msgpack
import msgpack
except ImportError:
# Fall back to msgpack_pure
import msgpack_pure as msgpack # pylint: disable=import-error
# Import Salt l... |
saltstack/salt | salt/thorium/key.py | timeout | python | def timeout(name, delete=0, reject=0):
'''
If any minion's status is older than the timeout value then apply the
given action to the timed out key. This example will remove keys to
minions that have not checked in for 300 seconds (5 minutes)
USAGE:
.. code-block:: yaml
statreg:
... | If any minion's status is older than the timeout value then apply the
given action to the timed out key. This example will remove keys to
minions that have not checked in for 300 seconds (5 minutes)
USAGE:
.. code-block:: yaml
statreg:
status.reg
clean_keys:
key.t... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/key.py#L24-L80 | [
"def _get_key_api():\n '''\n Return the key api hook\n '''\n if 'keyapi' not in __context__:\n __context__['keyapi'] = salt.key.Key(__opts__)\n return __context__['keyapi']\n"
] | # -*- coding: utf-8 -*-
'''
The key Thorium State is used to apply changes to the accepted/rejected/pending keys
.. versionadded:: 2016.11.0
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import time
# Import salt libs
import salt.key
def _get_key_api():
'''
... |
saltstack/salt | salt/beacons/inotify.py | _get_notifier | python | def _get_notifier(config):
'''
Check the context for the notifier and construct it if not present
'''
if 'inotify.notifier' not in __context__:
__context__['inotify.queue'] = collections.deque()
wm = pyinotify.WatchManager()
__context__['inotify.notifier'] = pyinotify.Notifier(wm... | Check the context for the notifier and construct it if not present | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/inotify.py#L70-L82 | null | # -*- coding: utf-8 -*-
'''
Watch files and translate the changes into salt events
:depends: - pyinotify Python module >= 0.9.5
:Caution: Using generic mask options like open, access, ignored, and
closed_nowrite with reactors can easily cause the reactor
to loop on itself. To mitigate this... |
saltstack/salt | salt/beacons/inotify.py | validate | python | def validate(config):
'''
Validate the beacon configuration
'''
VALID_MASK = [
'access',
'attrib',
'close_nowrite',
'close_write',
'create',
'delete',
'delete_self',
'excl_unlink',
'ignored',
'modify',
'moved_from',... | Validate the beacon configuration | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/inotify.py#L85-L150 | null | # -*- coding: utf-8 -*-
'''
Watch files and translate the changes into salt events
:depends: - pyinotify Python module >= 0.9.5
:Caution: Using generic mask options like open, access, ignored, and
closed_nowrite with reactors can easily cause the reactor
to loop on itself. To mitigate this... |
saltstack/salt | salt/beacons/inotify.py | beacon | python | def beacon(config):
'''
Watch the configured files
Example Config
.. code-block:: yaml
beacons:
inotify:
- files:
/path/to/file/or/dir:
mask:
- open
- create
- close_write
... | Watch the configured files
Example Config
.. code-block:: yaml
beacons:
inotify:
- files:
/path/to/file/or/dir:
mask:
- open
- create
- close_write
recurse: True
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/inotify.py#L153-L323 | [
"def _get_mask(mask):\n '''\n Return the int that represents the mask\n '''\n return MASKS.get(mask, 0)\n",
"def _get_notifier(config):\n '''\n Check the context for the notifier and construct it if not present\n '''\n if 'inotify.notifier' not in __context__:\n __context__['inotify... | # -*- coding: utf-8 -*-
'''
Watch files and translate the changes into salt events
:depends: - pyinotify Python module >= 0.9.5
:Caution: Using generic mask options like open, access, ignored, and
closed_nowrite with reactors can easily cause the reactor
to loop on itself. To mitigate this... |
saltstack/salt | salt/modules/gem.py | _gem | 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 ... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L23-L64 | null | # -*- coding: utf-8 -*-
'''
Manage ruby gems.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import logging
# Import Salt libs
import salt.utils.itertools
import salt.utils.platform
from salt.exceptions import CommandExecutionError
__func_alias__ = {
'... |
saltstack/salt | salt/modules/gem.py | install | 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
'''
... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L67-L146 | [
"def _gem(command, ruby=None, runas=None, gem_bin=None):\n '''\n Run the actual gem command. If rvm or rbenv is installed, run the command\n using the corresponding module. rbenv is not available on windows, so don't\n try.\n\n :param command: string\n Command to run\n :param ruby: string : Non... | # -*- coding: utf-8 -*-
'''
Manage ruby gems.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import logging
# Import Salt libs
import salt.utils.itertools
import salt.utils.platform
from salt.exceptions import CommandExecutionError
__func_alias__ = {
'... |
saltstack/salt | salt/modules/gem.py | uninstall | 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... | 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.
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L149-L177 | [
"def _gem(command, ruby=None, runas=None, gem_bin=None):\n '''\n Run the actual gem command. If rvm or rbenv is installed, run the command\n using the corresponding module. rbenv is not available on windows, so don't\n try.\n\n :param command: string\n Command to run\n :param ruby: string : Non... | # -*- coding: utf-8 -*-
'''
Manage ruby gems.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import logging
# Import Salt libs
import salt.utils.itertools
import salt.utils.platform
from salt.exceptions import CommandExecutionError
__func_alias__ = {
'... |
saltstack/salt | salt/modules/gem.py | update | 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... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L180-L208 | [
"def _gem(command, ruby=None, runas=None, gem_bin=None):\n '''\n Run the actual gem command. If rvm or rbenv is installed, run the command\n using the corresponding module. rbenv is not available on windows, so don't\n try.\n\n :param command: string\n Command to run\n :param ruby: string : Non... | # -*- coding: utf-8 -*-
'''
Manage ruby gems.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import logging
# Import Salt libs
import salt.utils.itertools
import salt.utils.platform
from salt.exceptions import CommandExecutionError
__func_alias__ = {
'... |
saltstack/salt | salt/modules/gem.py | update_system | 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... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L211-L234 | [
"def _gem(command, ruby=None, runas=None, gem_bin=None):\n '''\n Run the actual gem command. If rvm or rbenv is installed, run the command\n using the corresponding module. rbenv is not available on windows, so don't\n try.\n\n :param command: string\n Command to run\n :param ruby: string : Non... | # -*- coding: utf-8 -*-
'''
Manage ruby gems.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import logging
# Import Salt libs
import salt.utils.itertools
import salt.utils.platform
from salt.exceptions import CommandExecutionError
__func_alias__ = {
'... |
saltstack/salt | salt/modules/gem.py | version | 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.... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L237-L266 | [
"def split(orig, sep=None):\n '''\n Generator function for iterating through large strings, particularly useful\n as a replacement for str.splitlines().\n\n See http://stackoverflow.com/a/3865367\n '''\n exp = re.compile(r'\\s+' if sep is None else re.escape(sep))\n pos = 0\n length = len(or... | # -*- coding: utf-8 -*-
'''
Manage ruby gems.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import logging
# Import Salt libs
import salt.utils.itertools
import salt.utils.platform
from salt.exceptions import CommandExecutionError
__func_alias__ = {
'... |
saltstack/salt | salt/modules/gem.py | list_ | 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 ... | 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 `... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L276-L310 | [
"def split(orig, sep=None):\n '''\n Generator function for iterating through large strings, particularly useful\n as a replacement for str.splitlines().\n\n See http://stackoverflow.com/a/3865367\n '''\n exp = re.compile(r'\\s+' if sep is None else re.escape(sep))\n pos = 0\n length = len(or... | # -*- coding: utf-8 -*-
'''
Manage ruby gems.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import logging
# Import Salt libs
import salt.utils.itertools
import salt.utils.platform
from salt.exceptions import CommandExecutionError
__func_alias__ = {
'... |
saltstack/salt | salt/modules/gem.py | list_upgrades | python | def list_upgrades(ruby=None,
runas=None,
gem_bin=None):
'''
.. versionadded:: 2015.8.0
Check if an upgrade is available for installed gems
gem_bin : None
Full path to ``gem`` binary to use.
ruby : None
If RVM or rbenv are installed, the ruby vers... | .. versionadded:: 2015.8.0
Check if an upgrade is available for installed gems
gem_bin : None
Full path to ``gem`` binary to use.
ruby : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if ``gem_bin`` is specified.
runas : None
The user to... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L313-L348 | [
"def split(orig, sep=None):\n '''\n Generator function for iterating through large strings, particularly useful\n as a replacement for str.splitlines().\n\n See http://stackoverflow.com/a/3865367\n '''\n exp = re.compile(r'\\s+' if sep is None else re.escape(sep))\n pos = 0\n length = len(or... | # -*- coding: utf-8 -*-
'''
Manage ruby gems.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import logging
# Import Salt libs
import salt.utils.itertools
import salt.utils.platform
from salt.exceptions import CommandExecutionError
__func_alias__ = {
'... |
saltstack/salt | salt/modules/gem.py | sources_add | 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... | 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 ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L351-L374 | [
"def _gem(command, ruby=None, runas=None, gem_bin=None):\n '''\n Run the actual gem command. If rvm or rbenv is installed, run the command\n using the corresponding module. rbenv is not available on windows, so don't\n try.\n\n :param command: string\n Command to run\n :param ruby: string : Non... | # -*- coding: utf-8 -*-
'''
Manage ruby gems.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import logging
# Import Salt libs
import salt.utils.itertools
import salt.utils.platform
from salt.exceptions import CommandExecutionError
__func_alias__ = {
'... |
saltstack/salt | salt/modules/gem.py | sources_remove | 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... | 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.
:... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L377-L400 | [
"def _gem(command, ruby=None, runas=None, gem_bin=None):\n '''\n Run the actual gem command. If rvm or rbenv is installed, run the command\n using the corresponding module. rbenv is not available on windows, so don't\n try.\n\n :param command: string\n Command to run\n :param ruby: string : Non... | # -*- coding: utf-8 -*-
'''
Manage ruby gems.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import logging
# Import Salt libs
import salt.utils.itertools
import salt.utils.platform
from salt.exceptions import CommandExecutionError
__func_alias__ = {
'... |
saltstack/salt | salt/modules/gem.py | sources_list | 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... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L403-L422 | [
"def _gem(command, ruby=None, runas=None, gem_bin=None):\n '''\n Run the actual gem command. If rvm or rbenv is installed, run the command\n using the corresponding module. rbenv is not available on windows, so don't\n try.\n\n :param command: string\n Command to run\n :param ruby: string : Non... | # -*- coding: utf-8 -*-
'''
Manage ruby gems.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import logging
# Import Salt libs
import salt.utils.itertools
import salt.utils.platform
from salt.exceptions import CommandExecutionError
__func_alias__ = {
'... |
saltstack/salt | salt/states/icinga2.py | generate_ticket | python | def generate_ticket(name, output=None, grain=None, key=None, overwrite=True):
'''
Generate an icinga2 ticket on the master.
name
The domain name for which this ticket will be generated
output
grain: output in a grain
other: the file to store results
None: output to the... | Generate an icinga2 ticket on the master.
name
The domain name for which this ticket will be generated
output
grain: output in a grain
other: the file to store results
None: output to the result comment (default)
grain:
grain to store the output (need output=grain... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L40-L131 | [
"def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ... | # -*- coding: utf-8 -*-
'''
Icinga2 state
=============
.. versionadded:: 2017.7.0
:depends: - Icinga2 Python module
:configuration: See :py:mod:`salt.modules.icinga2` for setup instructions.
The icinga2 module is used to execute commands.
Its output may be stored in a file or in a grain.
.. code-block:: yaml
... |
saltstack/salt | salt/states/icinga2.py | generate_cert | 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... | Generate an icinga2 certificate and key on the client.
name
The domain name for which this certificate and key will be generated | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L134-L163 | [
"def get_certs_path():\n icinga2_output = __salt__['cmd.run_all']([salt.utils.path.which('icinga2'),\n \"--version\"], python_shell=False)\n version = re.search(r'r\\d+\\.\\d+', icinga2_output['stdout']).group(0)\n # Return new certs path for icinga2 >= 2.8\n ... | # -*- coding: utf-8 -*-
'''
Icinga2 state
=============
.. versionadded:: 2017.7.0
:depends: - Icinga2 Python module
:configuration: See :py:mod:`salt.modules.icinga2` for setup instructions.
The icinga2 module is used to execute commands.
Its output may be stored in a file or in a grain.
.. code-block:: yaml
... |
saltstack/salt | salt/states/icinga2.py | save_cert | 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'... | 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 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L166-L196 | [
"def get_certs_path():\n icinga2_output = __salt__['cmd.run_all']([salt.utils.path.which('icinga2'),\n \"--version\"], python_shell=False)\n version = re.search(r'r\\d+\\.\\d+', icinga2_output['stdout']).group(0)\n # Return new certs path for icinga2 >= 2.8\n ... | # -*- coding: utf-8 -*-
'''
Icinga2 state
=============
.. versionadded:: 2017.7.0
:depends: - Icinga2 Python module
:configuration: See :py:mod:`salt.modules.icinga2` for setup instructions.
The icinga2 module is used to execute commands.
Its output may be stored in a file or in a grain.
.. code-block:: yaml
... |
saltstack/salt | salt/states/icinga2.py | request_cert | 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... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L199-L239 | [
"def get_certs_path():\n icinga2_output = __salt__['cmd.run_all']([salt.utils.path.which('icinga2'),\n \"--version\"], python_shell=False)\n version = re.search(r'r\\d+\\.\\d+', icinga2_output['stdout']).group(0)\n # Return new certs path for icinga2 >= 2.8\n ... | # -*- coding: utf-8 -*-
'''
Icinga2 state
=============
.. versionadded:: 2017.7.0
:depends: - Icinga2 Python module
:configuration: See :py:mod:`salt.modules.icinga2` for setup instructions.
The icinga2 module is used to execute commands.
Its output may be stored in a file or in a grain.
.. code-block:: yaml
... |
saltstack/salt | salt/states/icinga2.py | node_setup | python | def node_setup(name, master, ticket):
'''
Setup the 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
'''
ret = {'... | Setup the 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 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L242-L280 | [
"def get_certs_path():\n icinga2_output = __salt__['cmd.run_all']([salt.utils.path.which('icinga2'),\n \"--version\"], python_shell=False)\n version = re.search(r'r\\d+\\.\\d+', icinga2_output['stdout']).group(0)\n # Return new certs path for icinga2 >= 2.8\n ... | # -*- coding: utf-8 -*-
'''
Icinga2 state
=============
.. versionadded:: 2017.7.0
:depends: - Icinga2 Python module
:configuration: See :py:mod:`salt.modules.icinga2` for setup instructions.
The icinga2 module is used to execute commands.
Its output may be stored in a file or in a grain.
.. code-block:: yaml
... |
saltstack/salt | salt/cloud/clouds/linode.py | avail_images | 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... | Return available Linode images.
CLI Example:
.. code-block:: bash
salt-cloud --list-images my-linode-config
salt-cloud -f avail_images my-linode-config | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L110-L133 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | avail_locations | 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(
... | 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 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L136-L159 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | avail_sizes | 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... | Return available Linode sizes.
CLI Example:
.. code-block:: bash
salt-cloud --list-sizes my-linode-config
salt-cloud -f avail_sizes my-linode-config | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L162-L185 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | boot | 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
... | 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``.
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L188-L272 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | clone | 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:
.. ... | 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 ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L275-L320 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | create | python | def create(vm_):
'''
Create a single Linode VM.
'''
name = vm_['name']
try:
# Check for required profile parameters before sending any API calls.
if vm_['profile'] and config.is_profile_configured(__opts__,
__active_provider_... | Create a single Linode VM. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L323-L537 | [
"def clone(kwargs=None, call=None):\n '''\n Clone a Linode.\n\n linode_id\n The ID of the Linode to clone. Required.\n\n datacenter_id\n The ID of the Datacenter where the Linode will be placed. Required.\n\n plan_id\n The ID of the plan (size) of the Linode. Required.\n\n CLI... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | create_config | 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... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L540-L603 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | create_disk_from_distro | 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... | 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. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L606-L644 | [
"def get_password(vm_):\n r'''\n Return the password to use for a VM.\n\n vm\\_\n The configuration to obtain the password from.\n '''\n return config.get_cloud_config_value(\n 'password', vm_, __opts__,\n default=config.get_cloud_config_value(\n 'passwd', vm_, __opts_... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | create_swap_disk | 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 = {}... | 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. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L647-L673 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | create_data_disk | python | def create_data_disk(vm_=None, linode_id=None, data_size=None):
r'''
Create a data disk for the linode (type is hardcoded to ext4 at the moment)
.. versionadded:: 2016.3.0
vm\_
The VM profile to create the data disk for.
linode_id
The ID of the Linode to create the data disk for.
... | r'''
Create a data disk for the linode (type is hardcoded to ext4 at the moment)
.. versionadded:: 2016.3.0
vm\_
The VM profile to create the data disk for.
linode_id
The ID of the Linode to create the data disk for.
data_size
The size of the disk, in MB. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L676-L701 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | create_private_ip | 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) | r'''
Creates a private IP for the specified Linode.
linode_id
The ID of the Linode to create the IP address for. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L704-L714 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | get_config_id | 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... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L764-L806 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | get_disk_size | 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... | r'''
Returns the size of of the root disk in MB.
vm\_
The VM to get the disk size for. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L820-L830 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | get_data_disk_size | 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... | Return the size of of the data disk in MB
.. versionadded:: 2016.3.0 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L833-L843 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | get_distribution_id | 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... | r'''
Returns the distribution ID for a VM
vm\_
The VM to get the distribution ID for | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L846-L872 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | get_ips | 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')
... | Returns public and private IP addresses.
linode_id
Limits the IP addresses returned to the specified Linode ID. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L875-L912 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | get_linode | 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... | 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 ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L915-L955 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | get_linode_id_from_name | 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']:
... | 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. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L958-L976 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | get_password | 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... | r'''
Return the password to use for a VM.
vm\_
The configuration to obtain the password from. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L979-L993 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | _decode_linode_plan_label | 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... | 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` | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L996-L1049 | [
"def avail_sizes(call=None):\n '''\n Return available Linode sizes.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-cloud --list-sizes my-linode-config\n salt-cloud -f avail_sizes my-linode-config\n '''\n if call == 'action':\n raise SaltCloudException(\n 'The av... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | get_plan_id | 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... | 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" | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1052-L1081 | [
"def _decode_linode_plan_label(label):\n '''\n Attempts to decode a user-supplied Linode plan label\n into the format in Linode API output\n\n label\n The label, or name, of the plan to decode.\n\n Example:\n `Linode 2048` will decode to `Linode 2GB`\n '''\n sizes = avail_sizes()\... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | get_vm_size | 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 ==... | r'''
Returns the VM's size.
vm\_
The VM to get the size for. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1128-L1146 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | list_nodes_min | python | def list_nodes_min(call=None):
'''
Return a list of the VMs that are on the provider. Only a list of VM names and
their state is returned. This is the minimum amount of information needed to
check for existing VMs.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt... | Return a list of the VMs that are on the provider. Only a list of VM names and
their state is returned. This is the minimum amount of information needed to
check for existing VMs.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt-cloud -f list_nodes_min my-linode-config
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1199-L1231 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | reboot | 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... | 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 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1243-L1272 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | show_instance | 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... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1275-L1315 | [
"def get_linode_id_from_name(name):\n '''\n Returns the Linode ID for a VM from the provided name.\n\n name\n The name of the Linode from which to get the Linode ID. Required.\n '''\n nodes = _query('linode', 'list')['DATA']\n\n linode_id = ''\n for node in nodes:\n if name == nod... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | show_pricing | python | def show_pricing(kwargs=None, call=None):
'''
Show pricing for a particular profile. This is only an estimate, based on
unofficial pricing sources.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt-cloud -f show_pricing my-linode-config profile=my-linode-profile
'... | Show pricing for a particular profile. This is only an estimate, based on
unofficial pricing sources.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt-cloud -f show_pricing my-linode-config profile=my-linode-profile | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1318-L1360 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | start | 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... | Start a VM in Linode.
name
The name of the VM to start.
CLI Example:
.. code-block:: bash
salt-cloud -a stop vm_name | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1363-L1398 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | update_linode | 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... | 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. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1438-L1452 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | _clean_data | 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... | Returns the DATA response from a Linode API query as a single pre-formatted dictionary
api_response
The query to be cleaned. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1455-L1469 | null | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | _list_linodes | 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
... | Helper function to format and parse linode data | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1472-L1502 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | _query | 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... | Make a web call to the Linode API. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1505-L1582 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | _wait_for_job | 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 ... | 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. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1585-L1616 | [
"def _query(action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.linode.com/'):\n '''\n Make a web call to the Linode API.\n '''\n global LASTCALL\n vm_ = get_configured_provider()\n\n... | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | _wait_for_status | 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... | 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. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1619-L1658 | null | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | _get_status_descr_by_id | 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... | Return linode status by ID
status_id
linode VM status ID | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1661-L1671 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n"
] | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/cloud/clouds/linode.py | _validate_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... | Checks if the provided name fits Linode's labeling parameters.
.. versionadded:: 2015.5.6
name
The VM name to validate | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1684-L1711 | null | # -*- coding: utf-8 -*-
'''
Linode Cloud Module using Linode's REST API
===========================================
The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the ``apikey`` parameter. However, the default root password for new instances
also needs to ... |
saltstack/salt | salt/modules/napalm_netacl.py | _get_capirca_platform | python | def _get_capirca_platform(): # pylint: disable=too-many-return-statements
'''
Given the following NAPALM grains, we can determine the Capirca platform name:
- vendor
- device model
- operating system
Not the most optimal.
'''
vendor = __grains__['vendor'].lower()
os_ = __grains__[... | Given the following NAPALM grains, we can determine the Capirca platform name:
- vendor
- device model
- operating system
Not the most optimal. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L80-L108 | null | # -*- coding: utf-8 -*-
'''
NAPALM ACL
==========
Generate and load ACL (firewall) configuration on network devices.
.. versionadded:: 2017.7.0
:codeauthor: Mircea Ulinic <mircea@cloudflare.com>
:maturity: new
:depends: capirca, napalm
:platform: unix
Dependencies
------------
The firewall configuration is ... |
saltstack/salt | salt/modules/napalm_netacl.py | load_term_config | 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... | 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://... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L116-L451 | [
"def _get_capirca_platform(): # pylint: disable=too-many-return-statements\n '''\n Given the following NAPALM grains, we can determine the Capirca platform name:\n\n - vendor\n - device model\n - operating system\n\n Not the most optimal.\n '''\n vendor = __grains__['vendor'].lower()\n o... | # -*- coding: utf-8 -*-
'''
NAPALM ACL
==========
Generate and load ACL (firewall) configuration on network devices.
.. versionadded:: 2017.7.0
:codeauthor: Mircea Ulinic <mircea@cloudflare.com>
:maturity: new
:depends: capirca, napalm
:platform: unix
Dependencies
------------
The firewall configuration is ... |
saltstack/salt | salt/modules/napalm_netacl.py | load_filter_config | python | def load_filter_config(filter_name,
filter_options=None,
terms=None,
prepend=True,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=True,
... | Generate and load the configuration of a policy filter.
.. note::
The order of the terms is very important. The configuration loaded
on the device respects the order defined in the ``terms`` and/or
inside the pillar.
When merging the ``terms`` with the pillar data, consider the
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L455-L665 | [
"def _get_capirca_platform(): # pylint: disable=too-many-return-statements\n '''\n Given the following NAPALM grains, we can determine the Capirca platform name:\n\n - vendor\n - device model\n - operating system\n\n Not the most optimal.\n '''\n vendor = __grains__['vendor'].lower()\n o... | # -*- coding: utf-8 -*-
'''
NAPALM ACL
==========
Generate and load ACL (firewall) configuration on network devices.
.. versionadded:: 2017.7.0
:codeauthor: Mircea Ulinic <mircea@cloudflare.com>
:maturity: new
:depends: capirca, napalm
:platform: unix
Dependencies
------------
The firewall configuration is ... |
saltstack/salt | salt/modules/napalm_netacl.py | load_policy_config | 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,... | 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... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L669-L855 | [
"def _get_capirca_platform(): # pylint: disable=too-many-return-statements\n '''\n Given the following NAPALM grains, we can determine the Capirca platform name:\n\n - vendor\n - device model\n - operating system\n\n Not the most optimal.\n '''\n vendor = __grains__['vendor'].lower()\n o... | # -*- coding: utf-8 -*-
'''
NAPALM ACL
==========
Generate and load ACL (firewall) configuration on network devices.
.. versionadded:: 2017.7.0
:codeauthor: Mircea Ulinic <mircea@cloudflare.com>
:maturity: new
:depends: capirca, napalm
:platform: unix
Dependencies
------------
The firewall configuration is ... |
saltstack/salt | salt/modules/napalm_netacl.py | get_filter_pillar | python | def get_filter_pillar(filter_name,
pillar_key='acl',
pillarenv=None,
saltenv=None):
'''
Helper that can be used inside a state SLS,
in order to get the filter configuration given its name.
filter_name
The name of the filter.
... | Helper that can be used inside a state SLS,
in order to get the filter configuration given its name.
filter_name
The name of the filter.
pillar_key
The root key of the whole policy config.
pillarenv
Query the master to generate fresh pillar data on the fly,
specificall... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L858-L883 | null | # -*- coding: utf-8 -*-
'''
NAPALM ACL
==========
Generate and load ACL (firewall) configuration on network devices.
.. versionadded:: 2017.7.0
:codeauthor: Mircea Ulinic <mircea@cloudflare.com>
:maturity: new
:depends: capirca, napalm
:platform: unix
Dependencies
------------
The firewall configuration is ... |
saltstack/salt | salt/modules/napalm_netacl.py | get_term_pillar | python | def get_term_pillar(filter_name,
term_name,
pillar_key='acl',
pillarenv=None,
saltenv=None):
'''
Helper that can be used inside a state SLS,
in order to get the term configuration given its name,
under a certain filter uniqu... | Helper that can be used inside a state SLS,
in order to get the term configuration given its name,
under a certain filter uniquely identified by its name.
filter_name
The name of the filter.
term_name
The name of the term.
pillar_key: ``acl``
The root key of the whole poli... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L886-L917 | null | # -*- coding: utf-8 -*-
'''
NAPALM ACL
==========
Generate and load ACL (firewall) configuration on network devices.
.. versionadded:: 2017.7.0
:codeauthor: Mircea Ulinic <mircea@cloudflare.com>
:maturity: new
:depends: capirca, napalm
:platform: unix
Dependencies
------------
The firewall configuration is ... |
saltstack/salt | salt/modules/purefb.py | _get_blade | 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... | 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 (... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefb.py#L85-L123 | null | # -*- coding: utf-8 -*-
##
# Copyright 2018 Pure Storage Inc
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
saltstack/salt | salt/modules/purefb.py | _get_fs | 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 | Private function to
check for existance of a filesystem | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefb.py#L126-L137 | null | # -*- coding: utf-8 -*-
##
# Copyright 2018 Pure Storage Inc
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.