repository_name
stringclasses
316 values
func_path_in_repository
stringlengths
6
223
func_name
stringlengths
1
134
language
stringclasses
1 value
func_code_string
stringlengths
57
65.5k
func_documentation_string
stringlengths
1
46.3k
split_name
stringclasses
1 value
func_code_url
stringlengths
91
315
called_functions
listlengths
1
156
enclosing_scope
stringlengths
2
1.48M
saltstack/salt
salt/utils/vmware.py
get_dvss
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...
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.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1053-L1090
[ "def get_mors_with_properties(service_instance, object_type, property_list=None,\n container_ref=None, traversal_spec=None,\n local_properties=False):\n '''\n Returns a list containing properties and managed object references for the managed object.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_network_folder
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...
Retrieves the network folder of a datacenter
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1093-L1113
[ "def get_mors_with_properties(service_instance, object_type, property_list=None,\n container_ref=None, traversal_spec=None,\n local_properties=False):\n '''\n Returns a list containing properties and managed object references for the managed object.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
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_...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1116-L1152
[ "def wait_for_task(task, instance_name, task_type, sleep_seconds=1, log_level='debug'):\n '''\n Waits for a task to be completed.\n\n task\n The task to wait for.\n\n instance_name\n The name of the ESXi host, vCenter Server, or Virtual Machine that\n the task is being run on.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
update_dvs
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...
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.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1155-L1181
[ "def wait_for_task(task, instance_name, task_type, sleep_seconds=1, log_level='debug'):\n '''\n Waits for a task to be completed.\n\n task\n The task to wait for.\n\n instance_name\n The name of the ESXi host, vCenter Server, or Virtual Machine that\n the task is being run on.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
set_dvs_network_resource_management_enabled
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...
Sets whether NIOC is enabled on a DVS. dvs_ref The DVS reference. enabled Flag specifying whether NIOC is enabled.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1184-L1209
[ "def get_managed_object_name(mo_ref):\n '''\n Returns the name of a managed object.\n If the name wasn't found, it returns None.\n\n mo_ref\n The managed object reference.\n '''\n props = get_properties_of_managed_object(mo_ref, ['name'])\n return props.get('name')\n" ]
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_dvportgroups
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. ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1212-L1264
[ "def get_mors_with_properties(service_instance, object_type, property_list=None,\n container_ref=None, traversal_spec=None,\n local_properties=False):\n '''\n Returns a list containing properties and managed object references for the managed object.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_uplink_dvportgroup
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...
Returns the uplink distributed virtual portgroup of a distributed virtual switch (dvs) dvs_ref The dvs reference
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1267-L1293
[ "def get_mors_with_properties(service_instance, object_type, property_list=None,\n container_ref=None, traversal_spec=None,\n local_properties=False):\n '''\n Returns a list containing properties and managed object references for the managed object.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
create_dvportgroup
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...
Creates a distributed virtual portgroup on a distributed virtual switch (dvs) dvs_ref The dvs reference spec Portgroup spec (vim.DVPortgroupConfigSpec)
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1296-L1323
[ "def wait_for_task(task, instance_name, task_type, sleep_seconds=1, log_level='debug'):\n '''\n Waits for a task to be completed.\n\n task\n The task to wait for.\n\n instance_name\n The name of the ESXi host, vCenter Server, or Virtual Machine that\n the task is being run on.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
update_dvportgroup
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) ...
Updates a distributed virtual portgroup portgroup_ref The portgroup reference spec Portgroup spec (vim.DVPortgroupConfigSpec)
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1326-L1351
[ "def wait_for_task(task, instance_name, task_type, sleep_seconds=1, log_level='debug'):\n '''\n Waits for a task to be completed.\n\n task\n The task to wait for.\n\n instance_name\n The name of the ESXi host, vCenter Server, or Virtual Machine that\n the task is being run on.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_networks
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1379-L1423
[ "def get_mors_with_properties(service_instance, object_type, property_list=None,\n container_ref=None, traversal_spec=None,\n local_properties=False):\n '''\n Returns a list containing properties and managed object references for the managed object.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
list_objects
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1426-L1447
[ "def get_mors_with_properties(service_instance, object_type, property_list=None,\n container_ref=None, traversal_spec=None,\n local_properties=False):\n '''\n Returns a list containing properties and managed object references for the managed object.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_license_manager
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...
Returns the license manager. service_instance The Service Instance Object from which to obrain the license manager.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1450-L1472
null
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_license_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 = \ ...
Returns the license assignment manager. service_instance The Service Instance Object from which to obrain the license manager.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1475-L1501
null
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_licenses
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...
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.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1504-L1531
[ "def get_license_manager(service_instance):\n '''\n Returns the license manager.\n\n service_instance\n The Service Instance Object from which to obrain the license manager.\n '''\n\n log.debug('Retrieving license manager')\n try:\n lic_manager = service_instance.content.licenseManag...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
add_license
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...
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.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1534-L1570
[ "def get_license_manager(service_instance):\n '''\n Returns the license manager.\n\n service_instance\n The Service Instance Object from which to obrain the license manager.\n '''\n\n log.debug('Retrieving license manager')\n try:\n lic_manager = service_instance.content.licenseManag...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_assigned_licenses
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1573-L1655
[ "def get_license_assignment_manager(service_instance):\n '''\n Returns the license assignment manager.\n\n service_instance\n The Service Instance Object from which to obrain the license manager.\n '''\n\n log.debug('Retrieving license assignment manager')\n try:\n lic_assignment_man...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
assign_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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1658-L1728
[ "def get_license_assignment_manager(service_instance):\n '''\n Returns the license assignment manager.\n\n service_instance\n The Service Instance Object from which to obrain the license manager.\n '''\n\n log.debug('Retrieving license assignment manager')\n try:\n lic_assignment_man...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_datacenters
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...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1741-L1762
[ "def get_mors_with_properties(service_instance, object_type, property_list=None,\n container_ref=None, traversal_spec=None,\n local_properties=False):\n '''\n Returns a list containing properties and managed object references for the managed object.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_datacenter
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, ...
Returns a vim.Datacenter managed object. service_instance The Service Instance Object from which to obtain datacenter. datacenter_name The datacenter name
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1765-L1780
[ "def get_datacenters(service_instance, datacenter_names=None,\n get_all_datacenters=False):\n '''\n Returns all datacenters in a vCenter.\n\n service_instance\n The Service Instance Object from which to obtain cluster.\n\n datacenter_names\n List of datacenter names to f...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
create_datacenter
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...
Creates a datacenter. .. versionadded:: 2017.7.0 service_instance The Service Instance Object datacenter_name The datacenter name
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1783-L1810
[ "def get_root_folder(service_instance):\n '''\n Returns the root folder of a vCenter.\n\n service_instance\n The Service Instance Object for which to obtain the root folder.\n '''\n try:\n log.trace('Retrieving root folder')\n return service_instance.RetrieveContent().rootFolder\...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_cluster
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...
Returns a cluster in a datacenter. dc_ref The datacenter reference cluster The cluster to be retrieved
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1813-L1846
[ "def get_mors_with_properties(service_instance, object_type, property_list=None,\n container_ref=None, traversal_spec=None,\n local_properties=False):\n '''\n Returns a list containing properties and managed object references for the managed object.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
create_cluster
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...
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.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1849-L1878
[ "def get_managed_object_name(mo_ref):\n '''\n Returns the name of a managed object.\n If the name wasn't found, it returns None.\n\n mo_ref\n The managed object reference.\n '''\n props = get_properties_of_managed_object(mo_ref, ['name'])\n return props.get('name')\n" ]
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
update_cluster
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...
Updates a cluster in a datacenter. cluster_ref The cluster reference. cluster_spec The cluster spec (vim.ClusterConfigSpecEx). Defaults to None.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1881-L1908
[ "def wait_for_task(task, instance_name, task_type, sleep_seconds=1, log_level='debug'):\n '''\n Waits for a task to be completed.\n\n task\n The task to wait for.\n\n instance_name\n The name of the ESXi host, vCenter Server, or Virtual Machine that\n the task is being run on.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
list_datastores_full
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 ...
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.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1941-L1956
[ "def list_objects(service_instance, vim_object, properties=None):\n '''\n Returns a simple list of objects from a given service instance.\n\n service_instance\n The Service Instance for which to obtain a list of objects.\n\n object_type\n The type of content for which to obtain information...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
list_datastore_full
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...
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.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1959-L1992
[ "def get_mor_by_name(si, obj_type, obj_name):\n '''\n Get reference to an object of specified object type and name\n\n si\n ServiceInstance for the vSphere or ESXi server (see get_service_instance)\n\n obj_type\n Type of the object (vim.StoragePod, vim.Datastore, etc)\n\n obj_name\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_mor_by_name
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 ...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1995-L2013
[ "def get_inventory(service_instance):\n '''\n Return the inventory of a Service Instance Object.\n\n service_instance\n The Service Instance Object for which to obtain inventory.\n '''\n return service_instance.RetrieveContent()\n" ]
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_mor_by_moid
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2016-L2034
[ "def get_inventory(service_instance):\n '''\n Return the inventory of a Service Instance Object.\n\n service_instance\n The Service Instance Object for which to obtain inventory.\n '''\n return service_instance.RetrieveContent()\n" ]
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_datastore_files
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...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2037-L2081
[ "def wait_for_task(task, instance_name, task_type, sleep_seconds=1, log_level='debug'):\n '''\n Waits for a task to be completed.\n\n task\n The task to wait for.\n\n instance_name\n The name of the ESXi host, vCenter Server, or Virtual Machine that\n the task is being run on.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_datastores
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2084-L2211
[ "def get_mors_with_properties(service_instance, object_type, property_list=None,\n container_ref=None, traversal_spec=None,\n local_properties=False):\n '''\n Returns a list containing properties and managed object references for the managed object.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
rename_datastore
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...
Renames a datastore datastore_ref vim.Datastore reference to the datastore object to be changed new_datastore_name New datastore name
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2214-L2238
[ "def get_managed_object_name(mo_ref):\n '''\n Returns the name of a managed object.\n If the name wasn't found, it returns None.\n\n mo_ref\n The managed object reference.\n '''\n props = get_properties_of_managed_object(mo_ref, ['name'])\n return props.get('name')\n" ]
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
_get_partition_info
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...
Returns partition informations for a device path, of type vim.HostDiskPartitionInfo
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2266-L2287
null
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
_get_new_computed_partition_spec
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2290-L2350
null
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
create_vmfs_datastore
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2353-L2412
[ "def get_managed_object_name(mo_ref):\n '''\n Returns the name of a managed object.\n If the name wasn't found, it returns None.\n\n mo_ref\n The managed object reference.\n '''\n props = get_properties_of_managed_object(mo_ref, ['name'])\n return props.get('name')\n", "def get_service...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_host_datastore_system
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...
Returns a host's datastore system host_ref Reference to the ESXi host hostname Name of the host. This argument is optional.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2415-L2443
[ "def get_mors_with_properties(service_instance, object_type, property_list=None,\n container_ref=None, traversal_spec=None,\n local_properties=False):\n '''\n Returns a list containing properties and managed object references for the managed object.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
remove_datastore
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( ...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2446-L2481
[ "def get_properties_of_managed_object(mo_ref, properties):\n '''\n Returns specific properties of a managed object, retrieved in an\n optimally.\n\n mo_ref\n The managed object reference.\n\n properties\n List of properties of the managed object to retrieve.\n '''\n service_instan...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_hosts
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...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2484-L2547
[ "def get_datacenter(service_instance, datacenter_name):\n '''\n Returns a vim.Datacenter managed object.\n\n service_instance\n The Service Instance Object from which to obtain datacenter.\n\n datacenter_name\n The datacenter name\n '''\n items = get_datacenters(service_instance,\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
_get_scsi_address_to_lun_key_map
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. ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2550-L2610
[ "def get_managed_object_name(mo_ref):\n '''\n Returns the name of a managed object.\n If the name wasn't found, it returns None.\n\n mo_ref\n The managed object reference.\n '''\n props = get_properties_of_managed_object(mo_ref, ['name'])\n return props.get('name')\n", "def get_storage...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_all_luns
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. ...
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.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2613-L2660
[ "def get_managed_object_name(mo_ref):\n '''\n Returns the name of a managed object.\n If the name wasn't found, it returns None.\n\n mo_ref\n The managed object reference.\n '''\n props = get_properties_of_managed_object(mo_ref, ['name'])\n return props.get('name')\n", "def get_service...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_scsi_address_to_lun_map
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2663-L2689
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def get_managed_object_name(mo_ref):\n '''\n Returns the name of a managed object.\n If the name wasn't found, it returns None.\n\n mo_ref\n The managed object reference.\n '''\n props = get_properties_of_managed_object(mo_ref, [...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_disks
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2692-L2745
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def get_managed_object_name(mo_ref):\n '''\n Returns the name of a managed object.\n If the name wasn't found, it returns None.\n\n mo_ref\n The managed object reference.\n '''\n props = get_properties_of_managed_object(mo_ref, [...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_disk_partition_info
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...
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.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2748-L2790
[ "def get_properties_of_managed_object(mo_ref, properties):\n '''\n Returns specific properties of a managed object, retrieved in an\n optimally.\n\n mo_ref\n The managed object reference.\n\n properties\n List of properties of the managed object to retrieve.\n '''\n service_instan...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
erase_disk_partitions
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...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2793-L2864
[ "def get_mors_with_properties(service_instance, object_type, property_list=None,\n container_ref=None, traversal_spec=None,\n local_properties=False):\n '''\n Returns a list containing properties and managed object references for the managed object.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_diskgroups
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...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2867-L2924
[ "def get_managed_object_name(mo_ref):\n '''\n Returns the name of a managed object.\n If the name wasn't found, it returns None.\n\n mo_ref\n The managed object reference.\n '''\n props = get_properties_of_managed_object(mo_ref, ['name'])\n return props.get('name')\n" ]
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
_check_disks_in_diskgroup
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( ...
Checks that the disks in a disk group are as expected and raises CheckError exceptions if the check fails
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2927-L2944
null
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_host_cache
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2948-L2985
[ "def get_mors_with_properties(service_instance, object_type, property_list=None,\n container_ref=None, traversal_spec=None,\n local_properties=False):\n '''\n Returns a list containing properties and managed object references for the managed object.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
configure_host_cache
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2989-L3040
[ "def wait_for_task(task, instance_name, task_type, sleep_seconds=1, log_level='debug'):\n '''\n Waits for a task to be completed.\n\n task\n The task to wait for.\n\n instance_name\n The name of the ESXi host, vCenter Server, or Virtual Machine that\n the task is being run on.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_resource_pools
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3053-L3097
[ "def get_datacenter(service_instance, datacenter_name):\n '''\n Returns a vim.Datacenter managed object.\n\n service_instance\n The Service Instance Object from which to obtain datacenter.\n\n datacenter_name\n The datacenter name\n '''\n items = get_datacenters(service_instance,\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
wait_for_task
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3170-L3270
null
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_vm_by_property
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3273-L3326
[ "def get_datacenter(service_instance, datacenter_name):\n '''\n Returns a vim.Datacenter managed object.\n\n service_instance\n The Service Instance Object from which to obtain datacenter.\n\n datacenter_name\n The datacenter name\n '''\n items = get_datacenters(service_instance,\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_folder
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...
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)
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3329-L3369
[ "def get_datacenter(service_instance, datacenter_name):\n '''\n Returns a vim.Datacenter managed object.\n\n service_instance\n The Service Instance Object from which to obtain datacenter.\n\n datacenter_name\n The datacenter name\n '''\n items = get_datacenters(service_instance,\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
get_placement
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3372-L3451
[ "def get_hosts(service_instance, datacenter_name=None, host_names=None,\n cluster_name=None, get_all_hosts=False):\n '''\n Returns a list of vim.HostSystem objects representing ESXi hosts\n in a vcenter filtered by their names and/or datacenter, cluster membership.\n\n service_instance\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
convert_to_kb
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 ...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3454-L3472
null
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
power_cycle_vm
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: ...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3475-L3523
[ "def wait_for_task(task, instance_name, task_type, sleep_seconds=1, log_level='debug'):\n '''\n Waits for a task to be completed.\n\n task\n The task to wait for.\n\n instance_name\n The name of the ESXi host, vCenter Server, or Virtual Machine that\n the task is being run on.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
create_vm
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...
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_...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3526-L3568
[ "def wait_for_task(task, instance_name, task_type, sleep_seconds=1, log_level='debug'):\n '''\n Waits for a task to be completed.\n\n task\n The task to wait for.\n\n instance_name\n The name of the ESXi host, vCenter Server, or Virtual Machine that\n the task is being run on.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
register_vm
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3571-L3618
[ "def wait_for_task(task, instance_name, task_type, sleep_seconds=1, log_level='debug'):\n '''\n Waits for a task to be completed.\n\n task\n The task to wait for.\n\n instance_name\n The name of the ESXi host, vCenter Server, or Virtual Machine that\n the task is being run on.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
update_vm
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3621-L3647
[ "def wait_for_task(task, instance_name, task_type, sleep_seconds=1, log_level='debug'):\n '''\n Waits for a task to be completed.\n\n task\n The task to wait for.\n\n instance_name\n The name of the ESXi host, vCenter Server, or Virtual Machine that\n the task is being run on.\n\n ...
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/utils/vmware.py
unregister_vm
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...
Destroys the virtual machine vm_ref Managed object reference of a virtual machine object
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3675-L3694
[ "def get_managed_object_name(mo_ref):\n '''\n Returns the name of a managed object.\n If the name wasn't found, it returns None.\n\n mo_ref\n The managed object reference.\n '''\n props = get_properties_of_managed_object(mo_ref, ['name'])\n return props.get('name')\n" ]
# -*- coding: utf-8 -*- ''' Connection library for VMware .. versionadded:: 2015.8.2 This is a base library used by a number of VMware services such as VMware ESX, ESXi, and vCenter servers. :codeauthor: Nitin Madhok <nmadhok@clemson.edu> :codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstanley.com> Dependenci...
saltstack/salt
salt/auth/pki.py
auth
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/pki.py#L55-L145
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- # Majority of code shamelessly stolen from # http://www.v13.gr/blog/?p=303 ''' Authenticate via a PKI certificate. .. note:: This module is Experimental and should be used with caution Provides an authenticate function that will allow the caller to authenticate a user via their public cer...
saltstack/salt
salt/utils/dictdiffer.py
RecursiveDictDiffer._get_diffs
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L166-L192
[ "def _get_diffs(cls, dict1, dict2, ignore_missing_keys):\n '''\n Returns a dict with the differences between dict1 and dict2\n\n Notes:\n Keys that only exist in dict2 are not included in the diff if\n ignore_missing_keys is True, otherwise they are\n Simple compares are done on lists\...
class RecursiveDictDiffer(DictDiffer): ''' Calculates a recursive diff between the current_dict and the past_dict creating a diff in the format {'new': new_value, 'old': old_value} It recursively searches differences in common keys whose values are dictionaries creating a diff dict in the form...
saltstack/salt
salt/utils/dictdiffer.py
RecursiveDictDiffer._get_values
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(): ...
Returns a dictionaries with the 'new' values in a diff dict. type Which values to return, 'new' or 'old'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L195-L209
[ "def _get_values(cls, diff_dict, type='new'):\n '''\n Returns a dictionaries with the 'new' values in a diff dict.\n\n type\n Which values to return, 'new' or 'old'\n '''\n ret_dict = {}\n for p in diff_dict.keys():\n if type in diff_dict[p].keys():\n ret_dict.update({p: d...
class RecursiveDictDiffer(DictDiffer): ''' Calculates a recursive diff between the current_dict and the past_dict creating a diff in the format {'new': new_value, 'old': old_value} It recursively searches differences in common keys whose values are dictionaries creating a diff dict in the form...
saltstack/salt
salt/utils/dictdiffer.py
RecursiveDictDiffer._get_changes
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...
Returns a list of string message with the differences in a diff dict. Each inner difference is tabulated two space deeper
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L212-L245
[ "def _get_changes(cls, diff_dict):\n '''\n Returns a list of string message with the differences in a diff dict.\n\n Each inner difference is tabulated two space deeper\n '''\n changes_strings = []\n for p in sorted(diff_dict.keys()):\n if sorted(diff_dict[p].keys()) == ['new', 'old']:\n ...
class RecursiveDictDiffer(DictDiffer): ''' Calculates a recursive diff between the current_dict and the past_dict creating a diff in the format {'new': new_value, 'old': old_value} It recursively searches differences in common keys whose values are dictionaries creating a diff dict in the form...
saltstack/salt
salt/utils/dictdiffer.py
RecursiveDictDiffer.added
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], ...
Returns all keys that have been added. If the keys are in child dictionaries they will be represented with . notation
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L247-L269
[ "def _added(diffs, prefix):\n keys = []\n for key in diffs.keys():\n if isinstance(diffs[key], dict) and 'old' not in diffs[key]:\n keys.extend(_added(diffs[key],\n prefix='{0}{1}.'.format(prefix, key)))\n elif diffs[key]['old'] == self.NONE_VALUE:\n ...
class RecursiveDictDiffer(DictDiffer): ''' Calculates a recursive diff between the current_dict and the past_dict creating a diff in the format {'new': new_value, 'old': old_value} It recursively searches differences in common keys whose values are dictionaries creating a diff dict in the form...
saltstack/salt
salt/utils/dictdiffer.py
RecursiveDictDiffer.removed
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[...
Returns all keys that have been removed. If the keys are in child dictionaries they will be represented with . notation
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L271-L292
[ "def _removed(diffs, prefix):\n keys = []\n for key in diffs.keys():\n if isinstance(diffs[key], dict) and 'old' not in diffs[key]:\n keys.extend(_removed(diffs[key],\n prefix='{0}{1}.'.format(prefix, key)))\n elif diffs[key]['new'] == self.NONE_VALUE:\n ...
class RecursiveDictDiffer(DictDiffer): ''' Calculates a recursive diff between the current_dict and the past_dict creating a diff in the format {'new': new_value, 'old': old_value} It recursively searches differences in common keys whose values are dictionaries creating a diff dict in the form...
saltstack/salt
salt/utils/dictdiffer.py
RecursiveDictDiffer.changed
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...
Returns all keys that have been changed. If the keys are in child dictionaries they will be represented with . notation
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L294-L340
[ "def _changed(diffs, prefix):\n keys = []\n for key in diffs.keys():\n if not isinstance(diffs[key], dict):\n continue\n\n if isinstance(diffs[key], dict) and 'old' not in diffs[key]:\n keys.extend(_changed(diffs[key],\n prefix='{0}{1}.'.format...
class RecursiveDictDiffer(DictDiffer): ''' Calculates a recursive diff between the current_dict and the past_dict creating a diff in the format {'new': new_value, 'old': old_value} It recursively searches differences in common keys whose values are dictionaries creating a diff dict in the form...
saltstack/salt
salt/utils/dictdiffer.py
RecursiveDictDiffer.unchanged
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(): ...
Returns all keys that have been unchanged. If the keys are in child dictionaries they will be represented with . notation
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L342-L365
[ "def _unchanged(current_dict, diffs, prefix):\n keys = []\n for key in current_dict.keys():\n if key not in diffs:\n keys.append('{0}{1}'.format(prefix, key))\n elif isinstance(current_dict[key], dict):\n if 'new' in diffs[key]:\n # There is a diff\n ...
class RecursiveDictDiffer(DictDiffer): ''' Calculates a recursive diff between the current_dict and the past_dict creating a diff in the format {'new': new_value, 'old': old_value} It recursively searches differences in common keys whose values are dictionaries creating a diff dict in the form...
saltstack/salt
salt/modules/win_groupadd.py
_get_computer_object
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...
A helper function to get the object for the local machine Returns: object: Returns the computer object for the local machine
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L42-L51
null
# -*- coding: utf-8 -*- ''' Manage groups on Windows .. important:: If you feel that Salt should be using this module to manage groups on a minion, and it is using a different module (or gives an error similar to *'group.info' is not available*), see :ref:`here <module-provider-override>`. ''' from __f...
saltstack/salt
salt/modules/win_groupadd.py
_get_group_object
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...
A helper function to get a specified group object Args: name (str): The name of the object Returns: object: The specified group object
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L54-L67
null
# -*- coding: utf-8 -*- ''' Manage groups on Windows .. important:: If you feel that Salt should be using this module to manage groups on a minion, and it is using a different module (or gives an error similar to *'group.info' is not available*), see :ref:`here <module-provider-override>`. ''' from __f...
saltstack/salt
salt/modules/win_groupadd.py
_get_all_groups
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L70-L82
null
# -*- coding: utf-8 -*- ''' Manage groups on Windows .. important:: If you feel that Salt should be using this module to manage groups on a minion, and it is using a different module (or gives an error similar to *'group.info' is not available*), see :ref:`here <module-provider-override>`. ''' from __f...
saltstack/salt
salt/modules/win_groupadd.py
add
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): ...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L96-L128
[ "def info(name):\n '''\n Return information about a group\n\n Args:\n\n name (str):\n The name of the group for which to get information\n\n Returns:\n dict: A dictionary of information about the group\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' group.inf...
# -*- coding: utf-8 -*- ''' Manage groups on Windows .. important:: If you feel that Salt should be using this module to manage groups on a minion, and it is using a different module (or gives an error similar to *'group.info' is not available*), see :ref:`here <module-provider-override>`. ''' from __f...
saltstack/salt
salt/modules/win_groupadd.py
delete
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): ...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L131-L163
[ "def info(name):\n '''\n Return information about a group\n\n Args:\n\n name (str):\n The name of the group for which to get information\n\n Returns:\n dict: A dictionary of information about the group\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' group.inf...
# -*- coding: utf-8 -*- ''' Manage groups on Windows .. important:: If you feel that Salt should be using this module to manage groups on a minion, and it is using a different module (or gives an error similar to *'group.info' is not available*), see :ref:`here <module-provider-override>`. ''' from __f...
saltstack/salt
salt/modules/win_groupadd.py
info
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L166-L200
[ "def _get_group_object(name):\n '''\n A helper function to get a specified group object\n\n Args:\n\n name (str): The name of the object\n\n Returns:\n object: The specified group object\n '''\n with salt.utils.winapi.Com():\n nt = win32com.client.Dispatch('AdsNameSpaces')\n ...
# -*- coding: utf-8 -*- ''' Manage groups on Windows .. important:: If you feel that Salt should be using this module to manage groups on a minion, and it is using a different module (or gives an error similar to *'group.info' is not available*), see :ref:`here <module-provider-override>`. ''' from __f...
saltstack/salt
salt/modules/win_groupadd.py
getent
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...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L203-L238
[ "def _get_all_groups():\n '''\n A helper function that gets a list of group objects for all groups on the\n machine\n\n Returns:\n iter: A list of objects for all groups on the machine\n '''\n with salt.utils.winapi.Com():\n nt = win32com.client.Dispatch('AdsNameSpaces')\n results...
# -*- coding: utf-8 -*- ''' Manage groups on Windows .. important:: If you feel that Salt should be using this module to manage groups on a minion, and it is using a different module (or gives an error similar to *'group.info' is not available*), see :ref:`here <module-provider-override>`. ''' from __f...
saltstack/salt
salt/modules/win_groupadd.py
adduser
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: ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L241-L286
[ "def get_sam_name(username):\n r'''\n Gets the SAM name for a user. It basically prefixes a username without a\n backslash with the computer name. If the user does not exist, a SAM\n compatible name will be returned using the local hostname as the domain.\n\n i.e. salt.utils.get_same_name('Administra...
# -*- coding: utf-8 -*- ''' Manage groups on Windows .. important:: If you feel that Salt should be using this module to manage groups on a minion, and it is using a different module (or gives an error similar to *'group.info' is not available*), see :ref:`here <module-provider-override>`. ''' from __f...
saltstack/salt
salt/modules/win_groupadd.py
members
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L336-L405
[ "def _get_group_object(name):\n '''\n A helper function to get a specified group object\n\n Args:\n\n name (str): The name of the object\n\n Returns:\n object: The specified group object\n '''\n with salt.utils.winapi.Com():\n nt = win32com.client.Dispatch('AdsNameSpaces')\n ...
# -*- coding: utf-8 -*- ''' Manage groups on Windows .. important:: If you feel that Salt should be using this module to manage groups on a minion, and it is using a different module (or gives an error similar to *'group.info' is not available*), see :ref:`here <module-provider-override>`. ''' from __f...
saltstack/salt
salt/modules/win_groupadd.py
list_groups
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...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L408-L441
[ "def _get_all_groups():\n '''\n A helper function that gets a list of group objects for all groups on the\n machine\n\n Returns:\n iter: A list of objects for all groups on the machine\n '''\n with salt.utils.winapi.Com():\n nt = win32com.client.Dispatch('AdsNameSpaces')\n results...
# -*- coding: utf-8 -*- ''' Manage groups on Windows .. important:: If you feel that Salt should be using this module to manage groups on a minion, and it is using a different module (or gives an error similar to *'group.info' is not available*), see :ref:`here <module-provider-override>`. ''' from __f...
saltstack/salt
salt/utils/decorators/signature.py
identical_signature_wrapper
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' ' ...
Return a function with identical signature as ``original_function``'s which will call the ``wrapped_function``.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/decorators/signature.py#L18-L43
[ "def get_function_argspec(func, is_class_method=None):\n '''\n A small wrapper around getargspec that also supports callable classes\n :param is_class_method: Pass True if you are sure that the function being passed\n is a class method. The reason for this is that on Python 3\n ...
# -*- coding: utf-8 -*- ''' A decorator which returns a function with the same signature of the function which is being wrapped. ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import inspect from functools import wraps # Import Salt libs import salt.utils.args # Impo...
saltstack/salt
salt/modules/openvswitch.py
_stdout_list_split
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...
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.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L80-L96
null
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
_convert_json
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...
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.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L99-L129
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n" ]
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
bridge_list
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L147-L165
[ "def _stdout_list_split(retcode, stdout='', splitstring='\\n'):\n '''\n Evaulates Open vSwitch command`s retcode value.\n\n Args:\n retcode: Value of retcode field from response, should be 0, 1 or 2.\n stdout: Value of stdout filed from response.\n splitstring: String used to split the...
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
bridge_exists
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L168-L185
[ "def _retcode_to_bool(retcode):\n '''\n Evaulates Open vSwitch command`s retcode value.\n\n Args:\n retcode: Value of retcode field from response, should be 0, 1 or 2.\n\n Returns:\n True on 0, else False\n '''\n if retcode == 0:\n return True\n else:\n return False\...
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
bridge_create
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 ...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L188-L223
[ "def _param_may_exist(may_exist):\n '''\n Returns --may-exist parameter for Open vSwitch command.\n\n Args:\n may_exist: Boolean whether to use this parameter.\n\n Returns:\n String '--may-exist ' or empty string.\n '''\n if may_exist:\n return '--may-exist '\n else:\n ...
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
bridge_delete
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 ...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L226-L248
[ "def _param_if_exists(if_exists):\n '''\n Returns --if-exist parameter for Open vSwitch command.\n\n Args:\n if_exists: Boolean whether to use this parameter.\n\n Returns:\n String '--if-exist ' or empty string.\n '''\n if if_exists:\n return '--if-exists '\n else:\n ...
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
bridge_to_parent
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...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L251-L274
null
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
bridge_to_vlan
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L277-L298
null
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
port_add
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L301-L327
[ "def _param_may_exist(may_exist):\n '''\n Returns --may-exist parameter for Open vSwitch command.\n\n Args:\n may_exist: Boolean whether to use this parameter.\n\n Returns:\n String '--may-exist ' or empty string.\n '''\n if may_exist:\n return '--may-exist '\n else:\n ...
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
port_remove
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...
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,...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L330-L357
[ "def _param_if_exists(if_exists):\n '''\n Returns --if-exist parameter for Open vSwitch command.\n\n Args:\n if_exists: Boolean whether to use this parameter.\n\n Returns:\n String '--if-exist ' or empty string.\n '''\n if if_exists:\n return '--if-exists '\n else:\n ...
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
port_list
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 ''' ...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L360-L381
[ "def _stdout_list_split(retcode, stdout='', splitstring='\\n'):\n '''\n Evaulates Open vSwitch command`s retcode value.\n\n Args:\n retcode: Value of retcode field from response, should be 0, 1 or 2.\n stdout: Value of stdout filed from response.\n splitstring: String used to split the...
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
port_get_tag
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L384-L405
[ "def _stdout_list_split(retcode, stdout='', splitstring='\\n'):\n '''\n Evaulates Open vSwitch command`s retcode value.\n\n Args:\n retcode: Value of retcode field from response, should be 0, 1 or 2.\n stdout: Value of stdout filed from response.\n splitstring: String used to split the...
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
port_create_vlan
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L456-L494
[ "def _retcode_to_bool(retcode):\n '''\n Evaulates Open vSwitch command`s retcode value.\n\n Args:\n retcode: Value of retcode field from response, should be 0, 1 or 2.\n\n Returns:\n True on 0, else False\n '''\n if retcode == 0:\n return True\n else:\n return False\...
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
port_create_gre
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L497-L531
[ "def _retcode_to_bool(retcode):\n '''\n Evaulates Open vSwitch command`s retcode value.\n\n Args:\n retcode: Value of retcode field from response, should be 0, 1 or 2.\n\n Returns:\n True on 0, else False\n '''\n if retcode == 0:\n return True\n else:\n return False\...
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
port_create_vxlan
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L534-L571
[ "def _retcode_to_bool(retcode):\n '''\n Evaulates Open vSwitch command`s retcode value.\n\n Args:\n retcode: Value of retcode field from response, should be 0, 1 or 2.\n\n Returns:\n True on 0, else False\n '''\n if retcode == 0:\n return True\n else:\n return False\...
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
db_get
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L574-L604
[ "def _stdout_parse_json(stdout):\n '''\n Parses JSON output from ovs-vsctl and returns the corresponding object\n tree.\n\n Args:\n stdout: Output that shall be parsed.\n\n Returns:\n Object represented by the output.\n '''\n obj = json.loads(stdout)\n return _convert_json(obj)...
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/modules/openvswitch.py
db_set
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L607-L635
[ "def dumps(obj, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.dumps, and assumes that ensure_ascii is False (unless explicitly\n passed as True) for unicode compatibility. Note that setting it to True\n will mess up any unicode characters, as they will be dumped as the string\n lite...
# -*- coding: utf-8 -*- ''' Support for Open vSwitch - module with basic Open vSwitch commands. Suitable for setting up Openstack Neutron. :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io> ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging # Import salt ...
saltstack/salt
salt/states/azurearm_network.py
virtual_network_present
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: ...
.. 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L112-L258
null
# -*- coding: utf-8 -*- ''' Azure (ARM) Network State Module .. versionadded:: 2019.2.0 :maintainer: <devops@decisionlab.io> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://pypi....
saltstack/salt
salt/states/azurearm_network.py
virtual_network_absent
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...
.. 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L261-L321
null
# -*- coding: utf-8 -*- ''' Azure (ARM) Network State Module .. versionadded:: 2019.2.0 :maintainer: <devops@decisionlab.io> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://pypi....
saltstack/salt
salt/states/azurearm_network.py
subnet_present
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...
.. 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L324-L463
null
# -*- coding: utf-8 -*- ''' Azure (ARM) Network State Module .. versionadded:: 2019.2.0 :maintainer: <devops@decisionlab.io> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://pypi....
saltstack/salt
salt/states/azurearm_network.py
subnet_absent
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...
.. 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L466-L530
null
# -*- coding: utf-8 -*- ''' Azure (ARM) Network State Module .. versionadded:: 2019.2.0 :maintainer: <devops@decisionlab.io> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://pypi....
saltstack/salt
salt/states/azurearm_network.py
network_security_group_present
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...
.. 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L533-L671
null
# -*- coding: utf-8 -*- ''' Azure (ARM) Network State Module .. versionadded:: 2019.2.0 :maintainer: <devops@decisionlab.io> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://pypi....
saltstack/salt
salt/states/azurearm_network.py
network_security_group_absent
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...
.. 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L674-L734
null
# -*- coding: utf-8 -*- ''' Azure (ARM) Network State Module .. versionadded:: 2019.2.0 :maintainer: <devops@decisionlab.io> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://pypi....
saltstack/salt
salt/states/azurearm_network.py
security_rule_present
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...
.. 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L737-L1052
null
# -*- coding: utf-8 -*- ''' Azure (ARM) Network State Module .. versionadded:: 2019.2.0 :maintainer: <devops@decisionlab.io> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://pypi....