partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
_mod_run_check
Execute the onlyif and unless logic. Return a result dict if: * onlyif failed (onlyif != 0) * unless succeeded (unless == 0) else return True
salt/states/macpackage.py
def _mod_run_check(cmd_kwargs, onlyif, unless): ''' Execute the onlyif and unless logic. Return a result dict if: * onlyif failed (onlyif != 0) * unless succeeded (unless == 0) else return True ''' if onlyif: if __salt__['cmd.retcode'](onlyif, **cmd_kwargs) != 0: retu...
def _mod_run_check(cmd_kwargs, onlyif, unless): ''' Execute the onlyif and unless logic. Return a result dict if: * onlyif failed (onlyif != 0) * unless succeeded (unless == 0) else return True ''' if onlyif: if __salt__['cmd.retcode'](onlyif, **cmd_kwargs) != 0: retu...
[ "Execute", "the", "onlyif", "and", "unless", "logic", ".", "Return", "a", "result", "dict", "if", ":", "*", "onlyif", "failed", "(", "onlyif", "!", "=", "0", ")", "*", "unless", "succeeded", "(", "unless", "==", "0", ")", "else", "return", "True" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/macpackage.py#L248-L269
[ "def", "_mod_run_check", "(", "cmd_kwargs", ",", "onlyif", ",", "unless", ")", ":", "if", "onlyif", ":", "if", "__salt__", "[", "'cmd.retcode'", "]", "(", "onlyif", ",", "*", "*", "cmd_kwargs", ")", "!=", "0", ":", "return", "{", "'comment'", ":", "'on...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
status
Return the status for a service via rest_sample. If the name contains globbing, a dict mapping service name to True/False values is returned. .. versionadded:: 2015.8.0 .. versionchanged:: 2018.3.0 The service name can now be a glob (e.g. ``salt*``) Args: name (str): The name of t...
salt/modules/rest_service.py
def status(name, sig=None): ''' Return the status for a service via rest_sample. If the name contains globbing, a dict mapping service name to True/False values is returned. .. versionadded:: 2015.8.0 .. versionchanged:: 2018.3.0 The service name can now be a glob (e.g. ``salt*``) ...
def status(name, sig=None): ''' Return the status for a service via rest_sample. If the name contains globbing, a dict mapping service name to True/False values is returned. .. versionadded:: 2015.8.0 .. versionchanged:: 2018.3.0 The service name can now be a glob (e.g. ``salt*``) ...
[ "Return", "the", "status", "for", "a", "service", "via", "rest_sample", ".", "If", "the", "name", "contains", "globbing", "a", "dict", "mapping", "service", "name", "to", "True", "/", "False", "values", "is", "returned", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rest_service.py#L128-L169
[ "def", "status", "(", "name", ",", "sig", "=", "None", ")", ":", "proxy_fn", "=", "'rest_sample.service_status'", "contains_globbing", "=", "bool", "(", "re", ".", "search", "(", "r'\\*|\\?|\\[.+\\]'", ",", "name", ")", ")", "if", "contains_globbing", ":", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
clean_proc_dir
Loop through jid files in the minion proc directory (default /var/cache/salt/minion/proc) and remove any that refer to processes that no longer exist
salt/utils/schedule.py
def clean_proc_dir(opts): ''' Loop through jid files in the minion proc directory (default /var/cache/salt/minion/proc) and remove any that refer to processes that no longer exist ''' for basefilename in os.listdir(salt.minion.get_proc_dir(opts['cachedir'])): fn_ = os.path.join(salt.minion...
def clean_proc_dir(opts): ''' Loop through jid files in the minion proc directory (default /var/cache/salt/minion/proc) and remove any that refer to processes that no longer exist ''' for basefilename in os.listdir(salt.minion.get_proc_dir(opts['cachedir'])): fn_ = os.path.join(salt.minion...
[ "Loop", "through", "jid", "files", "in", "the", "minion", "proc", "directory", "(", "default", "/", "var", "/", "cache", "/", "salt", "/", "minion", "/", "proc", ")", "and", "remove", "any", "that", "refer", "to", "processes", "that", "no", "longer", "...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L1693-L1733
[ "def", "clean_proc_dir", "(", "opts", ")", ":", "for", "basefilename", "in", "os", ".", "listdir", "(", "salt", ".", "minion", ".", "get_proc_dir", "(", "opts", "[", "'cachedir'", "]", ")", ")", ":", "fn_", "=", "os", ".", "path", ".", "join", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.option
Return options merged from config and pillar
salt/utils/schedule.py
def option(self, opt): ''' Return options merged from config and pillar ''' if 'config.merge' in self.functions: return self.functions['config.merge'](opt, {}, omit_master=True) return self.opts.get(opt, {})
def option(self, opt): ''' Return options merged from config and pillar ''' if 'config.merge' in self.functions: return self.functions['config.merge'](opt, {}, omit_master=True) return self.opts.get(opt, {})
[ "Return", "options", "merged", "from", "config", "and", "pillar" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L165-L171
[ "def", "option", "(", "self", ",", "opt", ")", ":", "if", "'config.merge'", "in", "self", ".", "functions", ":", "return", "self", ".", "functions", "[", "'config.merge'", "]", "(", "opt", ",", "{", "}", ",", "omit_master", "=", "True", ")", "return", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule._get_schedule
Return the schedule data structure
salt/utils/schedule.py
def _get_schedule(self, include_opts=True, include_pillar=True, remove_hidden=False): ''' Return the schedule data structure ''' schedule = {} if include_pillar: pillar_schedule = self.opts.get('pillar'...
def _get_schedule(self, include_opts=True, include_pillar=True, remove_hidden=False): ''' Return the schedule data structure ''' schedule = {} if include_pillar: pillar_schedule = self.opts.get('pillar'...
[ "Return", "the", "schedule", "data", "structure" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L173-L199
[ "def", "_get_schedule", "(", "self", ",", "include_opts", "=", "True", ",", "include_pillar", "=", "True", ",", "remove_hidden", "=", "False", ")", ":", "schedule", "=", "{", "}", "if", "include_pillar", ":", "pillar_schedule", "=", "self", ".", "opts", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule._check_max_running
Return the schedule data structure
salt/utils/schedule.py
def _check_max_running(self, func, data, opts, now): ''' Return the schedule data structure ''' # Check to see if there are other jobs with this # signature running. If there are more than maxrunning # jobs present then don't start another. # If jid_include is Fa...
def _check_max_running(self, func, data, opts, now): ''' Return the schedule data structure ''' # Check to see if there are other jobs with this # signature running. If there are more than maxrunning # jobs present then don't start another. # If jid_include is Fa...
[ "Return", "the", "schedule", "data", "structure" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L201-L246
[ "def", "_check_max_running", "(", "self", ",", "func", ",", "data", ",", "opts", ",", "now", ")", ":", "# Check to see if there are other jobs with this", "# signature running. If there are more than maxrunning", "# jobs present then don't start another.", "# If jid_include is Fal...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.persist
Persist the modified schedule into <<configdir>>/<<default_include>>/_schedule.conf
salt/utils/schedule.py
def persist(self): ''' Persist the modified schedule into <<configdir>>/<<default_include>>/_schedule.conf ''' config_dir = self.opts.get('conf_dir', None) if config_dir is None and 'conf_file' in self.opts: config_dir = os.path.dirname(self.opts['conf_file']) ...
def persist(self): ''' Persist the modified schedule into <<configdir>>/<<default_include>>/_schedule.conf ''' config_dir = self.opts.get('conf_dir', None) if config_dir is None and 'conf_file' in self.opts: config_dir = os.path.dirname(self.opts['conf_file']) ...
[ "Persist", "the", "modified", "schedule", "into", "<<configdir", ">>", "/", "<<default_include", ">>", "/", "_schedule", ".", "conf" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L248-L281
[ "def", "persist", "(", "self", ")", ":", "config_dir", "=", "self", ".", "opts", ".", "get", "(", "'conf_dir'", ",", "None", ")", "if", "config_dir", "is", "None", "and", "'conf_file'", "in", "self", ".", "opts", ":", "config_dir", "=", "os", ".", "p...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.delete_job
Deletes a job from the scheduler. Ignore jobs from pillar
salt/utils/schedule.py
def delete_job(self, name, persist=True): ''' Deletes a job from the scheduler. Ignore jobs from pillar ''' # ensure job exists, then delete it if name in self.opts['schedule']: del self.opts['schedule'][name] elif name in self._get_schedule(include_opts=False...
def delete_job(self, name, persist=True): ''' Deletes a job from the scheduler. Ignore jobs from pillar ''' # ensure job exists, then delete it if name in self.opts['schedule']: del self.opts['schedule'][name] elif name in self._get_schedule(include_opts=False...
[ "Deletes", "a", "job", "from", "the", "scheduler", ".", "Ignore", "jobs", "from", "pillar" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L283-L304
[ "def", "delete_job", "(", "self", ",", "name", ",", "persist", "=", "True", ")", ":", "# ensure job exists, then delete it", "if", "name", "in", "self", ".", "opts", "[", "'schedule'", "]", ":", "del", "self", ".", "opts", "[", "'schedule'", "]", "[", "n...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.reset
Reset the scheduler to defaults
salt/utils/schedule.py
def reset(self): ''' Reset the scheduler to defaults ''' self.skip_function = None self.skip_during_range = None self.enabled = True self.splay = None self.opts['schedule'] = {}
def reset(self): ''' Reset the scheduler to defaults ''' self.skip_function = None self.skip_during_range = None self.enabled = True self.splay = None self.opts['schedule'] = {}
[ "Reset", "the", "scheduler", "to", "defaults" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L306-L314
[ "def", "reset", "(", "self", ")", ":", "self", ".", "skip_function", "=", "None", "self", ".", "skip_during_range", "=", "None", "self", ".", "enabled", "=", "True", "self", ".", "splay", "=", "None", "self", ".", "opts", "[", "'schedule'", "]", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.delete_job_prefix
Deletes a job from the scheduler. Ignores jobs from pillar
salt/utils/schedule.py
def delete_job_prefix(self, name, persist=True): ''' Deletes a job from the scheduler. Ignores jobs from pillar ''' # ensure job exists, then delete it for job in list(self.opts['schedule'].keys()): if job.startswith(name): del self.opts['schedule'][jo...
def delete_job_prefix(self, name, persist=True): ''' Deletes a job from the scheduler. Ignores jobs from pillar ''' # ensure job exists, then delete it for job in list(self.opts['schedule'].keys()): if job.startswith(name): del self.opts['schedule'][jo...
[ "Deletes", "a", "job", "from", "the", "scheduler", ".", "Ignores", "jobs", "from", "pillar" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L316-L340
[ "def", "delete_job_prefix", "(", "self", ",", "name", ",", "persist", "=", "True", ")", ":", "# ensure job exists, then delete it", "for", "job", "in", "list", "(", "self", ".", "opts", "[", "'schedule'", "]", ".", "keys", "(", ")", ")", ":", "if", "job"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.add_job
Adds a new job to the scheduler. The format is the same as required in the configuration file. See the docs on how YAML is interpreted into python data-structures to make sure, you pass correct dictionaries.
salt/utils/schedule.py
def add_job(self, data, persist=True): ''' Adds a new job to the scheduler. The format is the same as required in the configuration file. See the docs on how YAML is interpreted into python data-structures to make sure, you pass correct dictionaries. ''' # we don't do an...
def add_job(self, data, persist=True): ''' Adds a new job to the scheduler. The format is the same as required in the configuration file. See the docs on how YAML is interpreted into python data-structures to make sure, you pass correct dictionaries. ''' # we don't do an...
[ "Adds", "a", "new", "job", "to", "the", "scheduler", ".", "The", "format", "is", "the", "same", "as", "required", "in", "the", "configuration", "file", ".", "See", "the", "docs", "on", "how", "YAML", "is", "interpreted", "into", "python", "data", "-", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L342-L382
[ "def", "add_job", "(", "self", ",", "data", ",", "persist", "=", "True", ")", ":", "# we don't do any checking here besides making sure its a dict.", "# eval() already does for us and raises errors accordingly", "if", "not", "isinstance", "(", "data", ",", "dict", ")", ":...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.modify_job
Modify a job in the scheduler. Ignores jobs from pillar
salt/utils/schedule.py
def modify_job(self, name, schedule, persist=True): ''' Modify a job in the scheduler. Ignores jobs from pillar ''' # ensure job exists, then replace it if name in self.opts['schedule']: self.delete_job(name, persist) elif name in self._get_schedule(include_op...
def modify_job(self, name, schedule, persist=True): ''' Modify a job in the scheduler. Ignores jobs from pillar ''' # ensure job exists, then replace it if name in self.opts['schedule']: self.delete_job(name, persist) elif name in self._get_schedule(include_op...
[ "Modify", "a", "job", "in", "the", "scheduler", ".", "Ignores", "jobs", "from", "pillar" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L424-L438
[ "def", "modify_job", "(", "self", ",", "name", ",", "schedule", ",", "persist", "=", "True", ")", ":", "# ensure job exists, then replace it", "if", "name", "in", "self", ".", "opts", "[", "'schedule'", "]", ":", "self", ".", "delete_job", "(", "name", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.run_job
Run a schedule job now
salt/utils/schedule.py
def run_job(self, name): ''' Run a schedule job now ''' data = self._get_schedule().get(name, {}) if 'function' in data: func = data['function'] elif 'func' in data: func = data['func'] elif 'fun' in data: func = data['fun'] ...
def run_job(self, name): ''' Run a schedule job now ''' data = self._get_schedule().get(name, {}) if 'function' in data: func = data['function'] elif 'func' in data: func = data['func'] elif 'fun' in data: func = data['fun'] ...
[ "Run", "a", "schedule", "job", "now" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L440-L470
[ "def", "run_job", "(", "self", ",", "name", ")", ":", "data", "=", "self", ".", "_get_schedule", "(", ")", ".", "get", "(", "name", ",", "{", "}", ")", "if", "'function'", "in", "data", ":", "func", "=", "data", "[", "'function'", "]", "elif", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.enable_schedule
Enable the scheduler.
salt/utils/schedule.py
def enable_schedule(self): ''' Enable the scheduler. ''' self.opts['schedule']['enabled'] = True # Fire the complete event back along with updated list of schedule evt = salt.utils.event.get_event('minion', opts=self.opts, listen=False) evt.fire_event({'complete'...
def enable_schedule(self): ''' Enable the scheduler. ''' self.opts['schedule']['enabled'] = True # Fire the complete event back along with updated list of schedule evt = salt.utils.event.get_event('minion', opts=self.opts, listen=False) evt.fire_event({'complete'...
[ "Enable", "the", "scheduler", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L472-L481
[ "def", "enable_schedule", "(", "self", ")", ":", "self", ".", "opts", "[", "'schedule'", "]", "[", "'enabled'", "]", "=", "True", "# Fire the complete event back along with updated list of schedule", "evt", "=", "salt", ".", "utils", ".", "event", ".", "get_event"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.reload
Reload the schedule from saved schedule file.
salt/utils/schedule.py
def reload(self, schedule): ''' Reload the schedule from saved schedule file. ''' # Remove all jobs from self.intervals self.intervals = {} if 'schedule' in schedule: schedule = schedule['schedule'] self.opts.setdefault('schedule', {}).update(schedule...
def reload(self, schedule): ''' Reload the schedule from saved schedule file. ''' # Remove all jobs from self.intervals self.intervals = {} if 'schedule' in schedule: schedule = schedule['schedule'] self.opts.setdefault('schedule', {}).update(schedule...
[ "Reload", "the", "schedule", "from", "saved", "schedule", "file", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L494-L503
[ "def", "reload", "(", "self", ",", "schedule", ")", ":", "# Remove all jobs from self.intervals", "self", ".", "intervals", "=", "{", "}", "if", "'schedule'", "in", "schedule", ":", "schedule", "=", "schedule", "[", "'schedule'", "]", "self", ".", "opts", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.list
List the current schedule items
salt/utils/schedule.py
def list(self, where): ''' List the current schedule items ''' if where == 'pillar': schedule = self._get_schedule(include_opts=False) elif where == 'opts': schedule = self._get_schedule(include_pillar=False) else: schedule = self._get_...
def list(self, where): ''' List the current schedule items ''' if where == 'pillar': schedule = self._get_schedule(include_opts=False) elif where == 'opts': schedule = self._get_schedule(include_pillar=False) else: schedule = self._get_...
[ "List", "the", "current", "schedule", "items" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L505-L519
[ "def", "list", "(", "self", ",", "where", ")", ":", "if", "where", "==", "'pillar'", ":", "schedule", "=", "self", ".", "_get_schedule", "(", "include_opts", "=", "False", ")", "elif", "where", "==", "'opts'", ":", "schedule", "=", "self", ".", "_get_s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.save_schedule
Save the current schedule
salt/utils/schedule.py
def save_schedule(self): ''' Save the current schedule ''' self.persist() # Fire the complete event back along with the list of schedule evt = salt.utils.event.get_event('minion', opts=self.opts, listen=False) evt.fire_event({'complete': True}, ...
def save_schedule(self): ''' Save the current schedule ''' self.persist() # Fire the complete event back along with the list of schedule evt = salt.utils.event.get_event('minion', opts=self.opts, listen=False) evt.fire_event({'complete': True}, ...
[ "Save", "the", "current", "schedule" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L521-L530
[ "def", "save_schedule", "(", "self", ")", ":", "self", ".", "persist", "(", ")", "# Fire the complete event back along with the list of schedule", "evt", "=", "salt", ".", "utils", ".", "event", ".", "get_event", "(", "'minion'", ",", "opts", "=", "self", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.skip_job
Skip a job at a specific time in the scheduler. Ignores jobs from pillar
salt/utils/schedule.py
def skip_job(self, name, data): ''' Skip a job at a specific time in the scheduler. Ignores jobs from pillar ''' time = data['time'] time_fmt = data.get('time_fmt', '%Y-%m-%dT%H:%M:%S') # ensure job exists, then disable it if name in self.opts['schedule']...
def skip_job(self, name, data): ''' Skip a job at a specific time in the scheduler. Ignores jobs from pillar ''' time = data['time'] time_fmt = data.get('time_fmt', '%Y-%m-%dT%H:%M:%S') # ensure job exists, then disable it if name in self.opts['schedule']...
[ "Skip", "a", "job", "at", "a", "specific", "time", "in", "the", "scheduler", ".", "Ignores", "jobs", "from", "pillar" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L562-L584
[ "def", "skip_job", "(", "self", ",", "name", ",", "data", ")", ":", "time", "=", "data", "[", "'time'", "]", "time_fmt", "=", "data", ".", "get", "(", "'time_fmt'", ",", "'%Y-%m-%dT%H:%M:%S'", ")", "# ensure job exists, then disable it", "if", "name", "in", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.get_next_fire_time
Return the next fire time for the specified job
salt/utils/schedule.py
def get_next_fire_time(self, name, fmt='%Y-%m-%dT%H:%M:%S'): ''' Return the next fire time for the specified job ''' schedule = self._get_schedule() _next_fire_time = None if schedule: _next_fire_time = schedule.get(name, {}).get('_next_fire_time', None) ...
def get_next_fire_time(self, name, fmt='%Y-%m-%dT%H:%M:%S'): ''' Return the next fire time for the specified job ''' schedule = self._get_schedule() _next_fire_time = None if schedule: _next_fire_time = schedule.get(name, {}).get('_next_fire_time', None) ...
[ "Return", "the", "next", "fire", "time", "for", "the", "specified", "job" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L586-L601
[ "def", "get_next_fire_time", "(", "self", ",", "name", ",", "fmt", "=", "'%Y-%m-%dT%H:%M:%S'", ")", ":", "schedule", "=", "self", ".", "_get_schedule", "(", ")", "_next_fire_time", "=", "None", "if", "schedule", ":", "_next_fire_time", "=", "schedule", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.handle_func
Execute this method in a multiprocess or thread
salt/utils/schedule.py
def handle_func(self, multiprocessing_enabled, func, data): ''' Execute this method in a multiprocess or thread ''' if salt.utils.platform.is_windows() \ or self.opts.get('transport') == 'zeromq': # Since function references can't be pickled and pickling ...
def handle_func(self, multiprocessing_enabled, func, data): ''' Execute this method in a multiprocess or thread ''' if salt.utils.platform.is_windows() \ or self.opts.get('transport') == 'zeromq': # Since function references can't be pickled and pickling ...
[ "Execute", "this", "method", "in", "a", "multiprocess", "or", "thread" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L611-L851
[ "def", "handle_func", "(", "self", ",", "multiprocessing_enabled", ",", "func", ",", "data", ")", ":", "if", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", "or", "self", ".", "opts", ".", "get", "(", "'transport'", ")", "==", "'zer...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Schedule.eval
Evaluate and execute the schedule :param datetime now: Override current time with a datetime object instance``
salt/utils/schedule.py
def eval(self, now=None): ''' Evaluate and execute the schedule :param datetime now: Override current time with a datetime object instance`` ''' log.trace('==== evaluating schedule now %s =====', now) loop_interval = self.opts['loop_interval'] if not isinstanc...
def eval(self, now=None): ''' Evaluate and execute the schedule :param datetime now: Override current time with a datetime object instance`` ''' log.trace('==== evaluating schedule now %s =====', now) loop_interval = self.opts['loop_interval'] if not isinstanc...
[ "Evaluate", "and", "execute", "the", "schedule" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/schedule.py#L853-L1637
[ "def", "eval", "(", "self", ",", "now", "=", "None", ")", ":", "log", ".", "trace", "(", "'==== evaluating schedule now %s ====='", ",", "now", ")", "loop_interval", "=", "self", ".", "opts", "[", "'loop_interval'", "]", "if", "not", "isinstance", "(", "lo...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_run_aws
Runs the given command against AWS. cmd Command to run region Region to execute cmd in opts Pass in from salt user Pass in from salt kwargs Key-value arguments to pass to the command
salt/modules/aws_sqs.py
def _run_aws(cmd, region, opts, user, **kwargs): ''' Runs the given command against AWS. cmd Command to run region Region to execute cmd in opts Pass in from salt user Pass in from salt kwargs Key-value arguments to pass to the command ''' # Th...
def _run_aws(cmd, region, opts, user, **kwargs): ''' Runs the given command against AWS. cmd Command to run region Region to execute cmd in opts Pass in from salt user Pass in from salt kwargs Key-value arguments to pass to the command ''' # Th...
[ "Runs", "the", "given", "command", "against", "AWS", ".", "cmd", "Command", "to", "run", "region", "Region", "to", "execute", "cmd", "in", "opts", "Pass", "in", "from", "salt", "user", "Pass", "in", "from", "salt", "kwargs", "Key", "-", "value", "argumen...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aws_sqs.py#L34-L68
[ "def", "_run_aws", "(", "cmd", ",", "region", ",", "opts", ",", "user", ",", "*", "*", "kwargs", ")", ":", "# These args need a specific key value that aren't", "# valid python parameter keys", "receipthandle", "=", "kwargs", ".", "pop", "(", "'receipthandle'", ",",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
receive_message
Receive one or more messages from a queue in a region queue The name of the queue to receive messages from region Region where SQS queues exists num : 1 The max number of messages to receive opts : None Any additional options to add to the command line user : Non...
salt/modules/aws_sqs.py
def receive_message(queue, region, num=1, opts=None, user=None): ''' Receive one or more messages from a queue in a region queue The name of the queue to receive messages from region Region where SQS queues exists num : 1 The max number of messages to receive opts : N...
def receive_message(queue, region, num=1, opts=None, user=None): ''' Receive one or more messages from a queue in a region queue The name of the queue to receive messages from region Region where SQS queues exists num : 1 The max number of messages to receive opts : N...
[ "Receive", "one", "or", "more", "messages", "from", "a", "queue", "in", "a", "region" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aws_sqs.py#L71-L112
[ "def", "receive_message", "(", "queue", ",", "region", ",", "num", "=", "1", ",", "opts", "=", "None", ",", "user", "=", "None", ")", ":", "ret", "=", "{", "'Messages'", ":", "None", ",", "}", "queues", "=", "list_queues", "(", "region", ",", "opts...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_message
Delete one or more messages from a queue in a region queue The name of the queue to delete messages from region Region where SQS queues exists receipthandle The ReceiptHandle of the message to delete. The ReceiptHandle is obtained in the return from receive_message op...
salt/modules/aws_sqs.py
def delete_message(queue, region, receipthandle, opts=None, user=None): ''' Delete one or more messages from a queue in a region queue The name of the queue to delete messages from region Region where SQS queues exists receipthandle The ReceiptHandle of the message to dele...
def delete_message(queue, region, receipthandle, opts=None, user=None): ''' Delete one or more messages from a queue in a region queue The name of the queue to delete messages from region Region where SQS queues exists receipthandle The ReceiptHandle of the message to dele...
[ "Delete", "one", "or", "more", "messages", "from", "a", "queue", "in", "a", "region" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aws_sqs.py#L115-L152
[ "def", "delete_message", "(", "queue", ",", "region", ",", "receipthandle", ",", "opts", "=", "None", ",", "user", "=", "None", ")", ":", "queues", "=", "list_queues", "(", "region", ",", "opts", ",", "user", ")", "url_map", "=", "_parse_queue_list", "("...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_queues
List the queues in the selected region. region Region to list SQS queues for opts : None Any additional options to add to the command line user : None Run hg as a user other than what the minion runs as CLI Example: salt '*' aws_sqs.list_queues <region>
salt/modules/aws_sqs.py
def list_queues(region, opts=None, user=None): ''' List the queues in the selected region. region Region to list SQS queues for opts : None Any additional options to add to the command line user : None Run hg as a user other than what the minion runs as CLI Example: ...
def list_queues(region, opts=None, user=None): ''' List the queues in the selected region. region Region to list SQS queues for opts : None Any additional options to add to the command line user : None Run hg as a user other than what the minion runs as CLI Example: ...
[ "List", "the", "queues", "in", "the", "selected", "region", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aws_sqs.py#L155-L179
[ "def", "list_queues", "(", "region", ",", "opts", "=", "None", ",", "user", "=", "None", ")", ":", "out", "=", "_run_aws", "(", "'list-queues'", ",", "region", ",", "opts", ",", "user", ")", "ret", "=", "{", "'retcode'", ":", "0", ",", "'stdout'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_queue
Creates a queue with the correct name. name Name of the SQS queue to create region Region to create the SQS queue in opts : None Any additional options to add to the command line user : None Run hg as a user other than what the minion runs as CLI Example: ...
salt/modules/aws_sqs.py
def create_queue(name, region, opts=None, user=None): ''' Creates a queue with the correct name. name Name of the SQS queue to create region Region to create the SQS queue in opts : None Any additional options to add to the command line user : None Run hg as a...
def create_queue(name, region, opts=None, user=None): ''' Creates a queue with the correct name. name Name of the SQS queue to create region Region to create the SQS queue in opts : None Any additional options to add to the command line user : None Run hg as a...
[ "Creates", "a", "queue", "with", "the", "correct", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aws_sqs.py#L182-L214
[ "def", "create_queue", "(", "name", ",", "region", ",", "opts", "=", "None", ",", "user", "=", "None", ")", ":", "create", "=", "{", "'queue-name'", ":", "name", "}", "out", "=", "_run_aws", "(", "'create-queue'", ",", "region", "=", "region", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_queue
Deletes a queue in the region. name Name of the SQS queue to deletes region Name of the region to delete the queue from opts : None Any additional options to add to the command line user : None Run hg as a user other than what the minion runs as CLI Example: ...
salt/modules/aws_sqs.py
def delete_queue(name, region, opts=None, user=None): ''' Deletes a queue in the region. name Name of the SQS queue to deletes region Name of the region to delete the queue from opts : None Any additional options to add to the command line user : None Run hg as...
def delete_queue(name, region, opts=None, user=None): ''' Deletes a queue in the region. name Name of the SQS queue to deletes region Name of the region to delete the queue from opts : None Any additional options to add to the command line user : None Run hg as...
[ "Deletes", "a", "queue", "in", "the", "region", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aws_sqs.py#L217-L264
[ "def", "delete_queue", "(", "name", ",", "region", ",", "opts", "=", "None", ",", "user", "=", "None", ")", ":", "queues", "=", "list_queues", "(", "region", ",", "opts", ",", "user", ")", "url_map", "=", "_parse_queue_list", "(", "queues", ")", "log",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
queue_exists
Returns True or False on whether the queue exists in the region name Name of the SQS queue to search for region Name of the region to search for the queue in opts : None Any additional options to add to the command line user : None Run hg as a user other than what the...
salt/modules/aws_sqs.py
def queue_exists(name, region, opts=None, user=None): ''' Returns True or False on whether the queue exists in the region name Name of the SQS queue to search for region Name of the region to search for the queue in opts : None Any additional options to add to the command ...
def queue_exists(name, region, opts=None, user=None): ''' Returns True or False on whether the queue exists in the region name Name of the SQS queue to search for region Name of the region to search for the queue in opts : None Any additional options to add to the command ...
[ "Returns", "True", "or", "False", "on", "whether", "the", "queue", "exists", "in", "the", "region" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aws_sqs.py#L267-L290
[ "def", "queue_exists", "(", "name", ",", "region", ",", "opts", "=", "None", ",", "user", "=", "None", ")", ":", "output", "=", "list_queues", "(", "region", ",", "opts", ",", "user", ")", "return", "name", "in", "_parse_queue_list", "(", "output", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_queue_list
Parse the queue to get a dict of name -> URL
salt/modules/aws_sqs.py
def _parse_queue_list(list_output): ''' Parse the queue to get a dict of name -> URL ''' queues = dict((q.split('/')[-1], q) for q in list_output['stdout']) return queues
def _parse_queue_list(list_output): ''' Parse the queue to get a dict of name -> URL ''' queues = dict((q.split('/')[-1], q) for q in list_output['stdout']) return queues
[ "Parse", "the", "queue", "to", "get", "a", "dict", "of", "name", "-", ">", "URL" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aws_sqs.py#L293-L298
[ "def", "_parse_queue_list", "(", "list_output", ")", ":", "queues", "=", "dict", "(", "(", "q", ".", "split", "(", "'/'", ")", "[", "-", "1", "]", ",", "q", ")", "for", "q", "in", "list_output", "[", "'stdout'", "]", ")", "return", "queues" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_session
Get a connection to the XenServer host
salt/cloud/clouds/xen.py
def _get_session(): ''' Get a connection to the XenServer host ''' api_version = '1.0' originator = 'salt_cloud_{}_driver'.format(__virtualname__) url = config.get_cloud_config_value( 'url', get_configured_provider(), __opts__, search_global=False ) user =...
def _get_session(): ''' Get a connection to the XenServer host ''' api_version = '1.0' originator = 'salt_cloud_{}_driver'.format(__virtualname__) url = config.get_cloud_config_value( 'url', get_configured_provider(), __opts__, search_global=False ) user =...
[ "Get", "a", "connection", "to", "the", "XenServer", "host" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L131-L181
[ "def", "_get_session", "(", ")", ":", "api_version", "=", "'1.0'", "originator", "=", "'salt_cloud_{}_driver'", ".", "format", "(", "__virtualname__", ")", "url", "=", "config", ".", "get_cloud_config_value", "(", "'url'", ",", "get_configured_provider", "(", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes
List virtual machines .. code-block:: bash salt-cloud -Q
salt/cloud/clouds/xen.py
def list_nodes(): ''' List virtual machines .. code-block:: bash salt-cloud -Q ''' session = _get_session() vms = session.xenapi.VM.get_all_records() ret = {} for vm in vms: record = session.xenapi.VM.get_record(vm) if not record['is_a_template'] and not re...
def list_nodes(): ''' List virtual machines .. code-block:: bash salt-cloud -Q ''' session = _get_session() vms = session.xenapi.VM.get_all_records() ret = {} for vm in vms: record = session.xenapi.VM.get_record(vm) if not record['is_a_template'] and not re...
[ "List", "virtual", "machines" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L184-L214
[ "def", "list_nodes", "(", ")", ":", "session", "=", "_get_session", "(", ")", "vms", "=", "session", ".", "xenapi", ".", "VM", ".", "get_all_records", "(", ")", "ret", "=", "{", "}", "for", "vm", "in", "vms", ":", "record", "=", "session", ".", "xe...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_vm_ip
Get the IP address of the VM .. code-block:: bash salt-cloud -a get_vm_ip xenvm01 .. note:: Requires xen guest tools to be installed in VM
salt/cloud/clouds/xen.py
def get_vm_ip(name=None, session=None, call=None): ''' Get the IP address of the VM .. code-block:: bash salt-cloud -a get_vm_ip xenvm01 .. note:: Requires xen guest tools to be installed in VM ''' if call == 'function': raise SaltCloudException( 'This function mu...
def get_vm_ip(name=None, session=None, call=None): ''' Get the IP address of the VM .. code-block:: bash salt-cloud -a get_vm_ip xenvm01 .. note:: Requires xen guest tools to be installed in VM ''' if call == 'function': raise SaltCloudException( 'This function mu...
[ "Get", "the", "IP", "address", "of", "the", "VM" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L217-L260
[ "def", "get_vm_ip", "(", "name", "=", "None", ",", "session", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudException", "(", "'This function must be called with -a or --action.'", ")", "if", "session",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_vm_ip
Set the IP address on a virtual interface (vif)
salt/cloud/clouds/xen.py
def set_vm_ip(name=None, ipv4_cidr=None, ipv4_gw=None, session=None, call=None): ''' Set the IP address on a virtual interface (vif) ''' mode = 'static' # TODO: Need to add support for IPv6 if call == 'function': raise SaltCloudExc...
def set_vm_ip(name=None, ipv4_cidr=None, ipv4_gw=None, session=None, call=None): ''' Set the IP address on a virtual interface (vif) ''' mode = 'static' # TODO: Need to add support for IPv6 if call == 'function': raise SaltCloudExc...
[ "Set", "the", "IP", "address", "on", "a", "virtual", "interface", "(", "vif", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L263-L302
[ "def", "set_vm_ip", "(", "name", "=", "None", ",", "ipv4_cidr", "=", "None", ",", "ipv4_gw", "=", "None", ",", "session", "=", "None", ",", "call", "=", "None", ")", ":", "mode", "=", "'static'", "# TODO: Need to add support for IPv6", "if", "call", "==", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes_full
List full virtual machines .. code-block:: bash salt-cloud -F
salt/cloud/clouds/xen.py
def list_nodes_full(session=None): ''' List full virtual machines .. code-block:: bash salt-cloud -F ''' if session is None: session = _get_session() ret = {} vms = session.xenapi.VM.get_all() for vm in vms: record = session.xenapi.VM.get_record(vm) ...
def list_nodes_full(session=None): ''' List full virtual machines .. code-block:: bash salt-cloud -F ''' if session is None: session = _get_session() ret = {} vms = session.xenapi.VM.get_all() for vm in vms: record = session.xenapi.VM.get_record(vm) ...
[ "List", "full", "virtual", "machines" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L305-L351
[ "def", "list_nodes_full", "(", "session", "=", "None", ")", ":", "if", "session", "is", "None", ":", "session", "=", "_get_session", "(", ")", "ret", "=", "{", "}", "vms", "=", "session", ".", "xenapi", ".", "VM", ".", "get_all", "(", ")", "for", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vdi_list
Return available Xen VDI images If this function is called with the ``-f`` or ``--function`` then it can return a list with minimal deatil using the ``terse=True`` keyword argument. .. code-block:: bash salt-cloud -f vdi_list myxen terse=True
salt/cloud/clouds/xen.py
def vdi_list(call=None, kwargs=None): ''' Return available Xen VDI images If this function is called with the ``-f`` or ``--function`` then it can return a list with minimal deatil using the ``terse=True`` keyword argument. .. code-block:: bash salt-cloud -f vdi_list myxen terse=True ...
def vdi_list(call=None, kwargs=None): ''' Return available Xen VDI images If this function is called with the ``-f`` or ``--function`` then it can return a list with minimal deatil using the ``terse=True`` keyword argument. .. code-block:: bash salt-cloud -f vdi_list myxen terse=True ...
[ "Return", "available", "Xen", "VDI", "images" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L370-L411
[ "def", "vdi_list", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudException", "(", "'This function must be called with -f or --function.'", ")", "log", ".", "debug", "(", "'kwargs is %s'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
template_list
Return available Xen template information. This returns the details of each template to show number cores, memory sizes, etc.. .. code-block:: bash salt-cloud -f template_list myxen
salt/cloud/clouds/xen.py
def template_list(call=None): ''' Return available Xen template information. This returns the details of each template to show number cores, memory sizes, etc.. .. code-block:: bash salt-cloud -f template_list myxen ''' templates = {} session = _get_session() vms = session...
def template_list(call=None): ''' Return available Xen template information. This returns the details of each template to show number cores, memory sizes, etc.. .. code-block:: bash salt-cloud -f template_list myxen ''' templates = {} session = _get_session() vms = session...
[ "Return", "available", "Xen", "template", "information", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L447-L466
[ "def", "template_list", "(", "call", "=", "None", ")", ":", "templates", "=", "{", "}", "session", "=", "_get_session", "(", ")", "vms", "=", "session", ".", "xenapi", ".", "VM", ".", "get_all", "(", ")", "for", "vm", "in", "vms", ":", "record", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_instance
Show information about a specific VM or template .. code-block:: bash salt-cloud -a show_instance xenvm01 .. note:: memory is memory_dynamic_max
salt/cloud/clouds/xen.py
def show_instance(name, session=None, call=None): ''' Show information about a specific VM or template .. code-block:: bash salt-cloud -a show_instance xenvm01 .. note:: memory is memory_dynamic_max ''' if call == 'function': raise SaltCloudException( 'The...
def show_instance(name, session=None, call=None): ''' Show information about a specific VM or template .. code-block:: bash salt-cloud -a show_instance xenvm01 .. note:: memory is memory_dynamic_max ''' if call == 'function': raise SaltCloudException( 'The...
[ "Show", "information", "about", "a", "specific", "VM", "or", "template" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L469-L511
[ "def", "show_instance", "(", "name", ",", "session", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudException", "(", "'The show_instnce function must be called with -a or --action.'", ")", "log", ".", "de...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_determine_resource_pool
Called by create() used to determine resource pool
salt/cloud/clouds/xen.py
def _determine_resource_pool(session, vm_): ''' Called by create() used to determine resource pool ''' resource_pool = '' if 'resource_pool' in vm_.keys(): resource_pool = _get_pool(vm_['resource_pool'], session) else: pool = session.xenapi.pool.get_all() if not pool: ...
def _determine_resource_pool(session, vm_): ''' Called by create() used to determine resource pool ''' resource_pool = '' if 'resource_pool' in vm_.keys(): resource_pool = _get_pool(vm_['resource_pool'], session) else: pool = session.xenapi.pool.get_all() if not pool: ...
[ "Called", "by", "create", "()", "used", "to", "determine", "resource", "pool" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L514-L530
[ "def", "_determine_resource_pool", "(", "session", ",", "vm_", ")", ":", "resource_pool", "=", "''", "if", "'resource_pool'", "in", "vm_", ".", "keys", "(", ")", ":", "resource_pool", "=", "_get_pool", "(", "vm_", "[", "'resource_pool'", "]", ",", "session",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_determine_storage_repo
Called by create() used to determine storage repo for create
salt/cloud/clouds/xen.py
def _determine_storage_repo(session, resource_pool, vm_): ''' Called by create() used to determine storage repo for create ''' storage_repo = '' if 'storage_repo' in vm_.keys(): storage_repo = _get_sr(vm_['storage_repo'], session) else: storage_repo = None if resource_poo...
def _determine_storage_repo(session, resource_pool, vm_): ''' Called by create() used to determine storage repo for create ''' storage_repo = '' if 'storage_repo' in vm_.keys(): storage_repo = _get_sr(vm_['storage_repo'], session) else: storage_repo = None if resource_poo...
[ "Called", "by", "create", "()", "used", "to", "determine", "storage", "repo", "for", "create" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L533-L550
[ "def", "_determine_storage_repo", "(", "session", ",", "resource_pool", ",", "vm_", ")", ":", "storage_repo", "=", "''", "if", "'storage_repo'", "in", "vm_", ".", "keys", "(", ")", ":", "storage_repo", "=", "_get_sr", "(", "vm_", "[", "'storage_repo'", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Create a VM in Xen The configuration for this function is read from the profile settings. .. code-block:: bash salt-cloud -p some_profile xenvm01
salt/cloud/clouds/xen.py
def create(vm_): ''' Create a VM in Xen The configuration for this function is read from the profile settings. .. code-block:: bash salt-cloud -p some_profile xenvm01 ''' name = vm_['name'] record = {} ret = {} # fire creating event __utils__['cloud.fire_event']( ...
def create(vm_): ''' Create a VM in Xen The configuration for this function is read from the profile settings. .. code-block:: bash salt-cloud -p some_profile xenvm01 ''' name = vm_['name'] record = {} ret = {} # fire creating event __utils__['cloud.fire_event']( ...
[ "Create", "a", "VM", "in", "Xen" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L553-L661
[ "def", "create", "(", "vm_", ")", ":", "name", "=", "vm_", "[", "'name'", "]", "record", "=", "{", "}", "ret", "=", "{", "}", "# fire creating event", "__utils__", "[", "'cloud.fire_event'", "]", "(", "'event'", ",", "'starting create'", ",", "'salt/cloud/...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_deploy_salt_minion
Deploy salt minion during create()
salt/cloud/clouds/xen.py
def _deploy_salt_minion(name, session, vm_): ''' Deploy salt minion during create() ''' # Get bootstrap values vm_['ssh_host'] = get_vm_ip(name, session) vm_['user'] = vm_.get('user', 'root') vm_['password'] = vm_.get('password', 'p@ssw0rd!') vm_['provider'] = vm_.get('provider', 'xen') ...
def _deploy_salt_minion(name, session, vm_): ''' Deploy salt minion during create() ''' # Get bootstrap values vm_['ssh_host'] = get_vm_ip(name, session) vm_['user'] = vm_.get('user', 'root') vm_['password'] = vm_.get('password', 'p@ssw0rd!') vm_['provider'] = vm_.get('provider', 'xen') ...
[ "Deploy", "salt", "minion", "during", "create", "()" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L664-L678
[ "def", "_deploy_salt_minion", "(", "name", ",", "session", ",", "vm_", ")", ":", "# Get bootstrap values", "vm_", "[", "'ssh_host'", "]", "=", "get_vm_ip", "(", "name", ",", "session", ")", "vm_", "[", "'user'", "]", "=", "vm_", ".", "get", "(", "'user'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_set_static_ip
Set static IP during create() if defined
salt/cloud/clouds/xen.py
def _set_static_ip(name, session, vm_): ''' Set static IP during create() if defined ''' ipv4_cidr = '' ipv4_gw = '' if 'ipv4_gw' in vm_.keys(): log.debug('ipv4_gw is found in keys') ipv4_gw = vm_['ipv4_gw'] if 'ipv4_cidr' in vm_.keys(): log.debug('ipv4_cidr is found ...
def _set_static_ip(name, session, vm_): ''' Set static IP during create() if defined ''' ipv4_cidr = '' ipv4_gw = '' if 'ipv4_gw' in vm_.keys(): log.debug('ipv4_gw is found in keys') ipv4_gw = vm_['ipv4_gw'] if 'ipv4_cidr' in vm_.keys(): log.debug('ipv4_cidr is found ...
[ "Set", "static", "IP", "during", "create", "()", "if", "defined" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L681-L694
[ "def", "_set_static_ip", "(", "name", ",", "session", ",", "vm_", ")", ":", "ipv4_cidr", "=", "''", "ipv4_gw", "=", "''", "if", "'ipv4_gw'", "in", "vm_", ".", "keys", "(", ")", ":", "log", ".", "debug", "(", "'ipv4_gw is found in keys'", ")", "ipv4_gw", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_wait_for_ip
Wait for IP to be available during create()
salt/cloud/clouds/xen.py
def _wait_for_ip(name, session): ''' Wait for IP to be available during create() ''' start_time = datetime.now() status = None while status is None: status = get_vm_ip(name, session) if status is not None: # ignore APIPA address if status.startswith('169'...
def _wait_for_ip(name, session): ''' Wait for IP to be available during create() ''' start_time = datetime.now() status = None while status is None: status = get_vm_ip(name, session) if status is not None: # ignore APIPA address if status.startswith('169'...
[ "Wait", "for", "IP", "to", "be", "available", "during", "create", "()" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L697-L718
[ "def", "_wait_for_ip", "(", "name", ",", "session", ")", ":", "start_time", "=", "datetime", ".", "now", "(", ")", "status", "=", "None", "while", "status", "is", "None", ":", "status", "=", "get_vm_ip", "(", "name", ",", "session", ")", "if", "status"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_run_async_task
Run XenAPI task in asynchronous mode to prevent timeouts
salt/cloud/clouds/xen.py
def _run_async_task(task=None, session=None): ''' Run XenAPI task in asynchronous mode to prevent timeouts ''' if task is None or session is None: return None task_name = session.xenapi.task.get_name_label(task) log.debug('Running %s', task_name) while session.xenapi.task.get_status...
def _run_async_task(task=None, session=None): ''' Run XenAPI task in asynchronous mode to prevent timeouts ''' if task is None or session is None: return None task_name = session.xenapi.task.get_name_label(task) log.debug('Running %s', task_name) while session.xenapi.task.get_status...
[ "Run", "XenAPI", "task", "in", "asynchronous", "mode", "to", "prevent", "timeouts" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L721-L734
[ "def", "_run_async_task", "(", "task", "=", "None", ",", "session", "=", "None", ")", ":", "if", "task", "is", "None", "or", "session", "is", "None", ":", "return", "None", "task_name", "=", "session", ".", "xenapi", ".", "task", ".", "get_name_label", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_clone_vm
Create VM by cloning This is faster and should be used if source and target are in the same storage repository
salt/cloud/clouds/xen.py
def _clone_vm(image=None, name=None, session=None): ''' Create VM by cloning This is faster and should be used if source and target are in the same storage repository ''' if session is None: session = _get_session() log.debug('Creating VM %s by cloning %s', name, image) source ...
def _clone_vm(image=None, name=None, session=None): ''' Create VM by cloning This is faster and should be used if source and target are in the same storage repository ''' if session is None: session = _get_session() log.debug('Creating VM %s by cloning %s', name, image) source ...
[ "Create", "VM", "by", "cloning" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L737-L750
[ "def", "_clone_vm", "(", "image", "=", "None", ",", "name", "=", "None", ",", "session", "=", "None", ")", ":", "if", "session", "is", "None", ":", "session", "=", "_get_session", "(", ")", "log", ".", "debug", "(", "'Creating VM %s by cloning %s'", ",",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_copy_vm
Create VM by copy This is slower and should be used if source and target are NOT in the same storage repository template = object reference name = string name of new VM session = object reference sr = object reference
salt/cloud/clouds/xen.py
def _copy_vm(template=None, name=None, session=None, sr=None): ''' Create VM by copy This is slower and should be used if source and target are NOT in the same storage repository template = object reference name = string name of new VM session = object reference sr = object reference ...
def _copy_vm(template=None, name=None, session=None, sr=None): ''' Create VM by copy This is slower and should be used if source and target are NOT in the same storage repository template = object reference name = string name of new VM session = object reference sr = object reference ...
[ "Create", "VM", "by", "copy" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L753-L770
[ "def", "_copy_vm", "(", "template", "=", "None", ",", "name", "=", "None", ",", "session", "=", "None", ",", "sr", "=", "None", ")", ":", "if", "session", "is", "None", ":", "session", "=", "_get_session", "(", ")", "log", ".", "debug", "(", "'Crea...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_provision_vm
Provision vm right after clone/copy
salt/cloud/clouds/xen.py
def _provision_vm(name=None, session=None): ''' Provision vm right after clone/copy ''' if session is None: session = _get_session() log.info('Provisioning VM %s', name) vm = _get_vm(name, session) task = session.xenapi.Async.VM.provision(vm) _run_async_task(task, session)
def _provision_vm(name=None, session=None): ''' Provision vm right after clone/copy ''' if session is None: session = _get_session() log.info('Provisioning VM %s', name) vm = _get_vm(name, session) task = session.xenapi.Async.VM.provision(vm) _run_async_task(task, session)
[ "Provision", "vm", "right", "after", "clone", "/", "copy" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L773-L782
[ "def", "_provision_vm", "(", "name", "=", "None", ",", "session", "=", "None", ")", ":", "if", "session", "is", "None", ":", "session", "=", "_get_session", "(", ")", "log", ".", "info", "(", "'Provisioning VM %s'", ",", "name", ")", "vm", "=", "_get_v...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
unpause
UnPause a vm .. code-block:: bash salt-cloud -a unpause xenvm01
salt/cloud/clouds/xen.py
def unpause(name, call=None, session=None): ''' UnPause a vm .. code-block:: bash salt-cloud -a unpause xenvm01 ''' if call == 'function': raise SaltCloudException( 'The show_instnce function must be called with -a or --action.' ) if session is None: ...
def unpause(name, call=None, session=None): ''' UnPause a vm .. code-block:: bash salt-cloud -a unpause xenvm01 ''' if call == 'function': raise SaltCloudException( 'The show_instnce function must be called with -a or --action.' ) if session is None: ...
[ "UnPause", "a", "vm" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L829-L848
[ "def", "unpause", "(", "name", ",", "call", "=", "None", ",", "session", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudException", "(", "'The show_instnce function must be called with -a or --action.'", ")", "if", "session", "is"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
resume
Resume a vm from disk .. code-block:: bash salt-cloud -a resume xenvm01
salt/cloud/clouds/xen.py
def resume(name, call=None, session=None): ''' Resume a vm from disk .. code-block:: bash salt-cloud -a resume xenvm01 ''' if call == 'function': raise SaltCloudException( 'The show_instnce function must be called with -a or --action.' ) if session is None:...
def resume(name, call=None, session=None): ''' Resume a vm from disk .. code-block:: bash salt-cloud -a resume xenvm01 ''' if call == 'function': raise SaltCloudException( 'The show_instnce function must be called with -a or --action.' ) if session is None:...
[ "Resume", "a", "vm", "from", "disk" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L873-L892
[ "def", "resume", "(", "name", ",", "call", "=", "None", ",", "session", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudException", "(", "'The show_instnce function must be called with -a or --action.'", ")", "if", "session", "is",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
stop
Stop a vm .. code-block:: bash salt-cloud -a stop xenvm01
salt/cloud/clouds/xen.py
def stop(name, call=None, session=None): ''' Stop a vm .. code-block:: bash salt-cloud -a stop xenvm01 ''' if call == 'function': raise SaltCloudException( 'The show_instnce function must be called with -a or --action.' ) return shutdown(name, call, sessio...
def stop(name, call=None, session=None): ''' Stop a vm .. code-block:: bash salt-cloud -a stop xenvm01 ''' if call == 'function': raise SaltCloudException( 'The show_instnce function must be called with -a or --action.' ) return shutdown(name, call, sessio...
[ "Stop", "a", "vm" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L895-L909
[ "def", "stop", "(", "name", ",", "call", "=", "None", ",", "session", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudException", "(", "'The show_instnce function must be called with -a or --action.'", ")", "return", "shutdown", "(...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
reboot
Reboot a vm .. code-block:: bash salt-cloud -a reboot xenvm01
salt/cloud/clouds/xen.py
def reboot(name, call=None, session=None): ''' Reboot a vm .. code-block:: bash salt-cloud -a reboot xenvm01 ''' if call == 'function': raise SaltCloudException( 'The show_instnce function must be called with -a or --action.' ) if session is None: s...
def reboot(name, call=None, session=None): ''' Reboot a vm .. code-block:: bash salt-cloud -a reboot xenvm01 ''' if call == 'function': raise SaltCloudException( 'The show_instnce function must be called with -a or --action.' ) if session is None: s...
[ "Reboot", "a", "vm" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L934-L957
[ "def", "reboot", "(", "name", ",", "call", "=", "None", ",", "session", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudException", "(", "'The show_instnce function must be called with -a or --action.'", ")", "if", "session", "is",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_vm
Get XEN vm instance object reference
salt/cloud/clouds/xen.py
def _get_vm(name=None, session=None): ''' Get XEN vm instance object reference ''' if session is None: session = _get_session() vms = session.xenapi.VM.get_by_name_label(name) if len(vms) == 1: return vms[0] return None
def _get_vm(name=None, session=None): ''' Get XEN vm instance object reference ''' if session is None: session = _get_session() vms = session.xenapi.VM.get_by_name_label(name) if len(vms) == 1: return vms[0] return None
[ "Get", "XEN", "vm", "instance", "object", "reference" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L960-L969
[ "def", "_get_vm", "(", "name", "=", "None", ",", "session", "=", "None", ")", ":", "if", "session", "is", "None", ":", "session", "=", "_get_session", "(", ")", "vms", "=", "session", ".", "xenapi", ".", "VM", ".", "get_by_name_label", "(", "name", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_sr
Get XEN sr (storage repo) object reference
salt/cloud/clouds/xen.py
def _get_sr(name=None, session=None): ''' Get XEN sr (storage repo) object reference ''' if session is None: session = _get_session() srs = session.xenapi.SR.get_by_name_label(name) if len(srs) == 1: return srs[0] return None
def _get_sr(name=None, session=None): ''' Get XEN sr (storage repo) object reference ''' if session is None: session = _get_session() srs = session.xenapi.SR.get_by_name_label(name) if len(srs) == 1: return srs[0] return None
[ "Get", "XEN", "sr", "(", "storage", "repo", ")", "object", "reference" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L972-L981
[ "def", "_get_sr", "(", "name", "=", "None", ",", "session", "=", "None", ")", ":", "if", "session", "is", "None", ":", "session", "=", "_get_session", "(", ")", "srs", "=", "session", ".", "xenapi", ".", "SR", ".", "get_by_name_label", "(", "name", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_pool
Get XEN resource pool object reference
salt/cloud/clouds/xen.py
def _get_pool(name=None, session=None): ''' Get XEN resource pool object reference ''' if session is None: session = _get_session() pools = session.xenapi.pool.get_all() for pool in pools: pool_record = session.xenapi.pool.get_record(pool) if name in pool_record.get('name...
def _get_pool(name=None, session=None): ''' Get XEN resource pool object reference ''' if session is None: session = _get_session() pools = session.xenapi.pool.get_all() for pool in pools: pool_record = session.xenapi.pool.get_record(pool) if name in pool_record.get('name...
[ "Get", "XEN", "resource", "pool", "object", "reference" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L984-L995
[ "def", "_get_pool", "(", "name", "=", "None", ",", "session", "=", "None", ")", ":", "if", "session", "is", "None", ":", "session", "=", "_get_session", "(", ")", "pools", "=", "session", ".", "xenapi", ".", "pool", ".", "get_all", "(", ")", "for", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
destroy
Destroy Xen VM or template instance .. code-block:: bash salt-cloud -d xenvm01
salt/cloud/clouds/xen.py
def destroy(name=None, call=None): ''' Destroy Xen VM or template instance .. code-block:: bash salt-cloud -d xenvm01 ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a or --action.' ) ...
def destroy(name=None, call=None): ''' Destroy Xen VM or template instance .. code-block:: bash salt-cloud -d xenvm01 ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a or --action.' ) ...
[ "Destroy", "Xen", "VM", "or", "template", "instance" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L998-L1053
[ "def", "destroy", "(", "name", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The destroy action must be called with -d, --destroy, '", "'-a or --action.'", ")", "ret", "=", "{", "}", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sr_list
Geta list of storage repositories .. code-block:: bash salt-cloud -f sr_list myxen
salt/cloud/clouds/xen.py
def sr_list(call=None): ''' Geta list of storage repositories .. code-block:: bash salt-cloud -f sr_list myxen ''' if call != 'function': raise SaltCloudSystemExit( 'This function must be called with -f, --function argument.' ) ret = {} session = _get_s...
def sr_list(call=None): ''' Geta list of storage repositories .. code-block:: bash salt-cloud -f sr_list myxen ''' if call != 'function': raise SaltCloudSystemExit( 'This function must be called with -f, --function argument.' ) ret = {} session = _get_s...
[ "Geta", "list", "of", "storage", "repositories" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L1056-L1075
[ "def", "sr_list", "(", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'This function must be called with -f, --function argument.'", ")", "ret", "=", "{", "}", "session", "=", "_get_session", "(", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
host_list
Get a list of Xen Servers .. code-block:: bash salt-cloud -f host_list myxen
salt/cloud/clouds/xen.py
def host_list(call=None): ''' Get a list of Xen Servers .. code-block:: bash salt-cloud -f host_list myxen ''' if call == 'action': raise SaltCloudSystemExit( 'This function must be called with -f, --function argument.' ) ret = {} session = _get_session(...
def host_list(call=None): ''' Get a list of Xen Servers .. code-block:: bash salt-cloud -f host_list myxen ''' if call == 'action': raise SaltCloudSystemExit( 'This function must be called with -f, --function argument.' ) ret = {} session = _get_session(...
[ "Get", "a", "list", "of", "Xen", "Servers" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L1078-L1096
[ "def", "host_list", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'This function must be called with -f, --function argument.'", ")", "ret", "=", "{", "}", "session", "=", "_get_session", "(", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pool_list
Get a list of Resource Pools .. code-block:: bash salt-cloud -f pool_list myxen
salt/cloud/clouds/xen.py
def pool_list(call=None): ''' Get a list of Resource Pools .. code-block:: bash salt-cloud -f pool_list myxen ''' if call == 'action': raise SaltCloudSystemExit( 'This function must be called with -f, --function argument.' ) ret = {} session = _get_sess...
def pool_list(call=None): ''' Get a list of Resource Pools .. code-block:: bash salt-cloud -f pool_list myxen ''' if call == 'action': raise SaltCloudSystemExit( 'This function must be called with -f, --function argument.' ) ret = {} session = _get_sess...
[ "Get", "a", "list", "of", "Resource", "Pools" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L1099-L1118
[ "def", "pool_list", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'This function must be called with -f, --function argument.'", ")", "ret", "=", "{", "}", "session", "=", "_get_session", "(", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pif_list
Get a list of Resource Pools .. code-block:: bash salt-cloud -f pool_list myxen
salt/cloud/clouds/xen.py
def pif_list(call=None): ''' Get a list of Resource Pools .. code-block:: bash salt-cloud -f pool_list myxen ''' if call != 'function': raise SaltCloudSystemExit( 'This function must be called with -f, --function argument.' ) ret = {} session = _get_sess...
def pif_list(call=None): ''' Get a list of Resource Pools .. code-block:: bash salt-cloud -f pool_list myxen ''' if call != 'function': raise SaltCloudSystemExit( 'This function must be called with -f, --function argument.' ) ret = {} session = _get_sess...
[ "Get", "a", "list", "of", "Resource", "Pools" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L1121-L1139
[ "def", "pif_list", "(", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'This function must be called with -f, --function argument.'", ")", "ret", "=", "{", "}", "session", "=", "_get_session", "(", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vif_list
Get a list of virtual network interfaces on a VM **requires**: the name of the vm with the vbd definition .. code-block:: bash salt-cloud -a vif_list xenvm01
salt/cloud/clouds/xen.py
def vif_list(name, call=None, kwargs=None): ''' Get a list of virtual network interfaces on a VM **requires**: the name of the vm with the vbd definition .. code-block:: bash salt-cloud -a vif_list xenvm01 ''' if call == 'function': raise SaltCloudSystemExit( 'Th...
def vif_list(name, call=None, kwargs=None): ''' Get a list of virtual network interfaces on a VM **requires**: the name of the vm with the vbd definition .. code-block:: bash salt-cloud -a vif_list xenvm01 ''' if call == 'function': raise SaltCloudSystemExit( 'Th...
[ "Get", "a", "list", "of", "virtual", "network", "interfaces", "on", "a", "VM" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L1142-L1171
[ "def", "vif_list", "(", "name", ",", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'This function must be called with -a, --action argument.'", ")", "if", "name", "is", "No...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vbd_list
Get a list of VBDs on a VM **requires**: the name of the vm with the vbd definition .. code-block:: bash salt-cloud -a vbd_list xenvm01
salt/cloud/clouds/xen.py
def vbd_list(name=None, call=None): ''' Get a list of VBDs on a VM **requires**: the name of the vm with the vbd definition .. code-block:: bash salt-cloud -a vbd_list xenvm01 ''' if call == 'function': raise SaltCloudSystemExit( 'This function must be called with...
def vbd_list(name=None, call=None): ''' Get a list of VBDs on a VM **requires**: the name of the vm with the vbd definition .. code-block:: bash salt-cloud -a vbd_list xenvm01 ''' if call == 'function': raise SaltCloudSystemExit( 'This function must be called with...
[ "Get", "a", "list", "of", "VBDs", "on", "a", "VM" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L1174-L1205
[ "def", "vbd_list", "(", "name", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'This function must be called with -a, --action argument.'", ")", "if", "name", "is", "None", ":", "retu...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
destroy_vm_vdis
Get virtual block devices on VM .. code-block:: bash salt-cloud -a destroy_vm_vdis xenvm01
salt/cloud/clouds/xen.py
def destroy_vm_vdis(name=None, session=None, call=None): ''' Get virtual block devices on VM .. code-block:: bash salt-cloud -a destroy_vm_vdis xenvm01 ''' if session is None: session = _get_session() ret = {} # get vm object vms = session.xenapi.VM.get_by_name_label(...
def destroy_vm_vdis(name=None, session=None, call=None): ''' Get virtual block devices on VM .. code-block:: bash salt-cloud -a destroy_vm_vdis xenvm01 ''' if session is None: session = _get_session() ret = {} # get vm object vms = session.xenapi.VM.get_by_name_label(...
[ "Get", "virtual", "block", "devices", "on", "VM" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L1227-L1256
[ "def", "destroy_vm_vdis", "(", "name", "=", "None", ",", "session", "=", "None", ",", "call", "=", "None", ")", ":", "if", "session", "is", "None", ":", "session", "=", "_get_session", "(", ")", "ret", "=", "{", "}", "# get vm object", "vms", "=", "s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
destroy_template
Destroy Xen VM or template instance .. code-block:: bash salt-cloud -f destroy_template myxen name=testvm2
salt/cloud/clouds/xen.py
def destroy_template(name=None, call=None, kwargs=None): ''' Destroy Xen VM or template instance .. code-block:: bash salt-cloud -f destroy_template myxen name=testvm2 ''' if call == 'action': raise SaltCloudSystemExit( 'The destroy_template function must be ca...
def destroy_template(name=None, call=None, kwargs=None): ''' Destroy Xen VM or template instance .. code-block:: bash salt-cloud -f destroy_template myxen name=testvm2 ''' if call == 'action': raise SaltCloudSystemExit( 'The destroy_template function must be ca...
[ "Destroy", "Xen", "VM", "or", "template", "instance" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L1259-L1289
[ "def", "destroy_template", "(", "name", "=", "None", ",", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The destroy_template function must be called with -f.'", ")", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_pv_args
Get PV arguments for a VM .. code-block:: bash salt-cloud -a get_pv_args xenvm01
salt/cloud/clouds/xen.py
def get_pv_args(name, session=None, call=None): ''' Get PV arguments for a VM .. code-block:: bash salt-cloud -a get_pv_args xenvm01 ''' if call == 'function': raise SaltCloudException( 'This function must be called with -a or --action.' ) if session is Non...
def get_pv_args(name, session=None, call=None): ''' Get PV arguments for a VM .. code-block:: bash salt-cloud -a get_pv_args xenvm01 ''' if call == 'function': raise SaltCloudException( 'This function must be called with -a or --action.' ) if session is Non...
[ "Get", "PV", "arguments", "for", "a", "VM" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L1292-L1312
[ "def", "get_pv_args", "(", "name", ",", "session", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudException", "(", "'This function must be called with -a or --action.'", ")", "if", "session", "is", "Non...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_pv_args
Set PV arguments for a VM .. code-block:: bash salt-cloud -a set_pv_args xenvm01 pv_args="utf-8 graphical"
salt/cloud/clouds/xen.py
def set_pv_args(name, kwargs=None, session=None, call=None): ''' Set PV arguments for a VM .. code-block:: bash salt-cloud -a set_pv_args xenvm01 pv_args="utf-8 graphical" ''' if call == 'function': raise SaltCloudException( 'This function must be called with -a or --a...
def set_pv_args(name, kwargs=None, session=None, call=None): ''' Set PV arguments for a VM .. code-block:: bash salt-cloud -a set_pv_args xenvm01 pv_args="utf-8 graphical" ''' if call == 'function': raise SaltCloudException( 'This function must be called with -a or --a...
[ "Set", "PV", "arguments", "for", "a", "VM" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/xen.py#L1315-L1341
[ "def", "set_pv_args", "(", "name", ",", "kwargs", "=", "None", ",", "session", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudException", "(", "'This function must be called with -a or --action.'", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_name_in_services
Checks to see if the given service is in the given services. :param str name: Service label, file name, or full path :param dict services: The currently available services. :return: The service information for the service, otherwise an empty dictionary :rtype: dict
salt/modules/mac_service.py
def _name_in_services(name, services): ''' Checks to see if the given service is in the given services. :param str name: Service label, file name, or full path :param dict services: The currently available services. :return: The service information for the service, otherwise an empty dictiona...
def _name_in_services(name, services): ''' Checks to see if the given service is in the given services. :param str name: Service label, file name, or full path :param dict services: The currently available services. :return: The service information for the service, otherwise an empty dictiona...
[ "Checks", "to", "see", "if", "the", "given", "service", "is", "in", "the", "given", "services", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L76-L102
[ "def", "_name_in_services", "(", "name", ",", "services", ")", ":", "if", "name", "in", "services", ":", "# Match on label", "return", "services", "[", "name", "]", "for", "service", "in", "six", ".", "itervalues", "(", "services", ")", ":", "if", "service...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_service
Get information about a service. If the service is not found, raise an error :param str name: Service label, file name, or full path :return: The service information for the service, otherwise an Error :rtype: dict
salt/modules/mac_service.py
def _get_service(name): ''' Get information about a service. If the service is not found, raise an error :param str name: Service label, file name, or full path :return: The service information for the service, otherwise an Error :rtype: dict ''' services = __utils__['mac_utils.availa...
def _get_service(name): ''' Get information about a service. If the service is not found, raise an error :param str name: Service label, file name, or full path :return: The service information for the service, otherwise an Error :rtype: dict ''' services = __utils__['mac_utils.availa...
[ "Get", "information", "about", "a", "service", ".", "If", "the", "service", "is", "not", "found", "raise", "an", "error" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L105-L145
[ "def", "_get_service", "(", "name", ")", ":", "services", "=", "__utils__", "[", "'mac_utils.available_services'", "]", "(", ")", "name", "=", "name", ".", "lower", "(", ")", "service", "=", "_name_in_services", "(", "name", ",", "services", ")", "# if we wo...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_always_running_service
Check if the service should always be running based on the KeepAlive Key in the service plist. :param str name: Service label, file name, or full path :return: True if the KeepAlive key is set to True, False if set to False or not set in the plist at all. :rtype: bool .. versionadded:: 2...
salt/modules/mac_service.py
def _always_running_service(name): ''' Check if the service should always be running based on the KeepAlive Key in the service plist. :param str name: Service label, file name, or full path :return: True if the KeepAlive key is set to True, False if set to False or not set in the plist at ...
def _always_running_service(name): ''' Check if the service should always be running based on the KeepAlive Key in the service plist. :param str name: Service label, file name, or full path :return: True if the KeepAlive key is set to True, False if set to False or not set in the plist at ...
[ "Check", "if", "the", "service", "should", "always", "be", "running", "based", "on", "the", "KeepAlive", "Key", "in", "the", "service", "plist", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L148-L185
[ "def", "_always_running_service", "(", "name", ")", ":", "# get all the info from the launchctl service", "service_info", "=", "show", "(", "name", ")", "# get the value for the KeepAlive key in service plist", "try", ":", "keep_alive", "=", "service_info", "[", "'plist'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_domain_target
Returns the domain/service target and path for a service. This is used to determine whether or not a service should be loaded in a user space or system space. :param str name: Service label, file name, or full path :param bool service_target: Whether to return a full service target. This is needed...
salt/modules/mac_service.py
def _get_domain_target(name, service_target=False): ''' Returns the domain/service target and path for a service. This is used to determine whether or not a service should be loaded in a user space or system space. :param str name: Service label, file name, or full path :param bool service_tar...
def _get_domain_target(name, service_target=False): ''' Returns the domain/service target and path for a service. This is used to determine whether or not a service should be loaded in a user space or system space. :param str name: Service label, file name, or full path :param bool service_tar...
[ "Returns", "the", "domain", "/", "service", "target", "and", "path", "for", "a", "service", ".", "This", "is", "used", "to", "determine", "whether", "or", "not", "a", "service", "should", "be", "loaded", "in", "a", "user", "space", "or", "system", "space...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L188-L226
[ "def", "_get_domain_target", "(", "name", ",", "service_target", "=", "False", ")", ":", "# Get service information", "service", "=", "_get_service", "(", "name", ")", "# get the path to the service", "path", "=", "service", "[", "'file_path'", "]", "# most of the tim...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_
Run launchctl list and return the output :param str name: The name of the service to list :param str runas: User to run launchctl commands :return: If a name is passed returns information about the named service, otherwise returns a list of all services and pids :rtype: str CLI Example: ...
salt/modules/mac_service.py
def list_(name=None, runas=None): ''' Run launchctl list and return the output :param str name: The name of the service to list :param str runas: User to run launchctl commands :return: If a name is passed returns information about the named service, otherwise returns a list of all servic...
def list_(name=None, runas=None): ''' Run launchctl list and return the output :param str name: The name of the service to list :param str runas: User to run launchctl commands :return: If a name is passed returns information about the named service, otherwise returns a list of all servic...
[ "Run", "launchctl", "list", "and", "return", "the", "output" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L298-L336
[ "def", "list_", "(", "name", "=", "None", ",", "runas", "=", "None", ")", ":", "if", "name", ":", "# Get service information and label", "service", "=", "_get_service", "(", "name", ")", "label", "=", "service", "[", "'plist'", "]", "[", "'Label'", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
enable
Enable a launchd service. Raises an error if the service fails to be enabled :param str name: Service label, file name, or full path :param str runas: User to run launchctl commands :return: ``True`` if successful or if the service is already enabled :rtype: bool CLI Example: .. code-block:...
salt/modules/mac_service.py
def enable(name, runas=None): ''' Enable a launchd service. Raises an error if the service fails to be enabled :param str name: Service label, file name, or full path :param str runas: User to run launchctl commands :return: ``True`` if successful or if the service is already enabled :rtype: ...
def enable(name, runas=None): ''' Enable a launchd service. Raises an error if the service fails to be enabled :param str name: Service label, file name, or full path :param str runas: User to run launchctl commands :return: ``True`` if successful or if the service is already enabled :rtype: ...
[ "Enable", "a", "launchd", "service", ".", "Raises", "an", "error", "if", "the", "service", "fails", "to", "be", "enabled" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L339-L360
[ "def", "enable", "(", "name", ",", "runas", "=", "None", ")", ":", "# Get the domain target. enable requires a full <service-target>", "service_target", "=", "_get_domain_target", "(", "name", ",", "service_target", "=", "True", ")", "[", "0", "]", "# Enable the servi...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
disable
Disable a launchd service. Raises an error if the service fails to be disabled :param str name: Service label, file name, or full path :param str runas: User to run launchctl commands :return: ``True`` if successful or if the service is already disabled :rtype: bool CLI Example: .. code...
salt/modules/mac_service.py
def disable(name, runas=None): ''' Disable a launchd service. Raises an error if the service fails to be disabled :param str name: Service label, file name, or full path :param str runas: User to run launchctl commands :return: ``True`` if successful or if the service is already disabled ...
def disable(name, runas=None): ''' Disable a launchd service. Raises an error if the service fails to be disabled :param str name: Service label, file name, or full path :param str runas: User to run launchctl commands :return: ``True`` if successful or if the service is already disabled ...
[ "Disable", "a", "launchd", "service", ".", "Raises", "an", "error", "if", "the", "service", "fails", "to", "be", "disabled" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L363-L385
[ "def", "disable", "(", "name", ",", "runas", "=", "None", ")", ":", "# Get the service target. enable requires a full <service-target>", "service_target", "=", "_get_domain_target", "(", "name", ",", "service_target", "=", "True", ")", "[", "0", "]", "# disable the se...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
start
Start a launchd service. Raises an error if the service fails to start .. note:: To start a service in macOS the service must be enabled first. Use ``service.enable`` to enable the service. :param str name: Service label, file name, or full path :param str runas: User to run launchctl co...
salt/modules/mac_service.py
def start(name, runas=None): ''' Start a launchd service. Raises an error if the service fails to start .. note:: To start a service in macOS the service must be enabled first. Use ``service.enable`` to enable the service. :param str name: Service label, file name, or full path :...
def start(name, runas=None): ''' Start a launchd service. Raises an error if the service fails to start .. note:: To start a service in macOS the service must be enabled first. Use ``service.enable`` to enable the service. :param str name: Service label, file name, or full path :...
[ "Start", "a", "launchd", "service", ".", "Raises", "an", "error", "if", "the", "service", "fails", "to", "start" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L388-L413
[ "def", "start", "(", "name", ",", "runas", "=", "None", ")", ":", "# Get the domain target.", "domain_target", ",", "path", "=", "_get_domain_target", "(", "name", ")", "# Load (bootstrap) the service: will raise an error if it fails", "return", "launchctl", "(", "'boot...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
stop
Stop a launchd service. Raises an error if the service fails to stop .. note:: Though ``service.stop`` will unload a service in macOS, the service will start on next boot unless it is disabled. Use ``service.disable`` to disable the service :param str name: Service label, file name, o...
salt/modules/mac_service.py
def stop(name, runas=None): ''' Stop a launchd service. Raises an error if the service fails to stop .. note:: Though ``service.stop`` will unload a service in macOS, the service will start on next boot unless it is disabled. Use ``service.disable`` to disable the service :par...
def stop(name, runas=None): ''' Stop a launchd service. Raises an error if the service fails to stop .. note:: Though ``service.stop`` will unload a service in macOS, the service will start on next boot unless it is disabled. Use ``service.disable`` to disable the service :par...
[ "Stop", "a", "launchd", "service", ".", "Raises", "an", "error", "if", "the", "service", "fails", "to", "stop" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L416-L442
[ "def", "stop", "(", "name", ",", "runas", "=", "None", ")", ":", "# Get the domain target.", "domain_target", ",", "path", "=", "_get_domain_target", "(", "name", ")", "# Stop (bootout) the service: will raise an error if it fails", "return", "launchctl", "(", "'bootout...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
restart
Unloads and reloads a launchd service. Raises an error if the service fails to reload :param str name: Service label, file name, or full path :param str runas: User to run launchctl commands :return: ``True`` if successful :rtype: bool CLI Example: .. code-block:: bash salt '*...
salt/modules/mac_service.py
def restart(name, runas=None): ''' Unloads and reloads a launchd service. Raises an error if the service fails to reload :param str name: Service label, file name, or full path :param str runas: User to run launchctl commands :return: ``True`` if successful :rtype: bool CLI Example:...
def restart(name, runas=None): ''' Unloads and reloads a launchd service. Raises an error if the service fails to reload :param str name: Service label, file name, or full path :param str runas: User to run launchctl commands :return: ``True`` if successful :rtype: bool CLI Example:...
[ "Unloads", "and", "reloads", "a", "launchd", "service", ".", "Raises", "an", "error", "if", "the", "service", "fails", "to", "reload" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L445-L468
[ "def", "restart", "(", "name", ",", "runas", "=", "None", ")", ":", "# Restart the service: will raise an error if it fails", "if", "enabled", "(", "name", ")", ":", "stop", "(", "name", ",", "runas", "=", "runas", ")", "start", "(", "name", ",", "runas", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
status
Return the status for a service. :param str name: Used to find the service from launchctl. Can be any part of the service name or a regex expression. :param str sig: Find the service with status.pid instead. Note that ``name`` must still be provided. :param str runas: User to run launch...
salt/modules/mac_service.py
def status(name, sig=None, runas=None): ''' Return the status for a service. :param str name: Used to find the service from launchctl. Can be any part of the service name or a regex expression. :param str sig: Find the service with status.pid instead. Note that ``name`` must still be...
def status(name, sig=None, runas=None): ''' Return the status for a service. :param str name: Used to find the service from launchctl. Can be any part of the service name or a regex expression. :param str sig: Find the service with status.pid instead. Note that ``name`` must still be...
[ "Return", "the", "status", "for", "a", "service", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L471-L527
[ "def", "status", "(", "name", ",", "sig", "=", "None", ",", "runas", "=", "None", ")", ":", "# Find service with ps", "if", "sig", ":", "return", "__salt__", "[", "'status.pid'", "]", "(", "sig", ")", "try", ":", "_get_service", "(", "name", ")", "exce...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
enabled
Check if the specified service is enabled :param str name: The name of the service to look up :param str runas: User to run launchctl commands :return: True if the specified service enabled, otherwise False :rtype: bool CLI Example: .. code-block:: bash salt '*' service.enabled org...
salt/modules/mac_service.py
def enabled(name, runas=None): ''' Check if the specified service is enabled :param str name: The name of the service to look up :param str runas: User to run launchctl commands :return: True if the specified service enabled, otherwise False :rtype: bool CLI Example: .. code-block::...
def enabled(name, runas=None): ''' Check if the specified service is enabled :param str name: The name of the service to look up :param str runas: User to run launchctl commands :return: True if the specified service enabled, otherwise False :rtype: bool CLI Example: .. code-block::...
[ "Check", "if", "the", "specified", "service", "is", "enabled" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L571-L593
[ "def", "enabled", "(", "name", ",", "runas", "=", "None", ")", ":", "# Try to list the service. If it can't be listed, it's not enabled", "try", ":", "list_", "(", "name", "=", "name", ",", "runas", "=", "runas", ")", "return", "True", "except", "CommandExecution...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
disabled
Check if the specified service is not enabled. This is the opposite of ``service.enabled`` :param str name: The name to look up :param str runas: User to run launchctl commands :param str domain: domain to check for disabled services. Default is system. :return: True if the specified service is ...
salt/modules/mac_service.py
def disabled(name, runas=None, domain='system'): ''' Check if the specified service is not enabled. This is the opposite of ``service.enabled`` :param str name: The name to look up :param str runas: User to run launchctl commands :param str domain: domain to check for disabled services. Defau...
def disabled(name, runas=None, domain='system'): ''' Check if the specified service is not enabled. This is the opposite of ``service.enabled`` :param str name: The name to look up :param str runas: User to run launchctl commands :param str domain: domain to check for disabled services. Defau...
[ "Check", "if", "the", "specified", "service", "is", "not", "enabled", ".", "This", "is", "the", "opposite", "of", "service", ".", "enabled" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L596-L630
[ "def", "disabled", "(", "name", ",", "runas", "=", "None", ",", "domain", "=", "'system'", ")", ":", "disabled", "=", "launchctl", "(", "'print-disabled'", ",", "domain", ",", "return_stdout", "=", "True", ",", "runas", "=", "runas", ")", "for", "service...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_all
Return a list of services that are enabled or available. Can be used to find the name of a service. :param str runas: User to run launchctl commands :return: A list of all the services available or enabled :rtype: list CLI Example: .. code-block:: bash salt '*' service.get_all
salt/modules/mac_service.py
def get_all(runas=None): ''' Return a list of services that are enabled or available. Can be used to find the name of a service. :param str runas: User to run launchctl commands :return: A list of all the services available or enabled :rtype: list CLI Example: .. code-block:: bash ...
def get_all(runas=None): ''' Return a list of services that are enabled or available. Can be used to find the name of a service. :param str runas: User to run launchctl commands :return: A list of all the services available or enabled :rtype: list CLI Example: .. code-block:: bash ...
[ "Return", "a", "list", "of", "services", "that", "are", "enabled", "or", "available", ".", "Can", "be", "used", "to", "find", "the", "name", "of", "a", "service", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L633-L656
[ "def", "get_all", "(", "runas", "=", "None", ")", ":", "# Get list of enabled services", "enabled", "=", "get_enabled", "(", "runas", "=", "runas", ")", "# Get list of all services", "available", "=", "list", "(", "__utils__", "[", "'mac_utils.available_services'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_enabled
Return a list of all services that are enabled. Can be used to find the name of a service. :param str runas: User to run launchctl commands :return: A list of all the services enabled on the system :rtype: list CLI Example: .. code-block:: bash salt '*' service.get_enabled
salt/modules/mac_service.py
def get_enabled(runas=None): ''' Return a list of all services that are enabled. Can be used to find the name of a service. :param str runas: User to run launchctl commands :return: A list of all the services enabled on the system :rtype: list CLI Example: .. code-block:: bash ...
def get_enabled(runas=None): ''' Return a list of all services that are enabled. Can be used to find the name of a service. :param str runas: User to run launchctl commands :return: A list of all the services enabled on the system :rtype: list CLI Example: .. code-block:: bash ...
[ "Return", "a", "list", "of", "all", "services", "that", "are", "enabled", ".", "Can", "be", "used", "to", "find", "the", "name", "of", "a", "service", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_service.py#L659-L689
[ "def", "get_enabled", "(", "runas", "=", "None", ")", ":", "# Collect list of enabled services", "stdout", "=", "list_", "(", "runas", "=", "runas", ")", "service_lines", "=", "[", "line", "for", "line", "in", "stdout", ".", "splitlines", "(", ")", "]", "#...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_conn
Return a conn object for the passed VM data
salt/cloud/clouds/nova.py
def get_conn(): ''' Return a conn object for the passed VM data ''' vm_ = get_configured_provider() kwargs = vm_.copy() # pylint: disable=E1103 kwargs['username'] = vm_['user'] kwargs['project_id'] = vm_['tenant'] kwargs['auth_url'] = vm_['identity_url'] kwargs['region_name'] = vm...
def get_conn(): ''' Return a conn object for the passed VM data ''' vm_ = get_configured_provider() kwargs = vm_.copy() # pylint: disable=E1103 kwargs['username'] = vm_['user'] kwargs['project_id'] = vm_['tenant'] kwargs['auth_url'] = vm_['identity_url'] kwargs['region_name'] = vm...
[ "Return", "a", "conn", "object", "for", "the", "passed", "VM", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L301-L324
[ "def", "get_conn", "(", ")", ":", "vm_", "=", "get_configured_provider", "(", ")", "kwargs", "=", "vm_", ".", "copy", "(", ")", "# pylint: disable=E1103", "kwargs", "[", "'username'", "]", "=", "vm_", "[", "'user'", "]", "kwargs", "[", "'project_id'", "]",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_locations
Return a list of locations
salt/cloud/clouds/nova.py
def avail_locations(conn=None, call=None): ''' Return a list of locations ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locations option' ) if conn is None: ...
def avail_locations(conn=None, call=None): ''' Return a list of locations ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locations option' ) if conn is None: ...
[ "Return", "a", "list", "of", "locations" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L327-L345
[ "def", "avail_locations", "(", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_locations function must be called with '", "'-f or --function, or with the --list-locations option'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_image
Return the image object to use
salt/cloud/clouds/nova.py
def get_image(conn, vm_): ''' Return the image object to use ''' vm_image = config.get_cloud_config_value('image', vm_, __opts__, default='').encode( 'ascii', 'salt-cloud-force-ascii' ) if not vm_image: log.debug('No image set, must be boot from volume') return None ...
def get_image(conn, vm_): ''' Return the image object to use ''' vm_image = config.get_cloud_config_value('image', vm_, __opts__, default='').encode( 'ascii', 'salt-cloud-force-ascii' ) if not vm_image: log.debug('No image set, must be boot from volume') return None ...
[ "Return", "the", "image", "object", "to", "use" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L348-L374
[ "def", "get_image", "(", "conn", ",", "vm_", ")", ":", "vm_image", "=", "config", ".", "get_cloud_config_value", "(", "'image'", ",", "vm_", ",", "__opts__", ",", "default", "=", "''", ")", ".", "encode", "(", "'ascii'", ",", "'salt-cloud-force-ascii'", ")...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_instance
Show the details from the provider concerning an instance
salt/cloud/clouds/nova.py
def show_instance(name, call=None): ''' Show the details from the provider concerning an instance ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) conn = get_conn() node = conn.show_instance(name).__...
def show_instance(name, call=None): ''' Show the details from the provider concerning an instance ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) conn = get_conn() node = conn.show_instance(name).__...
[ "Show", "the", "details", "from", "the", "provider", "concerning", "an", "instance" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L388-L400
[ "def", "show_instance", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_instance action must be called with -a or --action.'", ")", "conn", "=", "get_conn", "(", ")", "node", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_size
Return the VM's size object
salt/cloud/clouds/nova.py
def get_size(conn, vm_): ''' Return the VM's size object ''' sizes = conn.list_sizes() vm_size = config.get_cloud_config_value('size', vm_, __opts__) if not vm_size: return sizes[0] for size in sizes: if vm_size and six.text_type(vm_size) in (six.text_type(sizes[size]['id'])...
def get_size(conn, vm_): ''' Return the VM's size object ''' sizes = conn.list_sizes() vm_size = config.get_cloud_config_value('size', vm_, __opts__) if not vm_size: return sizes[0] for size in sizes: if vm_size and six.text_type(vm_size) in (six.text_type(sizes[size]['id'])...
[ "Return", "the", "VM", "s", "size", "object" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L403-L417
[ "def", "get_size", "(", "conn", ",", "vm_", ")", ":", "sizes", "=", "conn", ".", "list_sizes", "(", ")", "vm_size", "=", "config", ".", "get_cloud_config_value", "(", "'size'", ",", "vm_", ",", "__opts__", ")", "if", "not", "vm_size", ":", "return", "s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ignore_cidr
Return True if we are to ignore the specified IP. Compatible with IPv4.
salt/cloud/clouds/nova.py
def ignore_cidr(vm_, ip): ''' Return True if we are to ignore the specified IP. Compatible with IPv4. ''' if HAS_NETADDR is False: log.error('Error: netaddr is not installed') return 'Error: netaddr is not installed' cidr = config.get_cloud_config_value( 'ignore_cidr', vm_, ...
def ignore_cidr(vm_, ip): ''' Return True if we are to ignore the specified IP. Compatible with IPv4. ''' if HAS_NETADDR is False: log.error('Error: netaddr is not installed') return 'Error: netaddr is not installed' cidr = config.get_cloud_config_value( 'ignore_cidr', vm_, ...
[ "Return", "True", "if", "we", "are", "to", "ignore", "the", "specified", "IP", ".", "Compatible", "with", "IPv4", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L441-L456
[ "def", "ignore_cidr", "(", "vm_", ",", "ip", ")", ":", "if", "HAS_NETADDR", "is", "False", ":", "log", ".", "error", "(", "'Error: netaddr is not installed'", ")", "return", "'Error: netaddr is not installed'", "cidr", "=", "config", ".", "get_cloud_config_value", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rackconnect
Determine if we should wait for rackconnect automation before running. Either 'False' (default) or 'True'.
salt/cloud/clouds/nova.py
def rackconnect(vm_): ''' Determine if we should wait for rackconnect automation before running. Either 'False' (default) or 'True'. ''' return config.get_cloud_config_value( 'rackconnect', vm_, __opts__, default=False, search_global=False )
def rackconnect(vm_): ''' Determine if we should wait for rackconnect automation before running. Either 'False' (default) or 'True'. ''' return config.get_cloud_config_value( 'rackconnect', vm_, __opts__, default=False, search_global=False )
[ "Determine", "if", "we", "should", "wait", "for", "rackconnect", "automation", "before", "running", ".", "Either", "False", "(", "default", ")", "or", "True", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L470-L478
[ "def", "rackconnect", "(", "vm_", ")", ":", "return", "config", ".", "get_cloud_config_value", "(", "'rackconnect'", ",", "vm_", ",", "__opts__", ",", "default", "=", "False", ",", "search_global", "=", "False", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rackconnectv3
Determine if server is using rackconnectv3 or not Return the rackconnect network name or False
salt/cloud/clouds/nova.py
def rackconnectv3(vm_): ''' Determine if server is using rackconnectv3 or not Return the rackconnect network name or False ''' return config.get_cloud_config_value( 'rackconnectv3', vm_, __opts__, default=False, search_global=False )
def rackconnectv3(vm_): ''' Determine if server is using rackconnectv3 or not Return the rackconnect network name or False ''' return config.get_cloud_config_value( 'rackconnectv3', vm_, __opts__, default=False, search_global=False )
[ "Determine", "if", "server", "is", "using", "rackconnectv3", "or", "not", "Return", "the", "rackconnect", "network", "name", "or", "False" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L481-L489
[ "def", "rackconnectv3", "(", "vm_", ")", ":", "return", "config", ".", "get_cloud_config_value", "(", "'rackconnectv3'", ",", "vm_", ",", "__opts__", ",", "default", "=", "False", ",", "search_global", "=", "False", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cloudnetwork
Determine if we should use an extra network to bootstrap Either 'False' (default) or 'True'.
salt/cloud/clouds/nova.py
def cloudnetwork(vm_): ''' Determine if we should use an extra network to bootstrap Either 'False' (default) or 'True'. ''' return config.get_cloud_config_value( 'cloudnetwork', vm_, __opts__, default=False, search_global=False )
def cloudnetwork(vm_): ''' Determine if we should use an extra network to bootstrap Either 'False' (default) or 'True'. ''' return config.get_cloud_config_value( 'cloudnetwork', vm_, __opts__, default=False, search_global=False )
[ "Determine", "if", "we", "should", "use", "an", "extra", "network", "to", "bootstrap", "Either", "False", "(", "default", ")", "or", "True", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L492-L500
[ "def", "cloudnetwork", "(", "vm_", ")", ":", "return", "config", ".", "get_cloud_config_value", "(", "'cloudnetwork'", ",", "vm_", ",", "__opts__", ",", "default", "=", "False", ",", "search_global", "=", "False", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
managedcloud
Determine if we should wait for the managed cloud automation before running. Either 'False' (default) or 'True'.
salt/cloud/clouds/nova.py
def managedcloud(vm_): ''' Determine if we should wait for the managed cloud automation before running. Either 'False' (default) or 'True'. ''' return config.get_cloud_config_value( 'managedcloud', vm_, __opts__, default=False, search_global=False )
def managedcloud(vm_): ''' Determine if we should wait for the managed cloud automation before running. Either 'False' (default) or 'True'. ''' return config.get_cloud_config_value( 'managedcloud', vm_, __opts__, default=False, search_global=False )
[ "Determine", "if", "we", "should", "wait", "for", "the", "managed", "cloud", "automation", "before", "running", ".", "Either", "False", "(", "default", ")", "or", "True", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L503-L511
[ "def", "managedcloud", "(", "vm_", ")", ":", "return", "config", ".", "get_cloud_config_value", "(", "'managedcloud'", ",", "vm_", ",", "__opts__", ",", "default", "=", "False", ",", "search_global", "=", "False", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
destroy
Delete a single VM
salt/cloud/clouds/nova.py
def destroy(name, conn=None, call=None): ''' Delete a single VM ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a or --action.' ) __utils__['cloud.fire_event']( 'event', 'destroy...
def destroy(name, conn=None, call=None): ''' Delete a single VM ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a or --action.' ) __utils__['cloud.fire_event']( 'event', 'destroy...
[ "Delete", "a", "single", "VM" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L514-L575
[ "def", "destroy", "(", "name", ",", "conn", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The destroy action must be called with -d, --destroy, '", "'-a or --action.'", ")", "__utils__"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
request_instance
Put together all of the information necessary to request an instance through Novaclient and then fire off the request the instance. Returns data about the instance
salt/cloud/clouds/nova.py
def request_instance(vm_=None, call=None): ''' Put together all of the information necessary to request an instance through Novaclient and then fire off the request the instance. Returns data about the instance ''' if call == 'function': # Technically this function may be called other w...
def request_instance(vm_=None, call=None): ''' Put together all of the information necessary to request an instance through Novaclient and then fire off the request the instance. Returns data about the instance ''' if call == 'function': # Technically this function may be called other w...
[ "Put", "together", "all", "of", "the", "information", "necessary", "to", "request", "an", "instance", "through", "Novaclient", "and", "then", "fire", "off", "the", "request", "the", "instance", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L578-L791
[ "def", "request_instance", "(", "vm_", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "# Technically this function may be called other ways too, but it", "# definitely cannot be called with --function.", "raise", "SaltCloudSystemExit",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Create a single VM from a data dict
salt/cloud/clouds/nova.py
def create(vm_): ''' Create a single VM from a data dict ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, __active_provider_name__ or 'nov...
def create(vm_): ''' Create a single VM from a data dict ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, __active_provider_name__ or 'nov...
[ "Create", "a", "single", "VM", "from", "a", "data", "dict" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L934-L1077
[ "def", "create", "(", "vm_", ")", ":", "try", ":", "# Check for required profile parameters before sending any API calls.", "if", "vm_", "[", "'profile'", "]", "and", "config", ".", "is_profile_configured", "(", "__opts__", ",", "__active_provider_name__", "or", "'nova'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes
Return a list of the VMs that in this location
salt/cloud/clouds/nova.py
def list_nodes(call=None, **kwargs): ''' Return a list of the VMs that in this location ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) ret = {} conn = get_conn() server_list = conn.server_list...
def list_nodes(call=None, **kwargs): ''' Return a list of the VMs that in this location ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) ret = {} conn = get_conn() server_list = conn.server_list...
[ "Return", "a", "list", "of", "the", "VMs", "that", "in", "this", "location" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1096-L1147
[ "def", "list_nodes", "(", "call", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes function must be called with -f or --function.'", ")", "ret", "=", "{", "}", "conn", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes_full
Return a list of the VMs that in this location
salt/cloud/clouds/nova.py
def list_nodes_full(call=None, **kwargs): ''' Return a list of the VMs that in this location ''' if call == 'action': raise SaltCloudSystemExit( ( 'The list_nodes_full function must be called with' ' -f or --function.' ) ) ret ...
def list_nodes_full(call=None, **kwargs): ''' Return a list of the VMs that in this location ''' if call == 'action': raise SaltCloudSystemExit( ( 'The list_nodes_full function must be called with' ' -f or --function.' ) ) ret ...
[ "Return", "a", "list", "of", "the", "VMs", "that", "in", "this", "location" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1150-L1177
[ "def", "list_nodes_full", "(", "call", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "(", "'The list_nodes_full function must be called with'", "' -f or --function.'", ")", ")", "ret", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes_min
Return a list of the VMs that in this location
salt/cloud/clouds/nova.py
def list_nodes_min(call=None, **kwargs): ''' Return a list of the VMs that in this location ''' if call == 'action': raise SaltCloudSystemExit( ( 'The list_nodes_min function must be called with' ' -f or --function.' ) ) conn =...
def list_nodes_min(call=None, **kwargs): ''' Return a list of the VMs that in this location ''' if call == 'action': raise SaltCloudSystemExit( ( 'The list_nodes_min function must be called with' ' -f or --function.' ) ) conn =...
[ "Return", "a", "list", "of", "the", "VMs", "that", "in", "this", "location" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1180-L1197
[ "def", "list_nodes_min", "(", "call", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "(", "'The list_nodes_min function must be called with'", "' -f or --function.'", ")", ")", "conn", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
volume_create
Create block storage device
salt/cloud/clouds/nova.py
def volume_create(name, size=100, snapshot=None, voltype=None, **kwargs): ''' Create block storage device ''' conn = get_conn() create_kwargs = {'name': name, 'size': size, 'snapshot': snapshot, 'voltype': voltype} create_kwargs['ava...
def volume_create(name, size=100, snapshot=None, voltype=None, **kwargs): ''' Create block storage device ''' conn = get_conn() create_kwargs = {'name': name, 'size': size, 'snapshot': snapshot, 'voltype': voltype} create_kwargs['ava...
[ "Create", "block", "storage", "device" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1209-L1219
[ "def", "volume_create", "(", "name", ",", "size", "=", "100", ",", "snapshot", "=", "None", ",", "voltype", "=", "None", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "get_conn", "(", ")", "create_kwargs", "=", "{", "'name'", ":", "name", ",", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
volume_attach
Attach block volume
salt/cloud/clouds/nova.py
def volume_attach(name, server_name, device='/dev/xvdb', **kwargs): ''' Attach block volume ''' conn = get_conn() return conn.volume_attach( name, server_name, device, timeout=300 )
def volume_attach(name, server_name, device='/dev/xvdb', **kwargs): ''' Attach block volume ''' conn = get_conn() return conn.volume_attach( name, server_name, device, timeout=300 )
[ "Attach", "block", "volume" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1245-L1255
[ "def", "volume_attach", "(", "name", ",", "server_name", ",", "device", "=", "'/dev/xvdb'", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "get_conn", "(", ")", "return", "conn", ".", "volume_attach", "(", "name", ",", "server_name", ",", "device", ",",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
volume_create_attach
Create and attach volumes to created node
salt/cloud/clouds/nova.py
def volume_create_attach(name, call=None, **kwargs): ''' Create and attach volumes to created node ''' if call == 'function': raise SaltCloudSystemExit( 'The create_attach_volumes action must be called with ' '-a or --action.' ) if type(kwargs['volumes']) is ...
def volume_create_attach(name, call=None, **kwargs): ''' Create and attach volumes to created node ''' if call == 'function': raise SaltCloudSystemExit( 'The create_attach_volumes action must be called with ' '-a or --action.' ) if type(kwargs['volumes']) is ...
[ "Create", "and", "attach", "volumes", "to", "created", "node" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1262-L1318
[ "def", "volume_create_attach", "(", "name", ",", "call", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The create_attach_volumes action must be called with '", "'-a or --action.'", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
virtual_interface_create
Create private networks
salt/cloud/clouds/nova.py
def virtual_interface_create(name, net_name, **kwargs): ''' Create private networks ''' conn = get_conn() return conn.virtual_interface_create(name, net_name)
def virtual_interface_create(name, net_name, **kwargs): ''' Create private networks ''' conn = get_conn() return conn.virtual_interface_create(name, net_name)
[ "Create", "private", "networks" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/nova.py#L1357-L1362
[ "def", "virtual_interface_create", "(", "name", ",", "net_name", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "get_conn", "(", ")", "return", "conn", ".", "virtual_interface_create", "(", "name", ",", "net_name", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46