repository_name
stringclasses
316 values
func_path_in_repository
stringlengths
6
223
func_name
stringlengths
1
134
language
stringclasses
1 value
func_code_string
stringlengths
57
65.5k
func_documentation_string
stringlengths
1
46.3k
split_name
stringclasses
1 value
func_code_url
stringlengths
91
315
called_functions
listlengths
1
156
enclosing_scope
stringlengths
2
1.48M
saltstack/salt
salt/cloud/clouds/proxmox.py
get_vmconfig
python
def get_vmconfig(vmid, node=None, node_type='openvz'): ''' Get VM configuration ''' if node is None: # We need to figure out which node this VM is on. for host_name, host_details in six.iteritems(avail_locations()): for item in query('get', 'nodes/{0}/{1}'.format(host_name, n...
Get VM configuration
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/proxmox.py#L1059-L1073
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def query(conn_type, option, post_data=None):\n '''\n Execute the HTTP request to the API\n '''\n if ticket is None or csrf is None or url is None:\n log.debug('Not authenticated yet, doing that now..')\n _authenticate()\n\n ...
# -*- coding: utf-8 -*- ''' Proxmox Cloud Module ====================== .. versionadded:: 2014.7.0 The Proxmox cloud module is used to control access to cloud providers using the Proxmox system (KVM / OpenVZ / LXC). Set up the cloud configuration at ``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/pro...
saltstack/salt
salt/cloud/clouds/proxmox.py
wait_for_state
python
def wait_for_state(vmid, state, timeout=300): ''' Wait until a specific state has been reached on a node ''' start_time = time.time() node = get_vm_status(vmid=vmid) if not node: log.error('wait_for_state: No VM retrieved based on given criteria.') raise SaltCloudExecutionFailure...
Wait until a specific state has been reached on a node
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/proxmox.py#L1098-L1119
[ "def get_vm_status(vmid=None, name=None):\n '''\n Get the status for a VM, either via the ID or the hostname\n '''\n if vmid is not None:\n log.debug('get_vm_status: VMID %s', vmid)\n vmobj = _get_vm_by_id(vmid)\n elif name is not None:\n log.debug('get_vm_status: name %s', name)...
# -*- coding: utf-8 -*- ''' Proxmox Cloud Module ====================== .. versionadded:: 2014.7.0 The Proxmox cloud module is used to control access to cloud providers using the Proxmox system (KVM / OpenVZ / LXC). Set up the cloud configuration at ``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/pro...
saltstack/salt
salt/cloud/clouds/proxmox.py
wait_for_task
python
def wait_for_task(upid, timeout=300): ''' Wait until a the task has been finished successfully ''' start_time = time.time() info = _lookup_proxmox_task(upid) if not info: log.error('wait_for_task: No task information ' 'retrieved based on given criteria.') raise...
Wait until a the task has been finished successfully
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/proxmox.py#L1122-L1141
[ "def _lookup_proxmox_task(upid):\n '''\n Retrieve the (latest) logs and retrieve the status for a UPID.\n This can be used to verify whether a task has completed.\n '''\n log.debug('Getting creation status for upid: %s', upid)\n tasks = query('get', 'cluster/tasks')\n\n if tasks:\n for t...
# -*- coding: utf-8 -*- ''' Proxmox Cloud Module ====================== .. versionadded:: 2014.7.0 The Proxmox cloud module is used to control access to cloud providers using the Proxmox system (KVM / OpenVZ / LXC). Set up the cloud configuration at ``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/pro...
saltstack/salt
salt/cloud/clouds/proxmox.py
destroy
python
def destroy(name, call=None): ''' Destroy a node. CLI Example: .. code-block:: bash salt-cloud --destroy mymachine ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a or --action.' )...
Destroy a node. CLI Example: .. code-block:: bash salt-cloud --destroy mymachine
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/proxmox.py#L1144-L1198
[ "def stop(name, vmid=None, call=None):\n '''\n Stop a node (\"pulling the plug\").\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-cloud -a stop mymachine\n '''\n if call != 'action':\n raise SaltCloudSystemExit(\n 'The stop action must be called with -a or --action.'\n...
# -*- coding: utf-8 -*- ''' Proxmox Cloud Module ====================== .. versionadded:: 2014.7.0 The Proxmox cloud module is used to control access to cloud providers using the Proxmox system (KVM / OpenVZ / LXC). Set up the cloud configuration at ``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/pro...
saltstack/salt
salt/cloud/clouds/proxmox.py
set_vm_status
python
def set_vm_status(status, name=None, vmid=None): ''' Convenience function for setting VM status ''' log.debug('Set status to %s for %s (%s)', status, name, vmid) if vmid is not None: log.debug('set_vm_status: via ID - VMID %s (%s): %s', vmid, name, status) vmobj = ...
Convenience function for setting VM status
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/proxmox.py#L1201-L1231
[ "def query(conn_type, option, post_data=None):\n '''\n Execute the HTTP request to the API\n '''\n if ticket is None or csrf is None or url is None:\n log.debug('Not authenticated yet, doing that now..')\n _authenticate()\n\n full_url = 'https://{0}:{1}/api2/json/{2}'.format(url, port, ...
# -*- coding: utf-8 -*- ''' Proxmox Cloud Module ====================== .. versionadded:: 2014.7.0 The Proxmox cloud module is used to control access to cloud providers using the Proxmox system (KVM / OpenVZ / LXC). Set up the cloud configuration at ``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/pro...
saltstack/salt
salt/cloud/clouds/proxmox.py
get_vm_status
python
def get_vm_status(vmid=None, name=None): ''' Get the status for a VM, either via the ID or the hostname ''' if vmid is not None: log.debug('get_vm_status: VMID %s', vmid) vmobj = _get_vm_by_id(vmid) elif name is not None: log.debug('get_vm_status: name %s', name) vmob...
Get the status for a VM, either via the ID or the hostname
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/proxmox.py#L1234-L1258
[ "def query(conn_type, option, post_data=None):\n '''\n Execute the HTTP request to the API\n '''\n if ticket is None or csrf is None or url is None:\n log.debug('Not authenticated yet, doing that now..')\n _authenticate()\n\n full_url = 'https://{0}:{1}/api2/json/{2}'.format(url, port, ...
# -*- coding: utf-8 -*- ''' Proxmox Cloud Module ====================== .. versionadded:: 2014.7.0 The Proxmox cloud module is used to control access to cloud providers using the Proxmox system (KVM / OpenVZ / LXC). Set up the cloud configuration at ``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/pro...
saltstack/salt
salt/cloud/clouds/proxmox.py
start
python
def start(name, vmid=None, call=None): ''' Start a node. CLI Example: .. code-block:: bash salt-cloud -a start mymachine ''' if call != 'action': raise SaltCloudSystemExit( 'The start action must be called with -a or --action.' ) log.debug('Start: %s (...
Start a node. CLI Example: .. code-block:: bash salt-cloud -a start mymachine
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/proxmox.py#L1261-L1283
[ "def set_vm_status(status, name=None, vmid=None):\n '''\n Convenience function for setting VM status\n '''\n log.debug('Set status to %s for %s (%s)', status, name, vmid)\n\n if vmid is not None:\n log.debug('set_vm_status: via ID - VMID %s (%s): %s',\n vmid, name, status)\n ...
# -*- coding: utf-8 -*- ''' Proxmox Cloud Module ====================== .. versionadded:: 2014.7.0 The Proxmox cloud module is used to control access to cloud providers using the Proxmox system (KVM / OpenVZ / LXC). Set up the cloud configuration at ``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/pro...
saltstack/salt
salt/cloud/clouds/proxmox.py
stop
python
def stop(name, vmid=None, call=None): ''' Stop a node ("pulling the plug"). CLI Example: .. code-block:: bash salt-cloud -a stop mymachine ''' if call != 'action': raise SaltCloudSystemExit( 'The stop action must be called with -a or --action.' ) if no...
Stop a node ("pulling the plug"). CLI Example: .. code-block:: bash salt-cloud -a stop mymachine
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/proxmox.py#L1286-L1307
[ "def set_vm_status(status, name=None, vmid=None):\n '''\n Convenience function for setting VM status\n '''\n log.debug('Set status to %s for %s (%s)', status, name, vmid)\n\n if vmid is not None:\n log.debug('set_vm_status: via ID - VMID %s (%s): %s',\n vmid, name, status)\n ...
# -*- coding: utf-8 -*- ''' Proxmox Cloud Module ====================== .. versionadded:: 2014.7.0 The Proxmox cloud module is used to control access to cloud providers using the Proxmox system (KVM / OpenVZ / LXC). Set up the cloud configuration at ``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/pro...
saltstack/salt
salt/states/rsync.py
_get_summary
python
def _get_summary(rsync_out): ''' Get summary from the rsync successful output. ''' return "- " + "\n- ".join([elm for elm in rsync_out.split("\n\n")[-1].replace(" ", "\n").split("\n") if elm])
Get summary from the rsync successful output.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rsync.py#L48-L53
null
# -*- coding: utf-8 -*- # # Copyright 2015 SUSE LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
saltstack/salt
salt/states/rsync.py
_get_changes
python
def _get_changes(rsync_out): ''' Get changes from the rsync successful output. ''' copied = list() deleted = list() for line in rsync_out.split("\n\n")[0].split("\n")[1:]: if line.startswith("deleting "): deleted.append(line.split(" ", 1)[-1]) else: copie...
Get changes from the rsync successful output.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rsync.py#L56-L77
null
# -*- coding: utf-8 -*- # # Copyright 2015 SUSE LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
saltstack/salt
salt/states/rsync.py
synchronized
python
def synchronized(name, source, delete=False, force=False, update=False, passwordfile=None, exclude=None, excludefrom=None, prepare=False, dryrun=False, additional_opts...
Guarantees that the source directory is always copied to the target. name Name of the target directory. source Source directory. prepare Create destination directory if it does not exists. delete Delete extraneous files from the destination dirs (True or False) f...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rsync.py#L80-L170
[ "def _get_changes(rsync_out):\n '''\n Get changes from the rsync successful output.\n '''\n copied = list()\n deleted = list()\n\n for line in rsync_out.split(\"\\n\\n\")[0].split(\"\\n\")[1:]:\n if line.startswith(\"deleting \"):\n deleted.append(line.split(\" \", 1)[-1])\n ...
# -*- coding: utf-8 -*- # # Copyright 2015 SUSE LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
saltstack/salt
salt/modules/cisconso.py
get_data
python
def get_data(datastore, path): ''' Get the configuration of the device tree at the given path :param datastore: The datastore, e.g. running, operational. One of the NETCONF store IETF types :type datastore: :class:`DatastoreType` (``str`` enum). :param path: The device path to set the val...
Get the configuration of the device tree at the given path :param datastore: The datastore, e.g. running, operational. One of the NETCONF store IETF types :type datastore: :class:`DatastoreType` (``str`` enum). :param path: The device path to set the value at, a list of element names in o...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cisconso.py#L37-L58
[ "def _proxy_cmd(command, *args, **kwargs):\n '''\n run commands from __proxy__\n :mod:`salt.proxy.cisconso<salt.proxy.cisconso>`\n\n command\n function from `salt.proxy.cisconso` to run\n\n args\n positional args to pass to `command` function\n\n kwargs\n key word arguments to...
# -*- coding: utf-8 -*- ''' Execution module for Cisco Network Services Orchestrator Proxy minions .. versionadded: 2016.11.0 For documentation on setting up the cisconso proxy minion look in the documentation for :mod:`salt.proxy.cisconso<salt.proxy.cisconso>`. ''' from __future__ import absolute_import, print_funct...
saltstack/salt
salt/modules/cisconso.py
set_data_value
python
def set_data_value(datastore, path, data): ''' Set a data entry in a datastore :param datastore: The datastore, e.g. running, operational. One of the NETCONF store IETF types :type datastore: :class:`DatastoreType` (``str`` enum). :param path: The device path to set the value at, ...
Set a data entry in a datastore :param datastore: The datastore, e.g. running, operational. One of the NETCONF store IETF types :type datastore: :class:`DatastoreType` (``str`` enum). :param path: The device path to set the value at, a list of element names in order, / separated :type...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cisconso.py#L61-L85
[ "def _proxy_cmd(command, *args, **kwargs):\n '''\n run commands from __proxy__\n :mod:`salt.proxy.cisconso<salt.proxy.cisconso>`\n\n command\n function from `salt.proxy.cisconso` to run\n\n args\n positional args to pass to `command` function\n\n kwargs\n key word arguments to...
# -*- coding: utf-8 -*- ''' Execution module for Cisco Network Services Orchestrator Proxy minions .. versionadded: 2016.11.0 For documentation on setting up the cisconso proxy minion look in the documentation for :mod:`salt.proxy.cisconso<salt.proxy.cisconso>`. ''' from __future__ import absolute_import, print_funct...
saltstack/salt
salt/states/postgres_initdb.py
present
python
def present(name, user=None, password=None, auth='password', encoding='UTF8', locale=None, runas=None, waldir=None, checksums=False): ''' Initialize the PostgreSQL data directory name The name of the directory to initialize user ...
Initialize the PostgreSQL data directory name The name of the directory to initialize user The database superuser name password The password to set for the postgres user auth The default authentication method for local connections encoding The default enc...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/postgres_initdb.py#L39-L121
null
# -*- coding: utf-8 -*- ''' Initialization of PostgreSQL data directory =========================================== The postgres_initdb module is used to initialize the postgresql data directory. .. versionadded:: 2016.3.0 .. code-block:: yaml pgsql-data-dir: postgres_initdb.present: - name: /var/...
saltstack/salt
salt/modules/wordpress.py
list_plugins
python
def list_plugins(path, user): ''' List plugins in an installed wordpress path path path to wordpress install location user user to run the command as CLI Example: .. code-block:: bash salt '*' wordpress.list_plugins /var/www/html apache ''' ret = [] resp ...
List plugins in an installed wordpress path path path to wordpress install location user user to run the command as CLI Example: .. code-block:: bash salt '*' wordpress.list_plugins /var/www/html apache
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/wordpress.py#L29-L51
null
# -*- coding: utf-8 -*- ''' This module is used to manage Wordpress installations :depends: wp binary from http://wp-cli.org/ ''' # Import Python Modules from __future__ import absolute_import, print_function, unicode_literals import collections # Import Salt Modules import salt.utils.path from salt.ext.six.moves im...
saltstack/salt
salt/modules/wordpress.py
show_plugin
python
def show_plugin(name, path, user): ''' Show a plugin in a wordpress install and check if it is installed name Wordpress plugin name path path to wordpress install location user user to run the command as CLI Example: .. code-block:: bash salt '*' wordpre...
Show a plugin in a wordpress install and check if it is installed name Wordpress plugin name path path to wordpress install location user user to run the command as CLI Example: .. code-block:: bash salt '*' wordpress.show_plugin HyperDB /var/www/html apache
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/wordpress.py#L54-L82
null
# -*- coding: utf-8 -*- ''' This module is used to manage Wordpress installations :depends: wp binary from http://wp-cli.org/ ''' # Import Python Modules from __future__ import absolute_import, print_function, unicode_literals import collections # Import Salt Modules import salt.utils.path from salt.ext.six.moves im...
saltstack/salt
salt/modules/wordpress.py
activate
python
def activate(name, path, user): ''' Activate a wordpress plugin name Wordpress plugin name path path to wordpress install location user user to run the command as CLI Example: .. code-block:: bash salt '*' wordpress.activate HyperDB /var/www/html apache ...
Activate a wordpress plugin name Wordpress plugin name path path to wordpress install location user user to run the command as CLI Example: .. code-block:: bash salt '*' wordpress.activate HyperDB /var/www/html apache
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/wordpress.py#L85-L115
[ "def show_plugin(name, path, user):\n '''\n Show a plugin in a wordpress install and check if it is installed\n\n name\n Wordpress plugin name\n\n path\n path to wordpress install location\n\n user\n user to run the command as\n\n CLI Example:\n\n .. code-block:: bash\n\n ...
# -*- coding: utf-8 -*- ''' This module is used to manage Wordpress installations :depends: wp binary from http://wp-cli.org/ ''' # Import Python Modules from __future__ import absolute_import, print_function, unicode_literals import collections # Import Salt Modules import salt.utils.path from salt.ext.six.moves im...
saltstack/salt
salt/modules/wordpress.py
is_installed
python
def is_installed(path, user=None): ''' Check if wordpress is installed and setup path path to wordpress install location user user to run the command as CLI Example: .. code-block:: bash salt '*' wordpress.is_installed /var/www/html apache ''' retcode = __sal...
Check if wordpress is installed and setup path path to wordpress install location user user to run the command as CLI Example: .. code-block:: bash salt '*' wordpress.is_installed /var/www/html apache
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/wordpress.py#L151-L172
null
# -*- coding: utf-8 -*- ''' This module is used to manage Wordpress installations :depends: wp binary from http://wp-cli.org/ ''' # Import Python Modules from __future__ import absolute_import, print_function, unicode_literals import collections # Import Salt Modules import salt.utils.path from salt.ext.six.moves im...
saltstack/salt
salt/modules/wordpress.py
install
python
def install(path, user, admin_user, admin_password, admin_email, title, url): ''' Run the initial setup functions for a wordpress install path path to wordpress install location user user to run the command as admin_user Username for the Administrative user for the wordpre...
Run the initial setup functions for a wordpress install path path to wordpress install location user user to run the command as admin_user Username for the Administrative user for the wordpress install admin_password Initial Password for the Administrative user for th...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/wordpress.py#L175-L225
null
# -*- coding: utf-8 -*- ''' This module is used to manage Wordpress installations :depends: wp binary from http://wp-cli.org/ ''' # Import Python Modules from __future__ import absolute_import, print_function, unicode_literals import collections # Import Salt Modules import salt.utils.path from salt.ext.six.moves im...
saltstack/salt
salt/matchers/grain_pcre_match.py
match
python
def match(tgt, delimiter=DEFAULT_TARGET_DELIM, opts=None): ''' Matches a grain based on regex ''' if not opts: opts = __opts__ log.debug('grains pcre target: %s', tgt) if delimiter not in tgt: log.error('Got insufficient arguments for grains pcre match ' 'statem...
Matches a grain based on regex
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/matchers/grain_pcre_match.py#L15-L28
[ "def subdict_match(data,\n expr,\n delimiter=DEFAULT_TARGET_DELIM,\n regex_match=False,\n exact_match=False):\n '''\n Check for a match in a dictionary using a delimiter character to denote\n levels of subdicts, and also allowing the delim...
# -*- coding: utf-8 -*- ''' This is the default grains PCRE matcher. ''' from __future__ import absolute_import, print_function, unicode_literals import logging from salt.defaults import DEFAULT_TARGET_DELIM # pylint: disable=3rd-party-module-not-gated import salt.utils.data # pylint: disable=3rd-party-module-not-g...
saltstack/salt
salt/utils/yamldumper.py
dump
python
def dump(data, stream=None, **kwargs): ''' .. versionadded:: 2018.3.0 Helper that wraps yaml.dump and ensures that we encode unicode strings unless explicitly told not to. ''' if 'allow_unicode' not in kwargs: kwargs['allow_unicode'] = True return yaml.dump(data, stream, **kwargs)
.. versionadded:: 2018.3.0 Helper that wraps yaml.dump and ensures that we encode unicode strings unless explicitly told not to.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/yamldumper.py#L116-L125
null
# -*- coding: utf-8 -*- ''' salt.utils.yamldumper ~~~~~~~~~~~~~~~~~~~~~ ''' # pylint: disable=W0232 # class has no __init__ method from __future__ import absolute_import, print_function, unicode_literals try: from yaml import CDumper as Dumper from yaml import CSafeDumper as SafeDumper except ...
saltstack/salt
salt/utils/yamldumper.py
safe_dump
python
def safe_dump(data, stream=None, **kwargs): ''' Use a custom dumper to ensure that defaultdict and OrderedDict are represented properly. Ensure that unicode strings are encoded unless explicitly told not to. ''' if 'allow_unicode' not in kwargs: kwargs['allow_unicode'] = True return ...
Use a custom dumper to ensure that defaultdict and OrderedDict are represented properly. Ensure that unicode strings are encoded unless explicitly told not to.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/yamldumper.py#L128-L136
null
# -*- coding: utf-8 -*- ''' salt.utils.yamldumper ~~~~~~~~~~~~~~~~~~~~~ ''' # pylint: disable=W0232 # class has no __init__ method from __future__ import absolute_import, print_function, unicode_literals try: from yaml import CDumper as Dumper from yaml import CSafeDumper as SafeDumper except ...
saltstack/salt
salt/cloud/clouds/opennebula.py
avail_images
python
def avail_images(call=None): ''' Return available OpenNebula images. CLI Example: .. code-block:: bash salt-cloud --list-images opennebula salt-cloud --function avail_images opennebula salt-cloud -f avail_images opennebula ''' if call == 'action': raise SaltCl...
Return available OpenNebula images. CLI Example: .. code-block:: bash salt-cloud --list-images opennebula salt-cloud --function avail_images opennebula salt-cloud -f avail_images opennebula
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L132-L160
[ "def _xml_to_dict(xml):\n '''\n Helper function to covert xml into a data dictionary.\n\n xml\n The xml data to convert.\n '''\n dicts = {}\n for item in xml:\n key = item.tag.lower()\n idx = 1\n while key in dicts:\n key += six.text_type(idx)\n id...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
avail_locations
python
def avail_locations(call=None): ''' Return available OpenNebula locations. CLI Example: .. code-block:: bash salt-cloud --list-locations opennebula salt-cloud --function avail_locations opennebula salt-cloud -f avail_locations opennebula ''' if call == 'action': ...
Return available OpenNebula locations. CLI Example: .. code-block:: bash salt-cloud --list-locations opennebula salt-cloud --function avail_locations opennebula salt-cloud -f avail_locations opennebula
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L163-L190
[ "def _xml_to_dict(xml):\n '''\n Helper function to covert xml into a data dictionary.\n\n xml\n The xml data to convert.\n '''\n dicts = {}\n for item in xml:\n key = item.tag.lower()\n idx = 1\n while key in dicts:\n key += six.text_type(idx)\n id...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
list_clusters
python
def list_clusters(call=None): ''' Returns a list of clusters in OpenNebula. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f list_clusters opennebula ''' if call == 'action': raise SaltCloudSystemExit( 'The list_clusters function must...
Returns a list of clusters in OpenNebula. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f list_clusters opennebula
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L212-L237
[ "def _xml_to_dict(xml):\n '''\n Helper function to covert xml into a data dictionary.\n\n xml\n The xml data to convert.\n '''\n dicts = {}\n for item in xml:\n key = item.tag.lower()\n idx = 1\n while key in dicts:\n key += six.text_type(idx)\n id...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
list_datastores
python
def list_datastores(call=None): ''' Returns a list of data stores on OpenNebula. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f list_datastores opennebula ''' if call == 'action': raise SaltCloudSystemExit( 'The list_datastores func...
Returns a list of data stores on OpenNebula. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f list_datastores opennebula
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L240-L265
[ "def _xml_to_dict(xml):\n '''\n Helper function to covert xml into a data dictionary.\n\n xml\n The xml data to convert.\n '''\n dicts = {}\n for item in xml:\n key = item.tag.lower()\n idx = 1\n while key in dicts:\n key += six.text_type(idx)\n id...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
list_security_groups
python
def list_security_groups(call=None): ''' Lists all security groups available to the user and the user's groups. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f list_security_groups opennebula ''' if call == 'action': raise SaltCloudSystemExit( ...
Lists all security groups available to the user and the user's groups. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f list_security_groups opennebula
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L346-L371
[ "def _xml_to_dict(xml):\n '''\n Helper function to covert xml into a data dictionary.\n\n xml\n The xml data to convert.\n '''\n dicts = {}\n for item in xml:\n key = item.tag.lower()\n idx = 1\n while key in dicts:\n key += six.text_type(idx)\n id...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
list_templates
python
def list_templates(call=None): ''' Lists all templates available to the user and the user's groups. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f list_templates opennebula ''' if call == 'action': raise SaltCloudSystemExit( 'The li...
Lists all templates available to the user and the user's groups. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f list_templates opennebula
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L374-L399
[ "def _xml_to_dict(xml):\n '''\n Helper function to covert xml into a data dictionary.\n\n xml\n The xml data to convert.\n '''\n dicts = {}\n for item in xml:\n key = item.tag.lower()\n idx = 1\n while key in dicts:\n key += six.text_type(idx)\n id...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
list_vns
python
def list_vns(call=None): ''' Lists all virtual networks available to the user and the user's groups. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f list_vns opennebula ''' if call == 'action': raise SaltCloudSystemExit( 'The list_vn...
Lists all virtual networks available to the user and the user's groups. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f list_vns opennebula
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L402-L427
[ "def _xml_to_dict(xml):\n '''\n Helper function to covert xml into a data dictionary.\n\n xml\n The xml data to convert.\n '''\n dicts = {}\n for item in xml:\n key = item.tag.lower()\n idx = 1\n while key in dicts:\n key += six.text_type(idx)\n id...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
reboot
python
def reboot(name, call=None): ''' Reboot a VM. .. versionadded:: 2016.3.0 name The name of the VM to reboot. CLI Example: .. code-block:: bash salt-cloud -a reboot my-vm ''' if call != 'action': raise SaltCloudSystemExit( 'The start action must be ...
Reboot a VM. .. versionadded:: 2016.3.0 name The name of the VM to reboot. CLI Example: .. code-block:: bash salt-cloud -a reboot my-vm
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L430-L452
[ "def vm_action(name, kwargs=None, call=None):\n '''\n Submits an action to be performed on a given virtual machine.\n\n .. versionadded:: 2016.3.0\n\n name\n The name of the VM to action.\n\n action\n The action to be performed on the VM. Available options include:\n - boot\n ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
start
python
def start(name, call=None): ''' Start a VM. .. versionadded:: 2016.3.0 name The name of the VM to start. CLI Example: .. code-block:: bash salt-cloud -a start my-vm ''' if call != 'action': raise SaltCloudSystemExit( 'The start action must be call...
Start a VM. .. versionadded:: 2016.3.0 name The name of the VM to start. CLI Example: .. code-block:: bash salt-cloud -a start my-vm
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L455-L477
[ "def vm_action(name, kwargs=None, call=None):\n '''\n Submits an action to be performed on a given virtual machine.\n\n .. versionadded:: 2016.3.0\n\n name\n The name of the VM to action.\n\n action\n The action to be performed on the VM. Available options include:\n - boot\n ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
stop
python
def stop(name, call=None): ''' Stop a VM. .. versionadded:: 2016.3.0 name The name of the VM to stop. CLI Example: .. code-block:: bash salt-cloud -a stop my-vm ''' if call != 'action': raise SaltCloudSystemExit( 'The start action must be called w...
Stop a VM. .. versionadded:: 2016.3.0 name The name of the VM to stop. CLI Example: .. code-block:: bash salt-cloud -a stop my-vm
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L480-L502
[ "def vm_action(name, kwargs=None, call=None):\n '''\n Submits an action to be performed on a given virtual machine.\n\n .. versionadded:: 2016.3.0\n\n name\n The name of the VM to action.\n\n action\n The action to be performed on the VM. Available options include:\n - boot\n ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
get_one_version
python
def get_one_version(kwargs=None, call=None): ''' Returns the OpenNebula version. .. versionadded:: 2016.3.5 CLI Example: .. code-block:: bash salt-cloud -f get_one_version one_provider_name ''' if call == 'action': raise SaltCloudSystemExit( 'The get_cluster_...
Returns the OpenNebula version. .. versionadded:: 2016.3.5 CLI Example: .. code-block:: bash salt-cloud -f get_one_version one_provider_name
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L505-L529
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
get_cluster_id
python
def get_cluster_id(kwargs=None, call=None): ''' Returns a cluster's ID from the given cluster name. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f get_cluster_id opennebula name=my-cluster-name ''' if call == 'action': raise SaltCloudSystemExit...
Returns a cluster's ID from the given cluster name. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f get_cluster_id opennebula name=my-cluster-name
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L532-L565
[ "def list_clusters(call=None):\n '''\n Returns a list of clusters in OpenNebula.\n\n .. versionadded:: 2016.3.0\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-cloud -f list_clusters opennebula\n '''\n if call == 'action':\n raise SaltCloudSystemExit(\n 'The list_clu...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
get_datastore_id
python
def get_datastore_id(kwargs=None, call=None): ''' Returns a data store's ID from the given data store name. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f get_datastore_id opennebula name=my-datastore-name ''' if call == 'action': raise SaltClo...
Returns a data store's ID from the given data store name. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f get_datastore_id opennebula name=my-datastore-name
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L568-L601
[ "def list_datastores(call=None):\n '''\n Returns a list of data stores on OpenNebula.\n\n .. versionadded:: 2016.3.0\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-cloud -f list_datastores opennebula\n '''\n if call == 'action':\n raise SaltCloudSystemExit(\n 'The l...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
get_host_id
python
def get_host_id(kwargs=None, call=None): ''' Returns a host's ID from the given host name. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f get_host_id opennebula name=my-host-name ''' if call == 'action': raise SaltCloudSystemExit( '...
Returns a host's ID from the given host name. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f get_host_id opennebula name=my-host-name
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L604-L637
[ "def avail_locations(call=None):\n '''\n Return available OpenNebula locations.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-cloud --list-locations opennebula\n salt-cloud --function avail_locations opennebula\n salt-cloud -f avail_locations opennebula\n\n '''\n if call ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
get_image
python
def get_image(vm_): r''' Return the image object to use. vm\_ The VM dictionary for which to obtain an image. ''' images = avail_images() vm_image = six.text_type(config.get_cloud_config_value( 'image', vm_, __opts__, search_global=False )) for image in images: i...
r''' Return the image object to use. vm\_ The VM dictionary for which to obtain an image.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L640-L656
[ "def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
get_image_id
python
def get_image_id(kwargs=None, call=None): ''' Returns an image's ID from the given image name. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f get_image_id opennebula name=my-image-name ''' if call == 'action': raise SaltCloudSystemExit( ...
Returns an image's ID from the given image name. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f get_image_id opennebula name=my-image-name
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L659-L692
[ "def avail_images(call=None):\n '''\n Return available OpenNebula images.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-cloud --list-images opennebula\n salt-cloud --function avail_images opennebula\n salt-cloud -f avail_images opennebula\n\n '''\n if call == 'action':\n ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
get_secgroup_id
python
def get_secgroup_id(kwargs=None, call=None): ''' Returns a security group's ID from the given security group name. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f get_secgroup_id opennebula name=my-secgroup-name ''' if call == 'action': raise Sa...
Returns a security group's ID from the given security group name. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f get_secgroup_id opennebula name=my-secgroup-name
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L721-L754
[ "def list_security_groups(call=None):\n '''\n Lists all security groups available to the user and the user's groups.\n\n .. versionadded:: 2016.3.0\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-cloud -f list_security_groups opennebula\n '''\n if call == 'action':\n raise Salt...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
get_template_image
python
def get_template_image(kwargs=None, call=None): ''' Returns a template's image from the given template name. .. versionadded:: 2018.3.0 .. code-block:: bash salt-cloud -f get_template_image opennebula name=my-template-name ''' if call == 'action': raise SaltCloudSystemExit( ...
Returns a template's image from the given template name. .. versionadded:: 2018.3.0 .. code-block:: bash salt-cloud -f get_template_image opennebula name=my-template-name
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L757-L788
[ "def list_templates(call=None):\n '''\n Lists all templates available to the user and the user's groups.\n\n .. versionadded:: 2016.3.0\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-cloud -f list_templates opennebula\n '''\n if call == 'action':\n raise SaltCloudSystemExit(\n...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
get_template
python
def get_template(vm_): r''' Return the template id for a VM. .. versionadded:: 2016.11.0 vm\_ The VM dictionary for which to obtain a template. ''' vm_template = six.text_type(config.get_cloud_config_value( 'template', vm_, __opts__, search_global=False )) try: ...
r''' Return the template id for a VM. .. versionadded:: 2016.11.0 vm\_ The VM dictionary for which to obtain a template.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L827-L845
[ "def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
get_vm_id
python
def get_vm_id(kwargs=None, call=None): ''' Returns a virtual machine's ID from the given virtual machine's name. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f get_vm_id opennebula name=my-vm ''' if call == 'action': raise SaltCloudSystemExit( ...
Returns a virtual machine's ID from the given virtual machine's name. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f get_vm_id opennebula name=my-vm
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L848-L881
[ "def list_nodes(call=None):\n '''\n Return a list of VMs on OpenNebula.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-cloud -Q\n salt-cloud --query\n salt-cloud --function list_nodes opennebula\n salt-cloud -f list_nodes opennebula\n\n '''\n if call == 'action':\n ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
get_vn_id
python
def get_vn_id(kwargs=None, call=None): ''' Returns a virtual network's ID from the given virtual network's name. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f get_vn_id opennebula name=my-vn-name ''' if call == 'action': raise SaltCloudSystemE...
Returns a virtual network's ID from the given virtual network's name. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt-cloud -f get_vn_id opennebula name=my-vn-name
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L884-L917
[ "def list_vns(call=None):\n '''\n Lists all virtual networks available to the user and the user's groups.\n\n .. versionadded:: 2016.3.0\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-cloud -f list_vns opennebula\n '''\n if call == 'action':\n raise SaltCloudSystemExit(\n ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
_get_device_template
python
def _get_device_template(disk, disk_info, template=None): ''' Returns the template format to create a disk in open nebula .. versionadded:: 2018.3.0 ''' def _require_disk_opts(*args): for arg in args: if arg not in disk_info: raise SaltCloudSystemExit( ...
Returns the template format to create a disk in open nebula .. versionadded:: 2018.3.0
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L920-L963
null
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
create
python
def create(vm_): r''' Create a single VM from a data dict. vm\_ The dictionary use to create a VM. Optional vm\_ dict options for overwriting template: region_id Optional - OpenNebula Zone ID memory Optional - In MB cpu Optional - Percent of host CPU to a...
r''' Create a single VM from a data dict. vm\_ The dictionary use to create a VM. Optional vm\_ dict options for overwriting template: region_id Optional - OpenNebula Zone ID memory Optional - In MB cpu Optional - Percent of host CPU to allocate vcpu ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L967-L1178
[ "def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
destroy
python
def destroy(name, call=None): ''' Destroy a node. Will check termination protection and warn if enabled. name The name of the vm to be destroyed. CLI Example: .. code-block:: bash salt-cloud --destroy vm_name salt-cloud -d vm_name salt-cloud --action destroy vm_na...
Destroy a node. Will check termination protection and warn if enabled. name The name of the vm to be destroyed. CLI Example: .. code-block:: bash salt-cloud --destroy vm_name salt-cloud -d vm_name salt-cloud --action destroy vm_name salt-cloud -a destroy vm_name
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L1181-L1240
[ "def show_instance(name, call=None):\n '''\n Show the details from OpenNebula concerning a named VM.\n\n name\n The name of the VM for which to display details.\n\n call\n Type of call to use with this function such as ``function``.\n\n CLI Example:\n\n .. code-block:: bash\n\n ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
image_allocate
python
def image_allocate(call=None, kwargs=None): ''' Allocates a new image in OpenNebula. .. versionadded:: 2016.3.0 path The path to a file containing the template of the image to allocate. Syntax within the file can be the usual attribute=value or XML. Can be used instead of ``dat...
Allocates a new image in OpenNebula. .. versionadded:: 2016.3.0 path The path to a file containing the template of the image to allocate. Syntax within the file can be the usual attribute=value or XML. Can be used instead of ``data``. data The data containing the template ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L1243-L1328
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
image_clone
python
def image_clone(call=None, kwargs=None): ''' Clones an existing image. .. versionadded:: 2016.3.0 name The name of the new image. image_id The ID of the image to be cloned. Can be used instead of ``image_name``. image_name The name of the image to be cloned. Can be us...
Clones an existing image. .. versionadded:: 2016.3.0 name The name of the new image. image_id The ID of the image to be cloned. Can be used instead of ``image_name``. image_name The name of the image to be cloned. Can be used instead of ``image_id``. CLI Example: .....
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L1331-L1396
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
image_info
python
def image_info(call=None, kwargs=None): ''' Retrieves information for a given image. Either a name or an image_id must be supplied. .. versionadded:: 2016.3.0 name The name of the image for which to gather information. Can be used instead of ``image_id``. image_id The ...
Retrieves information for a given image. Either a name or an image_id must be supplied. .. versionadded:: 2016.3.0 name The name of the image for which to gather information. Can be used instead of ``image_id``. image_id The ID of the image for which to gather information. Can...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L1458-L1513
[ "def _xml_to_dict(xml):\n '''\n Helper function to covert xml into a data dictionary.\n\n xml\n The xml data to convert.\n '''\n dicts = {}\n for item in xml:\n key = item.tag.lower()\n idx = 1\n while key in dicts:\n key += six.text_type(idx)\n id...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
image_persistent
python
def image_persistent(call=None, kwargs=None): ''' Sets the Image as persistent or not persistent. .. versionadded:: 2016.3.0 name The name of the image to set. Can be used instead of ``image_id``. image_id The ID of the image to set. Can be used instead of ``name``. persist ...
Sets the Image as persistent or not persistent. .. versionadded:: 2016.3.0 name The name of the image to set. Can be used instead of ``image_id``. image_id The ID of the image to set. Can be used instead of ``name``. persist A boolean value to set the image as persistent or n...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L1516-L1582
[ "def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \"true\"\n 3. Any object for which bool(obj) returns Tr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
image_snapshot_delete
python
def image_snapshot_delete(call=None, kwargs=None): ''' Deletes a snapshot from the image. .. versionadded:: 2016.3.0 image_id The ID of the image from which to delete the snapshot. Can be used instead of ``image_name``. image_name The name of the image from which to delete...
Deletes a snapshot from the image. .. versionadded:: 2016.3.0 image_id The ID of the image from which to delete the snapshot. Can be used instead of ``image_name``. image_name The name of the image from which to delete the snapshot. Can be used instead of ``image_id``. ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L1585-L1651
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
image_update
python
def image_update(call=None, kwargs=None): ''' Replaces the image template contents. .. versionadded:: 2016.3.0 image_id The ID of the image to update. Can be used instead of ``image_name``. image_name The name of the image to update. Can be used instead of ``image_id``. path ...
Replaces the image template contents. .. versionadded:: 2016.3.0 image_id The ID of the image to update. Can be used instead of ``image_name``. image_name The name of the image to update. Can be used instead of ``image_id``. path The path to a file containing the template of ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L1789-L1894
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
secgroup_delete
python
def secgroup_delete(call=None, kwargs=None): ''' Deletes the given security group from OpenNebula. Either a name or a secgroup_id must be supplied. .. versionadded:: 2016.3.0 name The name of the security group to delete. Can be used instead of ``secgroup_id``. secgroup_id ...
Deletes the given security group from OpenNebula. Either a name or a secgroup_id must be supplied. .. versionadded:: 2016.3.0 name The name of the security group to delete. Can be used instead of ``secgroup_id``. secgroup_id The ID of the security group to delete. Can be used ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2060-L2117
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
secgroup_info
python
def secgroup_info(call=None, kwargs=None): ''' Retrieves information for the given security group. Either a name or a secgroup_id must be supplied. .. versionadded:: 2016.3.0 name The name of the security group for which to gather information. Can be used instead of ``secgroup_id``...
Retrieves information for the given security group. Either a name or a secgroup_id must be supplied. .. versionadded:: 2016.3.0 name The name of the security group for which to gather information. Can be used instead of ``secgroup_id``. secgroup_id The ID of the security group...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2120-L2175
[ "def _xml_to_dict(xml):\n '''\n Helper function to covert xml into a data dictionary.\n\n xml\n The xml data to convert.\n '''\n dicts = {}\n for item in xml:\n key = item.tag.lower()\n idx = 1\n while key in dicts:\n key += six.text_type(idx)\n id...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
secgroup_update
python
def secgroup_update(call=None, kwargs=None): ''' Replaces the security group template contents. .. versionadded:: 2016.3.0 secgroup_id The ID of the security group to update. Can be used instead of ``secgroup_name``. secgroup_name The name of the security group to update. ...
Replaces the security group template contents. .. versionadded:: 2016.3.0 secgroup_id The ID of the security group to update. Can be used instead of ``secgroup_name``. secgroup_name The name of the security group to update. Can be used instead of ``secgroup_id``. path...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2178-L2287
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
template_allocate
python
def template_allocate(call=None, kwargs=None): ''' Allocates a new template in OpenNebula. .. versionadded:: 2016.3.0 path The path to a file containing the elements of the template to be allocated. Syntax within the file can be the usual attribute=value or XML. Can be used ins...
Allocates a new template in OpenNebula. .. versionadded:: 2016.3.0 path The path to a file containing the elements of the template to be allocated. Syntax within the file can be the usual attribute=value or XML. Can be used instead of ``data``. data Contains the elements o...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2290-L2353
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
template_clone
python
def template_clone(call=None, kwargs=None): ''' Clones an existing virtual machine template. .. versionadded:: 2016.3.0 name The name of the new template. template_id The ID of the template to be cloned. Can be used instead of ``template_name``. template_name The name...
Clones an existing virtual machine template. .. versionadded:: 2016.3.0 name The name of the new template. template_id The ID of the template to be cloned. Can be used instead of ``template_name``. template_name The name of the template to be cloned. Can be used instead of ``...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2356-L2426
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
template_delete
python
def template_delete(call=None, kwargs=None): ''' Deletes the given template from OpenNebula. Either a name or a template_id must be supplied. .. versionadded:: 2016.3.0 name The name of the template to delete. Can be used instead of ``template_id``. template_id The ID of the t...
Deletes the given template from OpenNebula. Either a name or a template_id must be supplied. .. versionadded:: 2016.3.0 name The name of the template to delete. Can be used instead of ``template_id``. template_id The ID of the template to delete. Can be used instead of ``name``. ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2429-L2485
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
template_instantiate
python
def template_instantiate(call=None, kwargs=None): ''' Instantiates a new virtual machine from a template. .. versionadded:: 2016.3.0 .. note:: ``template_instantiate`` creates a VM on OpenNebula from a template, but it does not install Salt on the new VM. Use the ``create`` function fo...
Instantiates a new virtual machine from a template. .. versionadded:: 2016.3.0 .. note:: ``template_instantiate`` creates a VM on OpenNebula from a template, but it does not install Salt on the new VM. Use the ``create`` function for that functionality: ``salt-cloud -p opennebula-profi...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2488-L2560
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
template_update
python
def template_update(call=None, kwargs=None): ''' Replaces the template contents. .. versionadded:: 2016.3.0 template_id The ID of the template to update. Can be used instead of ``template_name``. template_name The name of the template to update. Can be used instead of ``template_i...
Replaces the template contents. .. versionadded:: 2016.3.0 template_id The ID of the template to update. Can be used instead of ``template_name``. template_name The name of the template to update. Can be used instead of ``template_id``. path The path to a file containing the ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2563-L2672
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vm_action
python
def vm_action(name, kwargs=None, call=None): ''' Submits an action to be performed on a given virtual machine. .. versionadded:: 2016.3.0 name The name of the VM to action. action The action to be performed on the VM. Available options include: - boot - delete ...
Submits an action to be performed on a given virtual machine. .. versionadded:: 2016.3.0 name The name of the VM to action. action The action to be performed on the VM. Available options include: - boot - delete - delete-recreate - hold - ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2675-L2737
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vm_allocate
python
def vm_allocate(call=None, kwargs=None): ''' Allocates a new virtual machine in OpenNebula. .. versionadded:: 2016.3.0 path The path to a file defining the template of the VM to allocate. Syntax within the file can be the usual attribute=value or XML. Can be used instead of ``d...
Allocates a new virtual machine in OpenNebula. .. versionadded:: 2016.3.0 path The path to a file defining the template of the VM to allocate. Syntax within the file can be the usual attribute=value or XML. Can be used instead of ``data``. data Contains the template defini...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2740-L2805
[ "def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \"true\"\n 3. Any object for which bool(obj) returns Tr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vm_attach
python
def vm_attach(name, kwargs=None, call=None): ''' Attaches a new disk to the given virtual machine. .. versionadded:: 2016.3.0 name The name of the VM for which to attach the new disk. path The path to a file containing a single disk vector attribute. Syntax within the file...
Attaches a new disk to the given virtual machine. .. versionadded:: 2016.3.0 name The name of the VM for which to attach the new disk. path The path to a file containing a single disk vector attribute. Syntax within the file can be the usual attribute=value or XML. Can be ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2808-L2872
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vm_deploy
python
def vm_deploy(name, kwargs=None, call=None): ''' Initiates the instance of the given VM on the target host. .. versionadded:: 2016.3.0 name The name of the VM to deploy. host_id The ID of the target host where the VM will be deployed. Can be used instead of ``host_name``. ...
Initiates the instance of the given VM on the target host. .. versionadded:: 2016.3.0 name The name of the VM to deploy. host_id The ID of the target host where the VM will be deployed. Can be used instead of ``host_name``. host_name The name of the target host where ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2942-L3038
[ "def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \"true\"\n 3. Any object for which bool(obj) returns Tr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vm_detach
python
def vm_detach(name, kwargs=None, call=None): ''' Detaches a disk from a virtual machine. .. versionadded:: 2016.3.0 name The name of the VM from which to detach the disk. disk_id The ID of the disk to detach. CLI Example: .. code-block:: bash salt-cloud -a vm_de...
Detaches a disk from a virtual machine. .. versionadded:: 2016.3.0 name The name of the VM from which to detach the disk. disk_id The ID of the disk to detach. CLI Example: .. code-block:: bash salt-cloud -a vm_detach my-vm disk_id=1
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3041-L3085
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vm_detach_nic
python
def vm_detach_nic(name, kwargs=None, call=None): ''' Detaches a disk from a virtual machine. .. versionadded:: 2016.3.0 name The name of the VM from which to detach the network interface. nic_id The ID of the nic to detach. CLI Example: .. code-block:: bash salt...
Detaches a disk from a virtual machine. .. versionadded:: 2016.3.0 name The name of the VM from which to detach the network interface. nic_id The ID of the nic to detach. CLI Example: .. code-block:: bash salt-cloud -a vm_detach_nic my-vm nic_id=1
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3088-L3132
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vm_disk_save
python
def vm_disk_save(name, kwargs=None, call=None): ''' Sets the disk to be saved in the given image. .. versionadded:: 2016.3.0 name The name of the VM containing the disk to save. disk_id The ID of the disk to save. image_name The name of the new image where the disk wi...
Sets the disk to be saved in the given image. .. versionadded:: 2016.3.0 name The name of the VM containing the disk to save. disk_id The ID of the disk to save. image_name The name of the new image where the disk will be saved. image_type The type for the new im...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3135-L3202
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vm_disk_snapshot_create
python
def vm_disk_snapshot_create(name, kwargs=None, call=None): ''' Takes a new snapshot of the disk image. .. versionadded:: 2016.3.0 name The name of the VM of which to take the snapshot. disk_id The ID of the disk to save. description The description for the snapshot. ...
Takes a new snapshot of the disk image. .. versionadded:: 2016.3.0 name The name of the VM of which to take the snapshot. disk_id The ID of the disk to save. description The description for the snapshot. CLI Example: .. code-block:: bash salt-cloud -a vm_di...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3205-L3258
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vm_disk_snapshot_delete
python
def vm_disk_snapshot_delete(name, kwargs=None, call=None): ''' Deletes a disk snapshot based on the given VM and the disk_id. .. versionadded:: 2016.3.0 name The name of the VM containing the snapshot to delete. disk_id The ID of the disk to save. snapshot_id The ID o...
Deletes a disk snapshot based on the given VM and the disk_id. .. versionadded:: 2016.3.0 name The name of the VM containing the snapshot to delete. disk_id The ID of the disk to save. snapshot_id The ID of the snapshot to be deleted. CLI Example: .. code-block:: ba...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3261-L3314
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vm_info
python
def vm_info(name, call=None): ''' Retrieves information for a given virtual machine. A VM name must be supplied. .. versionadded:: 2016.3.0 name The name of the VM for which to gather information. CLI Example: .. code-block:: bash salt-cloud -a vm_info my-vm ''' if c...
Retrieves information for a given virtual machine. A VM name must be supplied. .. versionadded:: 2016.3.0 name The name of the VM for which to gather information. CLI Example: .. code-block:: bash salt-cloud -a vm_info my-vm
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3373-L3404
[ "def _xml_to_dict(xml):\n '''\n Helper function to covert xml into a data dictionary.\n\n xml\n The xml data to convert.\n '''\n dicts = {}\n for item in xml:\n key = item.tag.lower()\n idx = 1\n while key in dicts:\n key += six.text_type(idx)\n id...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vm_monitoring
python
def vm_monitoring(name, call=None): ''' Returns the monitoring records for a given virtual machine. A VM name must be supplied. The monitoring information returned is a list of VM elements. Each VM element contains the complete dictionary of the VM with the updated information returned by the p...
Returns the monitoring records for a given virtual machine. A VM name must be supplied. The monitoring information returned is a list of VM elements. Each VM element contains the complete dictionary of the VM with the updated information returned by the poll action. .. versionadded:: 2016.3.0 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3511-L3551
[ "def _xml_to_dict(xml):\n '''\n Helper function to covert xml into a data dictionary.\n\n xml\n The xml data to convert.\n '''\n dicts = {}\n for item in xml:\n key = item.tag.lower()\n idx = 1\n while key in dicts:\n key += six.text_type(idx)\n id...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vm_snapshot_create
python
def vm_snapshot_create(vm_name, kwargs=None, call=None): ''' Creates a new virtual machine snapshot from the provided VM. .. versionadded:: 2016.3.0 vm_name The name of the VM from which to create the snapshot. snapshot_name The name of the snapshot to be created. CLI Example...
Creates a new virtual machine snapshot from the provided VM. .. versionadded:: 2016.3.0 vm_name The name of the VM from which to create the snapshot. snapshot_name The name of the snapshot to be created. CLI Example: .. code-block:: bash salt-cloud -a vm_snapshot_create...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3629-L3673
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vm_snapshot_delete
python
def vm_snapshot_delete(vm_name, kwargs=None, call=None): ''' Deletes a virtual machine snapshot from the provided VM. .. versionadded:: 2016.3.0 vm_name The name of the VM from which to delete the snapshot. snapshot_id The ID of the snapshot to be deleted. CLI Example: ....
Deletes a virtual machine snapshot from the provided VM. .. versionadded:: 2016.3.0 vm_name The name of the VM from which to delete the snapshot. snapshot_id The ID of the snapshot to be deleted. CLI Example: .. code-block:: bash salt-cloud -a vm_snapshot_delete my-vm s...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3676-L3720
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vm_update
python
def vm_update(name, kwargs=None, call=None): ''' Replaces the user template contents. .. versionadded:: 2016.3.0 name The name of the VM to update. path The path to a file containing new user template contents. Syntax within the file can be the usual attribute=value or XML...
Replaces the user template contents. .. versionadded:: 2016.3.0 name The name of the VM to update. path The path to a file containing new user template contents. Syntax within the file can be the usual attribute=value or XML. Can be used instead of ``data``. data Cont...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3770-L3854
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vn_allocate
python
def vn_allocate(call=None, kwargs=None): ''' Allocates a new virtual network in OpenNebula. .. versionadded:: 2016.3.0 path The path to a file containing the template of the virtual network to allocate. Syntax within the file can be the usual attribute=value or XML. Can be used ...
Allocates a new virtual network in OpenNebula. .. versionadded:: 2016.3.0 path The path to a file containing the template of the virtual network to allocate. Syntax within the file can be the usual attribute=value or XML. Can be used instead of ``data``. data Contains the ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3944-L4025
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vn_delete
python
def vn_delete(call=None, kwargs=None): ''' Deletes the given virtual network from OpenNebula. Either a name or a vn_id must be supplied. .. versionadded:: 2016.3.0 name The name of the virtual network to delete. Can be used instead of ``vn_id``. vn_id The ID of the virtual net...
Deletes the given virtual network from OpenNebula. Either a name or a vn_id must be supplied. .. versionadded:: 2016.3.0 name The name of the virtual network to delete. Can be used instead of ``vn_id``. vn_id The ID of the virtual network to delete. Can be used instead of ``name``. ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4028-L4084
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vn_free_ar
python
def vn_free_ar(call=None, kwargs=None): ''' Frees a reserved address range from a virtual network. .. versionadded:: 2016.3.0 vn_id The ID of the virtual network from which to free an address range. Can be used instead of ``vn_name``. vn_name The name of the virtual networ...
Frees a reserved address range from a virtual network. .. versionadded:: 2016.3.0 vn_id The ID of the virtual network from which to free an address range. Can be used instead of ``vn_name``. vn_name The name of the virtual network from which to free an address range. Can b...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4087-L4153
[ "def _get_xml_rpc():\n '''\n Uses the OpenNebula cloud provider configurations to connect to the\n OpenNebula API.\n\n Returns the server connection created as well as the user and password\n values from the cloud provider config file used to make the connection.\n '''\n vm_ = get_configured_pr...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vn_info
python
def vn_info(call=None, kwargs=None): ''' Retrieves information for the virtual network. .. versionadded:: 2016.3.0 name The name of the virtual network for which to gather information. Can be used instead of ``vn_id``. vn_id The ID of the virtual network for which to gathe...
Retrieves information for the virtual network. .. versionadded:: 2016.3.0 name The name of the virtual network for which to gather information. Can be used instead of ``vn_id``. vn_id The ID of the virtual network for which to gather information. Can be used instead of ``n...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4242-L4298
[ "def _xml_to_dict(xml):\n '''\n Helper function to covert xml into a data dictionary.\n\n xml\n The xml data to convert.\n '''\n dicts = {}\n for item in xml:\n key = item.tag.lower()\n idx = 1\n while key in dicts:\n key += six.text_type(idx)\n id...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
vn_release
python
def vn_release(call=None, kwargs=None): ''' Releases a virtual network lease that was previously on hold. .. versionadded:: 2016.3.0 vn_id The ID of the virtual network from which to release the lease. Can be used instead of ``vn_name``. vn_name The name of the virtual net...
Releases a virtual network lease that was previously on hold. .. versionadded:: 2016.3.0 vn_id The ID of the virtual network from which to release the lease. Can be used instead of ``vn_name``. vn_name The name of the virtual network from which to release the lease. Can be...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4301-L4384
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
_get_xml
python
def _get_xml(xml_str): ''' Intrepret the data coming from opennebula and raise if it's not XML. ''' try: xml_data = etree.XML(xml_str) # XMLSyntaxError seems to be only available from lxml, but that is the xml # library loaded by this module except etree.XMLSyntaxError as err: ...
Intrepret the data coming from opennebula and raise if it's not XML.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4500-L4512
null
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
_get_xml_rpc
python
def _get_xml_rpc(): ''' Uses the OpenNebula cloud provider configurations to connect to the OpenNebula API. Returns the server connection created as well as the user and password values from the cloud provider config file used to make the connection. ''' vm_ = get_configured_provider() ...
Uses the OpenNebula cloud provider configurations to connect to the OpenNebula API. Returns the server connection created as well as the user and password values from the cloud provider config file used to make the connection.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4515-L4539
[ "def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
_list_nodes
python
def _list_nodes(full=False): ''' Helper function for the list_* query functions - Constructs the appropriate dictionaries to return from the API query. full If performing a full query, such as in list_nodes_full, change this parameter to ``True``. ''' server, user, password = _g...
Helper function for the list_* query functions - Constructs the appropriate dictionaries to return from the API query. full If performing a full query, such as in list_nodes_full, change this parameter to ``True``.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4542-L4583
[ "def _xml_to_dict(xml):\n '''\n Helper function to covert xml into a data dictionary.\n\n xml\n The xml data to convert.\n '''\n dicts = {}\n for item in xml:\n key = item.tag.lower()\n idx = 1\n while key in dicts:\n key += six.text_type(idx)\n id...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/cloud/clouds/opennebula.py
_xml_to_dict
python
def _xml_to_dict(xml): ''' Helper function to covert xml into a data dictionary. xml The xml data to convert. ''' dicts = {} for item in xml: key = item.tag.lower() idx = 1 while key in dicts: key += six.text_type(idx) idx += 1 if ...
Helper function to covert xml into a data dictionary. xml The xml data to convert.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4586-L4605
[ "def _xml_to_dict(xml):\n '''\n Helper function to covert xml into a data dictionary.\n\n xml\n The xml data to convert.\n '''\n dicts = {}\n for item in xml:\n key = item.tag.lower()\n idx = 1\n while key in dicts:\n key += six.text_type(idx)\n id...
# -*- coding: utf-8 -*- ''' OpenNebula Cloud Module ======================= The OpenNebula cloud module is used to control access to an OpenNebula cloud. .. versionadded:: 2014.7.0 :depends: lxml :depends: OpenNebula installation running version ``4.14`` or later. Use of this module requires the ``xml_rpc``, ``user...
saltstack/salt
salt/modules/config.py
option
python
def option( value, default='', omit_opts=False, omit_master=False, omit_pillar=False): ''' Pass in a generic option and receive the value that will be assigned CLI Example: .. code-block:: bash salt '*' config.option redis.host ''' if not omit_o...
Pass in a generic option and receive the value that will be assigned CLI Example: .. code-block:: bash salt '*' config.option redis.host
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/config.py#L131-L157
null
# -*- coding: utf-8 -*- ''' Return config information ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import copy import re import os import logging # Import salt libs import salt.config import salt.utils.data import salt.utils.dictupdate import salt.utils.files impor...
saltstack/salt
salt/modules/config.py
get
python
def get(key, default='', delimiter=':', merge=None, omit_opts=False, omit_pillar=False, omit_master=False, omit_grains=False): ''' .. versionadded: 0.14.0 Attempt to retrieve the named value from the minion config file, pillar, grains or the master config. If the named value is not available, r...
.. versionadded: 0.14.0 Attempt to retrieve the named value from the minion config file, pillar, grains or the master config. If the named value is not available, return the value specified by ``default``. If not specified, the default is an empty string. Values can also be retrieved from nested d...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/config.py#L216-L422
[ "def merge(obj_a, obj_b, strategy='smart', renderer='yaml', merge_lists=False):\n if strategy == 'smart':\n if renderer.split('|')[-1] == 'yamlex' or renderer.startswith('yamlex_'):\n strategy = 'aggregate'\n else:\n strategy = 'recurse'\n\n if strategy == 'list':\n ...
# -*- coding: utf-8 -*- ''' Return config information ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import copy import re import os import logging # Import salt libs import salt.config import salt.utils.data import salt.utils.dictupdate import salt.utils.files impor...
saltstack/salt
salt/modules/config.py
dot_vals
python
def dot_vals(value): ''' Pass in a configuration value that should be preceded by the module name and a dot, this will return a list of all read key/value pairs CLI Example: .. code-block:: bash salt '*' config.dot_vals host ''' ret = {} for key, val in six.iteritems(__pillar_...
Pass in a configuration value that should be preceded by the module name and a dot, this will return a list of all read key/value pairs CLI Example: .. code-block:: bash salt '*' config.dot_vals host
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/config.py#L425-L443
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n" ]
# -*- coding: utf-8 -*- ''' Return config information ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import copy import re import os import logging # Import salt libs import salt.config import salt.utils.data import salt.utils.dictupdate import salt.utils.files impor...
saltstack/salt
salt/modules/config.py
gather_bootstrap_script
python
def gather_bootstrap_script(bootstrap=None): ''' Download the salt-bootstrap script, and return its location bootstrap URL of alternate bootstrap script CLI Example: .. code-block:: bash salt '*' config.gather_bootstrap_script ''' if not HAS_CLOUD: return False, '...
Download the salt-bootstrap script, and return its location bootstrap URL of alternate bootstrap script CLI Example: .. code-block:: bash salt '*' config.gather_bootstrap_script
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/config.py#L446-L463
[ "def update_bootstrap(config, url=None):\n '''\n Update the salt-bootstrap script\n\n url can be one of:\n\n - The URL to fetch the bootstrap script from\n - The absolute path to the bootstrap\n - The content of the bootstrap script\n '''\n default_url = config.get('bootstrap_scr...
# -*- coding: utf-8 -*- ''' Return config information ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import copy import re import os import logging # Import salt libs import salt.config import salt.utils.data import salt.utils.dictupdate import salt.utils.files impor...
saltstack/salt
salt/states/panos.py
_build_members
python
def _build_members(members, anycheck=False): ''' Builds a member formatted string for XML operation. ''' if isinstance(members, list): # This check will strip down members to a single any statement if anycheck and 'any' in members: return "<member>any</member>" resp...
Builds a member formatted string for XML operation.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L101-L116
null
# -*- coding: utf-8 -*- ''' A state module to manage Palo Alto network devices. :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix About ===== This state module was designed to handle connections to a Palo Alto based firewall. This module relies on the Pal...
saltstack/salt
salt/states/panos.py
_edit_config
python
def _edit_config(xpath, element): ''' Sends an edit request to the device. ''' query = {'type': 'config', 'action': 'edit', 'xpath': xpath, 'element': element} response = __proxy__['panos.call'](query) return _validate_response(response)
Sends an edit request to the device.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L134-L146
[ "def _validate_response(response):\n '''\n Validates a response from a Palo Alto device. Used to verify success of commands.\n\n '''\n if not response:\n return False, 'Unable to validate response from device.'\n elif 'msg' in response:\n if 'line' in response['msg']:\n if re...
# -*- coding: utf-8 -*- ''' A state module to manage Palo Alto network devices. :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix About ===== This state module was designed to handle connections to a Palo Alto based firewall. This module relies on the Pal...
saltstack/salt
salt/states/panos.py
_move_after
python
def _move_after(xpath, target): ''' Moves an xpath to the after of its section. ''' query = {'type': 'config', 'action': 'move', 'xpath': xpath, 'where': 'after', 'dst': target} response = __proxy__['panos.call'](query) return _validate_resp...
Moves an xpath to the after of its section.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L163-L176
[ "def _validate_response(response):\n '''\n Validates a response from a Palo Alto device. Used to verify success of commands.\n\n '''\n if not response:\n return False, 'Unable to validate response from device.'\n elif 'msg' in response:\n if 'line' in response['msg']:\n if re...
# -*- coding: utf-8 -*- ''' A state module to manage Palo Alto network devices. :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix About ===== This state module was designed to handle connections to a Palo Alto based firewall. This module relies on the Pal...
saltstack/salt
salt/states/panos.py
_move_before
python
def _move_before(xpath, target): ''' Moves an xpath to the bottom of its section. ''' query = {'type': 'config', 'action': 'move', 'xpath': xpath, 'where': 'before', 'dst': target} response = __proxy__['panos.call'](query) return _validate_r...
Moves an xpath to the bottom of its section.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L179-L192
[ "def _validate_response(response):\n '''\n Validates a response from a Palo Alto device. Used to verify success of commands.\n\n '''\n if not response:\n return False, 'Unable to validate response from device.'\n elif 'msg' in response:\n if 'line' in response['msg']:\n if re...
# -*- coding: utf-8 -*- ''' A state module to manage Palo Alto network devices. :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix About ===== This state module was designed to handle connections to a Palo Alto based firewall. This module relies on the Pal...
saltstack/salt
salt/states/panos.py
_set_config
python
def _set_config(xpath, element): ''' Sends a set request to the device. ''' query = {'type': 'config', 'action': 'set', 'xpath': xpath, 'element': element} response = __proxy__['panos.call'](query) return _validate_response(response)
Sends a set request to the device.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L225-L237
[ "def _validate_response(response):\n '''\n Validates a response from a Palo Alto device. Used to verify success of commands.\n\n '''\n if not response:\n return False, 'Unable to validate response from device.'\n elif 'msg' in response:\n if 'line' in response['msg']:\n if re...
# -*- coding: utf-8 -*- ''' A state module to manage Palo Alto network devices. :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix About ===== This state module was designed to handle connections to a Palo Alto based firewall. This module relies on the Pal...
saltstack/salt
salt/states/panos.py
_validate_response
python
def _validate_response(response): ''' Validates a response from a Palo Alto device. Used to verify success of commands. ''' if not response: return False, 'Unable to validate response from device.' elif 'msg' in response: if 'line' in response['msg']: if response['msg'][...
Validates a response from a Palo Alto device. Used to verify success of commands.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L240-L265
null
# -*- coding: utf-8 -*- ''' A state module to manage Palo Alto network devices. :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix About ===== This state module was designed to handle connections to a Palo Alto based firewall. This module relies on the Pal...
saltstack/salt
salt/states/panos.py
add_config_lock
python
def add_config_lock(name): ''' Prevent other users from changing configuration until the lock is released. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/takelock: panos.add_config_lock ''' ret = _default_ret(name) ret....
Prevent other users from changing configuration until the lock is released. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/takelock: panos.add_config_lock
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L268-L289
[ "def _default_ret(name):\n '''\n Set the default response values.\n\n '''\n ret = {\n 'name': name,\n 'changes': {},\n 'commit': None,\n 'result': False,\n 'comment': ''\n }\n return ret\n" ]
# -*- coding: utf-8 -*- ''' A state module to manage Palo Alto network devices. :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix About ===== This state module was designed to handle connections to a Palo Alto based firewall. This module relies on the Pal...
saltstack/salt
salt/states/panos.py
address_exists
python
def address_exists(name, addressname=None, vsys=1, ipnetmask=None, iprange=None, fqdn=None, description=None, commit=False): ''' Ensures that an address object exists in the confi...
Ensures that an address object exists in the configured state. If it does not exist or is not configured with the specified attributes, it will be adjusted to match the specified values. This module will only process a single address type (ip-netmask, ip-range, or fqdn). It will process the specified value...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L292-L424
[ "def to_dict(xmltree, attr=False):\n '''\n Convert an XML tree into a dict. The tree that is passed in must be an\n ElementTree object.\n Args:\n xmltree: An ElementTree object.\n attr: If true, attributes will be parsed. If false, they will be ignored.\n\n '''\n if attr:\n re...
# -*- coding: utf-8 -*- ''' A state module to manage Palo Alto network devices. :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix About ===== This state module was designed to handle connections to a Palo Alto based firewall. This module relies on the Pal...
saltstack/salt
salt/states/panos.py
commit_config
python
def commit_config(name): ''' Commits the candidate configuration to the running configuration. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/commit: panos.commit_config ''' ret = _default_ret(name) ret.update({ ...
Commits the candidate configuration to the running configuration. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/commit: panos.commit_config
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L589-L610
[ "def _default_ret(name):\n '''\n Set the default response values.\n\n '''\n ret = {\n 'name': name,\n 'changes': {},\n 'commit': None,\n 'result': False,\n 'comment': ''\n }\n return ret\n" ]
# -*- coding: utf-8 -*- ''' A state module to manage Palo Alto network devices. :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix About ===== This state module was designed to handle connections to a Palo Alto based firewall. This module relies on the Pal...
saltstack/salt
salt/states/panos.py
delete_config
python
def delete_config(name, xpath=None, commit=False): ''' Deletes a Palo Alto XPATH to a specific value. Use the xpath parameter to specify the location of the object to be deleted. name: The name of the module function to execute. xpath(str): The XPATH of the configuration API tree to control. ...
Deletes a Palo Alto XPATH to a specific value. Use the xpath parameter to specify the location of the object to be deleted. name: The name of the module function to execute. xpath(str): The XPATH of the configuration API tree to control. commit(bool): If true the firewall will commit the changes, if...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L613-L660
[ "def _default_ret(name):\n '''\n Set the default response values.\n\n '''\n ret = {\n 'name': name,\n 'changes': {},\n 'commit': None,\n 'result': False,\n 'comment': ''\n }\n return ret\n", "def _validate_response(response):\n '''\n Validates a response ...
# -*- coding: utf-8 -*- ''' A state module to manage Palo Alto network devices. :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix About ===== This state module was designed to handle connections to a Palo Alto based firewall. This module relies on the Pal...
saltstack/salt
salt/states/panos.py
download_software
python
def download_software(name, version=None, synch=False, check=False): ''' Ensures that a software version is downloaded. name: The name of the module function to execute. version(str): The software version to check. If this version is not already downloaded, it will attempt to download the file fro...
Ensures that a software version is downloaded. name: The name of the module function to execute. version(str): The software version to check. If this version is not already downloaded, it will attempt to download the file from Palo Alto. synch(bool): If true, after downloading the file it will be syn...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L663-L733
[ "def _default_ret(name):\n '''\n Set the default response values.\n\n '''\n ret = {\n 'name': name,\n 'changes': {},\n 'commit': None,\n 'result': False,\n 'comment': ''\n }\n return ret\n" ]
# -*- coding: utf-8 -*- ''' A state module to manage Palo Alto network devices. :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix About ===== This state module was designed to handle connections to a Palo Alto based firewall. This module relies on the Pal...
saltstack/salt
salt/states/panos.py
edit_config
python
def edit_config(name, xpath=None, value=None, commit=False): ''' Edits a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not changed. You can replace an existing object hierarchy at a specified location in the configuration with a new value. Use the...
Edits a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not changed. You can replace an existing object hierarchy at a specified location in the configuration with a new value. Use the xpath parameter to specify the location of the object, including the nod...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L736-L815
[ "def to_dict(xmltree, attr=False):\n '''\n Convert an XML tree into a dict. The tree that is passed in must be an\n ElementTree object.\n Args:\n xmltree: An ElementTree object.\n attr: If true, attributes will be parsed. If false, they will be ignored.\n\n '''\n if attr:\n re...
# -*- coding: utf-8 -*- ''' A state module to manage Palo Alto network devices. :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix About ===== This state module was designed to handle connections to a Palo Alto based firewall. This module relies on the Pal...
saltstack/salt
salt/states/panos.py
move_config
python
def move_config(name, xpath=None, where=None, dst=None, commit=False): ''' Moves a XPATH value to a new location. Use the xpath parameter to specify the location of the object to be moved, the where parameter to specify type of move, and dst parameter to specify the destination path. name: The nam...
Moves a XPATH value to a new location. Use the xpath parameter to specify the location of the object to be moved, the where parameter to specify type of move, and dst parameter to specify the destination path. name: The name of the module function to execute. xpath(str): The XPATH of the configuratio...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L818-L888
[ "def _default_ret(name):\n '''\n Set the default response values.\n\n '''\n ret = {\n 'name': name,\n 'changes': {},\n 'commit': None,\n 'result': False,\n 'comment': ''\n }\n return ret\n", "def _move_after(xpath, target):\n '''\n Moves an xpath to the a...
# -*- coding: utf-8 -*- ''' A state module to manage Palo Alto network devices. :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix About ===== This state module was designed to handle connections to a Palo Alto based firewall. This module relies on the Pal...