partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
get_host_id
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
salt/cloud/clouds/opennebula.py
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( '...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L604-L637
[ "def", "get_host_id", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The get_host_id function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_image
r''' Return the image object to use. vm\_ The VM dictionary for which to obtain an image.
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L640-L656
[ "def", "get_image", "(", "vm_", ")", ":", "images", "=", "avail_images", "(", ")", "vm_image", "=", "six", ".", "text_type", "(", "config", ".", "get_cloud_config_value", "(", "'image'", ",", "vm_", ",", "__opts__", ",", "search_global", "=", "False", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_image_id
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
salt/cloud/clouds/opennebula.py
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( ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L659-L692
[ "def", "get_image_id", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The get_image_id function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_secgroup_id
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
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L721-L754
[ "def", "get_secgroup_id", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The get_secgroup_id function must be called with -f or --function.'", ")", "if", "kwargs", "is", "No...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_template_image
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
salt/cloud/clouds/opennebula.py
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( ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L757-L788
[ "def", "get_template_image", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The get_template_image function must be called with -f or --function.'", ")", "if", "kwargs", "is",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_template
r''' Return the template id for a VM. .. versionadded:: 2016.11.0 vm\_ The VM dictionary for which to obtain a template.
salt/cloud/clouds/opennebula.py
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: ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L827-L845
[ "def", "get_template", "(", "vm_", ")", ":", "vm_template", "=", "six", ".", "text_type", "(", "config", ".", "get_cloud_config_value", "(", "'template'", ",", "vm_", ",", "__opts__", ",", "search_global", "=", "False", ")", ")", "try", ":", "return", "lis...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_vm_id
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
salt/cloud/clouds/opennebula.py
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( ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L848-L881
[ "def", "get_vm_id", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The get_vm_id function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_vn_id
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
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L884-L917
[ "def", "get_vn_id", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The get_vn_id function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_device_template
Returns the template format to create a disk in open nebula .. versionadded:: 2018.3.0
salt/cloud/clouds/opennebula.py
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( ...
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" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L920-L963
[ "def", "_get_device_template", "(", "disk", ",", "disk_info", ",", "template", "=", "None", ")", ":", "def", "_require_disk_opts", "(", "*", "args", ")", ":", "for", "arg", "in", "args", ":", "if", "arg", "not", "in", "disk_info", ":", "raise", "SaltClou...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
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 ...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L967-L1178
[ "def", "create", "(", "vm_", ")", ":", "try", ":", "# Check for required profile parameters before sending any API calls.", "if", "vm_", "[", "'profile'", "]", "and", "config", ".", "is_profile_configured", "(", "__opts__", ",", "__active_provider_name__", "or", "'openn...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
destroy
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
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L1181-L1240
[ "def", "destroy", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The destroy action must be called with -d, --destroy, '", "'-a or --action.'", ")", "__utils__", "[", "'cloud.fire_event'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
image_allocate
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 ...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L1243-L1328
[ "def", "image_allocate", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The image_allocate function must be called with -f or --function.'", ")", "if", "kwargs", "is", "No...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
image_clone
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: .....
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L1331-L1396
[ "def", "image_clone", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The image_clone function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
image_info
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...
salt/cloud/clouds/opennebula.py
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 ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L1458-L1513
[ "def", "image_info", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The image_info function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
image_persistent
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...
salt/cloud/clouds/opennebula.py
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 ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L1516-L1582
[ "def", "image_persistent", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The image_persistent function must be called with -f or --function.'", ")", "if", "kwargs", "is", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
image_snapshot_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``. ...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L1585-L1651
[ "def", "image_snapshot_delete", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The image_snapshot_delete function must be called with -f or --function.'", ")", "if", "kwargs",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
image_update
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 ...
salt/cloud/clouds/opennebula.py
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 ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L1789-L1894
[ "def", "image_update", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The image_allocate function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
secgroup_delete
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 ...
salt/cloud/clouds/opennebula.py
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 ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2060-L2117
[ "def", "secgroup_delete", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The secgroup_delete function must be called with -f or --function.'", ")", "if", "kwargs", "is", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
secgroup_info
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...
salt/cloud/clouds/opennebula.py
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``...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2120-L2175
[ "def", "secgroup_info", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The secgroup_info function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
secgroup_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...
salt/cloud/clouds/opennebula.py
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. ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2178-L2287
[ "def", "secgroup_update", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The secgroup_allocate function must be called with -f or --function.'", ")", "if", "kwargs", "is", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
template_allocate
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...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2290-L2353
[ "def", "template_allocate", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The template_allocate function must be called with -f or --function.'", ")", "if", "kwargs", "is",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
template_clone
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 ``...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2356-L2426
[ "def", "template_clone", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The template_clone function must be called with -f or --function.'", ")", "if", "kwargs", "is", "No...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
template_delete
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``. ...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2429-L2485
[ "def", "template_delete", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The template_delete function must be called with -f or --function.'", ")", "if", "kwargs", "is", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
template_instantiate
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...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2488-L2560
[ "def", "template_instantiate", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The template_instantiate function must be called with -f or --function.'", ")", "if", "kwargs", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
template_update
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 ...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2563-L2672
[ "def", "template_update", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The template_update function must be called with -f or --function.'", ")", "if", "kwargs", "is", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vm_action
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 - ...
salt/cloud/clouds/opennebula.py
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 ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2675-L2737
[ "def", "vm_action", "(", "name", ",", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The vm_action function must be called with -a or --action.'", ")", "if", "kwargs", "is", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vm_allocate
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...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2740-L2805
[ "def", "vm_allocate", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The vm_allocate function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vm_attach
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 ...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2808-L2872
[ "def", "vm_attach", "(", "name", ",", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The vm_attach action must be called with -a or --action.'", ")", "if", "kwargs", "is", "N...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vm_deploy
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 ...
salt/cloud/clouds/opennebula.py
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``. ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L2942-L3038
[ "def", "vm_deploy", "(", "name", ",", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The vm_deploy action must be called with -a or --action.'", ")", "if", "kwargs", "is", "N...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vm_detach
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
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3041-L3085
[ "def", "vm_detach", "(", "name", ",", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The vm_detach action must be called with -a or --action.'", ")", "if", "kwargs", "is", "N...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vm_detach_nic
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
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3088-L3132
[ "def", "vm_detach_nic", "(", "name", ",", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The vm_detach_nic action must be called with -a or --action.'", ")", "if", "kwargs", "i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vm_disk_save
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...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3135-L3202
[ "def", "vm_disk_save", "(", "name", ",", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The vm_disk_save action must be called with -a or --action.'", ")", "if", "kwargs", "is"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vm_disk_snapshot_create
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...
salt/cloud/clouds/opennebula.py
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. ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3205-L3258
[ "def", "vm_disk_snapshot_create", "(", "name", ",", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The vm_disk_snapshot_create action must be called with -a or --action.'", ")", "i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vm_disk_snapshot_delete
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...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3261-L3314
[ "def", "vm_disk_snapshot_delete", "(", "name", ",", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The vm_disk_snapshot_delete action must be called with -a or --action.'", ")", "i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vm_info
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
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3373-L3404
[ "def", "vm_info", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The vm_info action must be called with -a or --action.'", ")", "server", ",", "user", ",", "password", "=", "_get_xml_rpc...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vm_monitoring
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 ...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3511-L3551
[ "def", "vm_monitoring", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The vm_monitoring action must be called with -a or --action.'", ")", "server", ",", "user", ",", "password", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vm_snapshot_create
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...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3629-L3673
[ "def", "vm_snapshot_create", "(", "vm_name", ",", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The vm_snapshot_create action must be called with -a or --action.'", ")", "if", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vm_snapshot_delete
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...
salt/cloud/clouds/opennebula.py
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: ....
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3676-L3720
[ "def", "vm_snapshot_delete", "(", "vm_name", ",", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The vm_snapshot_delete action must be called with -a or --action.'", ")", "if", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vm_update
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...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3770-L3854
[ "def", "vm_update", "(", "name", ",", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The vm_update action must be called with -a or --action.'", ")", "if", "kwargs", "is", "N...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vn_allocate
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 ...
salt/cloud/clouds/opennebula.py
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 ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L3944-L4025
[ "def", "vn_allocate", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The vn_allocate function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vn_delete
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``. ...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4028-L4084
[ "def", "vn_delete", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The vn_delete function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", ":"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vn_free_ar
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...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4087-L4153
[ "def", "vn_free_ar", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The vn_free_ar function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vn_info
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...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4242-L4298
[ "def", "vn_info", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The vn_info function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vn_release
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...
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4301-L4384
[ "def", "vn_release", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The vn_reserve function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_xml
Intrepret the data coming from opennebula and raise if it's not XML.
salt/cloud/clouds/opennebula.py
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: ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4500-L4512
[ "def", "_get_xml", "(", "xml_str", ")", ":", "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", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_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.
salt/cloud/clouds/opennebula.py
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() ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4515-L4539
[ "def", "_get_xml_rpc", "(", ")", ":", "vm_", "=", "get_configured_provider", "(", ")", "xml_rpc", "=", "config", ".", "get_cloud_config_value", "(", "'xml_rpc'", ",", "vm_", ",", "__opts__", ",", "search_global", "=", "False", ")", "user", "=", "config", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_list_nodes
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``.
salt/cloud/clouds/opennebula.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4542-L4583
[ "def", "_list_nodes", "(", "full", "=", "False", ")", ":", "server", ",", "user", ",", "password", "=", "_get_xml_rpc", "(", ")", "auth", "=", "':'", ".", "join", "(", "[", "user", ",", "password", "]", ")", "vm_pool", "=", "server", ".", "one", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_xml_to_dict
Helper function to covert xml into a data dictionary. xml The xml data to convert.
salt/cloud/clouds/opennebula.py
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 ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/opennebula.py#L4586-L4605
[ "def", "_xml_to_dict", "(", "xml", ")", ":", "dicts", "=", "{", "}", "for", "item", "in", "xml", ":", "key", "=", "item", ".", "tag", ".", "lower", "(", ")", "idx", "=", "1", "while", "key", "in", "dicts", ":", "key", "+=", "six", ".", "text_ty...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
option
Pass in a generic option and receive the value that will be assigned CLI Example: .. code-block:: bash salt '*' config.option redis.host
salt/modules/config.py
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...
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" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/config.py#L131-L157
[ "def", "option", "(", "value", ",", "default", "=", "''", ",", "omit_opts", "=", "False", ",", "omit_master", "=", "False", ",", "omit_pillar", "=", "False", ")", ":", "if", "not", "omit_opts", ":", "if", "value", "in", "__opts__", ":", "return", "__op...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get
.. 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...
salt/modules/config.py
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...
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" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/config.py#L216-L422
[ "def", "get", "(", "key", ",", "default", "=", "''", ",", "delimiter", "=", "':'", ",", "merge", "=", "None", ",", "omit_opts", "=", "False", ",", "omit_pillar", "=", "False", ",", "omit_master", "=", "False", ",", "omit_grains", "=", "False", ")", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
dot_vals
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
salt/modules/config.py
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_...
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" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/config.py#L425-L443
[ "def", "dot_vals", "(", "value", ")", ":", "ret", "=", "{", "}", "for", "key", ",", "val", "in", "six", ".", "iteritems", "(", "__pillar__", ".", "get", "(", "'master'", ",", "{", "}", ")", ")", ":", "if", "key", ".", "startswith", "(", "'{0}.'",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
gather_bootstrap_script
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
salt/modules/config.py
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, '...
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" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/config.py#L446-L463
[ "def", "gather_bootstrap_script", "(", "bootstrap", "=", "None", ")", ":", "if", "not", "HAS_CLOUD", ":", "return", "False", ",", "'config.gather_bootstrap_script is unavailable'", "ret", "=", "salt", ".", "utils", ".", "cloud", ".", "update_bootstrap", "(", "__op...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_build_members
Builds a member formatted string for XML operation.
salt/states/panos.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L101-L116
[ "def", "_build_members", "(", "members", ",", "anycheck", "=", "False", ")", ":", "if", "isinstance", "(", "members", ",", "list", ")", ":", "# This check will strip down members to a single any statement", "if", "anycheck", "and", "'any'", "in", "members", ":", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_edit_config
Sends an edit request to the device.
salt/states/panos.py
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)
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L134-L146
[ "def", "_edit_config", "(", "xpath", ",", "element", ")", ":", "query", "=", "{", "'type'", ":", "'config'", ",", "'action'", ":", "'edit'", ",", "'xpath'", ":", "xpath", ",", "'element'", ":", "element", "}", "response", "=", "__proxy__", "[", "'panos.c...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_move_after
Moves an xpath to the after of its section.
salt/states/panos.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L163-L176
[ "def", "_move_after", "(", "xpath", ",", "target", ")", ":", "query", "=", "{", "'type'", ":", "'config'", ",", "'action'", ":", "'move'", ",", "'xpath'", ":", "xpath", ",", "'where'", ":", "'after'", ",", "'dst'", ":", "target", "}", "response", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_move_before
Moves an xpath to the bottom of its section.
salt/states/panos.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L179-L192
[ "def", "_move_before", "(", "xpath", ",", "target", ")", ":", "query", "=", "{", "'type'", ":", "'config'", ",", "'action'", ":", "'move'", ",", "'xpath'", ":", "xpath", ",", "'where'", ":", "'before'", ",", "'dst'", ":", "target", "}", "response", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_set_config
Sends a set request to the device.
salt/states/panos.py
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)
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L225-L237
[ "def", "_set_config", "(", "xpath", ",", "element", ")", ":", "query", "=", "{", "'type'", ":", "'config'", ",", "'action'", ":", "'set'", ",", "'xpath'", ":", "xpath", ",", "'element'", ":", "element", "}", "response", "=", "__proxy__", "[", "'panos.cal...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_validate_response
Validates a response from a Palo Alto device. Used to verify success of commands.
salt/states/panos.py
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'][...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L240-L265
[ "def", "_validate_response", "(", "response", ")", ":", "if", "not", "response", ":", "return", "False", ",", "'Unable to validate response from device.'", "elif", "'msg'", "in", "response", ":", "if", "'line'", "in", "response", "[", "'msg'", "]", ":", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add_config_lock
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
salt/states/panos.py
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....
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L268-L289
[ "def", "add_config_lock", "(", "name", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "ret", ".", "update", "(", "{", "'changes'", ":", "__salt__", "[", "'panos.add_config_lock'", "]", "(", ")", ",", "'result'", ":", "True", "}", ")", "return", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
address_exists
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...
salt/states/panos.py
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...
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", "...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L292-L424
[ "def", "address_exists", "(", "name", ",", "addressname", "=", "None", ",", "vsys", "=", "1", ",", "ipnetmask", "=", "None", ",", "iprange", "=", "None", ",", "fqdn", "=", "None", ",", "description", "=", "None", ",", "commit", "=", "False", ")", ":"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
commit_config
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
salt/states/panos.py
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({ ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L589-L610
[ "def", "commit_config", "(", "name", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "ret", ".", "update", "(", "{", "'commit'", ":", "__salt__", "[", "'panos.commit'", "]", "(", ")", ",", "'result'", ":", "True", "}", ")", "return", "ret" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_config
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...
salt/states/panos.py
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. ...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L613-L660
[ "def", "delete_config", "(", "name", ",", "xpath", "=", "None", ",", "commit", "=", "False", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "if", "not", "xpath", ":", "return", "ret", "query", "=", "{", "'type'", ":", "'config'", ",", "'acti...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
download_software
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...
salt/states/panos.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L663-L733
[ "def", "download_software", "(", "name", ",", "version", "=", "None", ",", "synch", "=", "False", ",", "check", "=", "False", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "if", "check", "is", "True", ":", "__salt__", "[", "'panos.check_softwar...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
edit_config
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...
salt/states/panos.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L736-L815
[ "def", "edit_config", "(", "name", ",", "xpath", "=", "None", ",", "value", "=", "None", ",", "commit", "=", "False", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "# Verify if the current XPATH is equal to the specified value.", "# If we are equal, no cha...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
move_config
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...
salt/states/panos.py
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...
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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L818-L888
[ "def", "move_config", "(", "name", ",", "xpath", "=", "None", ",", "where", "=", "None", ",", "dst", "=", "None", ",", "commit", "=", "False", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "if", "not", "xpath", ":", "return", "ret", "if",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
remove_config_lock
Release config lock previously held. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/takelock: panos.remove_config_lock
salt/states/panos.py
def remove_config_lock(name): ''' Release config lock previously held. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/takelock: panos.remove_config_lock ''' ret = _default_ret(name) ret.update({ 'changes': __sal...
def remove_config_lock(name): ''' Release config lock previously held. name: The name of the module function to execute. SLS Example: .. code-block:: yaml panos/takelock: panos.remove_config_lock ''' ret = _default_ret(name) ret.update({ 'changes': __sal...
[ "Release", "config", "lock", "previously", "held", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L891-L912
[ "def", "remove_config_lock", "(", "name", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "ret", ".", "update", "(", "{", "'changes'", ":", "__salt__", "[", "'panos.remove_config_lock'", "]", "(", ")", ",", "'result'", ":", "True", "}", ")", "ret...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
security_rule_exists
Ensures that a security rule exists on the device. Also, ensure that all configurations are set appropriately. This method will create the rule if it does not exist. If the rule does exist, it will ensure that the configurations are set appropriately. If the rule does not exist and is created, any value t...
salt/states/panos.py
def security_rule_exists(name, rulename=None, vsys='1', action=None, disabled=None, sourcezone=None, destinationzone=None, source=None, ...
def security_rule_exists(name, rulename=None, vsys='1', action=None, disabled=None, sourcezone=None, destinationzone=None, source=None, ...
[ "Ensures", "that", "a", "security", "rule", "exists", "on", "the", "device", ".", "Also", "ensure", "that", "all", "configurations", "are", "set", "appropriately", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L970-L1328
[ "def", "security_rule_exists", "(", "name", ",", "rulename", "=", "None", ",", "vsys", "=", "'1'", ",", "action", "=", "None", ",", "disabled", "=", "None", ",", "sourcezone", "=", "None", ",", "destinationzone", "=", "None", ",", "source", "=", "None", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
service_exists
Ensures that a service 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. name: The name of the module function to execute. servicename(str): The name of the security object. The name is case-s...
salt/states/panos.py
def service_exists(name, servicename=None, vsys=1, protocol=None, port=None, description=None, commit=False): ''' Ensures that a service 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. nam...
def service_exists(name, servicename=None, vsys=1, protocol=None, port=None, description=None, commit=False): ''' Ensures that a service 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. nam...
[ "Ensures", "that", "a", "service", "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", "t...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L1331-L1438
[ "def", "service_exists", "(", "name", ",", "servicename", "=", "None", ",", "vsys", "=", "1", ",", "protocol", "=", "None", ",", "port", "=", "None", ",", "description", "=", "None", ",", "commit", "=", "False", ")", ":", "ret", "=", "_default_ret", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
service_group_exists
Ensures that a service group 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 enforce group membership. If a group exists and contains members this state does not include, thos...
salt/states/panos.py
def service_group_exists(name, groupname=None, vsys=1, members=None, description=None, commit=False): ''' Ensures that a service group object exists in the configured state. If it does no...
def service_group_exists(name, groupname=None, vsys=1, members=None, description=None, commit=False): ''' Ensures that a service group object exists in the configured state. If it does no...
[ "Ensures", "that", "a", "service", "group", "object", "exists", "in", "the", "configured", "state", ".", "If", "it", "does", "not", "exist", "or", "is", "not", "configured", "with", "the", "specified", "attributes", "it", "will", "be", "adjusted", "to", "m...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L1441-L1544
[ "def", "service_group_exists", "(", "name", ",", "groupname", "=", "None", ",", "vsys", "=", "1", ",", "members", "=", "None", ",", "description", "=", "None", ",", "commit", "=", "False", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_config
Sets a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not changed. You can add or create a new object at a specified location in the configuration hierarchy. Use the xpath parameter to specify the location of the object in the configuration name: The ...
salt/states/panos.py
def set_config(name, xpath=None, value=None, commit=False): ''' Sets a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not changed. You can add or create a new object at a specified location in the configuration hierarchy. Use the xpath parameter to...
def set_config(name, xpath=None, value=None, commit=False): ''' Sets a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not changed. You can add or create a new object at a specified location in the configuration hierarchy. Use the xpath parameter to...
[ "Sets", "a", "Palo", "Alto", "XPATH", "to", "a", "specific", "value", ".", "This", "will", "always", "overwrite", "the", "existing", "value", "even", "if", "it", "is", "not", "changed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L1547-L1592
[ "def", "set_config", "(", "name", ",", "xpath", "=", "None", ",", "value", "=", "None", ",", "commit", "=", "False", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "result", ",", "msg", "=", "_set_config", "(", "xpath", ",", "value", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_check_cb
If the callback is None or is not callable, return a lambda that returns the value passed.
salt/modules/cmdmod.py
def _check_cb(cb_): ''' If the callback is None or is not callable, return a lambda that returns the value passed. ''' if cb_ is not None: if hasattr(cb_, '__call__'): return cb_ else: log.error('log_callback is not callable, ignoring') return lambda x: x
def _check_cb(cb_): ''' If the callback is None or is not callable, return a lambda that returns the value passed. ''' if cb_ is not None: if hasattr(cb_, '__call__'): return cb_ else: log.error('log_callback is not callable, ignoring') return lambda x: x
[ "If", "the", "callback", "is", "None", "or", "is", "not", "callable", "return", "a", "lambda", "that", "returns", "the", "value", "passed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L79-L89
[ "def", "_check_cb", "(", "cb_", ")", ":", "if", "cb_", "is", "not", "None", ":", "if", "hasattr", "(", "cb_", ",", "'__call__'", ")", ":", "return", "cb_", "else", ":", "log", ".", "error", "(", "'log_callback is not callable, ignoring'", ")", "return", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_python_shell_default
Set python_shell default based on remote execution and __opts__['cmd_safe']
salt/modules/cmdmod.py
def _python_shell_default(python_shell, __pub_jid): ''' Set python_shell default based on remote execution and __opts__['cmd_safe'] ''' try: # Default to python_shell=True when run directly from remote execution # system. Cross-module calls won't have a jid. if __pub_jid and pyth...
def _python_shell_default(python_shell, __pub_jid): ''' Set python_shell default based on remote execution and __opts__['cmd_safe'] ''' try: # Default to python_shell=True when run directly from remote execution # system. Cross-module calls won't have a jid. if __pub_jid and pyth...
[ "Set", "python_shell", "default", "based", "on", "remote", "execution", "and", "__opts__", "[", "cmd_safe", "]" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L92-L106
[ "def", "_python_shell_default", "(", "python_shell", ",", "__pub_jid", ")", ":", "try", ":", "# Default to python_shell=True when run directly from remote execution", "# system. Cross-module calls won't have a jid.", "if", "__pub_jid", "and", "python_shell", "is", "None", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_render_cmd
If template is a valid template engine, process the cmd and cwd through that engine.
salt/modules/cmdmod.py
def _render_cmd(cmd, cwd, template, saltenv='base', pillarenv=None, pillar_override=None): ''' If template is a valid template engine, process the cmd and cwd through that engine. ''' if not template: return (cmd, cwd) # render the path as a template using path_template_engine as the en...
def _render_cmd(cmd, cwd, template, saltenv='base', pillarenv=None, pillar_override=None): ''' If template is a valid template engine, process the cmd and cwd through that engine. ''' if not template: return (cmd, cwd) # render the path as a template using path_template_engine as the en...
[ "If", "template", "is", "a", "valid", "template", "engine", "process", "the", "cmd", "and", "cwd", "through", "that", "engine", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L123-L172
[ "def", "_render_cmd", "(", "cmd", ",", "cwd", ",", "template", ",", "saltenv", "=", "'base'", ",", "pillarenv", "=", "None", ",", "pillar_override", "=", "None", ")", ":", "if", "not", "template", ":", "return", "(", "cmd", ",", "cwd", ")", "# render t...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_check_loglevel
Retrieve the level code for use in logging.Logger.log().
salt/modules/cmdmod.py
def _check_loglevel(level='info'): ''' Retrieve the level code for use in logging.Logger.log(). ''' try: level = level.lower() if level == 'quiet': return None else: return LOG_LEVELS[level] except (AttributeError, KeyError): log.error( ...
def _check_loglevel(level='info'): ''' Retrieve the level code for use in logging.Logger.log(). ''' try: level = level.lower() if level == 'quiet': return None else: return LOG_LEVELS[level] except (AttributeError, KeyError): log.error( ...
[ "Retrieve", "the", "level", "code", "for", "use", "in", "logging", ".", "Logger", ".", "log", "()", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L175-L191
[ "def", "_check_loglevel", "(", "level", "=", "'info'", ")", ":", "try", ":", "level", "=", "level", ".", "lower", "(", ")", "if", "level", "==", "'quiet'", ":", "return", "None", "else", ":", "return", "LOG_LEVELS", "[", "level", "]", "except", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_gather_pillar
Whenever a state run starts, gather the pillar data fresh
salt/modules/cmdmod.py
def _gather_pillar(pillarenv, pillar_override): ''' Whenever a state run starts, gather the pillar data fresh ''' pillar = salt.pillar.get_pillar( __opts__, __grains__, __opts__['id'], __opts__['saltenv'], pillar_override=pillar_override, pillarenv=pillare...
def _gather_pillar(pillarenv, pillar_override): ''' Whenever a state run starts, gather the pillar data fresh ''' pillar = salt.pillar.get_pillar( __opts__, __grains__, __opts__['id'], __opts__['saltenv'], pillar_override=pillar_override, pillarenv=pillare...
[ "Whenever", "a", "state", "run", "starts", "gather", "the", "pillar", "data", "fresh" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L204-L219
[ "def", "_gather_pillar", "(", "pillarenv", ",", "pillar_override", ")", ":", "pillar", "=", "salt", ".", "pillar", ".", "get_pillar", "(", "__opts__", ",", "__grains__", ",", "__opts__", "[", "'id'", "]", ",", "__opts__", "[", "'saltenv'", "]", ",", "pilla...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_check_avail
Check to see if the given command can be run
salt/modules/cmdmod.py
def _check_avail(cmd): ''' Check to see if the given command can be run ''' if isinstance(cmd, list): cmd = ' '.join([six.text_type(x) if not isinstance(x, six.string_types) else x for x in cmd]) bret = True wret = False if __salt__['config.get']('cmd_blacklis...
def _check_avail(cmd): ''' Check to see if the given command can be run ''' if isinstance(cmd, list): cmd = ' '.join([six.text_type(x) if not isinstance(x, six.string_types) else x for x in cmd]) bret = True wret = False if __salt__['config.get']('cmd_blacklis...
[ "Check", "to", "see", "if", "the", "given", "command", "can", "be", "run" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L222-L247
[ "def", "_check_avail", "(", "cmd", ")", ":", "if", "isinstance", "(", "cmd", ",", "list", ")", ":", "cmd", "=", "' '", ".", "join", "(", "[", "six", ".", "text_type", "(", "x", ")", "if", "not", "isinstance", "(", "x", ",", "six", ".", "string_ty...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_run
Do the DRY thing and only call subprocess.Popen() once
salt/modules/cmdmod.py
def _run(cmd, cwd=None, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, output_encoding=None, output_loglevel='debug', log_callback=None, runas=None, group=None, shell=DEFAULT_SHELL, python_shell=False, ...
def _run(cmd, cwd=None, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, output_encoding=None, output_loglevel='debug', log_callback=None, runas=None, group=None, shell=DEFAULT_SHELL, python_shell=False, ...
[ "Do", "the", "DRY", "thing", "and", "only", "call", "subprocess", ".", "Popen", "()", "once" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L250-L858
[ "def", "_run", "(", "cmd", ",", "cwd", "=", "None", ",", "stdin", "=", "None", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", "subprocess", ".", "PIPE", ",", "output_encoding", "=", "None", ",", "output_loglevel", "=", "'debug'", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_run_quiet
Helper for running commands quietly for minion startup
salt/modules/cmdmod.py
def _run_quiet(cmd, cwd=None, stdin=None, output_encoding=None, runas=None, shell=DEFAULT_SHELL, python_shell=False, env=None, template=None, umask=None, timeout=None, ...
def _run_quiet(cmd, cwd=None, stdin=None, output_encoding=None, runas=None, shell=DEFAULT_SHELL, python_shell=False, env=None, template=None, umask=None, timeout=None, ...
[ "Helper", "for", "running", "commands", "quietly", "for", "minion", "startup" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L861-L902
[ "def", "_run_quiet", "(", "cmd", ",", "cwd", "=", "None", ",", "stdin", "=", "None", ",", "output_encoding", "=", "None", ",", "runas", "=", "None", ",", "shell", "=", "DEFAULT_SHELL", ",", "python_shell", "=", "False", ",", "env", "=", "None", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_is_globalzone
Check if we are running in the globalzone
salt/modules/zoneadm.py
def _is_globalzone(): ''' Check if we are running in the globalzone ''' if not __grains__['kernel'] == 'SunOS': return False zonename = __salt__['cmd.run_all']('zonename') if zonename['retcode']: return False if zonename['stdout'] == 'global': return True return...
def _is_globalzone(): ''' Check if we are running in the globalzone ''' if not __grains__['kernel'] == 'SunOS': return False zonename = __salt__['cmd.run_all']('zonename') if zonename['retcode']: return False if zonename['stdout'] == 'global': return True return...
[ "Check", "if", "we", "are", "running", "in", "the", "globalzone" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L36-L49
[ "def", "_is_globalzone", "(", ")", ":", "if", "not", "__grains__", "[", "'kernel'", "]", "==", "'SunOS'", ":", "return", "False", "zonename", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'zonename'", ")", "if", "zonename", "[", "'retcode'", "]", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_zones
List all zones verbose : boolean display additional zone information installed : boolean include installed zones in output configured : boolean include configured zones in output hide_global : boolean do not include global zone CLI Example: .. code-block:: bash...
salt/modules/zoneadm.py
def list_zones(verbose=True, installed=False, configured=False, hide_global=True): ''' List all zones verbose : boolean display additional zone information installed : boolean include installed zones in output configured : boolean include configured zones in output hide_...
def list_zones(verbose=True, installed=False, configured=False, hide_global=True): ''' List all zones verbose : boolean display additional zone information installed : boolean include installed zones in output configured : boolean include configured zones in output hide_...
[ "List", "all", "zones" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L77-L124
[ "def", "list_zones", "(", "verbose", "=", "True", ",", "installed", "=", "False", ",", "configured", "=", "False", ",", "hide_global", "=", "True", ")", ":", "zones", "=", "{", "}", "## fetch zones", "header", "=", "'zoneid:zonename:state:zonepath:uuid:brand:ip-...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
boot
Boot (or activate) the specified zone. zone : string name or uuid of the zone single : boolean boots only to milestone svc:/milestone/single-user:default. altinit : string valid path to an alternative executable to be the primordial process. smf_options : string include ...
salt/modules/zoneadm.py
def boot(zone, single=False, altinit=None, smf_options=None): ''' Boot (or activate) the specified zone. zone : string name or uuid of the zone single : boolean boots only to milestone svc:/milestone/single-user:default. altinit : string valid path to an alternative executab...
def boot(zone, single=False, altinit=None, smf_options=None): ''' Boot (or activate) the specified zone. zone : string name or uuid of the zone single : boolean boots only to milestone svc:/milestone/single-user:default. altinit : string valid path to an alternative executab...
[ "Boot", "(", "or", "activate", ")", "the", "specified", "zone", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L127-L173
[ "def", "boot", "(", "zone", ",", "single", "=", "False", ",", "altinit", "=", "None", ",", "smf_options", "=", "None", ")", ":", "ret", "=", "{", "'status'", ":", "True", "}", "## build boot_options", "boot_options", "=", "''", "if", "single", ":", "bo...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
attach
Attach the specified zone. zone : string name of the zone force : boolean force the zone into the "installed" state with no validation brand_opts : string brand specific options to pass CLI Example: .. code-block:: bash salt '*' zoneadm.attach lawrence sal...
salt/modules/zoneadm.py
def attach(zone, force=False, brand_opts=None): ''' Attach the specified zone. zone : string name of the zone force : boolean force the zone into the "installed" state with no validation brand_opts : string brand specific options to pass CLI Example: .. code-block:...
def attach(zone, force=False, brand_opts=None): ''' Attach the specified zone. zone : string name of the zone force : boolean force the zone into the "installed" state with no validation brand_opts : string brand specific options to pass CLI Example: .. code-block:...
[ "Attach", "the", "specified", "zone", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L334-L366
[ "def", "attach", "(", "zone", ",", "force", "=", "False", ",", "brand_opts", "=", "None", ")", ":", "ret", "=", "{", "'status'", ":", "True", "}", "## attach zone", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'zoneadm -z {zone} attach{force}{bra...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ready
Prepares a zone for running applications. zone : string name or uuid of the zone CLI Example: .. code-block:: bash salt '*' zoneadm.ready clementine
salt/modules/zoneadm.py
def ready(zone): ''' Prepares a zone for running applications. zone : string name or uuid of the zone CLI Example: .. code-block:: bash salt '*' zoneadm.ready clementine ''' ret = {'status': True} ## ready zone res = __salt__['cmd.run_all']('zoneadm {zone} ready'...
def ready(zone): ''' Prepares a zone for running applications. zone : string name or uuid of the zone CLI Example: .. code-block:: bash salt '*' zoneadm.ready clementine ''' ret = {'status': True} ## ready zone res = __salt__['cmd.run_all']('zoneadm {zone} ready'...
[ "Prepares", "a", "zone", "for", "running", "applications", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L369-L394
[ "def", "ready", "(", "zone", ")", ":", "ret", "=", "{", "'status'", ":", "True", "}", "## ready zone", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'zoneadm {zone} ready'", ".", "format", "(", "zone", "=", "'-u {0}'", ".", "format", "(", "zon...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
verify
Check to make sure the configuration of the specified zone can safely be installed on the machine. zone : string name of the zone CLI Example: .. code-block:: bash salt '*' zoneadm.verify dolores
salt/modules/zoneadm.py
def verify(zone): ''' Check to make sure the configuration of the specified zone can safely be installed on the machine. zone : string name of the zone CLI Example: .. code-block:: bash salt '*' zoneadm.verify dolores ''' ret = {'status': True} ## verify zone ...
def verify(zone): ''' Check to make sure the configuration of the specified zone can safely be installed on the machine. zone : string name of the zone CLI Example: .. code-block:: bash salt '*' zoneadm.verify dolores ''' ret = {'status': True} ## verify zone ...
[ "Check", "to", "make", "sure", "the", "configuration", "of", "the", "specified", "zone", "can", "safely", "be", "installed", "on", "the", "machine", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L397-L423
[ "def", "verify", "(", "zone", ")", ":", "ret", "=", "{", "'status'", ":", "True", "}", "## verify zone", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'zoneadm -z {zone} verify'", ".", "format", "(", "zone", "=", "zone", ",", ")", ")", "ret", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
move
Move zone to new zonepath. zone : string name or uuid of the zone zonepath : string new zonepath CLI Example: .. code-block:: bash salt '*' zoneadm.move meave /sweetwater/meave
salt/modules/zoneadm.py
def move(zone, zonepath): ''' Move zone to new zonepath. zone : string name or uuid of the zone zonepath : string new zonepath CLI Example: .. code-block:: bash salt '*' zoneadm.move meave /sweetwater/meave ''' ret = {'status': True} ## verify zone re...
def move(zone, zonepath): ''' Move zone to new zonepath. zone : string name or uuid of the zone zonepath : string new zonepath CLI Example: .. code-block:: bash salt '*' zoneadm.move meave /sweetwater/meave ''' ret = {'status': True} ## verify zone re...
[ "Move", "zone", "to", "new", "zonepath", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L426-L454
[ "def", "move", "(", "zone", ",", "zonepath", ")", ":", "ret", "=", "{", "'status'", ":", "True", "}", "## verify zone", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'zoneadm {zone} move {path}'", ".", "format", "(", "zone", "=", "'-u {0}'", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install
Install the specified zone from the system. zone : string name of the zone nodataset : boolean do not create a ZFS file system brand_opts : string brand specific options to pass CLI Example: .. code-block:: bash salt '*' zoneadm.install dolores salt '*' zo...
salt/modules/zoneadm.py
def install(zone, nodataset=False, brand_opts=None): ''' Install the specified zone from the system. zone : string name of the zone nodataset : boolean do not create a ZFS file system brand_opts : string brand specific options to pass CLI Example: .. code-block:: b...
def install(zone, nodataset=False, brand_opts=None): ''' Install the specified zone from the system. zone : string name of the zone nodataset : boolean do not create a ZFS file system brand_opts : string brand specific options to pass CLI Example: .. code-block:: b...
[ "Install", "the", "specified", "zone", "from", "the", "system", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L488-L520
[ "def", "install", "(", "zone", ",", "nodataset", "=", "False", ",", "brand_opts", "=", "None", ")", ":", "ret", "=", "{", "'status'", ":", "True", "}", "## install zone", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'zoneadm -z {zone} install{nod...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
clone
Install a zone by copying an existing installed zone. zone : string name of the zone source : string zone to clone from snapshot : string optional name of snapshot to use as source CLI Example: .. code-block:: bash salt '*' zoneadm.clone clementine dolores
salt/modules/zoneadm.py
def clone(zone, source, snapshot=None): ''' Install a zone by copying an existing installed zone. zone : string name of the zone source : string zone to clone from snapshot : string optional name of snapshot to use as source CLI Example: .. code-block:: bash ...
def clone(zone, source, snapshot=None): ''' Install a zone by copying an existing installed zone. zone : string name of the zone source : string zone to clone from snapshot : string optional name of snapshot to use as source CLI Example: .. code-block:: bash ...
[ "Install", "a", "zone", "by", "copying", "an", "existing", "installed", "zone", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L523-L554
[ "def", "clone", "(", "zone", ",", "source", ",", "snapshot", "=", "None", ")", ":", "ret", "=", "{", "'status'", ":", "True", "}", "## install zone", "res", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "'zoneadm -z {zone} clone {snapshot}{source}'", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
find_file
Search the environment for the relative path
salt/fileserver/azurefs.py
def find_file(path, saltenv='base', **kwargs): ''' Search the environment for the relative path ''' fnd = {'path': '', 'rel': ''} for container in __opts__.get('azurefs', []): if container.get('saltenv', 'base') != saltenv: continue full = os.path.join(_get_con...
def find_file(path, saltenv='base', **kwargs): ''' Search the environment for the relative path ''' fnd = {'path': '', 'rel': ''} for container in __opts__.get('azurefs', []): if container.get('saltenv', 'base') != saltenv: continue full = os.path.join(_get_con...
[ "Search", "the", "environment", "for", "the", "relative", "path" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L102-L133
[ "def", "find_file", "(", "path", ",", "saltenv", "=", "'base'", ",", "*", "*", "kwargs", ")", ":", "fnd", "=", "{", "'path'", ":", "''", ",", "'rel'", ":", "''", "}", "for", "container", "in", "__opts__", ".", "get", "(", "'azurefs'", ",", "[", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
envs
Each container configuration can have an environment setting, or defaults to base
salt/fileserver/azurefs.py
def envs(): ''' Each container configuration can have an environment setting, or defaults to base ''' saltenvs = [] for container in __opts__.get('azurefs', []): saltenvs.append(container.get('saltenv', 'base')) # Remove duplicates return list(set(saltenvs))
def envs(): ''' Each container configuration can have an environment setting, or defaults to base ''' saltenvs = [] for container in __opts__.get('azurefs', []): saltenvs.append(container.get('saltenv', 'base')) # Remove duplicates return list(set(saltenvs))
[ "Each", "container", "configuration", "can", "have", "an", "environment", "setting", "or", "defaults", "to", "base" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L136-L145
[ "def", "envs", "(", ")", ":", "saltenvs", "=", "[", "]", "for", "container", "in", "__opts__", ".", "get", "(", "'azurefs'", ",", "[", "]", ")", ":", "saltenvs", ".", "append", "(", "container", ".", "get", "(", "'saltenv'", ",", "'base'", ")", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
serve_file
Return a chunk from a file based on the data received
salt/fileserver/azurefs.py
def serve_file(load, fnd): ''' Return a chunk from a file based on the data received ''' ret = {'data': '', 'dest': ''} required_load_keys = ('path', 'loc', 'saltenv') if not all(x in load for x in required_load_keys): log.debug( 'Not all of the required keys prese...
def serve_file(load, fnd): ''' Return a chunk from a file based on the data received ''' ret = {'data': '', 'dest': ''} required_load_keys = ('path', 'loc', 'saltenv') if not all(x in load for x in required_load_keys): log.debug( 'Not all of the required keys prese...
[ "Return", "a", "chunk", "from", "a", "file", "based", "on", "the", "data", "received" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L148-L175
[ "def", "serve_file", "(", "load", ",", "fnd", ")", ":", "ret", "=", "{", "'data'", ":", "''", ",", "'dest'", ":", "''", "}", "required_load_keys", "=", "(", "'path'", ",", "'loc'", ",", "'saltenv'", ")", "if", "not", "all", "(", "x", "in", "load", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update
Update caches of the storage containers. Compares the md5 of the files on disk to the md5 of the blobs in the container, and only updates if necessary. Also processes deletions by walking the container caches and comparing with the list of blobs in the container
salt/fileserver/azurefs.py
def update(): ''' Update caches of the storage containers. Compares the md5 of the files on disk to the md5 of the blobs in the container, and only updates if necessary. Also processes deletions by walking the container caches and comparing with the list of blobs in the container ''' f...
def update(): ''' Update caches of the storage containers. Compares the md5 of the files on disk to the md5 of the blobs in the container, and only updates if necessary. Also processes deletions by walking the container caches and comparing with the list of blobs in the container ''' f...
[ "Update", "caches", "of", "the", "storage", "containers", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L178-L272
[ "def", "update", "(", ")", ":", "for", "container", "in", "__opts__", "[", "'azurefs'", "]", ":", "path", "=", "_get_container_path", "(", "container", ")", "try", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "os", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
file_hash
Return a file hash based on the hash type set in the master config
salt/fileserver/azurefs.py
def file_hash(load, fnd): ''' Return a file hash based on the hash type set in the master config ''' if not all(x in load for x in ('path', 'saltenv')): return '', None ret = {'hash_type': __opts__['hash_type']} relpath = fnd['rel'] path = fnd['path'] hash_cachedir = os.path.join...
def file_hash(load, fnd): ''' Return a file hash based on the hash type set in the master config ''' if not all(x in load for x in ('path', 'saltenv')): return '', None ret = {'hash_type': __opts__['hash_type']} relpath = fnd['rel'] path = fnd['path'] hash_cachedir = os.path.join...
[ "Return", "a", "file", "hash", "based", "on", "the", "hash", "type", "set", "in", "the", "master", "config" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L275-L299
[ "def", "file_hash", "(", "load", ",", "fnd", ")", ":", "if", "not", "all", "(", "x", "in", "load", "for", "x", "in", "(", "'path'", ",", "'saltenv'", ")", ")", ":", "return", "''", ",", "None", "ret", "=", "{", "'hash_type'", ":", "__opts__", "["...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
file_list
Return a list of all files in a specified environment
salt/fileserver/azurefs.py
def file_list(load): ''' Return a list of all files in a specified environment ''' ret = set() try: for container in __opts__['azurefs']: if container.get('saltenv', 'base') != load['saltenv']: continue container_list = _get_container_path(container) +...
def file_list(load): ''' Return a list of all files in a specified environment ''' ret = set() try: for container in __opts__['azurefs']: if container.get('saltenv', 'base') != load['saltenv']: continue container_list = _get_container_path(container) +...
[ "Return", "a", "list", "of", "all", "files", "in", "a", "specified", "environment" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L302-L323
[ "def", "file_list", "(", "load", ")", ":", "ret", "=", "set", "(", ")", "try", ":", "for", "container", "in", "__opts__", "[", "'azurefs'", "]", ":", "if", "container", ".", "get", "(", "'saltenv'", ",", "'base'", ")", "!=", "load", "[", "'saltenv'",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
dir_list
Return a list of all directories in a specified environment
salt/fileserver/azurefs.py
def dir_list(load): ''' Return a list of all directories in a specified environment ''' ret = set() files = file_list(load) for f in files: dirname = f while dirname: dirname = os.path.dirname(dirname) if dirname: ret.add(dirname) retur...
def dir_list(load): ''' Return a list of all directories in a specified environment ''' ret = set() files = file_list(load) for f in files: dirname = f while dirname: dirname = os.path.dirname(dirname) if dirname: ret.add(dirname) retur...
[ "Return", "a", "list", "of", "all", "directories", "in", "a", "specified", "environment" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L326-L338
[ "def", "dir_list", "(", "load", ")", ":", "ret", "=", "set", "(", ")", "files", "=", "file_list", "(", "load", ")", "for", "f", "in", "files", ":", "dirname", "=", "f", "while", "dirname", ":", "dirname", "=", "os", ".", "path", ".", "dirname", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_container_path
Get the cache path for the container in question Cache paths are generate by combining the account name, container name, and saltenv, separated by underscores
salt/fileserver/azurefs.py
def _get_container_path(container): ''' Get the cache path for the container in question Cache paths are generate by combining the account name, container name, and saltenv, separated by underscores ''' root = os.path.join(__opts__['cachedir'], 'azurefs') container_dir = '{0}_{1}_{2}'.forma...
def _get_container_path(container): ''' Get the cache path for the container in question Cache paths are generate by combining the account name, container name, and saltenv, separated by underscores ''' root = os.path.join(__opts__['cachedir'], 'azurefs') container_dir = '{0}_{1}_{2}'.forma...
[ "Get", "the", "cache", "path", "for", "the", "container", "in", "question" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L341-L352
[ "def", "_get_container_path", "(", "container", ")", ":", "root", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]", ",", "'azurefs'", ")", "container_dir", "=", "'{0}_{1}_{2}'", ".", "format", "(", "container", ".", "get", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_container_service
Get the azure block blob service for the container in question Try account_key, sas_token, and no auth in that order
salt/fileserver/azurefs.py
def _get_container_service(container): ''' Get the azure block blob service for the container in question Try account_key, sas_token, and no auth in that order ''' if 'account_key' in container: account = azure.storage.CloudStorageAccount(container['account_name'], account_key=container['ac...
def _get_container_service(container): ''' Get the azure block blob service for the container in question Try account_key, sas_token, and no auth in that order ''' if 'account_key' in container: account = azure.storage.CloudStorageAccount(container['account_name'], account_key=container['ac...
[ "Get", "the", "azure", "block", "blob", "service", "for", "the", "container", "in", "question" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L355-L368
[ "def", "_get_container_service", "(", "container", ")", ":", "if", "'account_key'", "in", "container", ":", "account", "=", "azure", ".", "storage", ".", "CloudStorageAccount", "(", "container", "[", "'account_name'", "]", ",", "account_key", "=", "container", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_validate_config
Validate azurefs config, return False if it doesn't validate
salt/fileserver/azurefs.py
def _validate_config(): ''' Validate azurefs config, return False if it doesn't validate ''' if not isinstance(__opts__['azurefs'], list): log.error('azurefs configuration is not formed as a list, skipping azurefs') return False for container in __opts__['azurefs']: if not is...
def _validate_config(): ''' Validate azurefs config, return False if it doesn't validate ''' if not isinstance(__opts__['azurefs'], list): log.error('azurefs configuration is not formed as a list, skipping azurefs') return False for container in __opts__['azurefs']: if not is...
[ "Validate", "azurefs", "config", "return", "False", "if", "it", "doesn", "t", "validate" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L371-L391
[ "def", "_validate_config", "(", ")", ":", "if", "not", "isinstance", "(", "__opts__", "[", "'azurefs'", "]", ",", "list", ")", ":", "log", ".", "error", "(", "'azurefs configuration is not formed as a list, skipping azurefs'", ")", "return", "False", "for", "conta...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_smartos_computenode_data
Return useful information from a SmartOS compute node
salt/grains/smartos.py
def _smartos_computenode_data(): ''' Return useful information from a SmartOS compute node ''' # Provides: # vms_total # vms_running # vms_stopped # vms_type # sdc_version # vm_capable # vm_hw_virt grains = {} # collect vm data vms = {} for vm ...
def _smartos_computenode_data(): ''' Return useful information from a SmartOS compute node ''' # Provides: # vms_total # vms_running # vms_stopped # vms_type # sdc_version # vm_capable # vm_hw_virt grains = {} # collect vm data vms = {} for vm ...
[ "Return", "useful", "information", "from", "a", "SmartOS", "compute", "node" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/smartos.py#L49-L99
[ "def", "_smartos_computenode_data", "(", ")", ":", "# Provides:", "# vms_total", "# vms_running", "# vms_stopped", "# vms_type", "# sdc_version", "# vm_capable", "# vm_hw_virt", "grains", "=", "{", "}", "# collect vm data", "vms", "=", "{", "}", "for", "vm...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_smartos_zone_data
Return useful information from a SmartOS zone
salt/grains/smartos.py
def _smartos_zone_data(): ''' Return useful information from a SmartOS zone ''' # Provides: # zoneid # zonename # imageversion grains = { 'zoneid': __salt__['cmd.run']('zoneadm list -p | awk -F: \'{ print $1 }\'', python_shell=True), 'zonename': __salt__['cmd.run']...
def _smartos_zone_data(): ''' Return useful information from a SmartOS zone ''' # Provides: # zoneid # zonename # imageversion grains = { 'zoneid': __salt__['cmd.run']('zoneadm list -p | awk -F: \'{ print $1 }\'', python_shell=True), 'zonename': __salt__['cmd.run']...
[ "Return", "useful", "information", "from", "a", "SmartOS", "zone" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/smartos.py#L102-L126
[ "def", "_smartos_zone_data", "(", ")", ":", "# Provides:", "# zoneid", "# zonename", "# imageversion", "grains", "=", "{", "'zoneid'", ":", "__salt__", "[", "'cmd.run'", "]", "(", "'zoneadm list -p | awk -F: \\'{ print $1 }\\''", ",", "python_shell", "=", "True", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_smartos_zone_pkgsrc_data
SmartOS zone pkgsrc information
salt/grains/smartos.py
def _smartos_zone_pkgsrc_data(): ''' SmartOS zone pkgsrc information ''' # Provides: # pkgsrcversion # pkgsrcpath grains = { 'pkgsrcversion': 'Unknown', 'pkgsrcpath': 'Unknown', } pkgsrcversion = re.compile('^release:\\s(.+)') if os.path.isfile('/etc/pkgsrc_...
def _smartos_zone_pkgsrc_data(): ''' SmartOS zone pkgsrc information ''' # Provides: # pkgsrcversion # pkgsrcpath grains = { 'pkgsrcversion': 'Unknown', 'pkgsrcpath': 'Unknown', } pkgsrcversion = re.compile('^release:\\s(.+)') if os.path.isfile('/etc/pkgsrc_...
[ "SmartOS", "zone", "pkgsrc", "information" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/smartos.py#L129-L160
[ "def", "_smartos_zone_pkgsrc_data", "(", ")", ":", "# Provides:", "# pkgsrcversion", "# pkgsrcpath", "grains", "=", "{", "'pkgsrcversion'", ":", "'Unknown'", ",", "'pkgsrcpath'", ":", "'Unknown'", ",", "}", "pkgsrcversion", "=", "re", ".", "compile", "(", "'^r...
e8541fd6e744ab0df786c0f76102e41631f45d46