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
_check_hosts
Helper function that checks to see if the host provided is a vCenter Server or an ESXi host. If it's an ESXi host, returns a list of a single host_name. If a host reference isn't found, we're trying to find a host object for a vCenter server. Raises a CommandExecutionError in this case, as we need host ref...
salt/modules/vsphere.py
def _check_hosts(service_instance, host, host_names): ''' Helper function that checks to see if the host provided is a vCenter Server or an ESXi host. If it's an ESXi host, returns a list of a single host_name. If a host reference isn't found, we're trying to find a host object for a vCenter server...
def _check_hosts(service_instance, host, host_names): ''' Helper function that checks to see if the host provided is a vCenter Server or an ESXi host. If it's an ESXi host, returns a list of a single host_name. If a host reference isn't found, we're trying to find a host object for a vCenter server...
[ "Helper", "function", "that", "checks", "to", "see", "if", "the", "host", "provided", "is", "a", "vCenter", "Server", "or", "an", "ESXi", "host", ".", "If", "it", "s", "an", "ESXi", "host", "returns", "a", "list", "of", "a", "single", "host_name", "." ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6505-L6525
[ "def", "_check_hosts", "(", "service_instance", ",", "host", ",", "host_names", ")", ":", "if", "not", "host_names", ":", "host_name", "=", "_get_host_ref", "(", "service_instance", ",", "host", ")", "if", "host_name", ":", "host_names", "=", "[", "host", "]...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_format_coredump_stdout
Helper function to format the stdout from the get_coredump_network_config function. cmd_ret The return dictionary that comes from a cmd.run_all call.
salt/modules/vsphere.py
def _format_coredump_stdout(cmd_ret): ''' Helper function to format the stdout from the get_coredump_network_config function. cmd_ret The return dictionary that comes from a cmd.run_all call. ''' ret_dict = {} for line in cmd_ret['stdout'].splitlines(): line = line.strip().lower...
def _format_coredump_stdout(cmd_ret): ''' Helper function to format the stdout from the get_coredump_network_config function. cmd_ret The return dictionary that comes from a cmd.run_all call. ''' ret_dict = {} for line in cmd_ret['stdout'].splitlines(): line = line.strip().lower...
[ "Helper", "function", "to", "format", "the", "stdout", "from", "the", "get_coredump_network_config", "function", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6528-L6555
[ "def", "_format_coredump_stdout", "(", "cmd_ret", ")", ":", "ret_dict", "=", "{", "}", "for", "line", "in", "cmd_ret", "[", "'stdout'", "]", ".", "splitlines", "(", ")", ":", "line", "=", "line", ".", "strip", "(", ")", ".", "lower", "(", ")", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_format_firewall_stdout
Helper function to format the stdout from the get_firewall_status function. cmd_ret The return dictionary that comes from a cmd.run_all call.
salt/modules/vsphere.py
def _format_firewall_stdout(cmd_ret): ''' Helper function to format the stdout from the get_firewall_status function. cmd_ret The return dictionary that comes from a cmd.run_all call. ''' ret_dict = {'success': True, 'rulesets': {}} for line in cmd_ret['stdout'].splitlin...
def _format_firewall_stdout(cmd_ret): ''' Helper function to format the stdout from the get_firewall_status function. cmd_ret The return dictionary that comes from a cmd.run_all call. ''' ret_dict = {'success': True, 'rulesets': {}} for line in cmd_ret['stdout'].splitlin...
[ "Helper", "function", "to", "format", "the", "stdout", "from", "the", "get_firewall_status", "function", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6558-L6575
[ "def", "_format_firewall_stdout", "(", "cmd_ret", ")", ":", "ret_dict", "=", "{", "'success'", ":", "True", ",", "'rulesets'", ":", "{", "}", "}", "for", "line", "in", "cmd_ret", "[", "'stdout'", "]", ".", "splitlines", "(", ")", ":", "if", "line", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_format_syslog_config
Helper function to format the stdout from the get_syslog_config function. cmd_ret The return dictionary that comes from a cmd.run_all call.
salt/modules/vsphere.py
def _format_syslog_config(cmd_ret): ''' Helper function to format the stdout from the get_syslog_config function. cmd_ret The return dictionary that comes from a cmd.run_all call. ''' ret_dict = {'success': cmd_ret['retcode'] == 0} if cmd_ret['retcode'] != 0: ret_dict['message'...
def _format_syslog_config(cmd_ret): ''' Helper function to format the stdout from the get_syslog_config function. cmd_ret The return dictionary that comes from a cmd.run_all call. ''' ret_dict = {'success': cmd_ret['retcode'] == 0} if cmd_ret['retcode'] != 0: ret_dict['message'...
[ "Helper", "function", "to", "format", "the", "stdout", "from", "the", "get_syslog_config", "function", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6578-L6597
[ "def", "_format_syslog_config", "(", "cmd_ret", ")", ":", "ret_dict", "=", "{", "'success'", ":", "cmd_ret", "[", "'retcode'", "]", "==", "0", "}", "if", "cmd_ret", "[", "'retcode'", "]", "!=", "0", ":", "ret_dict", "[", "'message'", "]", "=", "cmd_ret",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_host_ref
Helper function that returns a host object either from the host location or the host_name. If host_name is provided, that is the host_object that will be returned. The function will first search for hosts by DNS Name. If no hosts are found, it will try searching by IP Address.
salt/modules/vsphere.py
def _get_host_ref(service_instance, host, host_name=None): ''' Helper function that returns a host object either from the host location or the host_name. If host_name is provided, that is the host_object that will be returned. The function will first search for hosts by DNS Name. If no hosts are found,...
def _get_host_ref(service_instance, host, host_name=None): ''' Helper function that returns a host object either from the host location or the host_name. If host_name is provided, that is the host_object that will be returned. The function will first search for hosts by DNS Name. If no hosts are found,...
[ "Helper", "function", "that", "returns", "a", "host", "object", "either", "from", "the", "host", "location", "or", "the", "host_name", ".", "If", "host_name", "is", "provided", "that", "is", "the", "host_object", "that", "will", "be", "returned", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6607-L6627
[ "def", "_get_host_ref", "(", "service_instance", ",", "host", ",", "host_name", "=", "None", ")", ":", "search_index", "=", "salt", ".", "utils", ".", "vmware", ".", "get_inventory", "(", "service_instance", ")", ".", "searchIndex", "# First, try to find the host ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_host_disks
Helper function that returns a dictionary containing a list of SSD and Non-SSD disks.
salt/modules/vsphere.py
def _get_host_disks(host_reference): ''' Helper function that returns a dictionary containing a list of SSD and Non-SSD disks. ''' storage_system = host_reference.configManager.storageSystem disks = storage_system.storageDeviceInfo.scsiLun ssds = [] non_ssds = [] for disk in disks: ...
def _get_host_disks(host_reference): ''' Helper function that returns a dictionary containing a list of SSD and Non-SSD disks. ''' storage_system = host_reference.configManager.storageSystem disks = storage_system.storageDeviceInfo.scsiLun ssds = [] non_ssds = [] for disk in disks: ...
[ "Helper", "function", "that", "returns", "a", "dictionary", "containing", "a", "list", "of", "SSD", "and", "Non", "-", "SSD", "disks", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6644-L6663
[ "def", "_get_host_disks", "(", "host_reference", ")", ":", "storage_system", "=", "host_reference", ".", "configManager", ".", "storageSystem", "disks", "=", "storage_system", ".", "storageDeviceInfo", ".", "scsiLun", "ssds", "=", "[", "]", "non_ssds", "=", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_vsan_eligible_disks
Helper function that returns a dictionary of host_name keys with either a list of eligible disks that can be added to VSAN or either an 'Error' message or a message saying no eligible disks were found. Possible keys/values look like: return = {'host_1': {'Error': 'VSAN System Config Manager is unset ...'},...
salt/modules/vsphere.py
def _get_vsan_eligible_disks(service_instance, host, host_names): ''' Helper function that returns a dictionary of host_name keys with either a list of eligible disks that can be added to VSAN or either an 'Error' message or a message saying no eligible disks were found. Possible keys/values look like: ...
def _get_vsan_eligible_disks(service_instance, host, host_names): ''' Helper function that returns a dictionary of host_name keys with either a list of eligible disks that can be added to VSAN or either an 'Error' message or a message saying no eligible disks were found. Possible keys/values look like: ...
[ "Helper", "function", "that", "returns", "a", "dictionary", "of", "host_name", "keys", "with", "either", "a", "list", "of", "eligible", "disks", "that", "can", "be", "added", "to", "VSAN", "or", "either", "an", "Error", "message", "or", "a", "message", "sa...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6673-L6725
[ "def", "_get_vsan_eligible_disks", "(", "service_instance", ",", "host", ",", "host_names", ")", ":", "ret", "=", "{", "}", "for", "host_name", "in", "host_names", ":", "# Get VSAN System Config Manager, if available.", "host_ref", "=", "_get_host_ref", "(", "service_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_reset_syslog_config_params
Helper function for reset_syslog_config that resets the config and populates the return dictionary.
salt/modules/vsphere.py
def _reset_syslog_config_params(host, username, password, cmd, resets, valid_resets, protocol=None, port=None, esxi_host=None, credstore=None): ''' Helper function for reset_syslog_config that resets the config and populates the return dictionary. ''' ret_dict = {} al...
def _reset_syslog_config_params(host, username, password, cmd, resets, valid_resets, protocol=None, port=None, esxi_host=None, credstore=None): ''' Helper function for reset_syslog_config that resets the config and populates the return dictionary. ''' ret_dict = {} al...
[ "Helper", "function", "for", "reset_syslog_config", "that", "resets", "the", "config", "and", "populates", "the", "return", "dictionary", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6728-L6758
[ "def", "_reset_syslog_config_params", "(", "host", ",", "username", ",", "password", ",", "cmd", ",", "resets", ",", "valid_resets", ",", "protocol", "=", "None", ",", "port", "=", "None", ",", "esxi_host", "=", "None", ",", "credstore", "=", "None", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_set_syslog_config_helper
Helper function for set_syslog_config that sets the config and populates the return dictionary.
salt/modules/vsphere.py
def _set_syslog_config_helper(host, username, password, syslog_config, config_value, protocol=None, port=None, reset_service=None, esxi_host=None, credstore=None): ''' Helper function for set_syslog_config that sets the config and populates the return dictionary. ''' cmd = ...
def _set_syslog_config_helper(host, username, password, syslog_config, config_value, protocol=None, port=None, reset_service=None, esxi_host=None, credstore=None): ''' Helper function for set_syslog_config that sets the config and populates the return dictionary. ''' cmd = ...
[ "Helper", "function", "for", "set_syslog_config", "that", "sets", "the", "config", "and", "populates", "the", "return", "dictionary", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6761-L6799
[ "def", "_set_syslog_config_helper", "(", "host", ",", "username", ",", "password", ",", "syslog_config", ",", "config_value", ",", "protocol", "=", "None", ",", "port", "=", "None", ",", "reset_service", "=", "None", ",", "esxi_host", "=", "None", ",", "cred...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add_host_to_dvs
Adds an ESXi host to a vSphere Distributed Virtual Switch and migrates the desired adapters to the DVS from the standard switch. host The location of the vCenter server. username The username used to login to the vCenter server. password The password used to login to the vCent...
salt/modules/vsphere.py
def add_host_to_dvs(host, username, password, vmknic_name, vmnic_name, dvs_name, target_portgroup_name, uplink_portgroup_name, protocol=None, port=None, host_names=None): ''' Adds an ESXi host to a vSphere Distributed Virtual Switch and migrates the desired adapters t...
def add_host_to_dvs(host, username, password, vmknic_name, vmnic_name, dvs_name, target_portgroup_name, uplink_portgroup_name, protocol=None, port=None, host_names=None): ''' Adds an ESXi host to a vSphere Distributed Virtual Switch and migrates the desired adapters t...
[ "Adds", "an", "ESXi", "host", "to", "a", "vSphere", "Distributed", "Virtual", "Switch", "and", "migrates", "the", "desired", "adapters", "to", "the", "DVS", "from", "the", "standard", "switch", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6804-L7129
[ "def", "add_host_to_dvs", "(", "host", ",", "username", ",", "password", ",", "vmknic_name", ",", "vmnic_name", ",", "dvs_name", ",", "target_portgroup_name", ",", "uplink_portgroup_name", ",", "protocol", "=", "None", ",", "port", "=", "None", ",", "host_names"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_proxy_target
Returns the target object of a proxy. If the object doesn't exist a VMwareObjectRetrievalError is raised service_instance Service instance (vim.ServiceInstance) of the vCenter/ESXi host.
salt/modules/vsphere.py
def _get_proxy_target(service_instance): ''' Returns the target object of a proxy. If the object doesn't exist a VMwareObjectRetrievalError is raised service_instance Service instance (vim.ServiceInstance) of the vCenter/ESXi host. ''' proxy_type = get_proxy_type() if not salt.util...
def _get_proxy_target(service_instance): ''' Returns the target object of a proxy. If the object doesn't exist a VMwareObjectRetrievalError is raised service_instance Service instance (vim.ServiceInstance) of the vCenter/ESXi host. ''' proxy_type = get_proxy_type() if not salt.util...
[ "Returns", "the", "target", "object", "of", "a", "proxy", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7134-L7177
[ "def", "_get_proxy_target", "(", "service_instance", ")", ":", "proxy_type", "=", "get_proxy_type", "(", ")", "if", "not", "salt", ".", "utils", ".", "vmware", ".", "is_connection_to_a_vcenter", "(", "service_instance", ")", ":", "raise", "CommandExecutionError", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_esxdatacenter_proxy_details
Returns the running esxdatacenter's proxy details
salt/modules/vsphere.py
def _get_esxdatacenter_proxy_details(): ''' Returns the running esxdatacenter's proxy details ''' det = __salt__['esxdatacenter.get_details']() return det.get('vcenter'), det.get('username'), det.get('password'), \ det.get('protocol'), det.get('port'), det.get('mechanism'), \ ...
def _get_esxdatacenter_proxy_details(): ''' Returns the running esxdatacenter's proxy details ''' det = __salt__['esxdatacenter.get_details']() return det.get('vcenter'), det.get('username'), det.get('password'), \ det.get('protocol'), det.get('port'), det.get('mechanism'), \ ...
[ "Returns", "the", "running", "esxdatacenter", "s", "proxy", "details" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7180-L7187
[ "def", "_get_esxdatacenter_proxy_details", "(", ")", ":", "det", "=", "__salt__", "[", "'esxdatacenter.get_details'", "]", "(", ")", "return", "det", ".", "get", "(", "'vcenter'", ")", ",", "det", ".", "get", "(", "'username'", ")", ",", "det", ".", "get",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_esxcluster_proxy_details
Returns the running esxcluster's proxy details
salt/modules/vsphere.py
def _get_esxcluster_proxy_details(): ''' Returns the running esxcluster's proxy details ''' det = __salt__['esxcluster.get_details']() return det.get('vcenter'), det.get('username'), det.get('password'), \ det.get('protocol'), det.get('port'), det.get('mechanism'), \ det.get(...
def _get_esxcluster_proxy_details(): ''' Returns the running esxcluster's proxy details ''' det = __salt__['esxcluster.get_details']() return det.get('vcenter'), det.get('username'), det.get('password'), \ det.get('protocol'), det.get('port'), det.get('mechanism'), \ det.get(...
[ "Returns", "the", "running", "esxcluster", "s", "proxy", "details" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7190-L7198
[ "def", "_get_esxcluster_proxy_details", "(", ")", ":", "det", "=", "__salt__", "[", "'esxcluster.get_details'", "]", "(", ")", "return", "det", ".", "get", "(", "'vcenter'", ")", ",", "det", ".", "get", "(", "'username'", ")", ",", "det", ".", "get", "("...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_esxi_proxy_details
Returns the running esxi's proxy details
salt/modules/vsphere.py
def _get_esxi_proxy_details(): ''' Returns the running esxi's proxy details ''' det = __proxy__['esxi.get_details']() host = det.get('host') if det.get('vcenter'): host = det['vcenter'] esxi_hosts = None if det.get('esxi_host'): esxi_hosts = [det['esxi_host']] return ...
def _get_esxi_proxy_details(): ''' Returns the running esxi's proxy details ''' det = __proxy__['esxi.get_details']() host = det.get('host') if det.get('vcenter'): host = det['vcenter'] esxi_hosts = None if det.get('esxi_host'): esxi_hosts = [det['esxi_host']] return ...
[ "Returns", "the", "running", "esxi", "s", "proxy", "details" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7201-L7214
[ "def", "_get_esxi_proxy_details", "(", ")", ":", "det", "=", "__proxy__", "[", "'esxi.get_details'", "]", "(", ")", "host", "=", "det", ".", "get", "(", "'host'", ")", "if", "det", ".", "get", "(", "'vcenter'", ")", ":", "host", "=", "det", "[", "'vc...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_vm
Returns vm object properties. name Name of the virtual machine. datacenter Datacenter name vm_properties List of vm properties. traversal_spec Traversal Spec object(s) for searching. parent_ref Container Reference object for searching under a given object...
salt/modules/vsphere.py
def get_vm(name, datacenter=None, vm_properties=None, traversal_spec=None, parent_ref=None, service_instance=None): ''' Returns vm object properties. name Name of the virtual machine. datacenter Datacenter name vm_properties List of vm properties. traversal...
def get_vm(name, datacenter=None, vm_properties=None, traversal_spec=None, parent_ref=None, service_instance=None): ''' Returns vm object properties. name Name of the virtual machine. datacenter Datacenter name vm_properties List of vm properties. traversal...
[ "Returns", "vm", "object", "properties", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7219-L7250
[ "def", "get_vm", "(", "name", ",", "datacenter", "=", "None", ",", "vm_properties", "=", "None", ",", "traversal_spec", "=", "None", ",", "parent_ref", "=", "None", ",", "service_instance", "=", "None", ")", ":", "virtual_machine", "=", "salt", ".", "utils...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_vm_config_file
Queries the virtual machine config file and returns vim.host.DatastoreBrowser.SearchResults object on success None on failure name Name of the virtual machine datacenter Datacenter name datastore Datastore where the virtual machine files are stored service_instance ...
salt/modules/vsphere.py
def get_vm_config_file(name, datacenter, placement, datastore, service_instance=None): ''' Queries the virtual machine config file and returns vim.host.DatastoreBrowser.SearchResults object on success None on failure name Name of the virtual machine datacenter ...
def get_vm_config_file(name, datacenter, placement, datastore, service_instance=None): ''' Queries the virtual machine config file and returns vim.host.DatastoreBrowser.SearchResults object on success None on failure name Name of the virtual machine datacenter ...
[ "Queries", "the", "virtual", "machine", "config", "file", "and", "returns", "vim", ".", "host", ".", "DatastoreBrowser", ".", "SearchResults", "object", "on", "success", "None", "on", "failure" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7255-L7307
[ "def", "get_vm_config_file", "(", "name", ",", "datacenter", ",", "placement", ",", "datastore", ",", "service_instance", "=", "None", ")", ":", "browser_spec", "=", "vim", ".", "host", ".", "DatastoreBrowser", ".", "SearchSpec", "(", ")", "directory", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_apply_hardware_version
Specifies vm container version or schedules upgrade, returns True on change and False if nothing have been changed. hardware_version Hardware version string eg. vmx-08 config_spec Configuration spec object operation Defines the operation which should be used, the possi...
salt/modules/vsphere.py
def _apply_hardware_version(hardware_version, config_spec, operation='add'): ''' Specifies vm container version or schedules upgrade, returns True on change and False if nothing have been changed. hardware_version Hardware version string eg. vmx-08 config_spec Configuration spec ob...
def _apply_hardware_version(hardware_version, config_spec, operation='add'): ''' Specifies vm container version or schedules upgrade, returns True on change and False if nothing have been changed. hardware_version Hardware version string eg. vmx-08 config_spec Configuration spec ob...
[ "Specifies", "vm", "container", "version", "or", "schedules", "upgrade", "returns", "True", "on", "change", "and", "False", "if", "nothing", "have", "been", "changed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7310-L7335
[ "def", "_apply_hardware_version", "(", "hardware_version", ",", "config_spec", ",", "operation", "=", "'add'", ")", ":", "log", ".", "trace", "(", "'Configuring virtual machine hardware '", "'version version=%s'", ",", "hardware_version", ")", "if", "operation", "==", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_apply_cpu_config
Sets CPU core count to the given value config_spec vm.ConfigSpec object cpu_props CPU properties dict
salt/modules/vsphere.py
def _apply_cpu_config(config_spec, cpu_props): ''' Sets CPU core count to the given value config_spec vm.ConfigSpec object cpu_props CPU properties dict ''' log.trace('Configuring virtual machine CPU ' 'settings cpu_props=%s', cpu_props) if 'count' in cpu_prop...
def _apply_cpu_config(config_spec, cpu_props): ''' Sets CPU core count to the given value config_spec vm.ConfigSpec object cpu_props CPU properties dict ''' log.trace('Configuring virtual machine CPU ' 'settings cpu_props=%s', cpu_props) if 'count' in cpu_prop...
[ "Sets", "CPU", "core", "count", "to", "the", "given", "value" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7338-L7359
[ "def", "_apply_cpu_config", "(", "config_spec", ",", "cpu_props", ")", ":", "log", ".", "trace", "(", "'Configuring virtual machine CPU '", "'settings cpu_props=%s'", ",", "cpu_props", ")", "if", "'count'", "in", "cpu_props", ":", "config_spec", ".", "numCPUs", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_apply_memory_config
Sets memory size to the given value config_spec vm.ConfigSpec object memory Memory size and unit
salt/modules/vsphere.py
def _apply_memory_config(config_spec, memory): ''' Sets memory size to the given value config_spec vm.ConfigSpec object memory Memory size and unit ''' log.trace('Configuring virtual machine memory ' 'settings memory=%s', memory) if 'size' in memory and 'unit'...
def _apply_memory_config(config_spec, memory): ''' Sets memory size to the given value config_spec vm.ConfigSpec object memory Memory size and unit ''' log.trace('Configuring virtual machine memory ' 'settings memory=%s', memory) if 'size' in memory and 'unit'...
[ "Sets", "memory", "size", "to", "the", "given", "value" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7362-L7388
[ "def", "_apply_memory_config", "(", "config_spec", ",", "memory", ")", ":", "log", ".", "trace", "(", "'Configuring virtual machine memory '", "'settings memory=%s'", ",", "memory", ")", "if", "'size'", "in", "memory", "and", "'unit'", "in", "memory", ":", "try", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_advanced_configs
Returns extra config parameters from a virtual machine advanced config list vm_name Virtual machine name datacenter Datacenter name where the virtual machine is available service_instance vCenter service instance for connection and configuration
salt/modules/vsphere.py
def get_advanced_configs(vm_name, datacenter, service_instance=None): ''' Returns extra config parameters from a virtual machine advanced config list vm_name Virtual machine name datacenter Datacenter name where the virtual machine is available service_instance vCenter ser...
def get_advanced_configs(vm_name, datacenter, service_instance=None): ''' Returns extra config parameters from a virtual machine advanced config list vm_name Virtual machine name datacenter Datacenter name where the virtual machine is available service_instance vCenter ser...
[ "Returns", "extra", "config", "parameters", "from", "a", "virtual", "machine", "advanced", "config", "list" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7394-L7411
[ "def", "get_advanced_configs", "(", "vm_name", ",", "datacenter", ",", "service_instance", "=", "None", ")", ":", "current_config", "=", "get_vm_config", "(", "vm_name", ",", "datacenter", "=", "datacenter", ",", "objects", "=", "True", ",", "service_instance", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_apply_advanced_config
Sets configuration parameters for the vm config_spec vm.ConfigSpec object advanced_config config key value pairs vm_extra_config Virtual machine vm_ref.config.extraConfig object
salt/modules/vsphere.py
def _apply_advanced_config(config_spec, advanced_config, vm_extra_config=None): ''' Sets configuration parameters for the vm config_spec vm.ConfigSpec object advanced_config config key value pairs vm_extra_config Virtual machine vm_ref.config.extraConfig object ''' ...
def _apply_advanced_config(config_spec, advanced_config, vm_extra_config=None): ''' Sets configuration parameters for the vm config_spec vm.ConfigSpec object advanced_config config key value pairs vm_extra_config Virtual machine vm_ref.config.extraConfig object ''' ...
[ "Sets", "configuration", "parameters", "for", "the", "vm" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7414-L7440
[ "def", "_apply_advanced_config", "(", "config_spec", ",", "advanced_config", ",", "vm_extra_config", "=", "None", ")", ":", "log", ".", "trace", "(", "'Configuring advanced configuration '", "'parameters %s'", ",", "advanced_config", ")", "if", "isinstance", "(", "adv...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_advanced_configs
Appends extra config parameters to a virtual machine advanced config list vm_name Virtual machine name datacenter Datacenter name where the virtual machine is available advanced_configs Dictionary with advanced parameter key value pairs service_instance vCenter servic...
salt/modules/vsphere.py
def set_advanced_configs(vm_name, datacenter, advanced_configs, service_instance=None): ''' Appends extra config parameters to a virtual machine advanced config list vm_name Virtual machine name datacenter Datacenter name where the virtual machine is available ...
def set_advanced_configs(vm_name, datacenter, advanced_configs, service_instance=None): ''' Appends extra config parameters to a virtual machine advanced config list vm_name Virtual machine name datacenter Datacenter name where the virtual machine is available ...
[ "Appends", "extra", "config", "parameters", "to", "a", "virtual", "machine", "advanced", "config", "list" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7446-L7483
[ "def", "set_advanced_configs", "(", "vm_name", ",", "datacenter", ",", "advanced_configs", ",", "service_instance", "=", "None", ")", ":", "current_config", "=", "get_vm_config", "(", "vm_name", ",", "datacenter", "=", "datacenter", ",", "objects", "=", "True", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_delete_advanced_config
Removes configuration parameters for the vm config_spec vm.ConfigSpec object advanced_config List of advanced config keys to be deleted vm_extra_config Virtual machine vm_ref.config.extraConfig object
salt/modules/vsphere.py
def _delete_advanced_config(config_spec, advanced_config, vm_extra_config): ''' Removes configuration parameters for the vm config_spec vm.ConfigSpec object advanced_config List of advanced config keys to be deleted vm_extra_config Virtual machine vm_ref.config.extraConfig...
def _delete_advanced_config(config_spec, advanced_config, vm_extra_config): ''' Removes configuration parameters for the vm config_spec vm.ConfigSpec object advanced_config List of advanced config keys to be deleted vm_extra_config Virtual machine vm_ref.config.extraConfig...
[ "Removes", "configuration", "parameters", "for", "the", "vm" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7486-L7512
[ "def", "_delete_advanced_config", "(", "config_spec", ",", "advanced_config", ",", "vm_extra_config", ")", ":", "log", ".", "trace", "(", "'Removing advanced configuration '", "'parameters %s'", ",", "advanced_config", ")", "if", "isinstance", "(", "advanced_config", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_advanced_configs
Removes extra config parameters from a virtual machine vm_name Virtual machine name datacenter Datacenter name where the virtual machine is available advanced_configs List of advanced config values to be removed service_instance vCenter service instance for connection...
salt/modules/vsphere.py
def delete_advanced_configs(vm_name, datacenter, advanced_configs, service_instance=None): ''' Removes extra config parameters from a virtual machine vm_name Virtual machine name datacenter Datacenter name where the virtual machine is available advanced...
def delete_advanced_configs(vm_name, datacenter, advanced_configs, service_instance=None): ''' Removes extra config parameters from a virtual machine vm_name Virtual machine name datacenter Datacenter name where the virtual machine is available advanced...
[ "Removes", "extra", "config", "parameters", "from", "a", "virtual", "machine" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7518-L7547
[ "def", "delete_advanced_configs", "(", "vm_name", ",", "datacenter", ",", "advanced_configs", ",", "service_instance", "=", "None", ")", ":", "datacenter_ref", "=", "salt", ".", "utils", ".", "vmware", ".", "get_datacenter", "(", "service_instance", ",", "datacent...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_scsi_controller_key
Returns key number of the SCSI controller keys bus_number Controller bus number from the adapter scsi_ctrls List of SCSI Controller objects (old+newly created)
salt/modules/vsphere.py
def _get_scsi_controller_key(bus_number, scsi_ctrls): ''' Returns key number of the SCSI controller keys bus_number Controller bus number from the adapter scsi_ctrls List of SCSI Controller objects (old+newly created) ''' # list of new/old VirtualSCSIController objects, both ne...
def _get_scsi_controller_key(bus_number, scsi_ctrls): ''' Returns key number of the SCSI controller keys bus_number Controller bus number from the adapter scsi_ctrls List of SCSI Controller objects (old+newly created) ''' # list of new/old VirtualSCSIController objects, both ne...
[ "Returns", "key", "number", "of", "the", "SCSI", "controller", "keys" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7550-L7568
[ "def", "_get_scsi_controller_key", "(", "bus_number", ",", "scsi_ctrls", ")", ":", "# list of new/old VirtualSCSIController objects, both new and old objects", "# should contain a key attribute key should be a negative integer in case", "# of a new object", "keys", "=", "[", "ctrl", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_apply_hard_disk
Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit a virtual disk device unit_number Add network adapter to this address key Device key number operation Action which should be done on the device add or edit disk_label Label of the new disk, ca...
salt/modules/vsphere.py
def _apply_hard_disk(unit_number, key, operation, disk_label=None, size=None, unit='GB', controller_key=None, thin_provision=None, eagerly_scrub=None, datastore=None, filename=None): ''' Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit a virtu...
def _apply_hard_disk(unit_number, key, operation, disk_label=None, size=None, unit='GB', controller_key=None, thin_provision=None, eagerly_scrub=None, datastore=None, filename=None): ''' Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit a virtu...
[ "Returns", "a", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "object", "specifying", "to", "add", "/", "edit", "a", "virtual", "disk", "device" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7571-L7643
[ "def", "_apply_hard_disk", "(", "unit_number", ",", "key", ",", "operation", ",", "disk_label", "=", "None", ",", "size", "=", "None", ",", "unit", "=", "'GB'", ",", "controller_key", "=", "None", ",", "thin_provision", "=", "None", ",", "eagerly_scrub", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_create_adapter_type
Returns a vim.vm.device.VirtualEthernetCard object specifying a virtual ethernet card information network_adapter None or VirtualEthernet object adapter_type String, type of adapter network_adapter_label string, network adapter name
salt/modules/vsphere.py
def _create_adapter_type(network_adapter, adapter_type, network_adapter_label=''): ''' Returns a vim.vm.device.VirtualEthernetCard object specifying a virtual ethernet card information network_adapter None or VirtualEthernet object adapter_type String, type...
def _create_adapter_type(network_adapter, adapter_type, network_adapter_label=''): ''' Returns a vim.vm.device.VirtualEthernetCard object specifying a virtual ethernet card information network_adapter None or VirtualEthernet object adapter_type String, type...
[ "Returns", "a", "vim", ".", "vm", ".", "device", ".", "VirtualEthernetCard", "object", "specifying", "a", "virtual", "ethernet", "card", "information" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7646-L7690
[ "def", "_create_adapter_type", "(", "network_adapter", ",", "adapter_type", ",", "network_adapter_label", "=", "''", ")", ":", "log", ".", "trace", "(", "'Configuring virtual machine network '", "'adapter adapter_type=%s'", ",", "adapter_type", ")", "if", "adapter_type", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_create_network_backing
Returns a vim.vm.device.VirtualDevice.BackingInfo object specifying a virtual ethernet card backing information network_name string, network name switch_type string, type of switch parent_ref Parent reference to search for network
salt/modules/vsphere.py
def _create_network_backing(network_name, switch_type, parent_ref): ''' Returns a vim.vm.device.VirtualDevice.BackingInfo object specifying a virtual ethernet card backing information network_name string, network name switch_type string, type of switch parent_ref Paren...
def _create_network_backing(network_name, switch_type, parent_ref): ''' Returns a vim.vm.device.VirtualDevice.BackingInfo object specifying a virtual ethernet card backing information network_name string, network name switch_type string, type of switch parent_ref Paren...
[ "Returns", "a", "vim", ".", "vm", ".", "device", ".", "VirtualDevice", ".", "BackingInfo", "object", "specifying", "a", "virtual", "ethernet", "card", "backing", "information" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7693-L7740
[ "def", "_create_network_backing", "(", "network_name", ",", "switch_type", ",", "parent_ref", ")", ":", "log", ".", "trace", "(", "'Configuring virtual machine network backing network_name=%s '", "'switch_type=%s parent=%s'", ",", "network_name", ",", "switch_type", ",", "s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_apply_network_adapter_config
Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit a network device network_adapter_label Network adapter label key Unique key for device creation network_name Network or port group name adapter_type Type of the adapter eg. vmxnet3 switch...
salt/modules/vsphere.py
def _apply_network_adapter_config(key, network_name, adapter_type, switch_type, network_adapter_label=None, operation='add', connectable=None, mac=None, parent=None): ''' Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit a...
def _apply_network_adapter_config(key, network_name, adapter_type, switch_type, network_adapter_label=None, operation='add', connectable=None, mac=None, parent=None): ''' Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit a...
[ "Returns", "a", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "object", "specifying", "to", "add", "/", "edit", "a", "network", "device" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7743-L7818
[ "def", "_apply_network_adapter_config", "(", "key", ",", "network_name", ",", "adapter_type", ",", "switch_type", ",", "network_adapter_label", "=", "None", ",", "operation", "=", "'add'", ",", "connectable", "=", "None", ",", "mac", "=", "None", ",", "parent", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_apply_scsi_controller
Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit a SCSI controller adapter SCSI controller adapter name adapter_type SCSI controller adapter type eg. paravirtual bus_sharing SCSI controller bus sharing eg. virtual_sharing key SCSI controlle...
salt/modules/vsphere.py
def _apply_scsi_controller(adapter, adapter_type, bus_sharing, key, bus_number, operation): ''' Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit a SCSI controller adapter SCSI controller adapter name adapter_type SCSI controller ada...
def _apply_scsi_controller(adapter, adapter_type, bus_sharing, key, bus_number, operation): ''' Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit a SCSI controller adapter SCSI controller adapter name adapter_type SCSI controller ada...
[ "Returns", "a", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "object", "specifying", "to", "add", "/", "edit", "a", "SCSI", "controller" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7821-L7891
[ "def", "_apply_scsi_controller", "(", "adapter", ",", "adapter_type", ",", "bus_sharing", ",", "key", ",", "bus_number", ",", "operation", ")", ":", "log", ".", "trace", "(", "'Configuring scsi controller adapter=%s adapter_type=%s '", "'bus_sharing=%s key=%s bus_number=%s'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_create_ide_controllers
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing IDE controllers ide_controllers IDE properties
salt/modules/vsphere.py
def _create_ide_controllers(ide_controllers): ''' Returns a list of vim.vm.device.VirtualDeviceSpec objects representing IDE controllers ide_controllers IDE properties ''' ide_ctrls = [] keys = range(-200, -250, -1) if ide_controllers: devs = [ide['adapter'] for ide in i...
def _create_ide_controllers(ide_controllers): ''' Returns a list of vim.vm.device.VirtualDeviceSpec objects representing IDE controllers ide_controllers IDE properties ''' ide_ctrls = [] keys = range(-200, -250, -1) if ide_controllers: devs = [ide['adapter'] for ide in i...
[ "Returns", "a", "list", "of", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "objects", "representing", "IDE", "controllers" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7894-L7910
[ "def", "_create_ide_controllers", "(", "ide_controllers", ")", ":", "ide_ctrls", "=", "[", "]", "keys", "=", "range", "(", "-", "200", ",", "-", "250", ",", "-", "1", ")", "if", "ide_controllers", ":", "devs", "=", "[", "ide", "[", "'adapter'", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_apply_ide_controller_config
Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit an IDE controller ide_controller_label Controller label of the IDE adapter operation Type of operation: add or edit key Unique key of the device bus_number Device bus number property
salt/modules/vsphere.py
def _apply_ide_controller_config(ide_controller_label, operation, key, bus_number=0): ''' Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit an IDE controller ide_controller_label Controller label of the IDE adapter operation Ty...
def _apply_ide_controller_config(ide_controller_label, operation, key, bus_number=0): ''' Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit an IDE controller ide_controller_label Controller label of the IDE adapter operation Ty...
[ "Returns", "a", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "object", "specifying", "to", "add", "/", "edit", "an", "IDE", "controller" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7913-L7945
[ "def", "_apply_ide_controller_config", "(", "ide_controller_label", ",", "operation", ",", "key", ",", "bus_number", "=", "0", ")", ":", "log", ".", "trace", "(", "'Configuring IDE controller ide_controller_label=%s'", ",", "ide_controller_label", ")", "ide_spec", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_create_sata_controllers
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing SATA controllers sata_controllers SATA properties
salt/modules/vsphere.py
def _create_sata_controllers(sata_controllers): ''' Returns a list of vim.vm.device.VirtualDeviceSpec objects representing SATA controllers sata_controllers SATA properties ''' sata_ctrls = [] keys = range(-15000, -15050, -1) if sata_controllers: devs = [sata['adapter'] ...
def _create_sata_controllers(sata_controllers): ''' Returns a list of vim.vm.device.VirtualDeviceSpec objects representing SATA controllers sata_controllers SATA properties ''' sata_ctrls = [] keys = range(-15000, -15050, -1) if sata_controllers: devs = [sata['adapter'] ...
[ "Returns", "a", "list", "of", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "objects", "representing", "SATA", "controllers" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7948-L7964
[ "def", "_create_sata_controllers", "(", "sata_controllers", ")", ":", "sata_ctrls", "=", "[", "]", "keys", "=", "range", "(", "-", "15000", ",", "-", "15050", ",", "-", "1", ")", "if", "sata_controllers", ":", "devs", "=", "[", "sata", "[", "'adapter'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_apply_sata_controller_config
Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit a SATA controller sata_controller_label Controller label of the SATA adapter operation Type of operation: add or edit key Unique key of the device bus_number Device bus number property
salt/modules/vsphere.py
def _apply_sata_controller_config(sata_controller_label, operation, key, bus_number=0): ''' Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit a SATA controller sata_controller_label Controller label of the SATA adapter operation ...
def _apply_sata_controller_config(sata_controller_label, operation, key, bus_number=0): ''' Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit a SATA controller sata_controller_label Controller label of the SATA adapter operation ...
[ "Returns", "a", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "object", "specifying", "to", "add", "/", "edit", "a", "SATA", "controller" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7967-L8000
[ "def", "_apply_sata_controller_config", "(", "sata_controller_label", ",", "operation", ",", "key", ",", "bus_number", "=", "0", ")", ":", "log", ".", "trace", "(", "'Configuring SATA controller sata_controller_label=%s'", ",", "sata_controller_label", ")", "sata_spec", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_apply_cd_drive
Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit a CD/DVD drive drive_label Leble of the CD/DVD drive key Unique key of the device device_type Type of the device: client or iso operation Type of operation: add or edit client_device ...
salt/modules/vsphere.py
def _apply_cd_drive(drive_label, key, device_type, operation, client_device=None, datastore_iso_file=None, connectable=None, controller_key=200, parent_ref=None): ''' Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit a CD/DVD drive drive_lab...
def _apply_cd_drive(drive_label, key, device_type, operation, client_device=None, datastore_iso_file=None, connectable=None, controller_key=200, parent_ref=None): ''' Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit a CD/DVD drive drive_lab...
[ "Returns", "a", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "object", "specifying", "to", "add", "/", "edit", "a", "CD", "/", "DVD", "drive" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8003-L8088
[ "def", "_apply_cd_drive", "(", "drive_label", ",", "key", ",", "device_type", ",", "operation", ",", "client_device", "=", "None", ",", "datastore_iso_file", "=", "None", ",", "connectable", "=", "None", ",", "controller_key", "=", "200", ",", "parent_ref", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_set_network_adapter_mapping
Returns a vim.vm.customization.AdapterMapping object containing the IP properties of a network adapter card domain Domain of the host gateway Gateway address ip_addr IP address subnet_mask Subnet mask mac MAC address of the guest
salt/modules/vsphere.py
def _set_network_adapter_mapping(domain, gateway, ip_addr, subnet_mask, mac): ''' Returns a vim.vm.customization.AdapterMapping object containing the IP properties of a network adapter card domain Domain of the host gateway Gateway address ip_addr IP address subne...
def _set_network_adapter_mapping(domain, gateway, ip_addr, subnet_mask, mac): ''' Returns a vim.vm.customization.AdapterMapping object containing the IP properties of a network adapter card domain Domain of the host gateway Gateway address ip_addr IP address subne...
[ "Returns", "a", "vim", ".", "vm", ".", "customization", ".", "AdapterMapping", "object", "containing", "the", "IP", "properties", "of", "a", "network", "adapter", "card" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8091-L8124
[ "def", "_set_network_adapter_mapping", "(", "domain", ",", "gateway", ",", "ip_addr", ",", "subnet_mask", ",", "mac", ")", ":", "adapter_mapping", "=", "vim", ".", "vm", ".", "customization", ".", "AdapterMapping", "(", ")", "adapter_mapping", ".", "macAddress",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_apply_serial_port
Returns a vim.vm.device.VirtualSerialPort representing a serial port component serial_device_spec Serial device properties key Unique key of the device operation Add or edit the given device .. code-block:: bash serial_ports: adapter: 'Serial port 1' ...
salt/modules/vsphere.py
def _apply_serial_port(serial_device_spec, key, operation='add'): ''' Returns a vim.vm.device.VirtualSerialPort representing a serial port component serial_device_spec Serial device properties key Unique key of the device operation Add or edit the given device .. ...
def _apply_serial_port(serial_device_spec, key, operation='add'): ''' Returns a vim.vm.device.VirtualSerialPort representing a serial port component serial_device_spec Serial device properties key Unique key of the device operation Add or edit the given device .. ...
[ "Returns", "a", "vim", ".", "vm", ".", "device", ".", "VirtualSerialPort", "representing", "a", "serial", "port", "component" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8127-L8194
[ "def", "_apply_serial_port", "(", "serial_device_spec", ",", "key", ",", "operation", "=", "'add'", ")", ":", "log", ".", "trace", "(", "'Creating serial port adapter=%s type=%s connectable=%s yield=%s'", ",", "serial_device_spec", "[", "'adapter'", "]", ",", "serial_de...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_create_disks
Returns a list of disk specs representing the disks to be created for a virtual machine service_instance Service instance (vim.ServiceInstance) of the vCenter. Default is None. disks List of disks with properties scsi_controllers List of SCSI controllers parent ...
salt/modules/vsphere.py
def _create_disks(service_instance, disks, scsi_controllers=None, parent=None): ''' Returns a list of disk specs representing the disks to be created for a virtual machine service_instance Service instance (vim.ServiceInstance) of the vCenter. Default is None. disks List of...
def _create_disks(service_instance, disks, scsi_controllers=None, parent=None): ''' Returns a list of disk specs representing the disks to be created for a virtual machine service_instance Service instance (vim.ServiceInstance) of the vCenter. Default is None. disks List of...
[ "Returns", "a", "list", "of", "disk", "specs", "representing", "the", "disks", "to", "be", "created", "for", "a", "virtual", "machine" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8197-L8285
[ "def", "_create_disks", "(", "service_instance", ",", "disks", ",", "scsi_controllers", "=", "None", ",", "parent", "=", "None", ")", ":", "disk_specs", "=", "[", "]", "keys", "=", "range", "(", "-", "2000", ",", "-", "2050", ",", "-", "1", ")", "if"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_create_scsi_devices
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing SCSI controllers scsi_devices: List of SCSI device properties
salt/modules/vsphere.py
def _create_scsi_devices(scsi_devices): ''' Returns a list of vim.vm.device.VirtualDeviceSpec objects representing SCSI controllers scsi_devices: List of SCSI device properties ''' keys = range(-1000, -1050, -1) scsi_specs = [] if scsi_devices: devs = [scsi['adapter'] fo...
def _create_scsi_devices(scsi_devices): ''' Returns a list of vim.vm.device.VirtualDeviceSpec objects representing SCSI controllers scsi_devices: List of SCSI device properties ''' keys = range(-1000, -1050, -1) scsi_specs = [] if scsi_devices: devs = [scsi['adapter'] fo...
[ "Returns", "a", "list", "of", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "objects", "representing", "SCSI", "controllers" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8288-L8312
[ "def", "_create_scsi_devices", "(", "scsi_devices", ")", ":", "keys", "=", "range", "(", "-", "1000", ",", "-", "1050", ",", "-", "1", ")", "scsi_specs", "=", "[", "]", "if", "scsi_devices", ":", "devs", "=", "[", "scsi", "[", "'adapter'", "]", "for"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_create_network_adapters
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing the interfaces to be created for a virtual machine network_interfaces List of network interfaces and properties parent Parent object reference .. code-block: bash interfaces: adapter: 'Network ad...
salt/modules/vsphere.py
def _create_network_adapters(network_interfaces, parent=None): ''' Returns a list of vim.vm.device.VirtualDeviceSpec objects representing the interfaces to be created for a virtual machine network_interfaces List of network interfaces and properties parent Parent object reference ...
def _create_network_adapters(network_interfaces, parent=None): ''' Returns a list of vim.vm.device.VirtualDeviceSpec objects representing the interfaces to be created for a virtual machine network_interfaces List of network interfaces and properties parent Parent object reference ...
[ "Returns", "a", "list", "of", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "objects", "representing", "the", "interfaces", "to", "be", "created", "for", "a", "virtual", "machine" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8315-L8359
[ "def", "_create_network_adapters", "(", "network_interfaces", ",", "parent", "=", "None", ")", ":", "network_specs", "=", "[", "]", "nics_settings", "=", "[", "]", "keys", "=", "range", "(", "-", "4000", ",", "-", "4050", ",", "-", "1", ")", "if", "net...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_create_serial_ports
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing the serial ports to be created for a virtual machine serial_ports Serial port properties
salt/modules/vsphere.py
def _create_serial_ports(serial_ports): ''' Returns a list of vim.vm.device.VirtualDeviceSpec objects representing the serial ports to be created for a virtual machine serial_ports Serial port properties ''' ports = [] keys = range(-9000, -9050, -1) if serial_ports: devs...
def _create_serial_ports(serial_ports): ''' Returns a list of vim.vm.device.VirtualDeviceSpec objects representing the serial ports to be created for a virtual machine serial_ports Serial port properties ''' ports = [] keys = range(-9000, -9050, -1) if serial_ports: devs...
[ "Returns", "a", "list", "of", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "objects", "representing", "the", "serial", "ports", "to", "be", "created", "for", "a", "virtual", "machine" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8362-L8378
[ "def", "_create_serial_ports", "(", "serial_ports", ")", ":", "ports", "=", "[", "]", "keys", "=", "range", "(", "-", "9000", ",", "-", "9050", ",", "-", "1", ")", "if", "serial_ports", ":", "devs", "=", "[", "serial", "[", "'adapter'", "]", "for", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_create_cd_drives
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing the CD/DVD drives to be created for a virtual machine cd_drives CD/DVD drive properties controllers CD/DVD drive controllers (IDE, SATA) parent_ref Parent object reference
salt/modules/vsphere.py
def _create_cd_drives(cd_drives, controllers=None, parent_ref=None): ''' Returns a list of vim.vm.device.VirtualDeviceSpec objects representing the CD/DVD drives to be created for a virtual machine cd_drives CD/DVD drive properties controllers CD/DVD drive controllers (IDE, SATA) ...
def _create_cd_drives(cd_drives, controllers=None, parent_ref=None): ''' Returns a list of vim.vm.device.VirtualDeviceSpec objects representing the CD/DVD drives to be created for a virtual machine cd_drives CD/DVD drive properties controllers CD/DVD drive controllers (IDE, SATA) ...
[ "Returns", "a", "list", "of", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "objects", "representing", "the", "CD", "/", "DVD", "drives", "to", "be", "created", "for", "a", "virtual", "machine" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8381-L8419
[ "def", "_create_cd_drives", "(", "cd_drives", ",", "controllers", "=", "None", ",", "parent_ref", "=", "None", ")", ":", "cd_drive_specs", "=", "[", "]", "keys", "=", "range", "(", "-", "3000", ",", "-", "3050", ",", "-", "1", ")", "if", "cd_drives", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_device_by_key
Returns the device with the given key, raises error if the device is not found. devices list of vim.vm.device.VirtualDevice objects key Unique key of device
salt/modules/vsphere.py
def _get_device_by_key(devices, key): ''' Returns the device with the given key, raises error if the device is not found. devices list of vim.vm.device.VirtualDevice objects key Unique key of device ''' device_keys = [d for d in devices if d.key == key] if device_keys: ...
def _get_device_by_key(devices, key): ''' Returns the device with the given key, raises error if the device is not found. devices list of vim.vm.device.VirtualDevice objects key Unique key of device ''' device_keys = [d for d in devices if d.key == key] if device_keys: ...
[ "Returns", "the", "device", "with", "the", "given", "key", "raises", "error", "if", "the", "device", "is", "not", "found", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8422-L8439
[ "def", "_get_device_by_key", "(", "devices", ",", "key", ")", ":", "device_keys", "=", "[", "d", "for", "d", "in", "devices", "if", "d", ".", "key", "==", "key", "]", "if", "device_keys", ":", "return", "device_keys", "[", "0", "]", "else", ":", "rai...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_device_by_label
Returns the device with the given label, raises error if the device is not found. devices list of vim.vm.device.VirtualDevice objects key Unique key of device
salt/modules/vsphere.py
def _get_device_by_label(devices, label): ''' Returns the device with the given label, raises error if the device is not found. devices list of vim.vm.device.VirtualDevice objects key Unique key of device ''' device_labels = [d for d in devices if d.deviceInfo.label == labe...
def _get_device_by_label(devices, label): ''' Returns the device with the given label, raises error if the device is not found. devices list of vim.vm.device.VirtualDevice objects key Unique key of device ''' device_labels = [d for d in devices if d.deviceInfo.label == labe...
[ "Returns", "the", "device", "with", "the", "given", "label", "raises", "error", "if", "the", "device", "is", "not", "found", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8442-L8459
[ "def", "_get_device_by_label", "(", "devices", ",", "label", ")", ":", "device_labels", "=", "[", "d", "for", "d", "in", "devices", "if", "d", ".", "deviceInfo", ".", "label", "==", "label", "]", "if", "device_labels", ":", "return", "device_labels", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_convert_units
Updates the size and unit dictionary values with the new unit values devices List of device data objects
salt/modules/vsphere.py
def _convert_units(devices): ''' Updates the size and unit dictionary values with the new unit values devices List of device data objects ''' if devices: for device in devices: if 'unit' in device and 'size' in device: device.update( s...
def _convert_units(devices): ''' Updates the size and unit dictionary values with the new unit values devices List of device data objects ''' if devices: for device in devices: if 'unit' in device and 'size' in device: device.update( s...
[ "Updates", "the", "size", "and", "unit", "dictionary", "values", "with", "the", "new", "unit", "values" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8462-L8476
[ "def", "_convert_units", "(", "devices", ")", ":", "if", "devices", ":", "for", "device", "in", "devices", ":", "if", "'unit'", "in", "device", "and", "'size'", "in", "device", ":", "device", ".", "update", "(", "salt", ".", "utils", ".", "vmware", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
compare_vm_configs
Compares virtual machine current and new configuration, the current is the one which is deployed now, and the new is the target config. Returns the differences between the objects in a dictionary, the keys are the configuration parameter keys and the values are differences objects: either list or recurs...
salt/modules/vsphere.py
def compare_vm_configs(new_config, current_config): ''' Compares virtual machine current and new configuration, the current is the one which is deployed now, and the new is the target config. Returns the differences between the objects in a dictionary, the keys are the configuration parameter keys a...
def compare_vm_configs(new_config, current_config): ''' Compares virtual machine current and new configuration, the current is the one which is deployed now, and the new is the target config. Returns the differences between the objects in a dictionary, the keys are the configuration parameter keys a...
[ "Compares", "virtual", "machine", "current", "and", "new", "configuration", "the", "current", "is", "the", "one", "which", "is", "deployed", "now", "and", "the", "new", "is", "the", "target", "config", ".", "Returns", "the", "differences", "between", "the", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8479-L8572
[ "def", "compare_vm_configs", "(", "new_config", ",", "current_config", ")", ":", "diffs", "=", "{", "}", "keys", "=", "set", "(", "new_config", ".", "keys", "(", ")", ")", "# These values identify the virtual machine, comparison is unnecessary", "keys", ".", "discar...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_vm_config
Queries and converts the virtual machine properties to the available format from the schema. If the objects attribute is True the config objects will have extra properties, like 'object' which will include the vim.vm.device.VirtualDevice, this is necessary for deletion and update actions. name ...
salt/modules/vsphere.py
def get_vm_config(name, datacenter=None, objects=True, service_instance=None): ''' Queries and converts the virtual machine properties to the available format from the schema. If the objects attribute is True the config objects will have extra properties, like 'object' which will include the vim.vm....
def get_vm_config(name, datacenter=None, objects=True, service_instance=None): ''' Queries and converts the virtual machine properties to the available format from the schema. If the objects attribute is True the config objects will have extra properties, like 'object' which will include the vim.vm....
[ "Queries", "and", "converts", "the", "virtual", "machine", "properties", "to", "the", "available", "format", "from", "the", "schema", ".", "If", "the", "objects", "attribute", "is", "True", "the", "config", "objects", "will", "have", "extra", "properties", "li...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8576-L8790
[ "def", "get_vm_config", "(", "name", ",", "datacenter", "=", "None", ",", "objects", "=", "True", ",", "service_instance", "=", "None", ")", ":", "properties", "=", "[", "'config.hardware.device'", ",", "'config.hardware.numCPU'", ",", "'config.hardware.numCoresPerS...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_update_disks
Changes the disk size and returns the config spec objects in a list. The controller property cannot be updated, because controller address identifies the disk by the unit and bus number properties. disks_diffs List of old and new disk properties, the properties are dictionary objects
salt/modules/vsphere.py
def _update_disks(disks_old_new): ''' Changes the disk size and returns the config spec objects in a list. The controller property cannot be updated, because controller address identifies the disk by the unit and bus number properties. disks_diffs List of old and new disk properties, the pr...
def _update_disks(disks_old_new): ''' Changes the disk size and returns the config spec objects in a list. The controller property cannot be updated, because controller address identifies the disk by the unit and bus number properties. disks_diffs List of old and new disk properties, the pr...
[ "Changes", "the", "disk", "size", "and", "returns", "the", "config", "spec", "objects", "in", "a", "list", ".", "The", "controller", "property", "cannot", "be", "updated", "because", "controller", "address", "identifies", "the", "disk", "by", "the", "unit", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8793-L8840
[ "def", "_update_disks", "(", "disks_old_new", ")", ":", "disk_changes", "=", "[", "]", "if", "disks_old_new", ":", "devs", "=", "[", "disk", "[", "'old'", "]", "[", "'address'", "]", "for", "disk", "in", "disks_old_new", "]", "log", ".", "trace", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_update_scsi_devices
Returns a list of vim.vm.device.VirtualDeviceSpec specifying the scsi properties as input the old and new configs are defined in a dictionary. scsi_diffs List of old and new scsi properties
salt/modules/vsphere.py
def _update_scsi_devices(scsis_old_new, current_disks): ''' Returns a list of vim.vm.device.VirtualDeviceSpec specifying the scsi properties as input the old and new configs are defined in a dictionary. scsi_diffs List of old and new scsi properties ''' device_config_specs = [] if ...
def _update_scsi_devices(scsis_old_new, current_disks): ''' Returns a list of vim.vm.device.VirtualDeviceSpec specifying the scsi properties as input the old and new configs are defined in a dictionary. scsi_diffs List of old and new scsi properties ''' device_config_specs = [] if ...
[ "Returns", "a", "list", "of", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "specifying", "the", "scsi", "properties", "as", "input", "the", "old", "and", "new", "configs", "are", "defined", "in", "a", "dictionary", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8843-L8900
[ "def", "_update_scsi_devices", "(", "scsis_old_new", ",", "current_disks", ")", ":", "device_config_specs", "=", "[", "]", "if", "scsis_old_new", ":", "devs", "=", "[", "scsi", "[", "'old'", "]", "[", "'adapter'", "]", "for", "scsi", "in", "scsis_old_new", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_update_network_adapters
Returns a list of vim.vm.device.VirtualDeviceSpec specifying configuration(s) for changed network adapters, the adapter type cannot be changed, as input the old and new configs are defined in a dictionary. interface_old_new Dictionary with old and new keys which contains the current and the ...
salt/modules/vsphere.py
def _update_network_adapters(interface_old_new, parent): ''' Returns a list of vim.vm.device.VirtualDeviceSpec specifying configuration(s) for changed network adapters, the adapter type cannot be changed, as input the old and new configs are defined in a dictionary. interface_old_new Dictio...
def _update_network_adapters(interface_old_new, parent): ''' Returns a list of vim.vm.device.VirtualDeviceSpec specifying configuration(s) for changed network adapters, the adapter type cannot be changed, as input the old and new configs are defined in a dictionary. interface_old_new Dictio...
[ "Returns", "a", "list", "of", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "specifying", "configuration", "(", "s", ")", "for", "changed", "network", "adapters", "the", "adapter", "type", "cannot", "be", "changed", "as", "input", "the", "old", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8903-L8941
[ "def", "_update_network_adapters", "(", "interface_old_new", ",", "parent", ")", ":", "network_changes", "=", "[", "]", "if", "interface_old_new", ":", "devs", "=", "[", "inter", "[", "'old'", "]", "[", "'mac'", "]", "for", "inter", "in", "interface_old_new", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_update_serial_ports
Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a deployed serial port configuration to the new given config serial_old_new Dictionary with old and new keys which contains the current and the next config for a serial port device
salt/modules/vsphere.py
def _update_serial_ports(serial_old_new): ''' Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a deployed serial port configuration to the new given config serial_old_new Dictionary with old and new keys which contains the current and the next config for a serial ...
def _update_serial_ports(serial_old_new): ''' Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a deployed serial port configuration to the new given config serial_old_new Dictionary with old and new keys which contains the current and the next config for a serial ...
[ "Returns", "a", "list", "of", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "specifying", "to", "edit", "a", "deployed", "serial", "port", "configuration", "to", "the", "new", "given", "config" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8944-L8966
[ "def", "_update_serial_ports", "(", "serial_old_new", ")", ":", "serial_changes", "=", "[", "]", "if", "serial_old_new", ":", "devs", "=", "[", "serial", "[", "'old'", "]", "[", "'adapter'", "]", "for", "serial", "in", "serial_old_new", "]", "log", ".", "t...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_update_cd_drives
Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a deployed cd drive configuration to the new given config drives_old_new Dictionary with old and new keys which contains the current and the next config for a cd drive controllers Controller device list paren...
salt/modules/vsphere.py
def _update_cd_drives(drives_old_new, controllers=None, parent=None): ''' Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a deployed cd drive configuration to the new given config drives_old_new Dictionary with old and new keys which contains the current and the nex...
def _update_cd_drives(drives_old_new, controllers=None, parent=None): ''' Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a deployed cd drive configuration to the new given config drives_old_new Dictionary with old and new keys which contains the current and the nex...
[ "Returns", "a", "list", "of", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "specifying", "to", "edit", "a", "deployed", "cd", "drive", "configuration", "to", "the", "new", "given", "config" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8969-L9009
[ "def", "_update_cd_drives", "(", "drives_old_new", ",", "controllers", "=", "None", ",", "parent", "=", "None", ")", ":", "cd_changes", "=", "[", "]", "if", "drives_old_new", ":", "devs", "=", "[", "drive", "[", "'old'", "]", "[", "'adapter'", "]", "for"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_delete_device
Returns a vim.vm.device.VirtualDeviceSpec specifying to remove a virtual machine device device Device data type object
salt/modules/vsphere.py
def _delete_device(device): ''' Returns a vim.vm.device.VirtualDeviceSpec specifying to remove a virtual machine device device Device data type object ''' log.trace('Deleting device with type %s', type(device)) device_spec = vim.vm.device.VirtualDeviceSpec() device_spec.operatio...
def _delete_device(device): ''' Returns a vim.vm.device.VirtualDeviceSpec specifying to remove a virtual machine device device Device data type object ''' log.trace('Deleting device with type %s', type(device)) device_spec = vim.vm.device.VirtualDeviceSpec() device_spec.operatio...
[ "Returns", "a", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "specifying", "to", "remove", "a", "virtual", "machine", "device" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9012-L9024
[ "def", "_delete_device", "(", "device", ")", ":", "log", ".", "trace", "(", "'Deleting device with type %s'", ",", "type", "(", "device", ")", ")", "device_spec", "=", "vim", ".", "vm", ".", "device", ".", "VirtualDeviceSpec", "(", ")", "device_spec", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_vm
Creates a virtual machine container. CLI Example: .. code-block:: bash salt vm_minion vsphere.create_vm vm_name=vmname cpu='{count: 2, nested: True}' ... vm_name Name of the virtual machine cpu Properties of CPUs for freshly created machines memory Memory size f...
salt/modules/vsphere.py
def create_vm(vm_name, cpu, memory, image, version, datacenter, datastore, placement, interfaces, disks, scsi_devices, serial_ports=None, ide_controllers=None, sata_controllers=None, cd_drives=None, advanced_configs=None, service_instance=None): ''' Creates a virtual ma...
def create_vm(vm_name, cpu, memory, image, version, datacenter, datastore, placement, interfaces, disks, scsi_devices, serial_ports=None, ide_controllers=None, sata_controllers=None, cd_drives=None, advanced_configs=None, service_instance=None): ''' Creates a virtual ma...
[ "Creates", "a", "virtual", "machine", "container", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9030-L9225
[ "def", "create_vm", "(", "vm_name", ",", "cpu", ",", "memory", ",", "image", ",", "version", ",", "datacenter", ",", "datastore", ",", "placement", ",", "interfaces", ",", "disks", ",", "scsi_devices", ",", "serial_ports", "=", "None", ",", "ide_controllers"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update_vm
Updates the configuration of the virtual machine if the config differs vm_name Virtual Machine name to be updated cpu CPU configuration options memory Memory configuration options version Virtual machine container hardware version image Virtual machine gu...
salt/modules/vsphere.py
def update_vm(vm_name, cpu=None, memory=None, image=None, version=None, interfaces=None, disks=None, scsi_devices=None, serial_ports=None, datacenter=None, datastore=None, cd_dvd_drives=None, sata_controllers=None, advanced_configs=None, service_instance=None): ...
def update_vm(vm_name, cpu=None, memory=None, image=None, version=None, interfaces=None, disks=None, scsi_devices=None, serial_ports=None, datacenter=None, datastore=None, cd_dvd_drives=None, sata_controllers=None, advanced_configs=None, service_instance=None): ...
[ "Updates", "the", "configuration", "of", "the", "virtual", "machine", "if", "the", "config", "differs" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9231-L9411
[ "def", "update_vm", "(", "vm_name", ",", "cpu", "=", "None", ",", "memory", "=", "None", ",", "image", "=", "None", ",", "version", "=", "None", ",", "interfaces", "=", "None", ",", "disks", "=", "None", ",", "scsi_devices", "=", "None", ",", "serial...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
register_vm
Registers a virtual machine to the inventory with the given vmx file. Returns comments and change list name Name of the virtual machine datacenter Datacenter of the virtual machine placement Placement dictionary of the virtual machine, host or cluster vmx_path: Fu...
salt/modules/vsphere.py
def register_vm(name, datacenter, placement, vmx_path, service_instance=None): ''' Registers a virtual machine to the inventory with the given vmx file. Returns comments and change list name Name of the virtual machine datacenter Datacenter of the virtual machine placement ...
def register_vm(name, datacenter, placement, vmx_path, service_instance=None): ''' Registers a virtual machine to the inventory with the given vmx file. Returns comments and change list name Name of the virtual machine datacenter Datacenter of the virtual machine placement ...
[ "Registers", "a", "virtual", "machine", "to", "the", "inventory", "with", "the", "given", "vmx", "file", ".", "Returns", "comments", "and", "change", "list" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9417-L9487
[ "def", "register_vm", "(", "name", ",", "datacenter", ",", "placement", ",", "vmx_path", ",", "service_instance", "=", "None", ")", ":", "log", ".", "trace", "(", "'Registering virtual machine with properties '", "'datacenter=%s, placement=%s, vmx_path=%s'", ",", "datac...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
power_on_vm
Powers on a virtual machine specified by it's name. name Name of the virtual machine datacenter Datacenter of the virtual machine service_instance Service instance (vim.ServiceInstance) of the vCenter. Default is None. .. code-block:: bash salt '*' vsphere.po...
salt/modules/vsphere.py
def power_on_vm(name, datacenter=None, service_instance=None): ''' Powers on a virtual machine specified by it's name. name Name of the virtual machine datacenter Datacenter of the virtual machine service_instance Service instance (vim.ServiceInstance) of the vCenter. ...
def power_on_vm(name, datacenter=None, service_instance=None): ''' Powers on a virtual machine specified by it's name. name Name of the virtual machine datacenter Datacenter of the virtual machine service_instance Service instance (vim.ServiceInstance) of the vCenter. ...
[ "Powers", "on", "a", "virtual", "machine", "specified", "by", "it", "s", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9493-L9529
[ "def", "power_on_vm", "(", "name", ",", "datacenter", "=", "None", ",", "service_instance", "=", "None", ")", ":", "log", ".", "trace", "(", "'Powering on virtual machine %s'", ",", "name", ")", "vm_properties", "=", "[", "'name'", ",", "'summary.runtime.powerSt...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_remove_vm
Helper function to remove a virtual machine name Name of the virtual machine service_instance vCenter service instance for connection and configuration datacenter Datacenter of the virtual machine placement Placement information of the virtual machine
salt/modules/vsphere.py
def _remove_vm(name, datacenter, service_instance, placement=None, power_off=None): ''' Helper function to remove a virtual machine name Name of the virtual machine service_instance vCenter service instance for connection and configuration datacenter Datacen...
def _remove_vm(name, datacenter, service_instance, placement=None, power_off=None): ''' Helper function to remove a virtual machine name Name of the virtual machine service_instance vCenter service instance for connection and configuration datacenter Datacen...
[ "Helper", "function", "to", "remove", "a", "virtual", "machine" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9574-L9613
[ "def", "_remove_vm", "(", "name", ",", "datacenter", ",", "service_instance", ",", "placement", "=", "None", ",", "power_off", "=", "None", ")", ":", "results", "=", "{", "}", "if", "placement", ":", "(", "resourcepool_object", ",", "placement_object", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_vm
Deletes a virtual machine defined by name and placement name Name of the virtual machine datacenter Datacenter of the virtual machine placement Placement information of the virtual machine service_instance vCenter service instance for connection and configuration ...
salt/modules/vsphere.py
def delete_vm(name, datacenter, placement=None, power_off=False, service_instance=None): ''' Deletes a virtual machine defined by name and placement name Name of the virtual machine datacenter Datacenter of the virtual machine placement Placement information ...
def delete_vm(name, datacenter, placement=None, power_off=False, service_instance=None): ''' Deletes a virtual machine defined by name and placement name Name of the virtual machine datacenter Datacenter of the virtual machine placement Placement information ...
[ "Deletes", "a", "virtual", "machine", "defined", "by", "name", "and", "placement" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9619-L9657
[ "def", "delete_vm", "(", "name", ",", "datacenter", ",", "placement", "=", "None", ",", "power_off", "=", "False", ",", "service_instance", "=", "None", ")", ":", "results", "=", "{", "}", "schema", "=", "ESXVirtualMachineDeleteSchema", ".", "serialize", "("...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_determine_auth
Acquire Azure ARM Credentials
salt/utils/azurearm.py
def _determine_auth(**kwargs): ''' Acquire Azure ARM Credentials ''' if 'profile' in kwargs: azure_credentials = __salt__['config.option'](kwargs['profile']) kwargs.update(azure_credentials) service_principal_creds_kwargs = ['client_id', 'secret', 'tenant'] user_pass_creds_kwarg...
def _determine_auth(**kwargs): ''' Acquire Azure ARM Credentials ''' if 'profile' in kwargs: azure_credentials = __salt__['config.option'](kwargs['profile']) kwargs.update(azure_credentials) service_principal_creds_kwargs = ['client_id', 'secret', 'tenant'] user_pass_creds_kwarg...
[ "Acquire", "Azure", "ARM", "Credentials" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L72-L137
[ "def", "_determine_auth", "(", "*", "*", "kwargs", ")", ":", "if", "'profile'", "in", "kwargs", ":", "azure_credentials", "=", "__salt__", "[", "'config.option'", "]", "(", "kwargs", "[", "'profile'", "]", ")", "kwargs", ".", "update", "(", "azure_credential...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_client
Dynamically load the selected client and return a management client object
salt/utils/azurearm.py
def get_client(client_type, **kwargs): ''' Dynamically load the selected client and return a management client object ''' client_map = {'compute': 'ComputeManagement', 'authorization': 'AuthorizationManagement', 'dns': 'DnsManagement', 'storage': 'St...
def get_client(client_type, **kwargs): ''' Dynamically load the selected client and return a management client object ''' client_map = {'compute': 'ComputeManagement', 'authorization': 'AuthorizationManagement', 'dns': 'DnsManagement', 'storage': 'St...
[ "Dynamically", "load", "the", "selected", "client", "and", "return", "a", "management", "client", "object" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L140-L197
[ "def", "get_client", "(", "client_type", ",", "*", "*", "kwargs", ")", ":", "client_map", "=", "{", "'compute'", ":", "'ComputeManagement'", ",", "'authorization'", ":", "'AuthorizationManagement'", ",", "'dns'", ":", "'DnsManagement'", ",", "'storage'", ":", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
log_cloud_error
Log an azurearm cloud error exception
salt/utils/azurearm.py
def log_cloud_error(client, message, **kwargs): ''' Log an azurearm cloud error exception ''' try: cloud_logger = getattr(log, kwargs.get('azurearm_log_level')) except (AttributeError, TypeError): cloud_logger = getattr(log, 'error') cloud_logger( 'An AzureARM %s CloudE...
def log_cloud_error(client, message, **kwargs): ''' Log an azurearm cloud error exception ''' try: cloud_logger = getattr(log, kwargs.get('azurearm_log_level')) except (AttributeError, TypeError): cloud_logger = getattr(log, 'error') cloud_logger( 'An AzureARM %s CloudE...
[ "Log", "an", "azurearm", "cloud", "error", "exception" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L200-L215
[ "def", "log_cloud_error", "(", "client", ",", "message", ",", "*", "*", "kwargs", ")", ":", "try", ":", "cloud_logger", "=", "getattr", "(", "log", ",", "kwargs", ".", "get", "(", "'azurearm_log_level'", ")", ")", "except", "(", "AttributeError", ",", "T...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
paged_object_to_list
Extract all pages within a paged object as a list of dictionaries
salt/utils/azurearm.py
def paged_object_to_list(paged_object): ''' Extract all pages within a paged object as a list of dictionaries ''' paged_return = [] while True: try: page = next(paged_object) paged_return.append(page.as_dict()) except CloudError: raise exce...
def paged_object_to_list(paged_object): ''' Extract all pages within a paged object as a list of dictionaries ''' paged_return = [] while True: try: page = next(paged_object) paged_return.append(page.as_dict()) except CloudError: raise exce...
[ "Extract", "all", "pages", "within", "a", "paged", "object", "as", "a", "list", "of", "dictionaries" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L218-L232
[ "def", "paged_object_to_list", "(", "paged_object", ")", ":", "paged_return", "=", "[", "]", "while", "True", ":", "try", ":", "page", "=", "next", "(", "paged_object", ")", "paged_return", ".", "append", "(", "page", ".", "as_dict", "(", ")", ")", "exce...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_object_model
Assemble an object from incoming parameters.
salt/utils/azurearm.py
def create_object_model(module_name, object_name, **kwargs): ''' Assemble an object from incoming parameters. ''' object_kwargs = {} try: model_module = importlib.import_module('azure.mgmt.{0}.models'.format(module_name)) # pylint: disable=invalid-name Model = getattr(model_...
def create_object_model(module_name, object_name, **kwargs): ''' Assemble an object from incoming parameters. ''' object_kwargs = {} try: model_module = importlib.import_module('azure.mgmt.{0}.models'.format(module_name)) # pylint: disable=invalid-name Model = getattr(model_...
[ "Assemble", "an", "object", "from", "incoming", "parameters", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L235-L278
[ "def", "create_object_model", "(", "module_name", ",", "object_name", ",", "*", "*", "kwargs", ")", ":", "object_kwargs", "=", "{", "}", "try", ":", "model_module", "=", "importlib", ".", "import_module", "(", "'azure.mgmt.{0}.models'", ".", "format", "(", "mo...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
compare_list_of_dicts
Compare lists of dictionaries representing Azure objects. Only keys found in the "new" dictionaries are compared to the "old" dictionaries, since getting Azure objects from the API returns some read-only data which should not be used in the comparison. A list of parameter names can be passed in order to compare...
salt/utils/azurearm.py
def compare_list_of_dicts(old, new, convert_id_to_name=None): ''' Compare lists of dictionaries representing Azure objects. Only keys found in the "new" dictionaries are compared to the "old" dictionaries, since getting Azure objects from the API returns some read-only data which should not be used in t...
def compare_list_of_dicts(old, new, convert_id_to_name=None): ''' Compare lists of dictionaries representing Azure objects. Only keys found in the "new" dictionaries are compared to the "old" dictionaries, since getting Azure objects from the API returns some read-only data which should not be used in t...
[ "Compare", "lists", "of", "dictionaries", "representing", "Azure", "objects", ".", "Only", "keys", "found", "in", "the", "new", "dictionaries", "are", "compared", "to", "the", "old", "dictionaries", "since", "getting", "Azure", "objects", "from", "the", "API", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L281-L332
[ "def", "compare_list_of_dicts", "(", "old", ",", "new", ",", "convert_id_to_name", "=", "None", ")", ":", "ret", "=", "{", "}", "if", "not", "convert_id_to_name", ":", "convert_id_to_name", "=", "[", "]", "if", "not", "isinstance", "(", "new", ",", "list",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_dependencies
Warn if dependencies aren't met.
salt/cloud/clouds/gce.py
def get_dependencies(): ''' Warn if dependencies aren't met. ''' if LIBCLOUD_IMPORT_ERROR: log.error("Failure when importing LibCloud: ", exc_info=LIBCLOUD_IMPORT_ERROR) log.error("Note: The libcloud dependency is called 'apache-libcloud' on PyPi/pip.") return config.check_driver_dep...
def get_dependencies(): ''' Warn if dependencies aren't met. ''' if LIBCLOUD_IMPORT_ERROR: log.error("Failure when importing LibCloud: ", exc_info=LIBCLOUD_IMPORT_ERROR) log.error("Note: The libcloud dependency is called 'apache-libcloud' on PyPi/pip.") return config.check_driver_dep...
[ "Warn", "if", "dependencies", "aren", "t", "met", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L159-L169
[ "def", "get_dependencies", "(", ")", ":", "if", "LIBCLOUD_IMPORT_ERROR", ":", "log", ".", "error", "(", "\"Failure when importing LibCloud: \"", ",", "exc_info", "=", "LIBCLOUD_IMPORT_ERROR", ")", "log", ".", "error", "(", "\"Note: The libcloud dependency is called 'apach...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_conn
Return a conn object for the passed VM data
salt/cloud/clouds/gce.py
def get_conn(): ''' Return a conn object for the passed VM data ''' driver = get_driver(Provider.GCE) provider = get_configured_provider() project = config.get_cloud_config_value('project', provider, __opts__) email = config.get_cloud_config_value( 'service_account_email_address', ...
def get_conn(): ''' Return a conn object for the passed VM data ''' driver = get_driver(Provider.GCE) provider = get_configured_provider() project = config.get_cloud_config_value('project', provider, __opts__) email = config.get_cloud_config_value( 'service_account_email_address', ...
[ "Return", "a", "conn", "object", "for", "the", "passed", "VM", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L183-L201
[ "def", "get_conn", "(", ")", ":", "driver", "=", "get_driver", "(", "Provider", ".", "GCE", ")", "provider", "=", "get_configured_provider", "(", ")", "project", "=", "config", ".", "get_cloud_config_value", "(", "'project'", ",", "provider", ",", "__opts__", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_expand_node
Convert the libcloud Node object into something more serializable.
salt/cloud/clouds/gce.py
def _expand_node(node): ''' Convert the libcloud Node object into something more serializable. ''' ret = {} ret.update(node.__dict__) try: del ret['extra']['boot_disk'] except Exception: # pylint: disable=W0703 pass zone = ret['extra']['zone'] ret['extra']['zone'] = ...
def _expand_node(node): ''' Convert the libcloud Node object into something more serializable. ''' ret = {} ret.update(node.__dict__) try: del ret['extra']['boot_disk'] except Exception: # pylint: disable=W0703 pass zone = ret['extra']['zone'] ret['extra']['zone'] = ...
[ "Convert", "the", "libcloud", "Node", "object", "into", "something", "more", "serializable", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L213-L233
[ "def", "_expand_node", "(", "node", ")", ":", "ret", "=", "{", "}", "ret", ".", "update", "(", "node", ".", "__dict__", ")", "try", ":", "del", "ret", "[", "'extra'", "]", "[", "'boot_disk'", "]", "except", "Exception", ":", "# pylint: disable=W0703", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_expand_disk
Convert the libcloud Volume object into something more serializable.
salt/cloud/clouds/gce.py
def _expand_disk(disk): ''' Convert the libcloud Volume object into something more serializable. ''' ret = {} ret.update(disk.__dict__) zone = ret['extra']['zone'] ret['extra']['zone'] = {} ret['extra']['zone'].update(zone.__dict__) return ret
def _expand_disk(disk): ''' Convert the libcloud Volume object into something more serializable. ''' ret = {} ret.update(disk.__dict__) zone = ret['extra']['zone'] ret['extra']['zone'] = {} ret['extra']['zone'].update(zone.__dict__) return ret
[ "Convert", "the", "libcloud", "Volume", "object", "into", "something", "more", "serializable", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L236-L245
[ "def", "_expand_disk", "(", "disk", ")", ":", "ret", "=", "{", "}", "ret", ".", "update", "(", "disk", ".", "__dict__", ")", "zone", "=", "ret", "[", "'extra'", "]", "[", "'zone'", "]", "ret", "[", "'extra'", "]", "[", "'zone'", "]", "=", "{", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_expand_address
Convert the libcloud GCEAddress object into something more serializable.
salt/cloud/clouds/gce.py
def _expand_address(addy): ''' Convert the libcloud GCEAddress object into something more serializable. ''' ret = {} ret.update(addy.__dict__) ret['extra']['zone'] = addy.region.name return ret
def _expand_address(addy): ''' Convert the libcloud GCEAddress object into something more serializable. ''' ret = {} ret.update(addy.__dict__) ret['extra']['zone'] = addy.region.name return ret
[ "Convert", "the", "libcloud", "GCEAddress", "object", "into", "something", "more", "serializable", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L248-L255
[ "def", "_expand_address", "(", "addy", ")", ":", "ret", "=", "{", "}", "ret", ".", "update", "(", "addy", ".", "__dict__", ")", "ret", "[", "'extra'", "]", "[", "'zone'", "]", "=", "addy", ".", "region", ".", "name", "return", "ret" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_expand_balancer
Convert the libcloud load-balancer object into something more serializable.
salt/cloud/clouds/gce.py
def _expand_balancer(lb): ''' Convert the libcloud load-balancer object into something more serializable. ''' ret = {} ret.update(lb.__dict__) hc = ret['extra']['healthchecks'] ret['extra']['healthchecks'] = [] for item in hc: ret['extra']['healthchecks'].append(_expand_item(item...
def _expand_balancer(lb): ''' Convert the libcloud load-balancer object into something more serializable. ''' ret = {} ret.update(lb.__dict__) hc = ret['extra']['healthchecks'] ret['extra']['healthchecks'] = [] for item in hc: ret['extra']['healthchecks'].append(_expand_item(item...
[ "Convert", "the", "libcloud", "load", "-", "balancer", "object", "into", "something", "more", "serializable", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L264-L301
[ "def", "_expand_balancer", "(", "lb", ")", ":", "ret", "=", "{", "}", "ret", ".", "update", "(", "lb", ".", "__dict__", ")", "hc", "=", "ret", "[", "'extra'", "]", "[", "'healthchecks'", "]", "ret", "[", "'extra'", "]", "[", "'healthchecks'", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_instance
Show the details of the existing instance.
salt/cloud/clouds/gce.py
def show_instance(vm_name, call=None): ''' Show the details of the existing instance. ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) conn = get_conn() node = _expand_node(conn.ex_get_node(vm_name)) ...
def show_instance(vm_name, call=None): ''' Show the details of the existing instance. ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) conn = get_conn() node = _expand_node(conn.ex_get_node(vm_name)) ...
[ "Show", "the", "details", "of", "the", "existing", "instance", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L304-L315
[ "def", "show_instance", "(", "vm_name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_instance action must be called with -a or --action.'", ")", "conn", "=", "get_conn", "(", ")", "node", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_sizes
Return a dict of available instances sizes (a.k.a machine types) and convert them to something more serializable.
salt/cloud/clouds/gce.py
def avail_sizes(conn=None): ''' Return a dict of available instances sizes (a.k.a machine types) and convert them to something more serializable. ''' if not conn: conn = get_conn() raw_sizes = conn.list_sizes('all') # get *all* the machine types! sizes = [] for size in raw_sizes...
def avail_sizes(conn=None): ''' Return a dict of available instances sizes (a.k.a machine types) and convert them to something more serializable. ''' if not conn: conn = get_conn() raw_sizes = conn.list_sizes('all') # get *all* the machine types! sizes = [] for size in raw_sizes...
[ "Return", "a", "dict", "of", "available", "instances", "sizes", "(", "a", ".", "k", ".", "a", "machine", "types", ")", "and", "convert", "them", "to", "something", "more", "serializable", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L318-L334
[ "def", "avail_sizes", "(", "conn", "=", "None", ")", ":", "if", "not", "conn", ":", "conn", "=", "get_conn", "(", ")", "raw_sizes", "=", "conn", ".", "list_sizes", "(", "'all'", ")", "# get *all* the machine types!", "sizes", "=", "[", "]", "for", "size"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_images
Return a dict of all available VM images on the cloud provider with relevant data. Note that for GCE, there are custom images within the project, but the generic images are in other projects. This returns a dict of images in the project plus images in well-known public projects that provide supported ...
salt/cloud/clouds/gce.py
def avail_images(conn=None): ''' Return a dict of all available VM images on the cloud provider with relevant data. Note that for GCE, there are custom images within the project, but the generic images are in other projects. This returns a dict of images in the project plus images in well-know...
def avail_images(conn=None): ''' Return a dict of all available VM images on the cloud provider with relevant data. Note that for GCE, there are custom images within the project, but the generic images are in other projects. This returns a dict of images in the project plus images in well-know...
[ "Return", "a", "dict", "of", "all", "available", "VM", "images", "on", "the", "cloud", "provider", "with", "relevant", "data", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L337-L376
[ "def", "avail_images", "(", "conn", "=", "None", ")", ":", "if", "not", "conn", ":", "conn", "=", "get_conn", "(", ")", "all_images", "=", "[", "]", "# The list of public image projects can be found via:", "# % gcloud compute images list", "# and looking at the \"PROJ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__get_image
The get_image for GCE allows partial name matching and returns a libcloud object.
salt/cloud/clouds/gce.py
def __get_image(conn, vm_): ''' The get_image for GCE allows partial name matching and returns a libcloud object. ''' img = config.get_cloud_config_value( 'image', vm_, __opts__, default='debian-7', search_global=False) return conn.ex_get_image(img)
def __get_image(conn, vm_): ''' The get_image for GCE allows partial name matching and returns a libcloud object. ''' img = config.get_cloud_config_value( 'image', vm_, __opts__, default='debian-7', search_global=False) return conn.ex_get_image(img)
[ "The", "get_image", "for", "GCE", "allows", "partial", "name", "matching", "and", "returns", "a", "libcloud", "object", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L379-L386
[ "def", "__get_image", "(", "conn", ",", "vm_", ")", ":", "img", "=", "config", ".", "get_cloud_config_value", "(", "'image'", ",", "vm_", ",", "__opts__", ",", "default", "=", "'debian-7'", ",", "search_global", "=", "False", ")", "return", "conn", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__get_location
Need to override libcloud to find the zone.
salt/cloud/clouds/gce.py
def __get_location(conn, vm_): ''' Need to override libcloud to find the zone. ''' location = config.get_cloud_config_value( 'location', vm_, __opts__) return conn.ex_get_zone(location)
def __get_location(conn, vm_): ''' Need to override libcloud to find the zone. ''' location = config.get_cloud_config_value( 'location', vm_, __opts__) return conn.ex_get_zone(location)
[ "Need", "to", "override", "libcloud", "to", "find", "the", "zone", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L389-L395
[ "def", "__get_location", "(", "conn", ",", "vm_", ")", ":", "location", "=", "config", ".", "get_cloud_config_value", "(", "'location'", ",", "vm_", ",", "__opts__", ")", "return", "conn", ".", "ex_get_zone", "(", "location", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__get_size
Need to override libcloud to find the machine type in the proper zone.
salt/cloud/clouds/gce.py
def __get_size(conn, vm_): ''' Need to override libcloud to find the machine type in the proper zone. ''' size = config.get_cloud_config_value( 'size', vm_, __opts__, default='n1-standard-1', search_global=False) return conn.ex_get_size(size, __get_location(conn, vm_))
def __get_size(conn, vm_): ''' Need to override libcloud to find the machine type in the proper zone. ''' size = config.get_cloud_config_value( 'size', vm_, __opts__, default='n1-standard-1', search_global=False) return conn.ex_get_size(size, __get_location(conn, vm_))
[ "Need", "to", "override", "libcloud", "to", "find", "the", "machine", "type", "in", "the", "proper", "zone", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L398-L404
[ "def", "__get_size", "(", "conn", ",", "vm_", ")", ":", "size", "=", "config", ".", "get_cloud_config_value", "(", "'size'", ",", "vm_", ",", "__opts__", ",", "default", "=", "'n1-standard-1'", ",", "search_global", "=", "False", ")", "return", "conn", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__get_tags
Get configured tags.
salt/cloud/clouds/gce.py
def __get_tags(vm_): ''' Get configured tags. ''' t = config.get_cloud_config_value( 'tags', vm_, __opts__, default='[]', search_global=False) # Consider warning the user that the tags in the cloud profile # could not be interpreted, bad formatting? try: tags = litera...
def __get_tags(vm_): ''' Get configured tags. ''' t = config.get_cloud_config_value( 'tags', vm_, __opts__, default='[]', search_global=False) # Consider warning the user that the tags in the cloud profile # could not be interpreted, bad formatting? try: tags = litera...
[ "Get", "configured", "tags", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L407-L422
[ "def", "__get_tags", "(", "vm_", ")", ":", "t", "=", "config", ".", "get_cloud_config_value", "(", "'tags'", ",", "vm_", ",", "__opts__", ",", "default", "=", "'[]'", ",", "search_global", "=", "False", ")", "# Consider warning the user that the tags in the cloud ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__get_metadata
Get configured metadata and add 'salt-cloud-profile'.
salt/cloud/clouds/gce.py
def __get_metadata(vm_): ''' Get configured metadata and add 'salt-cloud-profile'. ''' md = config.get_cloud_config_value( 'metadata', vm_, __opts__, default='{}', search_global=False) # Consider warning the user that the metadata in the cloud profile # could not be interpreted, ...
def __get_metadata(vm_): ''' Get configured metadata and add 'salt-cloud-profile'. ''' md = config.get_cloud_config_value( 'metadata', vm_, __opts__, default='{}', search_global=False) # Consider warning the user that the metadata in the cloud profile # could not be interpreted, ...
[ "Get", "configured", "metadata", "and", "add", "salt", "-", "cloud", "-", "profile", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L425-L449
[ "def", "__get_metadata", "(", "vm_", ")", ":", "md", "=", "config", ".", "get_cloud_config_value", "(", "'metadata'", ",", "vm_", ",", "__opts__", ",", "default", "=", "'{}'", ",", "search_global", "=", "False", ")", "# Consider warning the user that the metadata ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__get_host
Return public IP, private IP, or hostname for the libcloud 'node' object
salt/cloud/clouds/gce.py
def __get_host(node, vm_): ''' Return public IP, private IP, or hostname for the libcloud 'node' object ''' if __get_ssh_interface(vm_) == 'private_ips' or vm_['external_ip'] is None: ip_address = node.private_ips[0] log.info('Salt node data. Private_ip: %s', ip_address) else: ...
def __get_host(node, vm_): ''' Return public IP, private IP, or hostname for the libcloud 'node' object ''' if __get_ssh_interface(vm_) == 'private_ips' or vm_['external_ip'] is None: ip_address = node.private_ips[0] log.info('Salt node data. Private_ip: %s', ip_address) else: ...
[ "Return", "public", "IP", "private", "IP", "or", "hostname", "for", "the", "libcloud", "node", "object" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L452-L466
[ "def", "__get_host", "(", "node", ",", "vm_", ")", ":", "if", "__get_ssh_interface", "(", "vm_", ")", "==", "'private_ips'", "or", "vm_", "[", "'external_ip'", "]", "is", "None", ":", "ip_address", "=", "node", ".", "private_ips", "[", "0", "]", "log", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__get_network
Return a GCE libcloud network object with matching name
salt/cloud/clouds/gce.py
def __get_network(conn, vm_): ''' Return a GCE libcloud network object with matching name ''' network = config.get_cloud_config_value( 'network', vm_, __opts__, default='default', search_global=False) return conn.ex_get_network(network)
def __get_network(conn, vm_): ''' Return a GCE libcloud network object with matching name ''' network = config.get_cloud_config_value( 'network', vm_, __opts__, default='default', search_global=False) return conn.ex_get_network(network)
[ "Return", "a", "GCE", "libcloud", "network", "object", "with", "matching", "name" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L469-L476
[ "def", "__get_network", "(", "conn", ",", "vm_", ")", ":", "network", "=", "config", ".", "get_cloud_config_value", "(", "'network'", ",", "vm_", ",", "__opts__", ",", "default", "=", "'default'", ",", "search_global", "=", "False", ")", "return", "conn", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__get_subnetwork
Get configured subnetwork.
salt/cloud/clouds/gce.py
def __get_subnetwork(vm_): ''' Get configured subnetwork. ''' ex_subnetwork = config.get_cloud_config_value( 'subnetwork', vm_, __opts__, search_global=False) return ex_subnetwork
def __get_subnetwork(vm_): ''' Get configured subnetwork. ''' ex_subnetwork = config.get_cloud_config_value( 'subnetwork', vm_, __opts__, search_global=False) return ex_subnetwork
[ "Get", "configured", "subnetwork", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L479-L487
[ "def", "__get_subnetwork", "(", "vm_", ")", ":", "ex_subnetwork", "=", "config", ".", "get_cloud_config_value", "(", "'subnetwork'", ",", "vm_", ",", "__opts__", ",", "search_global", "=", "False", ")", "return", "ex_subnetwork" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__get_region
Return a GCE libcloud region object with matching name.
salt/cloud/clouds/gce.py
def __get_region(conn, vm_): ''' Return a GCE libcloud region object with matching name. ''' location = __get_location(conn, vm_) region = '-'.join(location.name.split('-')[:2]) return conn.ex_get_region(region)
def __get_region(conn, vm_): ''' Return a GCE libcloud region object with matching name. ''' location = __get_location(conn, vm_) region = '-'.join(location.name.split('-')[:2]) return conn.ex_get_region(region)
[ "Return", "a", "GCE", "libcloud", "region", "object", "with", "matching", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L490-L497
[ "def", "__get_region", "(", "conn", ",", "vm_", ")", ":", "location", "=", "__get_location", "(", "conn", ",", "vm_", ")", "region", "=", "'-'", ".", "join", "(", "location", ".", "name", ".", "split", "(", "'-'", ")", "[", ":", "2", "]", ")", "r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__create_orget_address
Reuse or create a static IP address. Returns a native GCEAddress construct to use with libcloud.
salt/cloud/clouds/gce.py
def __create_orget_address(conn, name, region): ''' Reuse or create a static IP address. Returns a native GCEAddress construct to use with libcloud. ''' try: addy = conn.ex_get_address(name, region) except ResourceNotFoundError: # pylint: disable=W0703 addr_kwargs = { ...
def __create_orget_address(conn, name, region): ''' Reuse or create a static IP address. Returns a native GCEAddress construct to use with libcloud. ''' try: addy = conn.ex_get_address(name, region) except ResourceNotFoundError: # pylint: disable=W0703 addr_kwargs = { ...
[ "Reuse", "or", "create", "a", "static", "IP", "address", ".", "Returns", "a", "native", "GCEAddress", "construct", "to", "use", "with", "libcloud", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L511-L526
[ "def", "__create_orget_address", "(", "conn", ",", "name", ",", "region", ")", ":", "try", ":", "addy", "=", "conn", ".", "ex_get_address", "(", "name", ",", "region", ")", "except", "ResourceNotFoundError", ":", "# pylint: disable=W0703", "addr_kwargs", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_allow
Convert firewall rule allowed user-string to specified REST API format.
salt/cloud/clouds/gce.py
def _parse_allow(allow): ''' Convert firewall rule allowed user-string to specified REST API format. ''' # input=> tcp:53,tcp:80,tcp:443,icmp,tcp:4201,udp:53 # output<= [ # {"IPProtocol": "tcp", "ports": ["53","80","443","4201"]}, # {"IPProtocol": "icmp"}, # {"IPProtocol": "u...
def _parse_allow(allow): ''' Convert firewall rule allowed user-string to specified REST API format. ''' # input=> tcp:53,tcp:80,tcp:443,icmp,tcp:4201,udp:53 # output<= [ # {"IPProtocol": "tcp", "ports": ["53","80","443","4201"]}, # {"IPProtocol": "icmp"}, # {"IPProtocol": "u...
[ "Convert", "firewall", "rule", "allowed", "user", "-", "string", "to", "specified", "REST", "API", "format", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L529-L563
[ "def", "_parse_allow", "(", "allow", ")", ":", "# input=> tcp:53,tcp:80,tcp:443,icmp,tcp:4201,udp:53", "# output<= [", "# {\"IPProtocol\": \"tcp\", \"ports\": [\"53\",\"80\",\"443\",\"4201\"]},", "# {\"IPProtocol\": \"icmp\"},", "# {\"IPProtocol\": \"udp\", \"ports\": [\"53\"]},", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__get_ssh_credentials
Get configured SSH credentials.
salt/cloud/clouds/gce.py
def __get_ssh_credentials(vm_): ''' Get configured SSH credentials. ''' ssh_user = config.get_cloud_config_value( 'ssh_username', vm_, __opts__, default=os.getenv('USER')) ssh_key = config.get_cloud_config_value( 'ssh_keyfile', vm_, __opts__, default=os.path.expanduser('~/.ss...
def __get_ssh_credentials(vm_): ''' Get configured SSH credentials. ''' ssh_user = config.get_cloud_config_value( 'ssh_username', vm_, __opts__, default=os.getenv('USER')) ssh_key = config.get_cloud_config_value( 'ssh_keyfile', vm_, __opts__, default=os.path.expanduser('~/.ss...
[ "Get", "configured", "SSH", "credentials", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L566-L575
[ "def", "__get_ssh_credentials", "(", "vm_", ")", ":", "ssh_user", "=", "config", ".", "get_cloud_config_value", "(", "'ssh_username'", ",", "vm_", ",", "__opts__", ",", "default", "=", "os", ".", "getenv", "(", "'USER'", ")", ")", "ssh_key", "=", "config", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_network
... versionchanged:: 2017.7.0 Create a GCE network. Must specify name and cidr. CLI Example: .. code-block:: bash salt-cloud -f create_network gce name=mynet cidr=10.10.10.0/24 mode=legacy description=optional salt-cloud -f create_network gce name=mynet description=optional
salt/cloud/clouds/gce.py
def create_network(kwargs=None, call=None): ''' ... versionchanged:: 2017.7.0 Create a GCE network. Must specify name and cidr. CLI Example: .. code-block:: bash salt-cloud -f create_network gce name=mynet cidr=10.10.10.0/24 mode=legacy description=optional salt-cloud -f create_ne...
def create_network(kwargs=None, call=None): ''' ... versionchanged:: 2017.7.0 Create a GCE network. Must specify name and cidr. CLI Example: .. code-block:: bash salt-cloud -f create_network gce name=mynet cidr=10.10.10.0/24 mode=legacy description=optional salt-cloud -f create_ne...
[ "...", "versionchanged", "::", "2017", ".", "7", ".", "0", "Create", "a", "GCE", "network", ".", "Must", "specify", "name", "and", "cidr", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L578-L642
[ "def", "create_network", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The create_network function must be called with -f or --function.'", ")", "if", "not", "kwargs", "o...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_network
Permanently delete a network. CLI Example: .. code-block:: bash salt-cloud -f delete_network gce name=mynet
salt/cloud/clouds/gce.py
def delete_network(kwargs=None, call=None): ''' Permanently delete a network. CLI Example: .. code-block:: bash salt-cloud -f delete_network gce name=mynet ''' if call != 'function': raise SaltCloudSystemExit( 'The delete_network function must be called with -f or ...
def delete_network(kwargs=None, call=None): ''' Permanently delete a network. CLI Example: .. code-block:: bash salt-cloud -f delete_network gce name=mynet ''' if call != 'function': raise SaltCloudSystemExit( 'The delete_network function must be called with -f or ...
[ "Permanently", "delete", "a", "network", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L645-L701
[ "def", "delete_network", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The delete_network function must be called with -f or --function.'", ")", "if", "not", "kwargs", "o...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_network
Show the details of an existing network. CLI Example: .. code-block:: bash salt-cloud -f show_network gce name=mynet
salt/cloud/clouds/gce.py
def show_network(kwargs=None, call=None): ''' Show the details of an existing network. CLI Example: .. code-block:: bash salt-cloud -f show_network gce name=mynet ''' if call != 'function': raise SaltCloudSystemExit( 'The show_network function must be called with -...
def show_network(kwargs=None, call=None): ''' Show the details of an existing network. CLI Example: .. code-block:: bash salt-cloud -f show_network gce name=mynet ''' if call != 'function': raise SaltCloudSystemExit( 'The show_network function must be called with -...
[ "Show", "the", "details", "of", "an", "existing", "network", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L704-L725
[ "def", "show_network", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_network function must be called with -f or --function.'", ")", "if", "not", "kwargs", "or", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_subnetwork
... versionadded:: 2017.7.0 Create a GCE Subnetwork. Must specify name, cidr, network, and region. CLI Example: .. code-block:: bash salt-cloud -f create_subnetwork gce name=mysubnet network=mynet1 region=us-west1 cidr=10.0.0.0/24 description=optional
salt/cloud/clouds/gce.py
def create_subnetwork(kwargs=None, call=None): ''' ... versionadded:: 2017.7.0 Create a GCE Subnetwork. Must specify name, cidr, network, and region. CLI Example: .. code-block:: bash salt-cloud -f create_subnetwork gce name=mysubnet network=mynet1 region=us-west1 cidr=10.0.0.0/24 descrip...
def create_subnetwork(kwargs=None, call=None): ''' ... versionadded:: 2017.7.0 Create a GCE Subnetwork. Must specify name, cidr, network, and region. CLI Example: .. code-block:: bash salt-cloud -f create_subnetwork gce name=mysubnet network=mynet1 region=us-west1 cidr=10.0.0.0/24 descrip...
[ "...", "versionadded", "::", "2017", ".", "7", ".", "0", "Create", "a", "GCE", "Subnetwork", ".", "Must", "specify", "name", "cidr", "network", "and", "region", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L728-L807
[ "def", "create_subnetwork", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The create_subnetwork function must be called with -f or --function.'", ")", "if", "not", "kwargs"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_subnetwork
... versionadded:: 2017.7.0 Delete a GCE Subnetwork. Must specify name and region. CLI Example: .. code-block:: bash salt-cloud -f delete_subnetwork gce name=mysubnet network=mynet1 region=us-west1
salt/cloud/clouds/gce.py
def delete_subnetwork(kwargs=None, call=None): ''' ... versionadded:: 2017.7.0 Delete a GCE Subnetwork. Must specify name and region. CLI Example: .. code-block:: bash salt-cloud -f delete_subnetwork gce name=mysubnet network=mynet1 region=us-west1 ''' if call != 'function': ...
def delete_subnetwork(kwargs=None, call=None): ''' ... versionadded:: 2017.7.0 Delete a GCE Subnetwork. Must specify name and region. CLI Example: .. code-block:: bash salt-cloud -f delete_subnetwork gce name=mysubnet network=mynet1 region=us-west1 ''' if call != 'function': ...
[ "...", "versionadded", "::", "2017", ".", "7", ".", "0", "Delete", "a", "GCE", "Subnetwork", ".", "Must", "specify", "name", "and", "region", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L810-L874
[ "def", "delete_subnetwork", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The delete_subnet function must be called with -f or --function.'", ")", "if", "not", "kwargs", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_subnetwork
... versionadded:: 2017.7.0 Show details of an existing GCE Subnetwork. Must specify name and region. CLI Example: .. code-block:: bash salt-cloud -f show_subnetwork gce name=mysubnet region=us-west1
salt/cloud/clouds/gce.py
def show_subnetwork(kwargs=None, call=None): ''' ... versionadded:: 2017.7.0 Show details of an existing GCE Subnetwork. Must specify name and region. CLI Example: .. code-block:: bash salt-cloud -f show_subnetwork gce name=mysubnet region=us-west1 ''' if call != 'function': ...
def show_subnetwork(kwargs=None, call=None): ''' ... versionadded:: 2017.7.0 Show details of an existing GCE Subnetwork. Must specify name and region. CLI Example: .. code-block:: bash salt-cloud -f show_subnetwork gce name=mysubnet region=us-west1 ''' if call != 'function': ...
[ "...", "versionadded", "::", "2017", ".", "7", ".", "0", "Show", "details", "of", "an", "existing", "GCE", "Subnetwork", ".", "Must", "specify", "name", "and", "region", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L877-L909
[ "def", "show_subnetwork", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_subnetwork function must be called with -f or --function.'", ")", "if", "not", "kwargs", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_fwrule
Create a GCE firewall rule. The 'default' network is used if not specified. CLI Example: .. code-block:: bash salt-cloud -f create_fwrule gce name=allow-http allow=tcp:80
salt/cloud/clouds/gce.py
def create_fwrule(kwargs=None, call=None): ''' Create a GCE firewall rule. The 'default' network is used if not specified. CLI Example: .. code-block:: bash salt-cloud -f create_fwrule gce name=allow-http allow=tcp:80 ''' if call != 'function': raise SaltCloudSystemExit( ...
def create_fwrule(kwargs=None, call=None): ''' Create a GCE firewall rule. The 'default' network is used if not specified. CLI Example: .. code-block:: bash salt-cloud -f create_fwrule gce name=allow-http allow=tcp:80 ''' if call != 'function': raise SaltCloudSystemExit( ...
[ "Create", "a", "GCE", "firewall", "rule", ".", "The", "default", "network", "is", "used", "if", "not", "specified", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L912-L986
[ "def", "create_fwrule", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The create_fwrule function must be called with -f or --function.'", ")", "if", "not", "kwargs", "or"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_fwrule
Permanently delete a firewall rule. CLI Example: .. code-block:: bash salt-cloud -f delete_fwrule gce name=allow-http
salt/cloud/clouds/gce.py
def delete_fwrule(kwargs=None, call=None): ''' Permanently delete a firewall rule. CLI Example: .. code-block:: bash salt-cloud -f delete_fwrule gce name=allow-http ''' if call != 'function': raise SaltCloudSystemExit( 'The delete_fwrule function must be called wit...
def delete_fwrule(kwargs=None, call=None): ''' Permanently delete a firewall rule. CLI Example: .. code-block:: bash salt-cloud -f delete_fwrule gce name=allow-http ''' if call != 'function': raise SaltCloudSystemExit( 'The delete_fwrule function must be called wit...
[ "Permanently", "delete", "a", "firewall", "rule", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L989-L1045
[ "def", "delete_fwrule", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The delete_fwrule function must be called with -f or --function.'", ")", "if", "not", "kwargs", "or"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_fwrule
Show the details of an existing firewall rule. CLI Example: .. code-block:: bash salt-cloud -f show_fwrule gce name=allow-http
salt/cloud/clouds/gce.py
def show_fwrule(kwargs=None, call=None): ''' Show the details of an existing firewall rule. CLI Example: .. code-block:: bash salt-cloud -f show_fwrule gce name=allow-http ''' if call != 'function': raise SaltCloudSystemExit( 'The show_fwrule function must be calle...
def show_fwrule(kwargs=None, call=None): ''' Show the details of an existing firewall rule. CLI Example: .. code-block:: bash salt-cloud -f show_fwrule gce name=allow-http ''' if call != 'function': raise SaltCloudSystemExit( 'The show_fwrule function must be calle...
[ "Show", "the", "details", "of", "an", "existing", "firewall", "rule", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1048-L1069
[ "def", "show_fwrule", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_fwrule function must be called with -f or --function.'", ")", "if", "not", "kwargs", "or", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_hc
Create an HTTP health check configuration. CLI Example: .. code-block:: bash salt-cloud -f create_hc gce name=hc path=/healthy port=80
salt/cloud/clouds/gce.py
def create_hc(kwargs=None, call=None): ''' Create an HTTP health check configuration. CLI Example: .. code-block:: bash salt-cloud -f create_hc gce name=hc path=/healthy port=80 ''' if call != 'function': raise SaltCloudSystemExit( 'The create_hc function must be c...
def create_hc(kwargs=None, call=None): ''' Create an HTTP health check configuration. CLI Example: .. code-block:: bash salt-cloud -f create_hc gce name=hc path=/healthy port=80 ''' if call != 'function': raise SaltCloudSystemExit( 'The create_hc function must be c...
[ "Create", "an", "HTTP", "health", "check", "configuration", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1072-L1145
[ "def", "create_hc", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The create_hc function must be called with -f or --function.'", ")", "if", "not", "kwargs", "or", "'na...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_hc
Permanently delete a health check. CLI Example: .. code-block:: bash salt-cloud -f delete_hc gce name=hc
salt/cloud/clouds/gce.py
def delete_hc(kwargs=None, call=None): ''' Permanently delete a health check. CLI Example: .. code-block:: bash salt-cloud -f delete_hc gce name=hc ''' if call != 'function': raise SaltCloudSystemExit( 'The delete_hc function must be called with -f or --function.' ...
def delete_hc(kwargs=None, call=None): ''' Permanently delete a health check. CLI Example: .. code-block:: bash salt-cloud -f delete_hc gce name=hc ''' if call != 'function': raise SaltCloudSystemExit( 'The delete_hc function must be called with -f or --function.' ...
[ "Permanently", "delete", "a", "health", "check", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1148-L1204
[ "def", "delete_hc", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The delete_hc function must be called with -f or --function.'", ")", "if", "not", "kwargs", "or", "'na...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_hc
Show the details of an existing health check. CLI Example: .. code-block:: bash salt-cloud -f show_hc gce name=hc
salt/cloud/clouds/gce.py
def show_hc(kwargs=None, call=None): ''' Show the details of an existing health check. CLI Example: .. code-block:: bash salt-cloud -f show_hc gce name=hc ''' if call != 'function': raise SaltCloudSystemExit( 'The show_hc function must be called with -f or --functi...
def show_hc(kwargs=None, call=None): ''' Show the details of an existing health check. CLI Example: .. code-block:: bash salt-cloud -f show_hc gce name=hc ''' if call != 'function': raise SaltCloudSystemExit( 'The show_hc function must be called with -f or --functi...
[ "Show", "the", "details", "of", "an", "existing", "health", "check", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1207-L1228
[ "def", "show_hc", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_hc function must be called with -f or --function.'", ")", "if", "not", "kwargs", "or", "'name'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_address
Create a static address in a region. CLI Example: .. code-block:: bash salt-cloud -f create_address gce name=my-ip region=us-central1 address=IP
salt/cloud/clouds/gce.py
def create_address(kwargs=None, call=None): ''' Create a static address in a region. CLI Example: .. code-block:: bash salt-cloud -f create_address gce name=my-ip region=us-central1 address=IP ''' if call != 'function': raise SaltCloudSystemExit( 'The create_addres...
def create_address(kwargs=None, call=None): ''' Create a static address in a region. CLI Example: .. code-block:: bash salt-cloud -f create_address gce name=my-ip region=us-central1 address=IP ''' if call != 'function': raise SaltCloudSystemExit( 'The create_addres...
[ "Create", "a", "static", "address", "in", "a", "region", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1231-L1286
[ "def", "create_address", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The create_address function must be called with -f or --function.'", ")", "if", "not", "kwargs", "o...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_address
Permanently delete a static address. CLI Example: .. code-block:: bash salt-cloud -f delete_address gce name=my-ip
salt/cloud/clouds/gce.py
def delete_address(kwargs=None, call=None): ''' Permanently delete a static address. CLI Example: .. code-block:: bash salt-cloud -f delete_address gce name=my-ip ''' if call != 'function': raise SaltCloudSystemExit( 'The delete_address function must be called with...
def delete_address(kwargs=None, call=None): ''' Permanently delete a static address. CLI Example: .. code-block:: bash salt-cloud -f delete_address gce name=my-ip ''' if call != 'function': raise SaltCloudSystemExit( 'The delete_address function must be called with...
[ "Permanently", "delete", "a", "static", "address", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1289-L1356
[ "def", "delete_address", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The delete_address function must be called with -f or --function.'", ")", "if", "not", "kwargs", "o...
e8541fd6e744ab0df786c0f76102e41631f45d46