repo
stringlengths
7
55
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
19
28.4k
docstring
stringlengths
1
46.9k
docstring_tokens
listlengths
1
1.97k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
saltstack/salt
salt/utils/vmware.py
get_dvss
def get_dvss(dc_ref, dvs_names=None, get_all_dvss=False): ''' Returns distributed virtual switches (DVSs) in a datacenter. dc_ref The parent datacenter reference. dvs_names The names of the DVSs to return. Default is None. get_all_dvss Return all DVSs in the datacenter. De...
python
def get_dvss(dc_ref, dvs_names=None, get_all_dvss=False): ''' Returns distributed virtual switches (DVSs) in a datacenter. dc_ref The parent datacenter reference. dvs_names The names of the DVSs to return. Default is None. get_all_dvss Return all DVSs in the datacenter. De...
[ "def", "get_dvss", "(", "dc_ref", ",", "dvs_names", "=", "None", ",", "get_all_dvss", "=", "False", ")", ":", "dc_name", "=", "get_managed_object_name", "(", "dc_ref", ")", "log", ".", "trace", "(", "'Retrieving DVSs in datacenter \\'%s\\', dvs_names=\\'%s\\', get_all...
Returns distributed virtual switches (DVSs) in a datacenter. dc_ref The parent datacenter reference. dvs_names The names of the DVSs to return. Default is None. get_all_dvss Return all DVSs in the datacenter. Default is False.
[ "Returns", "distributed", "virtual", "switches", "(", "DVSs", ")", "in", "a", "datacenter", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1053-L1090
train
saltstack/salt
salt/utils/vmware.py
get_network_folder
def get_network_folder(dc_ref): ''' Retrieves the network folder of a datacenter ''' dc_name = get_managed_object_name(dc_ref) log.trace('Retrieving network folder in datacenter \'%s\'', dc_name) service_instance = get_service_instance_from_managed_object(dc_ref) traversal_spec = vmodl.query...
python
def get_network_folder(dc_ref): ''' Retrieves the network folder of a datacenter ''' dc_name = get_managed_object_name(dc_ref) log.trace('Retrieving network folder in datacenter \'%s\'', dc_name) service_instance = get_service_instance_from_managed_object(dc_ref) traversal_spec = vmodl.query...
[ "def", "get_network_folder", "(", "dc_ref", ")", ":", "dc_name", "=", "get_managed_object_name", "(", "dc_ref", ")", "log", ".", "trace", "(", "'Retrieving network folder in datacenter \\'%s\\''", ",", "dc_name", ")", "service_instance", "=", "get_service_instance_from_ma...
Retrieves the network folder of a datacenter
[ "Retrieves", "the", "network", "folder", "of", "a", "datacenter" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1093-L1113
train
saltstack/salt
salt/utils/vmware.py
create_dvs
def create_dvs(dc_ref, dvs_name, dvs_create_spec=None): ''' Creates a distributed virtual switches (DVS) in a datacenter. Returns the reference to the newly created distributed virtual switch. dc_ref The parent datacenter reference. dvs_name The name of the DVS to create. dvs_...
python
def create_dvs(dc_ref, dvs_name, dvs_create_spec=None): ''' Creates a distributed virtual switches (DVS) in a datacenter. Returns the reference to the newly created distributed virtual switch. dc_ref The parent datacenter reference. dvs_name The name of the DVS to create. dvs_...
[ "def", "create_dvs", "(", "dc_ref", ",", "dvs_name", ",", "dvs_create_spec", "=", "None", ")", ":", "dc_name", "=", "get_managed_object_name", "(", "dc_ref", ")", "log", ".", "trace", "(", "'Creating DVS \\'%s\\' in datacenter \\'%s\\''", ",", "dvs_name", ",", "dc...
Creates a distributed virtual switches (DVS) in a datacenter. Returns the reference to the newly created distributed virtual switch. dc_ref The parent datacenter reference. dvs_name The name of the DVS to create. dvs_create_spec The DVS spec (vim.DVSCreateSpec) to use when cre...
[ "Creates", "a", "distributed", "virtual", "switches", "(", "DVS", ")", "in", "a", "datacenter", ".", "Returns", "the", "reference", "to", "the", "newly", "created", "distributed", "virtual", "switch", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1116-L1152
train
saltstack/salt
salt/utils/vmware.py
update_dvs
def update_dvs(dvs_ref, dvs_config_spec): ''' Updates a distributed virtual switch with the config_spec. dvs_ref The DVS reference. dvs_config_spec The updated config spec (vim.VMwareDVSConfigSpec) to be applied to the DVS. ''' dvs_name = get_managed_object_name(dvs_ref...
python
def update_dvs(dvs_ref, dvs_config_spec): ''' Updates a distributed virtual switch with the config_spec. dvs_ref The DVS reference. dvs_config_spec The updated config spec (vim.VMwareDVSConfigSpec) to be applied to the DVS. ''' dvs_name = get_managed_object_name(dvs_ref...
[ "def", "update_dvs", "(", "dvs_ref", ",", "dvs_config_spec", ")", ":", "dvs_name", "=", "get_managed_object_name", "(", "dvs_ref", ")", "log", ".", "trace", "(", "'Updating dvs \\'%s\\''", ",", "dvs_name", ")", "try", ":", "task", "=", "dvs_ref", ".", "Reconfi...
Updates a distributed virtual switch with the config_spec. dvs_ref The DVS reference. dvs_config_spec The updated config spec (vim.VMwareDVSConfigSpec) to be applied to the DVS.
[ "Updates", "a", "distributed", "virtual", "switch", "with", "the", "config_spec", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1155-L1181
train
saltstack/salt
salt/utils/vmware.py
set_dvs_network_resource_management_enabled
def set_dvs_network_resource_management_enabled(dvs_ref, enabled): ''' Sets whether NIOC is enabled on a DVS. dvs_ref The DVS reference. enabled Flag specifying whether NIOC is enabled. ''' dvs_name = get_managed_object_name(dvs_ref) log.trace('Setting network resource mana...
python
def set_dvs_network_resource_management_enabled(dvs_ref, enabled): ''' Sets whether NIOC is enabled on a DVS. dvs_ref The DVS reference. enabled Flag specifying whether NIOC is enabled. ''' dvs_name = get_managed_object_name(dvs_ref) log.trace('Setting network resource mana...
[ "def", "set_dvs_network_resource_management_enabled", "(", "dvs_ref", ",", "enabled", ")", ":", "dvs_name", "=", "get_managed_object_name", "(", "dvs_ref", ")", "log", ".", "trace", "(", "'Setting network resource management enable to %s on '", "'dvs \\'%s\\''", ",", "enabl...
Sets whether NIOC is enabled on a DVS. dvs_ref The DVS reference. enabled Flag specifying whether NIOC is enabled.
[ "Sets", "whether", "NIOC", "is", "enabled", "on", "a", "DVS", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1184-L1209
train
saltstack/salt
salt/utils/vmware.py
get_dvportgroups
def get_dvportgroups(parent_ref, portgroup_names=None, get_all_portgroups=False): ''' Returns distributed virtual porgroups (dvportgroups). The parent object can be either a datacenter or a dvs. parent_ref The parent object reference. Can be either a datacenter or a dvs. ...
python
def get_dvportgroups(parent_ref, portgroup_names=None, get_all_portgroups=False): ''' Returns distributed virtual porgroups (dvportgroups). The parent object can be either a datacenter or a dvs. parent_ref The parent object reference. Can be either a datacenter or a dvs. ...
[ "def", "get_dvportgroups", "(", "parent_ref", ",", "portgroup_names", "=", "None", ",", "get_all_portgroups", "=", "False", ")", ":", "if", "not", "(", "isinstance", "(", "parent_ref", ",", "(", "vim", ".", "Datacenter", ",", "vim", ".", "DistributedVirtualSwi...
Returns distributed virtual porgroups (dvportgroups). The parent object can be either a datacenter or a dvs. parent_ref The parent object reference. Can be either a datacenter or a dvs. portgroup_names The names of the dvss to return. Default is None. get_all_portgroups Return...
[ "Returns", "distributed", "virtual", "porgroups", "(", "dvportgroups", ")", ".", "The", "parent", "object", "can", "be", "either", "a", "datacenter", "or", "a", "dvs", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1212-L1264
train
saltstack/salt
salt/utils/vmware.py
get_uplink_dvportgroup
def get_uplink_dvportgroup(dvs_ref): ''' Returns the uplink distributed virtual portgroup of a distributed virtual switch (dvs) dvs_ref The dvs reference ''' dvs_name = get_managed_object_name(dvs_ref) log.trace('Retrieving uplink portgroup of dvs \'%s\'', dvs_name) traversal_sp...
python
def get_uplink_dvportgroup(dvs_ref): ''' Returns the uplink distributed virtual portgroup of a distributed virtual switch (dvs) dvs_ref The dvs reference ''' dvs_name = get_managed_object_name(dvs_ref) log.trace('Retrieving uplink portgroup of dvs \'%s\'', dvs_name) traversal_sp...
[ "def", "get_uplink_dvportgroup", "(", "dvs_ref", ")", ":", "dvs_name", "=", "get_managed_object_name", "(", "dvs_ref", ")", "log", ".", "trace", "(", "'Retrieving uplink portgroup of dvs \\'%s\\''", ",", "dvs_name", ")", "traversal_spec", "=", "vmodl", ".", "query", ...
Returns the uplink distributed virtual portgroup of a distributed virtual switch (dvs) dvs_ref The dvs reference
[ "Returns", "the", "uplink", "distributed", "virtual", "portgroup", "of", "a", "distributed", "virtual", "switch", "(", "dvs", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1267-L1293
train
saltstack/salt
salt/utils/vmware.py
create_dvportgroup
def create_dvportgroup(dvs_ref, spec): ''' Creates a distributed virtual portgroup on a distributed virtual switch (dvs) dvs_ref The dvs reference spec Portgroup spec (vim.DVPortgroupConfigSpec) ''' dvs_name = get_managed_object_name(dvs_ref) log.trace('Adding portgroup...
python
def create_dvportgroup(dvs_ref, spec): ''' Creates a distributed virtual portgroup on a distributed virtual switch (dvs) dvs_ref The dvs reference spec Portgroup spec (vim.DVPortgroupConfigSpec) ''' dvs_name = get_managed_object_name(dvs_ref) log.trace('Adding portgroup...
[ "def", "create_dvportgroup", "(", "dvs_ref", ",", "spec", ")", ":", "dvs_name", "=", "get_managed_object_name", "(", "dvs_ref", ")", "log", ".", "trace", "(", "'Adding portgroup %s to dvs \\'%s\\''", ",", "spec", ".", "name", ",", "dvs_name", ")", "log", ".", ...
Creates a distributed virtual portgroup on a distributed virtual switch (dvs) dvs_ref The dvs reference spec Portgroup spec (vim.DVPortgroupConfigSpec)
[ "Creates", "a", "distributed", "virtual", "portgroup", "on", "a", "distributed", "virtual", "switch", "(", "dvs", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1296-L1323
train
saltstack/salt
salt/utils/vmware.py
update_dvportgroup
def update_dvportgroup(portgroup_ref, spec): ''' Updates a distributed virtual portgroup portgroup_ref The portgroup reference spec Portgroup spec (vim.DVPortgroupConfigSpec) ''' pg_name = get_managed_object_name(portgroup_ref) log.trace('Updating portgrouo %s', pg_name) ...
python
def update_dvportgroup(portgroup_ref, spec): ''' Updates a distributed virtual portgroup portgroup_ref The portgroup reference spec Portgroup spec (vim.DVPortgroupConfigSpec) ''' pg_name = get_managed_object_name(portgroup_ref) log.trace('Updating portgrouo %s', pg_name) ...
[ "def", "update_dvportgroup", "(", "portgroup_ref", ",", "spec", ")", ":", "pg_name", "=", "get_managed_object_name", "(", "portgroup_ref", ")", "log", ".", "trace", "(", "'Updating portgrouo %s'", ",", "pg_name", ")", "try", ":", "task", "=", "portgroup_ref", "....
Updates a distributed virtual portgroup portgroup_ref The portgroup reference spec Portgroup spec (vim.DVPortgroupConfigSpec)
[ "Updates", "a", "distributed", "virtual", "portgroup" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1326-L1351
train
saltstack/salt
salt/utils/vmware.py
get_networks
def get_networks(parent_ref, network_names=None, get_all_networks=False): ''' Returns networks of standard switches. The parent object can be a datacenter. parent_ref The parent object reference. A datacenter object. network_names The name of the standard switch networks. Default i...
python
def get_networks(parent_ref, network_names=None, get_all_networks=False): ''' Returns networks of standard switches. The parent object can be a datacenter. parent_ref The parent object reference. A datacenter object. network_names The name of the standard switch networks. Default i...
[ "def", "get_networks", "(", "parent_ref", ",", "network_names", "=", "None", ",", "get_all_networks", "=", "False", ")", ":", "if", "not", "isinstance", "(", "parent_ref", ",", "vim", ".", "Datacenter", ")", ":", "raise", "salt", ".", "exceptions", ".", "A...
Returns networks of standard switches. The parent object can be a datacenter. parent_ref The parent object reference. A datacenter object. network_names The name of the standard switch networks. Default is None. get_all_networks Boolean indicates whether to return all networks...
[ "Returns", "networks", "of", "standard", "switches", ".", "The", "parent", "object", "can", "be", "a", "datacenter", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1379-L1423
train
saltstack/salt
salt/utils/vmware.py
list_objects
def list_objects(service_instance, vim_object, properties=None): ''' Returns a simple list of objects from a given service instance. service_instance The Service Instance for which to obtain a list of objects. object_type The type of content for which to obtain information. proper...
python
def list_objects(service_instance, vim_object, properties=None): ''' Returns a simple list of objects from a given service instance. service_instance The Service Instance for which to obtain a list of objects. object_type The type of content for which to obtain information. proper...
[ "def", "list_objects", "(", "service_instance", ",", "vim_object", ",", "properties", "=", "None", ")", ":", "if", "properties", "is", "None", ":", "properties", "=", "[", "'name'", "]", "items", "=", "[", "]", "item_list", "=", "get_mors_with_properties", "...
Returns a simple list of objects from a given service instance. service_instance The Service Instance for which to obtain a list of objects. object_type The type of content for which to obtain information. properties An optional list of object properties used to return reference r...
[ "Returns", "a", "simple", "list", "of", "objects", "from", "a", "given", "service", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1426-L1447
train
saltstack/salt
salt/utils/vmware.py
get_license_manager
def get_license_manager(service_instance): ''' Returns the license manager. service_instance The Service Instance Object from which to obrain the license manager. ''' log.debug('Retrieving license manager') try: lic_manager = service_instance.content.licenseManager except v...
python
def get_license_manager(service_instance): ''' Returns the license manager. service_instance The Service Instance Object from which to obrain the license manager. ''' log.debug('Retrieving license manager') try: lic_manager = service_instance.content.licenseManager except v...
[ "def", "get_license_manager", "(", "service_instance", ")", ":", "log", ".", "debug", "(", "'Retrieving license manager'", ")", "try", ":", "lic_manager", "=", "service_instance", ".", "content", ".", "licenseManager", "except", "vim", ".", "fault", ".", "NoPermis...
Returns the license manager. service_instance The Service Instance Object from which to obrain the license manager.
[ "Returns", "the", "license", "manager", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1450-L1472
train
saltstack/salt
salt/utils/vmware.py
get_license_assignment_manager
def get_license_assignment_manager(service_instance): ''' Returns the license assignment manager. service_instance The Service Instance Object from which to obrain the license manager. ''' log.debug('Retrieving license assignment manager') try: lic_assignment_manager = \ ...
python
def get_license_assignment_manager(service_instance): ''' Returns the license assignment manager. service_instance The Service Instance Object from which to obrain the license manager. ''' log.debug('Retrieving license assignment manager') try: lic_assignment_manager = \ ...
[ "def", "get_license_assignment_manager", "(", "service_instance", ")", ":", "log", ".", "debug", "(", "'Retrieving license assignment manager'", ")", "try", ":", "lic_assignment_manager", "=", "service_instance", ".", "content", ".", "licenseManager", ".", "licenseAssignm...
Returns the license assignment manager. service_instance The Service Instance Object from which to obrain the license manager.
[ "Returns", "the", "license", "assignment", "manager", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1475-L1501
train
saltstack/salt
salt/utils/vmware.py
get_licenses
def get_licenses(service_instance, license_manager=None): ''' Returns the licenses on a specific instance. service_instance The Service Instance Object from which to obrain the licenses. license_manager The License Manager object of the service instance. If not provided it will...
python
def get_licenses(service_instance, license_manager=None): ''' Returns the licenses on a specific instance. service_instance The Service Instance Object from which to obrain the licenses. license_manager The License Manager object of the service instance. If not provided it will...
[ "def", "get_licenses", "(", "service_instance", ",", "license_manager", "=", "None", ")", ":", "if", "not", "license_manager", ":", "license_manager", "=", "get_license_manager", "(", "service_instance", ")", "log", ".", "debug", "(", "'Retrieving licenses'", ")", ...
Returns the licenses on a specific instance. service_instance The Service Instance Object from which to obrain the licenses. license_manager The License Manager object of the service instance. If not provided it will be retrieved.
[ "Returns", "the", "licenses", "on", "a", "specific", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1504-L1531
train
saltstack/salt
salt/utils/vmware.py
add_license
def add_license(service_instance, key, description, license_manager=None): ''' Adds a license. service_instance The Service Instance Object. key The key of the license to add. description The description of the license to add. license_manager The License Manag...
python
def add_license(service_instance, key, description, license_manager=None): ''' Adds a license. service_instance The Service Instance Object. key The key of the license to add. description The description of the license to add. license_manager The License Manag...
[ "def", "add_license", "(", "service_instance", ",", "key", ",", "description", ",", "license_manager", "=", "None", ")", ":", "if", "not", "license_manager", ":", "license_manager", "=", "get_license_manager", "(", "service_instance", ")", "label", "=", "vim", "...
Adds a license. service_instance The Service Instance Object. key The key of the license to add. description The description of the license to add. license_manager The License Manager object of the service instance. If not provided it will be retrieved.
[ "Adds", "a", "license", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1534-L1570
train
saltstack/salt
salt/utils/vmware.py
get_assigned_licenses
def get_assigned_licenses(service_instance, entity_ref=None, entity_name=None, license_assignment_manager=None): ''' Returns the licenses assigned to an entity. If entity ref is not provided, then entity_name is assumed to be the vcenter. This is later checked if the entity nam...
python
def get_assigned_licenses(service_instance, entity_ref=None, entity_name=None, license_assignment_manager=None): ''' Returns the licenses assigned to an entity. If entity ref is not provided, then entity_name is assumed to be the vcenter. This is later checked if the entity nam...
[ "def", "get_assigned_licenses", "(", "service_instance", ",", "entity_ref", "=", "None", ",", "entity_name", "=", "None", ",", "license_assignment_manager", "=", "None", ")", ":", "if", "not", "license_assignment_manager", ":", "license_assignment_manager", "=", "get_...
Returns the licenses assigned to an entity. If entity ref is not provided, then entity_name is assumed to be the vcenter. This is later checked if the entity name is provided. service_instance The Service Instance Object from which to obtain the licenses. entity_ref VMware entity to ge...
[ "Returns", "the", "licenses", "assigned", "to", "an", "entity", ".", "If", "entity", "ref", "is", "not", "provided", "then", "entity_name", "is", "assumed", "to", "be", "the", "vcenter", ".", "This", "is", "later", "checked", "if", "the", "entity", "name",...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1573-L1655
train
saltstack/salt
salt/utils/vmware.py
assign_license
def assign_license(service_instance, license_key, license_name, entity_ref=None, entity_name=None, license_assignment_manager=None): ''' Assigns a license to an entity. service_instance The Service Instance Object from which to obrain the licenses. license...
python
def assign_license(service_instance, license_key, license_name, entity_ref=None, entity_name=None, license_assignment_manager=None): ''' Assigns a license to an entity. service_instance The Service Instance Object from which to obrain the licenses. license...
[ "def", "assign_license", "(", "service_instance", ",", "license_key", ",", "license_name", ",", "entity_ref", "=", "None", ",", "entity_name", "=", "None", ",", "license_assignment_manager", "=", "None", ")", ":", "if", "not", "license_assignment_manager", ":", "l...
Assigns a license to an entity. service_instance The Service Instance Object from which to obrain the licenses. license_key The key of the license to add. license_name The description of the license to add. entity_ref VMware entity to assign the license to. If...
[ "Assigns", "a", "license", "to", "an", "entity", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1658-L1728
train
saltstack/salt
salt/utils/vmware.py
get_datacenters
def get_datacenters(service_instance, datacenter_names=None, get_all_datacenters=False): ''' Returns all datacenters in a vCenter. service_instance The Service Instance Object from which to obtain cluster. datacenter_names List of datacenter names to filter by. Defa...
python
def get_datacenters(service_instance, datacenter_names=None, get_all_datacenters=False): ''' Returns all datacenters in a vCenter. service_instance The Service Instance Object from which to obtain cluster. datacenter_names List of datacenter names to filter by. Defa...
[ "def", "get_datacenters", "(", "service_instance", ",", "datacenter_names", "=", "None", ",", "get_all_datacenters", "=", "False", ")", ":", "items", "=", "[", "i", "[", "'object'", "]", "for", "i", "in", "get_mors_with_properties", "(", "service_instance", ",",...
Returns all datacenters in a vCenter. service_instance The Service Instance Object from which to obtain cluster. datacenter_names List of datacenter names to filter by. Default value is None. get_all_datacenters Flag specifying whether to retrieve all datacenters. Default ...
[ "Returns", "all", "datacenters", "in", "a", "vCenter", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1741-L1762
train
saltstack/salt
salt/utils/vmware.py
get_datacenter
def get_datacenter(service_instance, datacenter_name): ''' Returns a vim.Datacenter managed object. service_instance The Service Instance Object from which to obtain datacenter. datacenter_name The datacenter name ''' items = get_datacenters(service_instance, ...
python
def get_datacenter(service_instance, datacenter_name): ''' Returns a vim.Datacenter managed object. service_instance The Service Instance Object from which to obtain datacenter. datacenter_name The datacenter name ''' items = get_datacenters(service_instance, ...
[ "def", "get_datacenter", "(", "service_instance", ",", "datacenter_name", ")", ":", "items", "=", "get_datacenters", "(", "service_instance", ",", "datacenter_names", "=", "[", "datacenter_name", "]", ")", "if", "not", "items", ":", "raise", "salt", ".", "except...
Returns a vim.Datacenter managed object. service_instance The Service Instance Object from which to obtain datacenter. datacenter_name The datacenter name
[ "Returns", "a", "vim", ".", "Datacenter", "managed", "object", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1765-L1780
train
saltstack/salt
salt/utils/vmware.py
create_datacenter
def create_datacenter(service_instance, datacenter_name): ''' Creates a datacenter. .. versionadded:: 2017.7.0 service_instance The Service Instance Object datacenter_name The datacenter name ''' root_folder = get_root_folder(service_instance) log.trace('Creating datac...
python
def create_datacenter(service_instance, datacenter_name): ''' Creates a datacenter. .. versionadded:: 2017.7.0 service_instance The Service Instance Object datacenter_name The datacenter name ''' root_folder = get_root_folder(service_instance) log.trace('Creating datac...
[ "def", "create_datacenter", "(", "service_instance", ",", "datacenter_name", ")", ":", "root_folder", "=", "get_root_folder", "(", "service_instance", ")", "log", ".", "trace", "(", "'Creating datacenter \\'%s\\''", ",", "datacenter_name", ")", "try", ":", "dc_obj", ...
Creates a datacenter. .. versionadded:: 2017.7.0 service_instance The Service Instance Object datacenter_name The datacenter name
[ "Creates", "a", "datacenter", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1783-L1810
train
saltstack/salt
salt/utils/vmware.py
get_cluster
def get_cluster(dc_ref, cluster): ''' Returns a cluster in a datacenter. dc_ref The datacenter reference cluster The cluster to be retrieved ''' dc_name = get_managed_object_name(dc_ref) log.trace('Retrieving cluster \'%s\' from datacenter \'%s\'', cluster, dc...
python
def get_cluster(dc_ref, cluster): ''' Returns a cluster in a datacenter. dc_ref The datacenter reference cluster The cluster to be retrieved ''' dc_name = get_managed_object_name(dc_ref) log.trace('Retrieving cluster \'%s\' from datacenter \'%s\'', cluster, dc...
[ "def", "get_cluster", "(", "dc_ref", ",", "cluster", ")", ":", "dc_name", "=", "get_managed_object_name", "(", "dc_ref", ")", "log", ".", "trace", "(", "'Retrieving cluster \\'%s\\' from datacenter \\'%s\\''", ",", "cluster", ",", "dc_name", ")", "si", "=", "get_s...
Returns a cluster in a datacenter. dc_ref The datacenter reference cluster The cluster to be retrieved
[ "Returns", "a", "cluster", "in", "a", "datacenter", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1813-L1846
train
saltstack/salt
salt/utils/vmware.py
create_cluster
def create_cluster(dc_ref, cluster_name, cluster_spec): ''' Creates a cluster in a datacenter. dc_ref The parent datacenter reference. cluster_name The cluster name. cluster_spec The cluster spec (vim.ClusterConfigSpecEx). Defaults to None. ''' dc_name = ge...
python
def create_cluster(dc_ref, cluster_name, cluster_spec): ''' Creates a cluster in a datacenter. dc_ref The parent datacenter reference. cluster_name The cluster name. cluster_spec The cluster spec (vim.ClusterConfigSpecEx). Defaults to None. ''' dc_name = ge...
[ "def", "create_cluster", "(", "dc_ref", ",", "cluster_name", ",", "cluster_spec", ")", ":", "dc_name", "=", "get_managed_object_name", "(", "dc_ref", ")", "log", ".", "trace", "(", "'Creating cluster \\'%s\\' in datacenter \\'%s\\''", ",", "cluster_name", ",", "dc_nam...
Creates a cluster in a datacenter. dc_ref The parent datacenter reference. cluster_name The cluster name. cluster_spec The cluster spec (vim.ClusterConfigSpecEx). Defaults to None.
[ "Creates", "a", "cluster", "in", "a", "datacenter", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1849-L1878
train
saltstack/salt
salt/utils/vmware.py
update_cluster
def update_cluster(cluster_ref, cluster_spec): ''' Updates a cluster in a datacenter. cluster_ref The cluster reference. cluster_spec The cluster spec (vim.ClusterConfigSpecEx). Defaults to None. ''' cluster_name = get_managed_object_name(cluster_ref) log.trace('Upd...
python
def update_cluster(cluster_ref, cluster_spec): ''' Updates a cluster in a datacenter. cluster_ref The cluster reference. cluster_spec The cluster spec (vim.ClusterConfigSpecEx). Defaults to None. ''' cluster_name = get_managed_object_name(cluster_ref) log.trace('Upd...
[ "def", "update_cluster", "(", "cluster_ref", ",", "cluster_spec", ")", ":", "cluster_name", "=", "get_managed_object_name", "(", "cluster_ref", ")", "log", ".", "trace", "(", "'Updating cluster \\'%s\\''", ",", "cluster_name", ")", "try", ":", "task", "=", "cluste...
Updates a cluster in a datacenter. cluster_ref The cluster reference. cluster_spec The cluster spec (vim.ClusterConfigSpecEx). Defaults to None.
[ "Updates", "a", "cluster", "in", "a", "datacenter", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1881-L1908
train
saltstack/salt
salt/utils/vmware.py
list_datastores_full
def list_datastores_full(service_instance): ''' Returns a list of datastores associated with a given service instance. The list contains basic information about the datastore: name, type, url, capacity, free, used, usage, hosts service_instance The Service Instance Object from which to ...
python
def list_datastores_full(service_instance): ''' Returns a list of datastores associated with a given service instance. The list contains basic information about the datastore: name, type, url, capacity, free, used, usage, hosts service_instance The Service Instance Object from which to ...
[ "def", "list_datastores_full", "(", "service_instance", ")", ":", "datastores_list", "=", "list_objects", "(", "service_instance", ",", "vim", ".", "Datastore", ")", "datastores", "=", "{", "}", "for", "datastore", "in", "datastores_list", ":", "datastores", "[", ...
Returns a list of datastores associated with a given service instance. The list contains basic information about the datastore: name, type, url, capacity, free, used, usage, hosts service_instance The Service Instance Object from which to obtain datastores.
[ "Returns", "a", "list", "of", "datastores", "associated", "with", "a", "given", "service", "instance", ".", "The", "list", "contains", "basic", "information", "about", "the", "datastore", ":", "name", "type", "url", "capacity", "free", "used", "usage", "hosts"...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1941-L1956
train
saltstack/salt
salt/utils/vmware.py
list_datastore_full
def list_datastore_full(service_instance, datastore): ''' Returns a dictionary with the basic information for the given datastore: name, type, url, capacity, free, used, usage, hosts service_instance The Service Instance Object from which to obtain datastores. datastore Name of...
python
def list_datastore_full(service_instance, datastore): ''' Returns a dictionary with the basic information for the given datastore: name, type, url, capacity, free, used, usage, hosts service_instance The Service Instance Object from which to obtain datastores. datastore Name of...
[ "def", "list_datastore_full", "(", "service_instance", ",", "datastore", ")", ":", "datastore_object", "=", "get_mor_by_name", "(", "service_instance", ",", "vim", ".", "Datastore", ",", "datastore", ")", "if", "not", "datastore_object", ":", "raise", "salt", ".",...
Returns a dictionary with the basic information for the given datastore: name, type, url, capacity, free, used, usage, hosts service_instance The Service Instance Object from which to obtain datastores. datastore Name of the datastore.
[ "Returns", "a", "dictionary", "with", "the", "basic", "information", "for", "the", "given", "datastore", ":", "name", "type", "url", "capacity", "free", "used", "usage", "hosts" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1959-L1992
train
saltstack/salt
salt/utils/vmware.py
get_mor_by_name
def get_mor_by_name(si, obj_type, obj_name): ''' Get reference to an object of specified object type and name si ServiceInstance for the vSphere or ESXi server (see get_service_instance) obj_type Type of the object (vim.StoragePod, vim.Datastore, etc) obj_name Name of the ...
python
def get_mor_by_name(si, obj_type, obj_name): ''' Get reference to an object of specified object type and name si ServiceInstance for the vSphere or ESXi server (see get_service_instance) obj_type Type of the object (vim.StoragePod, vim.Datastore, etc) obj_name Name of the ...
[ "def", "get_mor_by_name", "(", "si", ",", "obj_type", ",", "obj_name", ")", ":", "inventory", "=", "get_inventory", "(", "si", ")", "container", "=", "inventory", ".", "viewManager", ".", "CreateContainerView", "(", "inventory", ".", "rootFolder", ",", "[", ...
Get reference to an object of specified object type and name si ServiceInstance for the vSphere or ESXi server (see get_service_instance) obj_type Type of the object (vim.StoragePod, vim.Datastore, etc) obj_name Name of the object
[ "Get", "reference", "to", "an", "object", "of", "specified", "object", "type", "and", "name" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1995-L2013
train
saltstack/salt
salt/utils/vmware.py
get_mor_by_moid
def get_mor_by_moid(si, obj_type, obj_moid): ''' Get reference to an object of specified object type and id si ServiceInstance for the vSphere or ESXi server (see get_service_instance) obj_type Type of the object (vim.StoragePod, vim.Datastore, etc) obj_moid ID of the obje...
python
def get_mor_by_moid(si, obj_type, obj_moid): ''' Get reference to an object of specified object type and id si ServiceInstance for the vSphere or ESXi server (see get_service_instance) obj_type Type of the object (vim.StoragePod, vim.Datastore, etc) obj_moid ID of the obje...
[ "def", "get_mor_by_moid", "(", "si", ",", "obj_type", ",", "obj_moid", ")", ":", "inventory", "=", "get_inventory", "(", "si", ")", "container", "=", "inventory", ".", "viewManager", ".", "CreateContainerView", "(", "inventory", ".", "rootFolder", ",", "[", ...
Get reference to an object of specified object type and id si ServiceInstance for the vSphere or ESXi server (see get_service_instance) obj_type Type of the object (vim.StoragePod, vim.Datastore, etc) obj_moid ID of the object
[ "Get", "reference", "to", "an", "object", "of", "specified", "object", "type", "and", "id" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2016-L2034
train
saltstack/salt
salt/utils/vmware.py
get_datastore_files
def get_datastore_files(service_instance, directory, datastores, container_object, browser_spec): ''' Get the files with a given browser specification from the datastore. service_instance The Service Instance Object from which to obtain datastores. directory The name of the directory w...
python
def get_datastore_files(service_instance, directory, datastores, container_object, browser_spec): ''' Get the files with a given browser specification from the datastore. service_instance The Service Instance Object from which to obtain datastores. directory The name of the directory w...
[ "def", "get_datastore_files", "(", "service_instance", ",", "directory", ",", "datastores", ",", "container_object", ",", "browser_spec", ")", ":", "files", "=", "[", "]", "datastore_objects", "=", "get_datastores", "(", "service_instance", ",", "container_object", ...
Get the files with a given browser specification from the datastore. service_instance The Service Instance Object from which to obtain datastores. directory The name of the directory where we would like to search datastores Name of the datastores container_object The ...
[ "Get", "the", "files", "with", "a", "given", "browser", "specification", "from", "the", "datastore", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2037-L2081
train
saltstack/salt
salt/utils/vmware.py
get_datastores
def get_datastores(service_instance, reference, datastore_names=None, backing_disk_ids=None, get_all_datastores=False): ''' Returns a list of vim.Datastore objects representing the datastores visible from a VMware object, filtered by their names, or the backing disk cannonical name or...
python
def get_datastores(service_instance, reference, datastore_names=None, backing_disk_ids=None, get_all_datastores=False): ''' Returns a list of vim.Datastore objects representing the datastores visible from a VMware object, filtered by their names, or the backing disk cannonical name or...
[ "def", "get_datastores", "(", "service_instance", ",", "reference", ",", "datastore_names", "=", "None", ",", "backing_disk_ids", "=", "None", ",", "get_all_datastores", "=", "False", ")", ":", "obj_name", "=", "get_managed_object_name", "(", "reference", ")", "if...
Returns a list of vim.Datastore objects representing the datastores visible from a VMware object, filtered by their names, or the backing disk cannonical name or scsi_addresses service_instance The Service Instance Object from which to obtain datastores. reference The VMware object fro...
[ "Returns", "a", "list", "of", "vim", ".", "Datastore", "objects", "representing", "the", "datastores", "visible", "from", "a", "VMware", "object", "filtered", "by", "their", "names", "or", "the", "backing", "disk", "cannonical", "name", "or", "scsi_addresses" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2084-L2211
train
saltstack/salt
salt/utils/vmware.py
rename_datastore
def rename_datastore(datastore_ref, new_datastore_name): ''' Renames a datastore datastore_ref vim.Datastore reference to the datastore object to be changed new_datastore_name New datastore name ''' ds_name = get_managed_object_name(datastore_ref) log.trace("Renaming datast...
python
def rename_datastore(datastore_ref, new_datastore_name): ''' Renames a datastore datastore_ref vim.Datastore reference to the datastore object to be changed new_datastore_name New datastore name ''' ds_name = get_managed_object_name(datastore_ref) log.trace("Renaming datast...
[ "def", "rename_datastore", "(", "datastore_ref", ",", "new_datastore_name", ")", ":", "ds_name", "=", "get_managed_object_name", "(", "datastore_ref", ")", "log", ".", "trace", "(", "\"Renaming datastore '%s' to '%s'\"", ",", "ds_name", ",", "new_datastore_name", ")", ...
Renames a datastore datastore_ref vim.Datastore reference to the datastore object to be changed new_datastore_name New datastore name
[ "Renames", "a", "datastore" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2214-L2238
train
saltstack/salt
salt/utils/vmware.py
_get_partition_info
def _get_partition_info(storage_system, device_path): ''' Returns partition informations for a device path, of type vim.HostDiskPartitionInfo ''' try: partition_infos = \ storage_system.RetrieveDiskPartitionInfo( devicePath=[device_path]) except vim.fa...
python
def _get_partition_info(storage_system, device_path): ''' Returns partition informations for a device path, of type vim.HostDiskPartitionInfo ''' try: partition_infos = \ storage_system.RetrieveDiskPartitionInfo( devicePath=[device_path]) except vim.fa...
[ "def", "_get_partition_info", "(", "storage_system", ",", "device_path", ")", ":", "try", ":", "partition_infos", "=", "storage_system", ".", "RetrieveDiskPartitionInfo", "(", "devicePath", "=", "[", "device_path", "]", ")", "except", "vim", ".", "fault", ".", "...
Returns partition informations for a device path, of type vim.HostDiskPartitionInfo
[ "Returns", "partition", "informations", "for", "a", "device", "path", "of", "type", "vim", ".", "HostDiskPartitionInfo" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2266-L2287
train
saltstack/salt
salt/utils/vmware.py
_get_new_computed_partition_spec
def _get_new_computed_partition_spec(storage_system, device_path, partition_info): ''' Computes the new disk partition info when adding a new vmfs partition that uses up the remainder of the disk; returns a tuple (new_partition_nu...
python
def _get_new_computed_partition_spec(storage_system, device_path, partition_info): ''' Computes the new disk partition info when adding a new vmfs partition that uses up the remainder of the disk; returns a tuple (new_partition_nu...
[ "def", "_get_new_computed_partition_spec", "(", "storage_system", ",", "device_path", ",", "partition_info", ")", ":", "log", ".", "trace", "(", "'Adding a partition at the end of the disk and getting the new '", "'computed partition spec'", ")", "# TODO implement support for multi...
Computes the new disk partition info when adding a new vmfs partition that uses up the remainder of the disk; returns a tuple (new_partition_number, vim.HostDiskPartitionSpec
[ "Computes", "the", "new", "disk", "partition", "info", "when", "adding", "a", "new", "vmfs", "partition", "that", "uses", "up", "the", "remainder", "of", "the", "disk", ";", "returns", "a", "tuple", "(", "new_partition_number", "vim", ".", "HostDiskPartitionSp...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2290-L2350
train
saltstack/salt
salt/utils/vmware.py
create_vmfs_datastore
def create_vmfs_datastore(host_ref, datastore_name, disk_ref, vmfs_major_version, storage_system=None): ''' Creates a VMFS datastore from a disk_id host_ref vim.HostSystem object referencing a host to create the datastore on datastore_name Name of the datastor...
python
def create_vmfs_datastore(host_ref, datastore_name, disk_ref, vmfs_major_version, storage_system=None): ''' Creates a VMFS datastore from a disk_id host_ref vim.HostSystem object referencing a host to create the datastore on datastore_name Name of the datastor...
[ "def", "create_vmfs_datastore", "(", "host_ref", ",", "datastore_name", ",", "disk_ref", ",", "vmfs_major_version", ",", "storage_system", "=", "None", ")", ":", "# TODO Support variable sized partitions", "hostname", "=", "get_managed_object_name", "(", "host_ref", ")", ...
Creates a VMFS datastore from a disk_id host_ref vim.HostSystem object referencing a host to create the datastore on datastore_name Name of the datastore disk_ref vim.HostScsiDislk on which the datastore is created vmfs_major_version VMFS major version to use
[ "Creates", "a", "VMFS", "datastore", "from", "a", "disk_id" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2353-L2412
train
saltstack/salt
salt/utils/vmware.py
get_host_datastore_system
def get_host_datastore_system(host_ref, hostname=None): ''' Returns a host's datastore system host_ref Reference to the ESXi host hostname Name of the host. This argument is optional. ''' if not hostname: hostname = get_managed_object_name(host_ref) service_instanc...
python
def get_host_datastore_system(host_ref, hostname=None): ''' Returns a host's datastore system host_ref Reference to the ESXi host hostname Name of the host. This argument is optional. ''' if not hostname: hostname = get_managed_object_name(host_ref) service_instanc...
[ "def", "get_host_datastore_system", "(", "host_ref", ",", "hostname", "=", "None", ")", ":", "if", "not", "hostname", ":", "hostname", "=", "get_managed_object_name", "(", "host_ref", ")", "service_instance", "=", "get_service_instance_from_managed_object", "(", "host...
Returns a host's datastore system host_ref Reference to the ESXi host hostname Name of the host. This argument is optional.
[ "Returns", "a", "host", "s", "datastore", "system" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2415-L2443
train
saltstack/salt
salt/utils/vmware.py
remove_datastore
def remove_datastore(service_instance, datastore_ref): ''' Creates a VMFS datastore from a disk_id service_instance The Service Instance Object containing the datastore datastore_ref The reference to the datastore to remove ''' ds_props = get_properties_of_managed_object( ...
python
def remove_datastore(service_instance, datastore_ref): ''' Creates a VMFS datastore from a disk_id service_instance The Service Instance Object containing the datastore datastore_ref The reference to the datastore to remove ''' ds_props = get_properties_of_managed_object( ...
[ "def", "remove_datastore", "(", "service_instance", ",", "datastore_ref", ")", ":", "ds_props", "=", "get_properties_of_managed_object", "(", "datastore_ref", ",", "[", "'host'", ",", "'info'", ",", "'name'", "]", ")", "ds_name", "=", "ds_props", "[", "'name'", ...
Creates a VMFS datastore from a disk_id service_instance The Service Instance Object containing the datastore datastore_ref The reference to the datastore to remove
[ "Creates", "a", "VMFS", "datastore", "from", "a", "disk_id" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2446-L2481
train
saltstack/salt
salt/utils/vmware.py
get_hosts
def get_hosts(service_instance, datacenter_name=None, host_names=None, cluster_name=None, get_all_hosts=False): ''' Returns a list of vim.HostSystem objects representing ESXi hosts in a vcenter filtered by their names and/or datacenter, cluster membership. service_instance The Ser...
python
def get_hosts(service_instance, datacenter_name=None, host_names=None, cluster_name=None, get_all_hosts=False): ''' Returns a list of vim.HostSystem objects representing ESXi hosts in a vcenter filtered by their names and/or datacenter, cluster membership. service_instance The Ser...
[ "def", "get_hosts", "(", "service_instance", ",", "datacenter_name", "=", "None", ",", "host_names", "=", "None", ",", "cluster_name", "=", "None", ",", "get_all_hosts", "=", "False", ")", ":", "properties", "=", "[", "'name'", "]", "if", "cluster_name", "an...
Returns a list of vim.HostSystem objects representing ESXi hosts in a vcenter filtered by their names and/or datacenter, cluster membership. service_instance The Service Instance Object from which to obtain the hosts. datacenter_name The datacenter name. Default is None. host_names ...
[ "Returns", "a", "list", "of", "vim", ".", "HostSystem", "objects", "representing", "ESXi", "hosts", "in", "a", "vcenter", "filtered", "by", "their", "names", "and", "/", "or", "datacenter", "cluster", "membership", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2484-L2547
train
saltstack/salt
salt/utils/vmware.py
_get_scsi_address_to_lun_key_map
def _get_scsi_address_to_lun_key_map(service_instance, host_ref, storage_system=None, hostname=None): ''' Returns a map between the scsi addresses and the keys of all luns on an ESXi host. ...
python
def _get_scsi_address_to_lun_key_map(service_instance, host_ref, storage_system=None, hostname=None): ''' Returns a map between the scsi addresses and the keys of all luns on an ESXi host. ...
[ "def", "_get_scsi_address_to_lun_key_map", "(", "service_instance", ",", "host_ref", ",", "storage_system", "=", "None", ",", "hostname", "=", "None", ")", ":", "if", "not", "hostname", ":", "hostname", "=", "get_managed_object_name", "(", "host_ref", ")", "if", ...
Returns a map between the scsi addresses and the keys of all luns on an ESXi host. map[<scsi_address>] = <lun key> service_instance The Service Instance Object from which to obtain the hosts host_ref The vim.HostSystem object representing the host that contains the requeste...
[ "Returns", "a", "map", "between", "the", "scsi", "addresses", "and", "the", "keys", "of", "all", "luns", "on", "an", "ESXi", "host", ".", "map", "[", "<scsi_address", ">", "]", "=", "<lun", "key", ">" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2550-L2610
train
saltstack/salt
salt/utils/vmware.py
get_all_luns
def get_all_luns(host_ref, storage_system=None, hostname=None): ''' Returns a list of all vim.HostScsiDisk objects in a disk host_ref The vim.HostSystem object representing the host that contains the requested disks. storage_system The host's storage system. Default is None. ...
python
def get_all_luns(host_ref, storage_system=None, hostname=None): ''' Returns a list of all vim.HostScsiDisk objects in a disk host_ref The vim.HostSystem object representing the host that contains the requested disks. storage_system The host's storage system. Default is None. ...
[ "def", "get_all_luns", "(", "host_ref", ",", "storage_system", "=", "None", ",", "hostname", "=", "None", ")", ":", "if", "not", "hostname", ":", "hostname", "=", "get_managed_object_name", "(", "host_ref", ")", "if", "not", "storage_system", ":", "si", "=",...
Returns a list of all vim.HostScsiDisk objects in a disk host_ref The vim.HostSystem object representing the host that contains the requested disks. storage_system The host's storage system. Default is None. hostname Name of the host. This argument is optional.
[ "Returns", "a", "list", "of", "all", "vim", ".", "HostScsiDisk", "objects", "in", "a", "disk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2613-L2660
train
saltstack/salt
salt/utils/vmware.py
get_scsi_address_to_lun_map
def get_scsi_address_to_lun_map(host_ref, storage_system=None, hostname=None): ''' Returns a map of all vim.ScsiLun objects on a ESXi host keyed by their scsi address host_ref The vim.HostSystem object representing the host that contains the requested disks. storage_system ...
python
def get_scsi_address_to_lun_map(host_ref, storage_system=None, hostname=None): ''' Returns a map of all vim.ScsiLun objects on a ESXi host keyed by their scsi address host_ref The vim.HostSystem object representing the host that contains the requested disks. storage_system ...
[ "def", "get_scsi_address_to_lun_map", "(", "host_ref", ",", "storage_system", "=", "None", ",", "hostname", "=", "None", ")", ":", "if", "not", "hostname", ":", "hostname", "=", "get_managed_object_name", "(", "host_ref", ")", "si", "=", "get_service_instance_from...
Returns a map of all vim.ScsiLun objects on a ESXi host keyed by their scsi address host_ref The vim.HostSystem object representing the host that contains the requested disks. storage_system The host's storage system. Default is None. hostname Name of the host. This ar...
[ "Returns", "a", "map", "of", "all", "vim", ".", "ScsiLun", "objects", "on", "a", "ESXi", "host", "keyed", "by", "their", "scsi", "address" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2663-L2689
train
saltstack/salt
salt/utils/vmware.py
get_disks
def get_disks(host_ref, disk_ids=None, scsi_addresses=None, get_all_disks=False): ''' Returns a list of vim.HostScsiDisk objects representing disks in a ESXi host, filtered by their cannonical names and scsi_addresses host_ref The vim.HostSystem object representing the host that c...
python
def get_disks(host_ref, disk_ids=None, scsi_addresses=None, get_all_disks=False): ''' Returns a list of vim.HostScsiDisk objects representing disks in a ESXi host, filtered by their cannonical names and scsi_addresses host_ref The vim.HostSystem object representing the host that c...
[ "def", "get_disks", "(", "host_ref", ",", "disk_ids", "=", "None", ",", "scsi_addresses", "=", "None", ",", "get_all_disks", "=", "False", ")", ":", "hostname", "=", "get_managed_object_name", "(", "host_ref", ")", "if", "get_all_disks", ":", "log", ".", "tr...
Returns a list of vim.HostScsiDisk objects representing disks in a ESXi host, filtered by their cannonical names and scsi_addresses host_ref The vim.HostSystem object representing the host that contains the requested disks. disk_ids The list of canonical names of the disks to be re...
[ "Returns", "a", "list", "of", "vim", ".", "HostScsiDisk", "objects", "representing", "disks", "in", "a", "ESXi", "host", "filtered", "by", "their", "cannonical", "names", "and", "scsi_addresses" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2692-L2745
train
saltstack/salt
salt/utils/vmware.py
get_disk_partition_info
def get_disk_partition_info(host_ref, disk_id, storage_system=None): ''' Returns all partitions on a disk host_ref The reference of the ESXi host containing the disk disk_id The canonical name of the disk whose partitions are to be removed storage_system The ESXi host's st...
python
def get_disk_partition_info(host_ref, disk_id, storage_system=None): ''' Returns all partitions on a disk host_ref The reference of the ESXi host containing the disk disk_id The canonical name of the disk whose partitions are to be removed storage_system The ESXi host's st...
[ "def", "get_disk_partition_info", "(", "host_ref", ",", "disk_id", ",", "storage_system", "=", "None", ")", ":", "hostname", "=", "get_managed_object_name", "(", "host_ref", ")", "service_instance", "=", "get_service_instance_from_managed_object", "(", "host_ref", ")", ...
Returns all partitions on a disk host_ref The reference of the ESXi host containing the disk disk_id The canonical name of the disk whose partitions are to be removed storage_system The ESXi host's storage system. Default is None.
[ "Returns", "all", "partitions", "on", "a", "disk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2748-L2790
train
saltstack/salt
salt/utils/vmware.py
erase_disk_partitions
def erase_disk_partitions(service_instance, host_ref, disk_id, hostname=None, storage_system=None): ''' Erases all partitions on a disk in a vcenter filtered by their names and/or datacenter, cluster membership service_instance The Service Instance Object from which t...
python
def erase_disk_partitions(service_instance, host_ref, disk_id, hostname=None, storage_system=None): ''' Erases all partitions on a disk in a vcenter filtered by their names and/or datacenter, cluster membership service_instance The Service Instance Object from which t...
[ "def", "erase_disk_partitions", "(", "service_instance", ",", "host_ref", ",", "disk_id", ",", "hostname", "=", "None", ",", "storage_system", "=", "None", ")", ":", "if", "not", "hostname", ":", "hostname", "=", "get_managed_object_name", "(", "host_ref", ")", ...
Erases all partitions on a disk in a vcenter filtered by their names and/or datacenter, cluster membership service_instance The Service Instance Object from which to obtain all information host_ref The reference of the ESXi host containing the disk disk_id The canonical name ...
[ "Erases", "all", "partitions", "on", "a", "disk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2793-L2864
train
saltstack/salt
salt/utils/vmware.py
get_diskgroups
def get_diskgroups(host_ref, cache_disk_ids=None, get_all_disk_groups=False): ''' Returns a list of vim.VsanHostDiskMapping objects representing disks in a ESXi host, filtered by their cannonical names. host_ref The vim.HostSystem object representing the host that contains the requested...
python
def get_diskgroups(host_ref, cache_disk_ids=None, get_all_disk_groups=False): ''' Returns a list of vim.VsanHostDiskMapping objects representing disks in a ESXi host, filtered by their cannonical names. host_ref The vim.HostSystem object representing the host that contains the requested...
[ "def", "get_diskgroups", "(", "host_ref", ",", "cache_disk_ids", "=", "None", ",", "get_all_disk_groups", "=", "False", ")", ":", "hostname", "=", "get_managed_object_name", "(", "host_ref", ")", "if", "get_all_disk_groups", ":", "log", ".", "trace", "(", "'Retr...
Returns a list of vim.VsanHostDiskMapping objects representing disks in a ESXi host, filtered by their cannonical names. host_ref The vim.HostSystem object representing the host that contains the requested disks. cache_disk_ids The list of cannonical names of the cache disks to be ...
[ "Returns", "a", "list", "of", "vim", ".", "VsanHostDiskMapping", "objects", "representing", "disks", "in", "a", "ESXi", "host", "filtered", "by", "their", "cannonical", "names", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2867-L2924
train
saltstack/salt
salt/utils/vmware.py
_check_disks_in_diskgroup
def _check_disks_in_diskgroup(disk_group, cache_disk_id, capacity_disk_ids): ''' Checks that the disks in a disk group are as expected and raises CheckError exceptions if the check fails ''' if not disk_group.ssd.canonicalName == cache_disk_id: raise salt.exceptions.ArgumentValueError( ...
python
def _check_disks_in_diskgroup(disk_group, cache_disk_id, capacity_disk_ids): ''' Checks that the disks in a disk group are as expected and raises CheckError exceptions if the check fails ''' if not disk_group.ssd.canonicalName == cache_disk_id: raise salt.exceptions.ArgumentValueError( ...
[ "def", "_check_disks_in_diskgroup", "(", "disk_group", ",", "cache_disk_id", ",", "capacity_disk_ids", ")", ":", "if", "not", "disk_group", ".", "ssd", ".", "canonicalName", "==", "cache_disk_id", ":", "raise", "salt", ".", "exceptions", ".", "ArgumentValueError", ...
Checks that the disks in a disk group are as expected and raises CheckError exceptions if the check fails
[ "Checks", "that", "the", "disks", "in", "a", "disk", "group", "are", "as", "expected", "and", "raises", "CheckError", "exceptions", "if", "the", "check", "fails" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2927-L2944
train
saltstack/salt
salt/utils/vmware.py
get_host_cache
def get_host_cache(host_ref, host_cache_manager=None): ''' Returns a vim.HostScsiDisk if the host cache is configured on the specified host, other wise returns None host_ref The vim.HostSystem object representing the host that contains the requested disks. host_cache_manager ...
python
def get_host_cache(host_ref, host_cache_manager=None): ''' Returns a vim.HostScsiDisk if the host cache is configured on the specified host, other wise returns None host_ref The vim.HostSystem object representing the host that contains the requested disks. host_cache_manager ...
[ "def", "get_host_cache", "(", "host_ref", ",", "host_cache_manager", "=", "None", ")", ":", "hostname", "=", "get_managed_object_name", "(", "host_ref", ")", "service_instance", "=", "get_service_instance_from_managed_object", "(", "host_ref", ")", "log", ".", "trace"...
Returns a vim.HostScsiDisk if the host cache is configured on the specified host, other wise returns None host_ref The vim.HostSystem object representing the host that contains the requested disks. host_cache_manager The vim.HostCacheConfigurationManager object representing the cac...
[ "Returns", "a", "vim", ".", "HostScsiDisk", "if", "the", "host", "cache", "is", "configured", "on", "the", "specified", "host", "other", "wise", "returns", "None" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2948-L2985
train
saltstack/salt
salt/utils/vmware.py
configure_host_cache
def configure_host_cache(host_ref, datastore_ref, swap_size_MiB, host_cache_manager=None): ''' Configures the host cahe of the specified host host_ref The vim.HostSystem object representing the host that contains the requested disks. datastore_ref The v...
python
def configure_host_cache(host_ref, datastore_ref, swap_size_MiB, host_cache_manager=None): ''' Configures the host cahe of the specified host host_ref The vim.HostSystem object representing the host that contains the requested disks. datastore_ref The v...
[ "def", "configure_host_cache", "(", "host_ref", ",", "datastore_ref", ",", "swap_size_MiB", ",", "host_cache_manager", "=", "None", ")", ":", "hostname", "=", "get_managed_object_name", "(", "host_ref", ")", "if", "not", "host_cache_manager", ":", "props", "=", "g...
Configures the host cahe of the specified host host_ref The vim.HostSystem object representing the host that contains the requested disks. datastore_ref The vim.Datastore opject representing the datastore the host cache will be configured on. swap_size_MiB The size...
[ "Configures", "the", "host", "cahe", "of", "the", "specified", "host" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2989-L3040
train
saltstack/salt
salt/utils/vmware.py
get_resource_pools
def get_resource_pools(service_instance, resource_pool_names, datacenter_name=None, get_all_resource_pools=False): ''' Retrieves resource pool objects service_instance The service instance object to query the vCenter resource_pool_names Resource pool names d...
python
def get_resource_pools(service_instance, resource_pool_names, datacenter_name=None, get_all_resource_pools=False): ''' Retrieves resource pool objects service_instance The service instance object to query the vCenter resource_pool_names Resource pool names d...
[ "def", "get_resource_pools", "(", "service_instance", ",", "resource_pool_names", ",", "datacenter_name", "=", "None", ",", "get_all_resource_pools", "=", "False", ")", ":", "properties", "=", "[", "'name'", "]", "if", "not", "resource_pool_names", ":", "resource_po...
Retrieves resource pool objects service_instance The service instance object to query the vCenter resource_pool_names Resource pool names datacenter_name Name of the datacenter where the resource pool is available get_all_resource_pools Boolean return Res...
[ "Retrieves", "resource", "pool", "objects" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3053-L3097
train
saltstack/salt
salt/utils/vmware.py
wait_for_task
def wait_for_task(task, instance_name, task_type, sleep_seconds=1, log_level='debug'): ''' Waits for a task to be completed. task The task to wait for. instance_name The name of the ESXi host, vCenter Server, or Virtual Machine that the task is being run on. task_type ...
python
def wait_for_task(task, instance_name, task_type, sleep_seconds=1, log_level='debug'): ''' Waits for a task to be completed. task The task to wait for. instance_name The name of the ESXi host, vCenter Server, or Virtual Machine that the task is being run on. task_type ...
[ "def", "wait_for_task", "(", "task", ",", "instance_name", ",", "task_type", ",", "sleep_seconds", "=", "1", ",", "log_level", "=", "'debug'", ")", ":", "time_counter", "=", "0", "start_time", "=", "time", ".", "time", "(", ")", "log", ".", "trace", "(",...
Waits for a task to be completed. task The task to wait for. instance_name The name of the ESXi host, vCenter Server, or Virtual Machine that the task is being run on. task_type The type of task being performed. Useful information for debugging purposes. sleep_seconds...
[ "Waits", "for", "a", "task", "to", "be", "completed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3170-L3270
train
saltstack/salt
salt/utils/vmware.py
get_vm_by_property
def get_vm_by_property(service_instance, name, datacenter=None, vm_properties=None, traversal_spec=None, parent_ref=None): ''' Get virtual machine properties based on the traversal specs and properties list, returns Virtual Machine object with properties. service_instance ...
python
def get_vm_by_property(service_instance, name, datacenter=None, vm_properties=None, traversal_spec=None, parent_ref=None): ''' Get virtual machine properties based on the traversal specs and properties list, returns Virtual Machine object with properties. service_instance ...
[ "def", "get_vm_by_property", "(", "service_instance", ",", "name", ",", "datacenter", "=", "None", ",", "vm_properties", "=", "None", ",", "traversal_spec", "=", "None", ",", "parent_ref", "=", "None", ")", ":", "if", "datacenter", "and", "not", "parent_ref", ...
Get virtual machine properties based on the traversal specs and properties list, returns Virtual Machine object with properties. service_instance Service instance object to access vCenter name Name of the virtual machine. datacenter Datacenter name vm_properties L...
[ "Get", "virtual", "machine", "properties", "based", "on", "the", "traversal", "specs", "and", "properties", "list", "returns", "Virtual", "Machine", "object", "with", "properties", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3273-L3326
train
saltstack/salt
salt/utils/vmware.py
get_folder
def get_folder(service_instance, datacenter, placement, base_vm_name=None): ''' Returns a Folder Object service_instance Service instance object datacenter Name of the datacenter placement Placement dictionary base_vm_name Existing virtual machine name (for cl...
python
def get_folder(service_instance, datacenter, placement, base_vm_name=None): ''' Returns a Folder Object service_instance Service instance object datacenter Name of the datacenter placement Placement dictionary base_vm_name Existing virtual machine name (for cl...
[ "def", "get_folder", "(", "service_instance", ",", "datacenter", ",", "placement", ",", "base_vm_name", "=", "None", ")", ":", "log", ".", "trace", "(", "'Retrieving folder information'", ")", "if", "base_vm_name", ":", "vm_object", "=", "get_vm_by_property", "(",...
Returns a Folder Object service_instance Service instance object datacenter Name of the datacenter placement Placement dictionary base_vm_name Existing virtual machine name (for cloning)
[ "Returns", "a", "Folder", "Object" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3329-L3369
train
saltstack/salt
salt/utils/vmware.py
get_placement
def get_placement(service_instance, datacenter, placement=None): ''' To create a virtual machine a resource pool needs to be supplied, we would like to use the strictest as possible. datacenter Name of the datacenter placement Dictionary with the placement info, cluster, host resource ...
python
def get_placement(service_instance, datacenter, placement=None): ''' To create a virtual machine a resource pool needs to be supplied, we would like to use the strictest as possible. datacenter Name of the datacenter placement Dictionary with the placement info, cluster, host resource ...
[ "def", "get_placement", "(", "service_instance", ",", "datacenter", ",", "placement", "=", "None", ")", ":", "log", ".", "trace", "(", "'Retrieving placement information'", ")", "resourcepool_object", ",", "placement_object", "=", "None", ",", "None", "if", "'host...
To create a virtual machine a resource pool needs to be supplied, we would like to use the strictest as possible. datacenter Name of the datacenter placement Dictionary with the placement info, cluster, host resource pool name return Resource pool, cluster and host object if any a...
[ "To", "create", "a", "virtual", "machine", "a", "resource", "pool", "needs", "to", "be", "supplied", "we", "would", "like", "to", "use", "the", "strictest", "as", "possible", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3372-L3451
train
saltstack/salt
salt/utils/vmware.py
convert_to_kb
def convert_to_kb(unit, size): ''' Converts the given size to KB based on the unit, returns a long integer. unit Unit of the size eg. GB; Note: to VMware a GB is the same as GiB = 1024MiB size Number which represents the size ''' if unit.lower() == 'gb': # vCenter needs ...
python
def convert_to_kb(unit, size): ''' Converts the given size to KB based on the unit, returns a long integer. unit Unit of the size eg. GB; Note: to VMware a GB is the same as GiB = 1024MiB size Number which represents the size ''' if unit.lower() == 'gb': # vCenter needs ...
[ "def", "convert_to_kb", "(", "unit", ",", "size", ")", ":", "if", "unit", ".", "lower", "(", ")", "==", "'gb'", ":", "# vCenter needs long value", "target_size", "=", "int", "(", "size", "*", "1024", "*", "1024", ")", "elif", "unit", ".", "lower", "(",...
Converts the given size to KB based on the unit, returns a long integer. unit Unit of the size eg. GB; Note: to VMware a GB is the same as GiB = 1024MiB size Number which represents the size
[ "Converts", "the", "given", "size", "to", "KB", "based", "on", "the", "unit", "returns", "a", "long", "integer", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3454-L3472
train
saltstack/salt
salt/utils/vmware.py
power_cycle_vm
def power_cycle_vm(virtual_machine, action='on'): ''' Powers on/off a virtual machine specified by it's name. virtual_machine vim.VirtualMachine object to power on/off virtual machine action Operation option to power on/off the machine ''' if action == 'on': try: ...
python
def power_cycle_vm(virtual_machine, action='on'): ''' Powers on/off a virtual machine specified by it's name. virtual_machine vim.VirtualMachine object to power on/off virtual machine action Operation option to power on/off the machine ''' if action == 'on': try: ...
[ "def", "power_cycle_vm", "(", "virtual_machine", ",", "action", "=", "'on'", ")", ":", "if", "action", "==", "'on'", ":", "try", ":", "task", "=", "virtual_machine", ".", "PowerOn", "(", ")", "task_name", "=", "'power on'", "except", "vim", ".", "fault", ...
Powers on/off a virtual machine specified by it's name. virtual_machine vim.VirtualMachine object to power on/off virtual machine action Operation option to power on/off the machine
[ "Powers", "on", "/", "off", "a", "virtual", "machine", "specified", "by", "it", "s", "name", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3475-L3523
train
saltstack/salt
salt/utils/vmware.py
create_vm
def create_vm(vm_name, vm_config_spec, folder_object, resourcepool_object, host_object=None): ''' Creates virtual machine from config spec vm_name Virtual machine name to be created vm_config_spec Virtual Machine Config Spec object folder_object vm Folder managed object re...
python
def create_vm(vm_name, vm_config_spec, folder_object, resourcepool_object, host_object=None): ''' Creates virtual machine from config spec vm_name Virtual machine name to be created vm_config_spec Virtual Machine Config Spec object folder_object vm Folder managed object re...
[ "def", "create_vm", "(", "vm_name", ",", "vm_config_spec", ",", "folder_object", ",", "resourcepool_object", ",", "host_object", "=", "None", ")", ":", "try", ":", "if", "host_object", "and", "isinstance", "(", "host_object", ",", "vim", ".", "HostSystem", ")"...
Creates virtual machine from config spec vm_name Virtual machine name to be created vm_config_spec Virtual Machine Config Spec object folder_object vm Folder managed object reference resourcepool_object Resource pool object where the machine will be created host_...
[ "Creates", "virtual", "machine", "from", "config", "spec" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3526-L3568
train
saltstack/salt
salt/utils/vmware.py
register_vm
def register_vm(datacenter, name, vmx_path, resourcepool_object, host_object=None): ''' Registers a virtual machine to the inventory with the given vmx file, on success it returns the vim.VirtualMachine managed object reference datacenter Datacenter object of the virtual machine, vim.Datacenter...
python
def register_vm(datacenter, name, vmx_path, resourcepool_object, host_object=None): ''' Registers a virtual machine to the inventory with the given vmx file, on success it returns the vim.VirtualMachine managed object reference datacenter Datacenter object of the virtual machine, vim.Datacenter...
[ "def", "register_vm", "(", "datacenter", ",", "name", ",", "vmx_path", ",", "resourcepool_object", ",", "host_object", "=", "None", ")", ":", "try", ":", "if", "host_object", ":", "task", "=", "datacenter", ".", "vmFolder", ".", "RegisterVM_Task", "(", "path...
Registers a virtual machine to the inventory with the given vmx file, on success it returns the vim.VirtualMachine managed object reference datacenter Datacenter object of the virtual machine, vim.Datacenter object name Name of the virtual machine vmx_path: Full path to the vm...
[ "Registers", "a", "virtual", "machine", "to", "the", "inventory", "with", "the", "given", "vmx", "file", "on", "success", "it", "returns", "the", "vim", ".", "VirtualMachine", "managed", "object", "reference" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3571-L3618
train
saltstack/salt
salt/utils/vmware.py
update_vm
def update_vm(vm_ref, vm_config_spec): ''' Updates the virtual machine configuration with the given object vm_ref Virtual machine managed object reference vm_config_spec Virtual machine config spec object to update ''' vm_name = get_managed_object_name(vm_ref) log.trace('Up...
python
def update_vm(vm_ref, vm_config_spec): ''' Updates the virtual machine configuration with the given object vm_ref Virtual machine managed object reference vm_config_spec Virtual machine config spec object to update ''' vm_name = get_managed_object_name(vm_ref) log.trace('Up...
[ "def", "update_vm", "(", "vm_ref", ",", "vm_config_spec", ")", ":", "vm_name", "=", "get_managed_object_name", "(", "vm_ref", ")", "log", ".", "trace", "(", "'Updating vm \\'%s\\''", ",", "vm_name", ")", "try", ":", "task", "=", "vm_ref", ".", "ReconfigVM_Task...
Updates the virtual machine configuration with the given object vm_ref Virtual machine managed object reference vm_config_spec Virtual machine config spec object to update
[ "Updates", "the", "virtual", "machine", "configuration", "with", "the", "given", "object" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3621-L3647
train
saltstack/salt
salt/utils/vmware.py
unregister_vm
def unregister_vm(vm_ref): ''' Destroys the virtual machine vm_ref Managed object reference of a virtual machine object ''' vm_name = get_managed_object_name(vm_ref) log.trace('Destroying vm \'%s\'', vm_name) try: vm_ref.UnregisterVM() except vim.fault.NoPermission as ex...
python
def unregister_vm(vm_ref): ''' Destroys the virtual machine vm_ref Managed object reference of a virtual machine object ''' vm_name = get_managed_object_name(vm_ref) log.trace('Destroying vm \'%s\'', vm_name) try: vm_ref.UnregisterVM() except vim.fault.NoPermission as ex...
[ "def", "unregister_vm", "(", "vm_ref", ")", ":", "vm_name", "=", "get_managed_object_name", "(", "vm_ref", ")", "log", ".", "trace", "(", "'Destroying vm \\'%s\\''", ",", "vm_name", ")", "try", ":", "vm_ref", ".", "UnregisterVM", "(", ")", "except", "vim", "...
Destroys the virtual machine vm_ref Managed object reference of a virtual machine object
[ "Destroys", "the", "virtual", "machine" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3675-L3694
train
saltstack/salt
salt/auth/pki.py
auth
def auth(username, password, **kwargs): ''' Returns True if the given user cert (password is the cert contents) was issued by the CA and if cert's Common Name is equal to username. Returns False otherwise. ``username``: we need it to run the auth function from CLI/API; it should ...
python
def auth(username, password, **kwargs): ''' Returns True if the given user cert (password is the cert contents) was issued by the CA and if cert's Common Name is equal to username. Returns False otherwise. ``username``: we need it to run the auth function from CLI/API; it should ...
[ "def", "auth", "(", "username", ",", "password", ",", "*", "*", "kwargs", ")", ":", "pem", "=", "password", "cacert_file", "=", "__salt__", "[", "'config.get'", "]", "(", "'external_auth:pki:ca_file'", ")", "log", ".", "debug", "(", "'Attempting to authenticat...
Returns True if the given user cert (password is the cert contents) was issued by the CA and if cert's Common Name is equal to username. Returns False otherwise. ``username``: we need it to run the auth function from CLI/API; it should be in master config auth/acl ``password``: conte...
[ "Returns", "True", "if", "the", "given", "user", "cert", "(", "password", "is", "the", "cert", "contents", ")", "was", "issued", "by", "the", "CA", "and", "if", "cert", "s", "Common", "Name", "is", "equal", "to", "username", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/pki.py#L55-L145
train
saltstack/salt
salt/utils/dictdiffer.py
RecursiveDictDiffer._get_diffs
def _get_diffs(cls, dict1, dict2, ignore_missing_keys): ''' Returns a dict with the differences between dict1 and dict2 Notes: Keys that only exist in dict2 are not included in the diff if ignore_missing_keys is True, otherwise they are Simple compares are do...
python
def _get_diffs(cls, dict1, dict2, ignore_missing_keys): ''' Returns a dict with the differences between dict1 and dict2 Notes: Keys that only exist in dict2 are not included in the diff if ignore_missing_keys is True, otherwise they are Simple compares are do...
[ "def", "_get_diffs", "(", "cls", ",", "dict1", ",", "dict2", ",", "ignore_missing_keys", ")", ":", "ret_dict", "=", "{", "}", "for", "p", "in", "dict1", ".", "keys", "(", ")", ":", "if", "p", "not", "in", "dict2", ":", "ret_dict", ".", "update", "(...
Returns a dict with the differences between dict1 and dict2 Notes: Keys that only exist in dict2 are not included in the diff if ignore_missing_keys is True, otherwise they are Simple compares are done on lists
[ "Returns", "a", "dict", "with", "the", "differences", "between", "dict1", "and", "dict2" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L166-L192
train
saltstack/salt
salt/utils/dictdiffer.py
RecursiveDictDiffer._get_values
def _get_values(cls, diff_dict, type='new'): ''' Returns a dictionaries with the 'new' values in a diff dict. type Which values to return, 'new' or 'old' ''' ret_dict = {} for p in diff_dict.keys(): if type in diff_dict[p].keys(): ...
python
def _get_values(cls, diff_dict, type='new'): ''' Returns a dictionaries with the 'new' values in a diff dict. type Which values to return, 'new' or 'old' ''' ret_dict = {} for p in diff_dict.keys(): if type in diff_dict[p].keys(): ...
[ "def", "_get_values", "(", "cls", ",", "diff_dict", ",", "type", "=", "'new'", ")", ":", "ret_dict", "=", "{", "}", "for", "p", "in", "diff_dict", ".", "keys", "(", ")", ":", "if", "type", "in", "diff_dict", "[", "p", "]", ".", "keys", "(", ")", ...
Returns a dictionaries with the 'new' values in a diff dict. type Which values to return, 'new' or 'old'
[ "Returns", "a", "dictionaries", "with", "the", "new", "values", "in", "a", "diff", "dict", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L195-L209
train
saltstack/salt
salt/utils/dictdiffer.py
RecursiveDictDiffer._get_changes
def _get_changes(cls, diff_dict): ''' Returns a list of string message with the differences in a diff dict. Each inner difference is tabulated two space deeper ''' changes_strings = [] for p in sorted(diff_dict.keys()): if sorted(diff_dict[p].keys()) == ['new...
python
def _get_changes(cls, diff_dict): ''' Returns a list of string message with the differences in a diff dict. Each inner difference is tabulated two space deeper ''' changes_strings = [] for p in sorted(diff_dict.keys()): if sorted(diff_dict[p].keys()) == ['new...
[ "def", "_get_changes", "(", "cls", ",", "diff_dict", ")", ":", "changes_strings", "=", "[", "]", "for", "p", "in", "sorted", "(", "diff_dict", ".", "keys", "(", ")", ")", ":", "if", "sorted", "(", "diff_dict", "[", "p", "]", ".", "keys", "(", ")", ...
Returns a list of string message with the differences in a diff dict. Each inner difference is tabulated two space deeper
[ "Returns", "a", "list", "of", "string", "message", "with", "the", "differences", "in", "a", "diff", "dict", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L212-L245
train
saltstack/salt
salt/utils/dictdiffer.py
RecursiveDictDiffer.added
def added(self): ''' Returns all keys that have been added. If the keys are in child dictionaries they will be represented with . notation ''' def _added(diffs, prefix): keys = [] for key in diffs.keys(): if isinstance(diffs[key], ...
python
def added(self): ''' Returns all keys that have been added. If the keys are in child dictionaries they will be represented with . notation ''' def _added(diffs, prefix): keys = [] for key in diffs.keys(): if isinstance(diffs[key], ...
[ "def", "added", "(", "self", ")", ":", "def", "_added", "(", "diffs", ",", "prefix", ")", ":", "keys", "=", "[", "]", "for", "key", "in", "diffs", ".", "keys", "(", ")", ":", "if", "isinstance", "(", "diffs", "[", "key", "]", ",", "dict", ")", ...
Returns all keys that have been added. If the keys are in child dictionaries they will be represented with . notation
[ "Returns", "all", "keys", "that", "have", "been", "added", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L247-L269
train
saltstack/salt
salt/utils/dictdiffer.py
RecursiveDictDiffer.removed
def removed(self): ''' Returns all keys that have been removed. If the keys are in child dictionaries they will be represented with . notation ''' def _removed(diffs, prefix): keys = [] for key in diffs.keys(): if isinstance(diffs[...
python
def removed(self): ''' Returns all keys that have been removed. If the keys are in child dictionaries they will be represented with . notation ''' def _removed(diffs, prefix): keys = [] for key in diffs.keys(): if isinstance(diffs[...
[ "def", "removed", "(", "self", ")", ":", "def", "_removed", "(", "diffs", ",", "prefix", ")", ":", "keys", "=", "[", "]", "for", "key", "in", "diffs", ".", "keys", "(", ")", ":", "if", "isinstance", "(", "diffs", "[", "key", "]", ",", "dict", "...
Returns all keys that have been removed. If the keys are in child dictionaries they will be represented with . notation
[ "Returns", "all", "keys", "that", "have", "been", "removed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L271-L292
train
saltstack/salt
salt/utils/dictdiffer.py
RecursiveDictDiffer.changed
def changed(self): ''' Returns all keys that have been changed. If the keys are in child dictionaries they will be represented with . notation ''' def _changed(diffs, prefix): keys = [] for key in diffs.keys(): if not isinstance(di...
python
def changed(self): ''' Returns all keys that have been changed. If the keys are in child dictionaries they will be represented with . notation ''' def _changed(diffs, prefix): keys = [] for key in diffs.keys(): if not isinstance(di...
[ "def", "changed", "(", "self", ")", ":", "def", "_changed", "(", "diffs", ",", "prefix", ")", ":", "keys", "=", "[", "]", "for", "key", "in", "diffs", ".", "keys", "(", ")", ":", "if", "not", "isinstance", "(", "diffs", "[", "key", "]", ",", "d...
Returns all keys that have been changed. If the keys are in child dictionaries they will be represented with . notation
[ "Returns", "all", "keys", "that", "have", "been", "changed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L294-L340
train
saltstack/salt
salt/utils/dictdiffer.py
RecursiveDictDiffer.unchanged
def unchanged(self): ''' Returns all keys that have been unchanged. If the keys are in child dictionaries they will be represented with . notation ''' def _unchanged(current_dict, diffs, prefix): keys = [] for key in current_dict.keys(): ...
python
def unchanged(self): ''' Returns all keys that have been unchanged. If the keys are in child dictionaries they will be represented with . notation ''' def _unchanged(current_dict, diffs, prefix): keys = [] for key in current_dict.keys(): ...
[ "def", "unchanged", "(", "self", ")", ":", "def", "_unchanged", "(", "current_dict", ",", "diffs", ",", "prefix", ")", ":", "keys", "=", "[", "]", "for", "key", "in", "current_dict", ".", "keys", "(", ")", ":", "if", "key", "not", "in", "diffs", ":...
Returns all keys that have been unchanged. If the keys are in child dictionaries they will be represented with . notation
[ "Returns", "all", "keys", "that", "have", "been", "unchanged", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L342-L365
train
saltstack/salt
salt/modules/win_groupadd.py
_get_computer_object
def _get_computer_object(): ''' A helper function to get the object for the local machine Returns: object: Returns the computer object for the local machine ''' with salt.utils.winapi.Com(): nt = win32com.client.Dispatch('AdsNameSpaces') return nt.GetObject('', 'WinNT://.,comput...
python
def _get_computer_object(): ''' A helper function to get the object for the local machine Returns: object: Returns the computer object for the local machine ''' with salt.utils.winapi.Com(): nt = win32com.client.Dispatch('AdsNameSpaces') return nt.GetObject('', 'WinNT://.,comput...
[ "def", "_get_computer_object", "(", ")", ":", "with", "salt", ".", "utils", ".", "winapi", ".", "Com", "(", ")", ":", "nt", "=", "win32com", ".", "client", ".", "Dispatch", "(", "'AdsNameSpaces'", ")", "return", "nt", ".", "GetObject", "(", "''", ",", ...
A helper function to get the object for the local machine Returns: object: Returns the computer object for the local machine
[ "A", "helper", "function", "to", "get", "the", "object", "for", "the", "local", "machine" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L42-L51
train
saltstack/salt
salt/modules/win_groupadd.py
_get_group_object
def _get_group_object(name): ''' A helper function to get a specified group object Args: name (str): The name of the object Returns: object: The specified group object ''' with salt.utils.winapi.Com(): nt = win32com.client.Dispatch('AdsNameSpaces') return nt.GetObj...
python
def _get_group_object(name): ''' A helper function to get a specified group object Args: name (str): The name of the object Returns: object: The specified group object ''' with salt.utils.winapi.Com(): nt = win32com.client.Dispatch('AdsNameSpaces') return nt.GetObj...
[ "def", "_get_group_object", "(", "name", ")", ":", "with", "salt", ".", "utils", ".", "winapi", ".", "Com", "(", ")", ":", "nt", "=", "win32com", ".", "client", ".", "Dispatch", "(", "'AdsNameSpaces'", ")", "return", "nt", ".", "GetObject", "(", "''", ...
A helper function to get a specified group object Args: name (str): The name of the object Returns: object: The specified group object
[ "A", "helper", "function", "to", "get", "a", "specified", "group", "object" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L54-L67
train
saltstack/salt
salt/modules/win_groupadd.py
_get_all_groups
def _get_all_groups(): ''' A helper function that gets a list of group objects for all groups on the machine Returns: iter: A list of objects for all groups on the machine ''' with salt.utils.winapi.Com(): nt = win32com.client.Dispatch('AdsNameSpaces') results = nt.GetObject...
python
def _get_all_groups(): ''' A helper function that gets a list of group objects for all groups on the machine Returns: iter: A list of objects for all groups on the machine ''' with salt.utils.winapi.Com(): nt = win32com.client.Dispatch('AdsNameSpaces') results = nt.GetObject...
[ "def", "_get_all_groups", "(", ")", ":", "with", "salt", ".", "utils", ".", "winapi", ".", "Com", "(", ")", ":", "nt", "=", "win32com", ".", "client", ".", "Dispatch", "(", "'AdsNameSpaces'", ")", "results", "=", "nt", ".", "GetObject", "(", "''", ",...
A helper function that gets a list of group objects for all groups on the machine Returns: iter: A list of objects for all groups on the machine
[ "A", "helper", "function", "that", "gets", "a", "list", "of", "group", "objects", "for", "all", "groups", "on", "the", "machine" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L70-L82
train
saltstack/salt
salt/modules/win_groupadd.py
add
def add(name, **kwargs): ''' Add the specified group Args: name (str): The name of the group to add Returns: bool: ``True`` if successful, otherwise ``False`` CLI Example: .. code-block:: bash salt '*' group.add foo ''' if not info(name): ...
python
def add(name, **kwargs): ''' Add the specified group Args: name (str): The name of the group to add Returns: bool: ``True`` if successful, otherwise ``False`` CLI Example: .. code-block:: bash salt '*' group.add foo ''' if not info(name): ...
[ "def", "add", "(", "name", ",", "*", "*", "kwargs", ")", ":", "if", "not", "info", "(", "name", ")", ":", "comp_obj", "=", "_get_computer_object", "(", ")", "try", ":", "new_group", "=", "comp_obj", ".", "Create", "(", "'group'", ",", "name", ")", ...
Add the specified group Args: name (str): The name of the group to add Returns: bool: ``True`` if successful, otherwise ``False`` CLI Example: .. code-block:: bash salt '*' group.add foo
[ "Add", "the", "specified", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L96-L128
train
saltstack/salt
salt/modules/win_groupadd.py
delete
def delete(name, **kwargs): ''' Remove the named group Args: name (str): The name of the group to remove Returns: bool: ``True`` if successful, otherwise ``False`` CLI Example: .. code-block:: bash salt '*' group.delete foo ''' if info(name): ...
python
def delete(name, **kwargs): ''' Remove the named group Args: name (str): The name of the group to remove Returns: bool: ``True`` if successful, otherwise ``False`` CLI Example: .. code-block:: bash salt '*' group.delete foo ''' if info(name): ...
[ "def", "delete", "(", "name", ",", "*", "*", "kwargs", ")", ":", "if", "info", "(", "name", ")", ":", "comp_obj", "=", "_get_computer_object", "(", ")", "try", ":", "comp_obj", ".", "Delete", "(", "'group'", ",", "name", ")", "log", ".", "info", "(...
Remove the named group Args: name (str): The name of the group to remove Returns: bool: ``True`` if successful, otherwise ``False`` CLI Example: .. code-block:: bash salt '*' group.delete foo
[ "Remove", "the", "named", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L131-L163
train
saltstack/salt
salt/modules/win_groupadd.py
info
def info(name): ''' Return information about a group Args: name (str): The name of the group for which to get information Returns: dict: A dictionary of information about the group CLI Example: .. code-block:: bash salt '*' group.info foo ''' try...
python
def info(name): ''' Return information about a group Args: name (str): The name of the group for which to get information Returns: dict: A dictionary of information about the group CLI Example: .. code-block:: bash salt '*' group.info foo ''' try...
[ "def", "info", "(", "name", ")", ":", "try", ":", "groupObj", "=", "_get_group_object", "(", "name", ")", "gr_name", "=", "groupObj", ".", "Name", "gr_mem", "=", "[", "_get_username", "(", "x", ")", "for", "x", "in", "groupObj", ".", "members", "(", ...
Return information about a group Args: name (str): The name of the group for which to get information Returns: dict: A dictionary of information about the group CLI Example: .. code-block:: bash salt '*' group.info foo
[ "Return", "information", "about", "a", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L166-L200
train
saltstack/salt
salt/modules/win_groupadd.py
getent
def getent(refresh=False): ''' Return info on all groups Args: refresh (bool): Refresh the info for all groups in ``__context__``. If False only the groups in ``__context__`` will be returned. If True the ``__context__`` will be refreshed with current data and r...
python
def getent(refresh=False): ''' Return info on all groups Args: refresh (bool): Refresh the info for all groups in ``__context__``. If False only the groups in ``__context__`` will be returned. If True the ``__context__`` will be refreshed with current data and r...
[ "def", "getent", "(", "refresh", "=", "False", ")", ":", "if", "'group.getent'", "in", "__context__", "and", "not", "refresh", ":", "return", "__context__", "[", "'group.getent'", "]", "ret", "=", "[", "]", "results", "=", "_get_all_groups", "(", ")", "for...
Return info on all groups Args: refresh (bool): Refresh the info for all groups in ``__context__``. If False only the groups in ``__context__`` will be returned. If True the ``__context__`` will be refreshed with current data and returned. Default is False ...
[ "Return", "info", "on", "all", "groups" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L203-L238
train
saltstack/salt
salt/modules/win_groupadd.py
adduser
def adduser(name, username, **kwargs): ''' Add a user to a group Args: name (str): The name of the group to modify username (str): The name of the user to add to the group Returns: bool: ``True`` if successful, otherwise ``False`` CLI Example: ...
python
def adduser(name, username, **kwargs): ''' Add a user to a group Args: name (str): The name of the group to modify username (str): The name of the user to add to the group Returns: bool: ``True`` if successful, otherwise ``False`` CLI Example: ...
[ "def", "adduser", "(", "name", ",", "username", ",", "*", "*", "kwargs", ")", ":", "try", ":", "group_obj", "=", "_get_group_object", "(", "name", ")", "except", "pywintypes", ".", "com_error", "as", "exc", ":", "msg", "=", "'Failed to access group {0}. {1}'...
Add a user to a group Args: name (str): The name of the group to modify username (str): The name of the user to add to the group Returns: bool: ``True`` if successful, otherwise ``False`` CLI Example: .. code-block:: bash salt '*' group.addu...
[ "Add", "a", "user", "to", "a", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L241-L286
train
saltstack/salt
salt/modules/win_groupadd.py
members
def members(name, members_list, **kwargs): ''' Ensure a group contains only the members in the list Args: name (str): The name of the group to modify members_list (str): A single user or a comma separated list of users. The group will contain only the u...
python
def members(name, members_list, **kwargs): ''' Ensure a group contains only the members in the list Args: name (str): The name of the group to modify members_list (str): A single user or a comma separated list of users. The group will contain only the u...
[ "def", "members", "(", "name", ",", "members_list", ",", "*", "*", "kwargs", ")", ":", "members_list", "=", "[", "salt", ".", "utils", ".", "win_functions", ".", "get_sam_name", "(", "m", ")", "for", "m", "in", "members_list", ".", "split", "(", "\",\"...
Ensure a group contains only the members in the list Args: name (str): The name of the group to modify members_list (str): A single user or a comma separated list of users. The group will contain only the users specified in this list. Returns: bool...
[ "Ensure", "a", "group", "contains", "only", "the", "members", "in", "the", "list" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L336-L405
train
saltstack/salt
salt/modules/win_groupadd.py
list_groups
def list_groups(refresh=False): ''' Return a list of groups Args: refresh (bool): Refresh the info for all groups in ``__context__``. If False only the groups in ``__context__`` will be returned. If True, the ``__context__`` will be refreshed with current data a...
python
def list_groups(refresh=False): ''' Return a list of groups Args: refresh (bool): Refresh the info for all groups in ``__context__``. If False only the groups in ``__context__`` will be returned. If True, the ``__context__`` will be refreshed with current data a...
[ "def", "list_groups", "(", "refresh", "=", "False", ")", ":", "if", "'group.list_groups'", "in", "__context__", "and", "not", "refresh", ":", "return", "__context__", "[", "'group.list_groups'", "]", "results", "=", "_get_all_groups", "(", ")", "ret", "=", "["...
Return a list of groups Args: refresh (bool): Refresh the info for all groups in ``__context__``. If False only the groups in ``__context__`` will be returned. If True, the ``__context__`` will be refreshed with current data and returned. Default is False ...
[ "Return", "a", "list", "of", "groups" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L408-L441
train
saltstack/salt
salt/utils/decorators/signature.py
identical_signature_wrapper
def identical_signature_wrapper(original_function, wrapped_function): ''' Return a function with identical signature as ``original_function``'s which will call the ``wrapped_function``. ''' context = {'__wrapped__': wrapped_function} function_def = compile( 'def {0}({1}):\n' ' ...
python
def identical_signature_wrapper(original_function, wrapped_function): ''' Return a function with identical signature as ``original_function``'s which will call the ``wrapped_function``. ''' context = {'__wrapped__': wrapped_function} function_def = compile( 'def {0}({1}):\n' ' ...
[ "def", "identical_signature_wrapper", "(", "original_function", ",", "wrapped_function", ")", ":", "context", "=", "{", "'__wrapped__'", ":", "wrapped_function", "}", "function_def", "=", "compile", "(", "'def {0}({1}):\\n'", "' return __wrapped__({2})'", ".", "format"...
Return a function with identical signature as ``original_function``'s which will call the ``wrapped_function``.
[ "Return", "a", "function", "with", "identical", "signature", "as", "original_function", "s", "which", "will", "call", "the", "wrapped_function", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/decorators/signature.py#L18-L43
train
saltstack/salt
salt/modules/openvswitch.py
_stdout_list_split
def _stdout_list_split(retcode, stdout='', splitstring='\n'): ''' Evaulates Open vSwitch command`s retcode value. Args: retcode: Value of retcode field from response, should be 0, 1 or 2. stdout: Value of stdout filed from response. splitstring: String used to split the stdout defau...
python
def _stdout_list_split(retcode, stdout='', splitstring='\n'): ''' Evaulates Open vSwitch command`s retcode value. Args: retcode: Value of retcode field from response, should be 0, 1 or 2. stdout: Value of stdout filed from response. splitstring: String used to split the stdout defau...
[ "def", "_stdout_list_split", "(", "retcode", ",", "stdout", "=", "''", ",", "splitstring", "=", "'\\n'", ")", ":", "if", "retcode", "==", "0", ":", "ret", "=", "stdout", ".", "split", "(", "splitstring", ")", "return", "ret", "else", ":", "return", "Fa...
Evaulates Open vSwitch command`s retcode value. Args: retcode: Value of retcode field from response, should be 0, 1 or 2. stdout: Value of stdout filed from response. splitstring: String used to split the stdout default new line. Returns: List or False.
[ "Evaulates", "Open", "vSwitch", "command", "s", "retcode", "value", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L80-L96
train
saltstack/salt
salt/modules/openvswitch.py
_convert_json
def _convert_json(obj): ''' Converts from the JSON output provided by ovs-vsctl into a usable Python object tree. In particular, sets and maps are converted from lists to actual sets or maps. Args: obj: Object that shall be recursively converted. Returns: Converted version of o...
python
def _convert_json(obj): ''' Converts from the JSON output provided by ovs-vsctl into a usable Python object tree. In particular, sets and maps are converted from lists to actual sets or maps. Args: obj: Object that shall be recursively converted. Returns: Converted version of o...
[ "def", "_convert_json", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "dict", ")", ":", "return", "{", "_convert_json", "(", "key", ")", ":", "_convert_json", "(", "val", ")", "for", "(", "key", ",", "val", ")", "in", "six", ".", "iter...
Converts from the JSON output provided by ovs-vsctl into a usable Python object tree. In particular, sets and maps are converted from lists to actual sets or maps. Args: obj: Object that shall be recursively converted. Returns: Converted version of object.
[ "Converts", "from", "the", "JSON", "output", "provided", "by", "ovs", "-", "vsctl", "into", "a", "usable", "Python", "object", "tree", ".", "In", "particular", "sets", "and", "maps", "are", "converted", "from", "lists", "to", "actual", "sets", "or", "maps"...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L99-L129
train
saltstack/salt
salt/modules/openvswitch.py
bridge_list
def bridge_list(): ''' Lists all existing real and fake bridges. Returns: List of bridges (or empty list), False on failure. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' openvswitch.bridge_list ''' cmd = 'ovs-vsctl list-br' result = __salt...
python
def bridge_list(): ''' Lists all existing real and fake bridges. Returns: List of bridges (or empty list), False on failure. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' openvswitch.bridge_list ''' cmd = 'ovs-vsctl list-br' result = __salt...
[ "def", "bridge_list", "(", ")", ":", "cmd", "=", "'ovs-vsctl list-br'", "result", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ")", "retcode", "=", "result", "[", "'retcode'", "]", "stdout", "=", "result", "[", "'stdout'", "]", "return", "_stdou...
Lists all existing real and fake bridges. Returns: List of bridges (or empty list), False on failure. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' openvswitch.bridge_list
[ "Lists", "all", "existing", "real", "and", "fake", "bridges", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L147-L165
train
saltstack/salt
salt/modules/openvswitch.py
bridge_exists
def bridge_exists(br): ''' Tests whether bridge exists as a real or fake bridge. Returns: True if Bridge exists, else False. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' openvswitch.bridge_exists br0 ''' cmd = 'ovs-vsctl br-exists {0}'.format...
python
def bridge_exists(br): ''' Tests whether bridge exists as a real or fake bridge. Returns: True if Bridge exists, else False. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' openvswitch.bridge_exists br0 ''' cmd = 'ovs-vsctl br-exists {0}'.format...
[ "def", "bridge_exists", "(", "br", ")", ":", "cmd", "=", "'ovs-vsctl br-exists {0}'", ".", "format", "(", "br", ")", "result", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ")", "retcode", "=", "result", "[", "'retcode'", "]", "return", "_retcode...
Tests whether bridge exists as a real or fake bridge. Returns: True if Bridge exists, else False. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' openvswitch.bridge_exists br0
[ "Tests", "whether", "bridge", "exists", "as", "a", "real", "or", "fake", "bridge", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L168-L185
train
saltstack/salt
salt/modules/openvswitch.py
bridge_create
def bridge_create(br, may_exist=True, parent=None, vlan=None): ''' Creates a new bridge. Args: br: A string - bridge name may_exist: Bool, if False - attempting to create a bridge that exists returns False. parent: String, the name of the parent bridge (if the bridge shall be ...
python
def bridge_create(br, may_exist=True, parent=None, vlan=None): ''' Creates a new bridge. Args: br: A string - bridge name may_exist: Bool, if False - attempting to create a bridge that exists returns False. parent: String, the name of the parent bridge (if the bridge shall be ...
[ "def", "bridge_create", "(", "br", ",", "may_exist", "=", "True", ",", "parent", "=", "None", ",", "vlan", "=", "None", ")", ":", "param_may_exist", "=", "_param_may_exist", "(", "may_exist", ")", "if", "parent", "is", "not", "None", "and", "vlan", "is",...
Creates a new bridge. Args: br: A string - bridge name may_exist: Bool, if False - attempting to create a bridge that exists returns False. parent: String, the name of the parent bridge (if the bridge shall be created as a fake bridge). If specified, vlan must also be ...
[ "Creates", "a", "new", "bridge", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L188-L223
train
saltstack/salt
salt/modules/openvswitch.py
bridge_delete
def bridge_delete(br, if_exists=True): ''' Deletes bridge and all of its ports. Args: br: A string - bridge name if_exists: Bool, if False - attempting to delete a bridge that does not exist returns False. Returns: True on success, else False. .. versionadded:: 2016.3.0 ...
python
def bridge_delete(br, if_exists=True): ''' Deletes bridge and all of its ports. Args: br: A string - bridge name if_exists: Bool, if False - attempting to delete a bridge that does not exist returns False. Returns: True on success, else False. .. versionadded:: 2016.3.0 ...
[ "def", "bridge_delete", "(", "br", ",", "if_exists", "=", "True", ")", ":", "param_if_exists", "=", "_param_if_exists", "(", "if_exists", ")", "cmd", "=", "'ovs-vsctl {1}del-br {0}'", ".", "format", "(", "br", ",", "param_if_exists", ")", "result", "=", "__sal...
Deletes bridge and all of its ports. Args: br: A string - bridge name if_exists: Bool, if False - attempting to delete a bridge that does not exist returns False. Returns: True on success, else False. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash ...
[ "Deletes", "bridge", "and", "all", "of", "its", "ports", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L226-L248
train
saltstack/salt
salt/modules/openvswitch.py
bridge_to_parent
def bridge_to_parent(br): ''' Returns the parent bridge of a bridge. Args: br: A string - bridge name Returns: Name of the parent bridge. This is the same as the bridge name if the bridge is not a fake bridge. If the bridge does not exist, False is returned. CLI Ex...
python
def bridge_to_parent(br): ''' Returns the parent bridge of a bridge. Args: br: A string - bridge name Returns: Name of the parent bridge. This is the same as the bridge name if the bridge is not a fake bridge. If the bridge does not exist, False is returned. CLI Ex...
[ "def", "bridge_to_parent", "(", "br", ")", ":", "cmd", "=", "'ovs-vsctl br-to-parent {0}'", ".", "format", "(", "br", ")", "result", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ")", "if", "result", "[", "'retcode'", "]", "!=", "0", ":", "retu...
Returns the parent bridge of a bridge. Args: br: A string - bridge name Returns: Name of the parent bridge. This is the same as the bridge name if the bridge is not a fake bridge. If the bridge does not exist, False is returned. CLI Example: .. code-block:: bash ...
[ "Returns", "the", "parent", "bridge", "of", "a", "bridge", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L251-L274
train
saltstack/salt
salt/modules/openvswitch.py
bridge_to_vlan
def bridge_to_vlan(br): ''' Returns the VLAN ID of a bridge. Args: br: A string - bridge name Returns: VLAN ID of the bridge. The VLAN ID is 0 if the bridge is not a fake bridge. If the bridge does not exist, False is returned. CLI Example: .. code-block:: bash ...
python
def bridge_to_vlan(br): ''' Returns the VLAN ID of a bridge. Args: br: A string - bridge name Returns: VLAN ID of the bridge. The VLAN ID is 0 if the bridge is not a fake bridge. If the bridge does not exist, False is returned. CLI Example: .. code-block:: bash ...
[ "def", "bridge_to_vlan", "(", "br", ")", ":", "cmd", "=", "'ovs-vsctl br-to-vlan {0}'", ".", "format", "(", "br", ")", "result", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ")", "if", "result", "[", "'retcode'", "]", "!=", "0", ":", "return",...
Returns the VLAN ID of a bridge. Args: br: A string - bridge name Returns: VLAN ID of the bridge. The VLAN ID is 0 if the bridge is not a fake bridge. If the bridge does not exist, False is returned. CLI Example: .. code-block:: bash salt '*' openvswitch.bridge_to_p...
[ "Returns", "the", "VLAN", "ID", "of", "a", "bridge", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L277-L298
train
saltstack/salt
salt/modules/openvswitch.py
port_add
def port_add(br, port, may_exist=False, internal=False): ''' Creates on bridge a new port named port. Returns: True on success, else False. Args: br: A string - bridge name port: A string - port name may_exist: Bool, if False - attempting to create a port that exists re...
python
def port_add(br, port, may_exist=False, internal=False): ''' Creates on bridge a new port named port. Returns: True on success, else False. Args: br: A string - bridge name port: A string - port name may_exist: Bool, if False - attempting to create a port that exists re...
[ "def", "port_add", "(", "br", ",", "port", ",", "may_exist", "=", "False", ",", "internal", "=", "False", ")", ":", "param_may_exist", "=", "_param_may_exist", "(", "may_exist", ")", "cmd", "=", "'ovs-vsctl {2}add-port {0} {1}'", ".", "format", "(", "br", ",...
Creates on bridge a new port named port. Returns: True on success, else False. Args: br: A string - bridge name port: A string - port name may_exist: Bool, if False - attempting to create a port that exists returns False. internal: A boolean to create an internal interf...
[ "Creates", "on", "bridge", "a", "new", "port", "named", "port", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L301-L327
train
saltstack/salt
salt/modules/openvswitch.py
port_remove
def port_remove(br, port, if_exists=True): ''' Deletes port. Args: br: A string - bridge name (If bridge is None, port is removed from whatever bridge contains it) port: A string - port name. if_exists: Bool, if False - attempting to delete a por that does not exist returns Fals...
python
def port_remove(br, port, if_exists=True): ''' Deletes port. Args: br: A string - bridge name (If bridge is None, port is removed from whatever bridge contains it) port: A string - port name. if_exists: Bool, if False - attempting to delete a por that does not exist returns Fals...
[ "def", "port_remove", "(", "br", ",", "port", ",", "if_exists", "=", "True", ")", ":", "param_if_exists", "=", "_param_if_exists", "(", "if_exists", ")", "if", "port", "and", "not", "br", ":", "cmd", "=", "'ovs-vsctl {1}del-port {0}'", ".", "format", "(", ...
Deletes port. Args: br: A string - bridge name (If bridge is None, port is removed from whatever bridge contains it) port: A string - port name. if_exists: Bool, if False - attempting to delete a por that does not exist returns False. (Default True) Returns: True on success,...
[ "Deletes", "port", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L330-L357
train
saltstack/salt
salt/modules/openvswitch.py
port_list
def port_list(br): ''' Lists all of the ports within bridge. Args: br: A string - bridge name. Returns: List of bridges (or empty list), False on failure. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' openvswitch.port_list br0 ''' ...
python
def port_list(br): ''' Lists all of the ports within bridge. Args: br: A string - bridge name. Returns: List of bridges (or empty list), False on failure. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' openvswitch.port_list br0 ''' ...
[ "def", "port_list", "(", "br", ")", ":", "cmd", "=", "'ovs-vsctl list-ports {0}'", ".", "format", "(", "br", ")", "result", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ")", "retcode", "=", "result", "[", "'retcode'", "]", "stdout", "=", "resu...
Lists all of the ports within bridge. Args: br: A string - bridge name. Returns: List of bridges (or empty list), False on failure. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' openvswitch.port_list br0
[ "Lists", "all", "of", "the", "ports", "within", "bridge", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L360-L381
train
saltstack/salt
salt/modules/openvswitch.py
port_get_tag
def port_get_tag(port): ''' Lists tags of the port. Args: port: A string - port name. Returns: List of tags (or empty list), False on failure. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' openvswitch.port_get_tag tap0 ''' cmd = 'o...
python
def port_get_tag(port): ''' Lists tags of the port. Args: port: A string - port name. Returns: List of tags (or empty list), False on failure. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' openvswitch.port_get_tag tap0 ''' cmd = 'o...
[ "def", "port_get_tag", "(", "port", ")", ":", "cmd", "=", "'ovs-vsctl get port {0} tag'", ".", "format", "(", "port", ")", "result", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ")", "retcode", "=", "result", "[", "'retcode'", "]", "stdout", "="...
Lists tags of the port. Args: port: A string - port name. Returns: List of tags (or empty list), False on failure. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' openvswitch.port_get_tag tap0
[ "Lists", "tags", "of", "the", "port", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L384-L405
train
saltstack/salt
salt/modules/openvswitch.py
port_create_vlan
def port_create_vlan(br, port, id, internal=False): ''' Isolate VM traffic using VLANs. Args: br: A string - bridge name. port: A string - port name. id: An integer in the valid range 0 to 4095 (inclusive), name of VLAN. internal: A boolean to create an internal interface if...
python
def port_create_vlan(br, port, id, internal=False): ''' Isolate VM traffic using VLANs. Args: br: A string - bridge name. port: A string - port name. id: An integer in the valid range 0 to 4095 (inclusive), name of VLAN. internal: A boolean to create an internal interface if...
[ "def", "port_create_vlan", "(", "br", ",", "port", ",", "id", ",", "internal", "=", "False", ")", ":", "interfaces", "=", "__salt__", "[", "'network.interfaces'", "]", "(", ")", "if", "not", "0", "<=", "id", "<=", "4095", ":", "return", "False", "elif"...
Isolate VM traffic using VLANs. Args: br: A string - bridge name. port: A string - port name. id: An integer in the valid range 0 to 4095 (inclusive), name of VLAN. internal: A boolean to create an internal interface if one does not exist. Returns: True on success, else...
[ "Isolate", "VM", "traffic", "using", "VLANs", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L456-L494
train
saltstack/salt
salt/modules/openvswitch.py
port_create_gre
def port_create_gre(br, port, id, remote): ''' Generic Routing Encapsulation - creates GRE tunnel between endpoints. Args: br: A string - bridge name. port: A string - port name. id: An integer - unsigned 32-bit number, tunnel's key. remote: A string - remote endpoint's IP a...
python
def port_create_gre(br, port, id, remote): ''' Generic Routing Encapsulation - creates GRE tunnel between endpoints. Args: br: A string - bridge name. port: A string - port name. id: An integer - unsigned 32-bit number, tunnel's key. remote: A string - remote endpoint's IP a...
[ "def", "port_create_gre", "(", "br", ",", "port", ",", "id", ",", "remote", ")", ":", "if", "not", "0", "<=", "id", "<", "2", "**", "32", ":", "return", "False", "elif", "not", "__salt__", "[", "'dig.check_ip'", "]", "(", "remote", ")", ":", "retur...
Generic Routing Encapsulation - creates GRE tunnel between endpoints. Args: br: A string - bridge name. port: A string - port name. id: An integer - unsigned 32-bit number, tunnel's key. remote: A string - remote endpoint's IP address. Returns: True on success, else Fal...
[ "Generic", "Routing", "Encapsulation", "-", "creates", "GRE", "tunnel", "between", "endpoints", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L497-L531
train
saltstack/salt
salt/modules/openvswitch.py
port_create_vxlan
def port_create_vxlan(br, port, id, remote, dst_port=None): ''' Virtual eXtensible Local Area Network - creates VXLAN tunnel between endpoints. Args: br: A string - bridge name. port: A string - port name. id: An integer - unsigned 64-bit number, tunnel's key. remote: A stri...
python
def port_create_vxlan(br, port, id, remote, dst_port=None): ''' Virtual eXtensible Local Area Network - creates VXLAN tunnel between endpoints. Args: br: A string - bridge name. port: A string - port name. id: An integer - unsigned 64-bit number, tunnel's key. remote: A stri...
[ "def", "port_create_vxlan", "(", "br", ",", "port", ",", "id", ",", "remote", ",", "dst_port", "=", "None", ")", ":", "dst_port", "=", "' options:dst_port='", "+", "six", ".", "text_type", "(", "dst_port", ")", "if", "0", "<", "dst_port", "<=", "65535", ...
Virtual eXtensible Local Area Network - creates VXLAN tunnel between endpoints. Args: br: A string - bridge name. port: A string - port name. id: An integer - unsigned 64-bit number, tunnel's key. remote: A string - remote endpoint's IP address. dst_port: An integer - port t...
[ "Virtual", "eXtensible", "Local", "Area", "Network", "-", "creates", "VXLAN", "tunnel", "between", "endpoints", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L534-L571
train
saltstack/salt
salt/modules/openvswitch.py
db_get
def db_get(table, record, column, if_exists=False): ''' Gets a column's value for a specific record. Args: table: A string - name of the database table. record: A string - identifier of the record. column: A string - name of the column. if_exists: A boolean - if True, it is ...
python
def db_get(table, record, column, if_exists=False): ''' Gets a column's value for a specific record. Args: table: A string - name of the database table. record: A string - identifier of the record. column: A string - name of the column. if_exists: A boolean - if True, it is ...
[ "def", "db_get", "(", "table", ",", "record", ",", "column", ",", "if_exists", "=", "False", ")", ":", "cmd", "=", "[", "'ovs-vsctl'", ",", "'--format=json'", ",", "'--columns={0}'", ".", "format", "(", "column", ")", "]", "if", "if_exists", ":", "cmd", ...
Gets a column's value for a specific record. Args: table: A string - name of the database table. record: A string - identifier of the record. column: A string - name of the column. if_exists: A boolean - if True, it is not an error if the record does not exist. Retu...
[ "Gets", "a", "column", "s", "value", "for", "a", "specific", "record", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L574-L604
train
saltstack/salt
salt/modules/openvswitch.py
db_set
def db_set(table, record, column, value, if_exists=False): ''' Sets a column's value for a specific record. Args: table: A string - name of the database table. record: A string - identifier of the record. column: A string - name of the column. value: A string - the value to ...
python
def db_set(table, record, column, value, if_exists=False): ''' Sets a column's value for a specific record. Args: table: A string - name of the database table. record: A string - identifier of the record. column: A string - name of the column. value: A string - the value to ...
[ "def", "db_set", "(", "table", ",", "record", ",", "column", ",", "value", ",", "if_exists", "=", "False", ")", ":", "cmd", "=", "[", "'ovs-vsctl'", "]", "if", "if_exists", ":", "cmd", "+=", "[", "'--if-exists'", "]", "cmd", "+=", "[", "'set'", ",", ...
Sets a column's value for a specific record. Args: table: A string - name of the database table. record: A string - identifier of the record. column: A string - name of the column. value: A string - the value to be set if_exists: A boolean - if True, it is not an error if th...
[ "Sets", "a", "column", "s", "value", "for", "a", "specific", "record", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L607-L635
train
saltstack/salt
salt/states/azurearm_network.py
virtual_network_present
def virtual_network_present(name, address_prefixes, resource_group, dns_servers=None, tags=None, connection_auth=None, **kwargs): ''' .. versionadded:: 2019.2.0 Ensure a virtual network exists. :param name: Name of the virtual network. :param resource_group: ...
python
def virtual_network_present(name, address_prefixes, resource_group, dns_servers=None, tags=None, connection_auth=None, **kwargs): ''' .. versionadded:: 2019.2.0 Ensure a virtual network exists. :param name: Name of the virtual network. :param resource_group: ...
[ "def", "virtual_network_present", "(", "name", ",", "address_prefixes", ",", "resource_group", ",", "dns_servers", "=", "None", ",", "tags", "=", "None", ",", "connection_auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":"...
.. versionadded:: 2019.2.0 Ensure a virtual network exists. :param name: Name of the virtual network. :param resource_group: The resource group assigned to the virtual network. :param address_prefixes: A list of CIDR blocks which can be used by subnets within the virtual netw...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L112-L258
train
saltstack/salt
salt/states/azurearm_network.py
virtual_network_absent
def virtual_network_absent(name, resource_group, connection_auth=None): ''' .. versionadded:: 2019.2.0 Ensure a virtual network does not exist in the resource group. :param name: Name of the virtual network. :param resource_group: The resource group assigned to the virtual network...
python
def virtual_network_absent(name, resource_group, connection_auth=None): ''' .. versionadded:: 2019.2.0 Ensure a virtual network does not exist in the resource group. :param name: Name of the virtual network. :param resource_group: The resource group assigned to the virtual network...
[ "def", "virtual_network_absent", "(", "name", ",", "resource_group", ",", "connection_auth", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", ...
.. versionadded:: 2019.2.0 Ensure a virtual network does not exist in the resource group. :param name: Name of the virtual network. :param resource_group: The resource group assigned to the virtual network. :param connection_auth: A dict with subscription and authentication p...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L261-L321
train
saltstack/salt
salt/states/azurearm_network.py
subnet_present
def subnet_present(name, address_prefix, virtual_network, resource_group, security_group=None, route_table=None, connection_auth=None, **kwargs): ''' .. versionadded:: 2019.2.0 Ensure a subnet exists. :param name: Name of the subnet. :param address_prefix: A CID...
python
def subnet_present(name, address_prefix, virtual_network, resource_group, security_group=None, route_table=None, connection_auth=None, **kwargs): ''' .. versionadded:: 2019.2.0 Ensure a subnet exists. :param name: Name of the subnet. :param address_prefix: A CID...
[ "def", "subnet_present", "(", "name", ",", "address_prefix", ",", "virtual_network", ",", "resource_group", ",", "security_group", "=", "None", ",", "route_table", "=", "None", ",", "connection_auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=...
.. versionadded:: 2019.2.0 Ensure a subnet exists. :param name: Name of the subnet. :param address_prefix: A CIDR block used by the subnet within the virtual network. :param virtual_network: Name of the existing virtual network to contain the subnet. :param resource_grou...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L324-L463
train
saltstack/salt
salt/states/azurearm_network.py
subnet_absent
def subnet_absent(name, virtual_network, resource_group, connection_auth=None): ''' .. versionadded:: 2019.2.0 Ensure a virtual network does not exist in the virtual network. :param name: Name of the subnet. :param virtual_network: Name of the existing virtual network containing t...
python
def subnet_absent(name, virtual_network, resource_group, connection_auth=None): ''' .. versionadded:: 2019.2.0 Ensure a virtual network does not exist in the virtual network. :param name: Name of the subnet. :param virtual_network: Name of the existing virtual network containing t...
[ "def", "subnet_absent", "(", "name", ",", "virtual_network", ",", "resource_group", ",", "connection_auth", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", ",", "'changes'", ":", ...
.. versionadded:: 2019.2.0 Ensure a virtual network does not exist in the virtual network. :param name: Name of the subnet. :param virtual_network: Name of the existing virtual network containing the subnet. :param resource_group: The resource group assigned to the virtual ne...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L466-L530
train
saltstack/salt
salt/states/azurearm_network.py
network_security_group_present
def network_security_group_present(name, resource_group, tags=None, security_rules=None, connection_auth=None, **kwargs): ''' .. versionadded:: 2019.2.0 Ensure a network security group exists. :param name: Name of the network security group. :param resou...
python
def network_security_group_present(name, resource_group, tags=None, security_rules=None, connection_auth=None, **kwargs): ''' .. versionadded:: 2019.2.0 Ensure a network security group exists. :param name: Name of the network security group. :param resou...
[ "def", "network_security_group_present", "(", "name", ",", "resource_group", ",", "tags", "=", "None", ",", "security_rules", "=", "None", ",", "connection_auth", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", ...
.. versionadded:: 2019.2.0 Ensure a network security group exists. :param name: Name of the network security group. :param resource_group: The resource group assigned to the network security group. :param tags: A dictionary of strings can be passed as tag metadata to the netw...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L533-L671
train
saltstack/salt
salt/states/azurearm_network.py
network_security_group_absent
def network_security_group_absent(name, resource_group, connection_auth=None): ''' .. versionadded:: 2019.2.0 Ensure a network security group does not exist in the resource group. :param name: Name of the network security group. :param resource_group: The resource group assigned t...
python
def network_security_group_absent(name, resource_group, connection_auth=None): ''' .. versionadded:: 2019.2.0 Ensure a network security group does not exist in the resource group. :param name: Name of the network security group. :param resource_group: The resource group assigned t...
[ "def", "network_security_group_absent", "(", "name", ",", "resource_group", ",", "connection_auth", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", ...
.. versionadded:: 2019.2.0 Ensure a network security group does not exist in the resource group. :param name: Name of the network security group. :param resource_group: The resource group assigned to the network security group. :param connection_auth: A dict with subscription...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L674-L734
train
saltstack/salt
salt/states/azurearm_network.py
security_rule_present
def security_rule_present(name, access, direction, priority, protocol, security_group, resource_group, destination_address_prefix=None, destination_port_range=None, source_address_prefix=None, source_port_range=None, description=None, destination_address_prefixes=None...
python
def security_rule_present(name, access, direction, priority, protocol, security_group, resource_group, destination_address_prefix=None, destination_port_range=None, source_address_prefix=None, source_port_range=None, description=None, destination_address_prefixes=None...
[ "def", "security_rule_present", "(", "name", ",", "access", ",", "direction", ",", "priority", ",", "protocol", ",", "security_group", ",", "resource_group", ",", "destination_address_prefix", "=", "None", ",", "destination_port_range", "=", "None", ",", "source_add...
.. versionadded:: 2019.2.0 Ensure a security rule exists. :param name: Name of the security rule. :param access: 'allow' or 'deny' :param direction: 'inbound' or 'outbound' :param priority: Integer between 100 and 4096 used for ordering rule application. :pa...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L737-L1052
train