id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
34,500 | saltstack/salt | salt/modules/vsphere.py | vmotion_disable | def vmotion_disable(host, username, password, protocol=None, port=None, host_names=None):
'''
Disable vMotion for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password use... | python | def vmotion_disable(host, username, password, protocol=None, port=None, host_names=None):
'''
Disable vMotion for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password use... | [
"def",
"vmotion_disable",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_service_insta... | Disable vMotion for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
protocol
Optionally set to alternate protocol if the host is not ... | [
"Disable",
"vMotion",
"for",
"a",
"given",
"host",
"or",
"list",
"of",
"host_names",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3225-L3289 |
34,501 | saltstack/salt | salt/modules/vsphere.py | vsan_add_disks | def vsan_add_disks(host, username, password, protocol=None, port=None, host_names=None):
'''
Add any VSAN-eligible disks to the VSAN System for the given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
p... | python | def vsan_add_disks(host, username, password, protocol=None, port=None, host_names=None):
'''
Add any VSAN-eligible disks to the VSAN System for the given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
p... | [
"def",
"vsan_add_disks",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_service_instan... | Add any VSAN-eligible disks to the VSAN System for the given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
protocol
Optionally set to alter... | [
"Add",
"any",
"VSAN",
"-",
"eligible",
"disks",
"to",
"the",
"VSAN",
"System",
"for",
"the",
"given",
"host",
"or",
"list",
"of",
"host_names",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3367-L3469 |
34,502 | saltstack/salt | salt/modules/vsphere.py | vsan_disable | def vsan_disable(host, username, password, protocol=None, port=None, host_names=None):
'''
Disable VSAN for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to l... | python | def vsan_disable(host, username, password, protocol=None, port=None, host_names=None):
'''
Disable VSAN for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to l... | [
"def",
"vsan_disable",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_service_instance... | Disable VSAN for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
protocol
Optionally set to alternate protocol if the host is not usi... | [
"Disable",
"VSAN",
"for",
"a",
"given",
"host",
"or",
"list",
"of",
"host_names",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3474-L3554 |
34,503 | saltstack/salt | salt/modules/vsphere.py | _get_dvs_config_dict | def _get_dvs_config_dict(dvs_name, dvs_config):
'''
Returns the dict representation of the DVS config
dvs_name
The name of the DVS
dvs_config
The DVS config
'''
log.trace('Building the dict of the DVS \'%s\' config', dvs_name)
conf_dict = {'name': dvs_name,
... | python | def _get_dvs_config_dict(dvs_name, dvs_config):
'''
Returns the dict representation of the DVS config
dvs_name
The name of the DVS
dvs_config
The DVS config
'''
log.trace('Building the dict of the DVS \'%s\' config', dvs_name)
conf_dict = {'name': dvs_name,
... | [
"def",
"_get_dvs_config_dict",
"(",
"dvs_name",
",",
"dvs_config",
")",
":",
"log",
".",
"trace",
"(",
"'Building the dict of the DVS \\'%s\\' config'",
",",
"dvs_name",
")",
"conf_dict",
"=",
"{",
"'name'",
":",
"dvs_name",
",",
"'contact_email'",
":",
"dvs_config"... | Returns the dict representation of the DVS config
dvs_name
The name of the DVS
dvs_config
The DVS config | [
"Returns",
"the",
"dict",
"representation",
"of",
"the",
"DVS",
"config"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3642-L3667 |
34,504 | saltstack/salt | salt/modules/vsphere.py | _get_dvs_link_discovery_protocol | def _get_dvs_link_discovery_protocol(dvs_name, dvs_link_disc_protocol):
'''
Returns the dict representation of the DVS link discovery protocol
dvs_name
The name of the DVS
dvs_link_disc_protocl
The DVS link discovery protocol
'''
log.trace('Building the dict of the DVS \'%s\' l... | python | def _get_dvs_link_discovery_protocol(dvs_name, dvs_link_disc_protocol):
'''
Returns the dict representation of the DVS link discovery protocol
dvs_name
The name of the DVS
dvs_link_disc_protocl
The DVS link discovery protocol
'''
log.trace('Building the dict of the DVS \'%s\' l... | [
"def",
"_get_dvs_link_discovery_protocol",
"(",
"dvs_name",
",",
"dvs_link_disc_protocol",
")",
":",
"log",
".",
"trace",
"(",
"'Building the dict of the DVS \\'%s\\' link discovery protocol'",
",",
"dvs_name",
")",
"return",
"{",
"'operation'",
":",
"dvs_link_disc_protocol",... | Returns the dict representation of the DVS link discovery protocol
dvs_name
The name of the DVS
dvs_link_disc_protocl
The DVS link discovery protocol | [
"Returns",
"the",
"dict",
"representation",
"of",
"the",
"DVS",
"link",
"discovery",
"protocol"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3670-L3682 |
34,505 | saltstack/salt | salt/modules/vsphere.py | _get_dvs_infrastructure_traffic_resources | def _get_dvs_infrastructure_traffic_resources(dvs_name,
dvs_infra_traffic_ress):
'''
Returns a list of dict representations of the DVS infrastructure traffic
resource
dvs_name
The name of the DVS
dvs_infra_traffic_ress
The DVS infrastru... | python | def _get_dvs_infrastructure_traffic_resources(dvs_name,
dvs_infra_traffic_ress):
'''
Returns a list of dict representations of the DVS infrastructure traffic
resource
dvs_name
The name of the DVS
dvs_infra_traffic_ress
The DVS infrastru... | [
"def",
"_get_dvs_infrastructure_traffic_resources",
"(",
"dvs_name",
",",
"dvs_infra_traffic_ress",
")",
":",
"log",
".",
"trace",
"(",
"'Building the dicts of the DVS \\'%s\\' infrastructure '",
"'traffic resources'",
",",
"dvs_name",
")",
"res_dicts",
"=",
"[",
"]",
"for"... | Returns a list of dict representations of the DVS infrastructure traffic
resource
dvs_name
The name of the DVS
dvs_infra_traffic_ress
The DVS infrastructure traffic resources | [
"Returns",
"a",
"list",
"of",
"dict",
"representations",
"of",
"the",
"DVS",
"infrastructure",
"traffic",
"resource"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3718-L3741 |
34,506 | saltstack/salt | salt/modules/vsphere.py | _get_dvportgroup_out_shaping | def _get_dvportgroup_out_shaping(pg_name, pg_default_port_config):
'''
Returns the out shaping policy of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup
'''
log.trace('Retrieving portgroup\'s \'%s... | python | def _get_dvportgroup_out_shaping(pg_name, pg_default_port_config):
'''
Returns the out shaping policy of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup
'''
log.trace('Retrieving portgroup\'s \'%s... | [
"def",
"_get_dvportgroup_out_shaping",
"(",
"pg_name",
",",
"pg_default_port_config",
")",
":",
"log",
".",
"trace",
"(",
"'Retrieving portgroup\\'s \\'%s\\' out shaping config'",
",",
"pg_name",
")",
"out_shaping_policy",
"=",
"pg_default_port_config",
".",
"outShapingPolicy... | Returns the out shaping policy of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup | [
"Returns",
"the",
"out",
"shaping",
"policy",
"of",
"a",
"distributed",
"virtual",
"portgroup"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4089-L4106 |
34,507 | saltstack/salt | salt/modules/vsphere.py | _get_dvportgroup_security_policy | def _get_dvportgroup_security_policy(pg_name, pg_default_port_config):
'''
Returns the security policy of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup
'''
log.trace('Retrieving portgroup\'s \'%... | python | def _get_dvportgroup_security_policy(pg_name, pg_default_port_config):
'''
Returns the security policy of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup
'''
log.trace('Retrieving portgroup\'s \'%... | [
"def",
"_get_dvportgroup_security_policy",
"(",
"pg_name",
",",
"pg_default_port_config",
")",
":",
"log",
".",
"trace",
"(",
"'Retrieving portgroup\\'s \\'%s\\' security policy config'",
",",
"pg_name",
")",
"sec_policy",
"=",
"pg_default_port_config",
".",
"securityPolicy",... | Returns the security policy of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup | [
"Returns",
"the",
"security",
"policy",
"of",
"a",
"distributed",
"virtual",
"portgroup"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4109-L4125 |
34,508 | saltstack/salt | salt/modules/vsphere.py | _get_dvportgroup_teaming | def _get_dvportgroup_teaming(pg_name, pg_default_port_config):
'''
Returns the teaming of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup
'''
log.trace('Retrieving portgroup\'s \'%s\' teaming conf... | python | def _get_dvportgroup_teaming(pg_name, pg_default_port_config):
'''
Returns the teaming of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup
'''
log.trace('Retrieving portgroup\'s \'%s\' teaming conf... | [
"def",
"_get_dvportgroup_teaming",
"(",
"pg_name",
",",
"pg_default_port_config",
")",
":",
"log",
".",
"trace",
"(",
"'Retrieving portgroup\\'s \\'%s\\' teaming config'",
",",
"pg_name",
")",
"teaming_policy",
"=",
"pg_default_port_config",
".",
"uplinkTeamingPolicy",
"if"... | Returns the teaming of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup | [
"Returns",
"the",
"teaming",
"of",
"a",
"distributed",
"virtual",
"portgroup"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4128-L4161 |
34,509 | saltstack/salt | salt/modules/vsphere.py | _get_dvportgroup_dict | def _get_dvportgroup_dict(pg_ref):
'''
Returns a dictionary with a distributed virutal portgroup data
pg_ref
Portgroup reference
'''
props = salt.utils.vmware.get_properties_of_managed_object(
pg_ref, ['name', 'config.description', 'config.numPorts',
'config.type',... | python | def _get_dvportgroup_dict(pg_ref):
'''
Returns a dictionary with a distributed virutal portgroup data
pg_ref
Portgroup reference
'''
props = salt.utils.vmware.get_properties_of_managed_object(
pg_ref, ['name', 'config.description', 'config.numPorts',
'config.type',... | [
"def",
"_get_dvportgroup_dict",
"(",
"pg_ref",
")",
":",
"props",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_properties_of_managed_object",
"(",
"pg_ref",
",",
"[",
"'name'",
",",
"'config.description'",
",",
"'config.numPorts'",
",",
"'config.type'",
","... | Returns a dictionary with a distributed virutal portgroup data
pg_ref
Portgroup reference | [
"Returns",
"a",
"dictionary",
"with",
"a",
"distributed",
"virutal",
"portgroup",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4164-L4198 |
34,510 | saltstack/salt | salt/modules/vsphere.py | list_dvportgroups | def list_dvportgroups(dvs=None, portgroup_names=None, service_instance=None):
'''
Returns a list of distributed virtual switch portgroups.
The list can be filtered by the portgroup names or by the DVS.
dvs
Name of the DVS containing the portgroups.
Default value is None.
portgroup_... | python | def list_dvportgroups(dvs=None, portgroup_names=None, service_instance=None):
'''
Returns a list of distributed virtual switch portgroups.
The list can be filtered by the portgroup names or by the DVS.
dvs
Name of the DVS containing the portgroups.
Default value is None.
portgroup_... | [
"def",
"list_dvportgroups",
"(",
"dvs",
"=",
"None",
",",
"portgroup_names",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"ret_dict",
"=",
"[",
"]",
"proxy_type",
"=",
"get_proxy_type",
"(",
")",
"if",
"proxy_type",
"==",
"'esxdatacenter'",
"... | Returns a list of distributed virtual switch portgroups.
The list can be filtered by the portgroup names or by the DVS.
dvs
Name of the DVS containing the portgroups.
Default value is None.
portgroup_names
List of portgroup names to look for. If None, all portgroups are
ret... | [
"Returns",
"a",
"list",
"of",
"distributed",
"virtual",
"switch",
"portgroups",
".",
"The",
"list",
"can",
"be",
"filtered",
"by",
"the",
"portgroup",
"names",
"or",
"by",
"the",
"DVS",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4204-L4253 |
34,511 | saltstack/salt | salt/modules/vsphere.py | list_uplink_dvportgroup | def list_uplink_dvportgroup(dvs, service_instance=None):
'''
Returns the uplink portgroup of a distributed virtual switch.
dvs
Name of the DVS containing the portgroup.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block::... | python | def list_uplink_dvportgroup(dvs, service_instance=None):
'''
Returns the uplink portgroup of a distributed virtual switch.
dvs
Name of the DVS containing the portgroup.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block::... | [
"def",
"list_uplink_dvportgroup",
"(",
"dvs",
",",
"service_instance",
"=",
"None",
")",
":",
"proxy_type",
"=",
"get_proxy_type",
"(",
")",
"if",
"proxy_type",
"==",
"'esxdatacenter'",
":",
"datacenter",
"=",
"__salt__",
"[",
"'esxdatacenter.get_details'",
"]",
"... | Returns the uplink portgroup of a distributed virtual switch.
dvs
Name of the DVS containing the portgroup.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_uplink_dvportgroup dvs=dvs_name | [
"Returns",
"the",
"uplink",
"portgroup",
"of",
"a",
"distributed",
"virtual",
"switch",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4259-L4286 |
34,512 | saltstack/salt | salt/modules/vsphere.py | _apply_dvportgroup_out_shaping | def _apply_dvportgroup_out_shaping(pg_name, out_shaping, out_shaping_conf):
'''
Applies the values in out_shaping_conf to an out_shaping object
pg_name
The name of the portgroup
out_shaping
The vim.DVSTrafficShapingPolicy to apply the config to
out_shaping_conf
The out sha... | python | def _apply_dvportgroup_out_shaping(pg_name, out_shaping, out_shaping_conf):
'''
Applies the values in out_shaping_conf to an out_shaping object
pg_name
The name of the portgroup
out_shaping
The vim.DVSTrafficShapingPolicy to apply the config to
out_shaping_conf
The out sha... | [
"def",
"_apply_dvportgroup_out_shaping",
"(",
"pg_name",
",",
"out_shaping",
",",
"out_shaping_conf",
")",
":",
"log",
".",
"trace",
"(",
"'Building portgroup\\'s \\'%s\\' out shaping policy'",
",",
"pg_name",
")",
"if",
"out_shaping_conf",
".",
"get",
"(",
"'average_ba... | Applies the values in out_shaping_conf to an out_shaping object
pg_name
The name of the portgroup
out_shaping
The vim.DVSTrafficShapingPolicy to apply the config to
out_shaping_conf
The out shaping config | [
"Applies",
"the",
"values",
"in",
"out_shaping_conf",
"to",
"an",
"out_shaping",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4289-L4315 |
34,513 | saltstack/salt | salt/modules/vsphere.py | _apply_dvportgroup_security_policy | def _apply_dvportgroup_security_policy(pg_name, sec_policy, sec_policy_conf):
'''
Applies the values in sec_policy_conf to a security policy object
pg_name
The name of the portgroup
sec_policy
The vim.DVSTrafficShapingPolicy to apply the config to
sec_policy_conf
The out s... | python | def _apply_dvportgroup_security_policy(pg_name, sec_policy, sec_policy_conf):
'''
Applies the values in sec_policy_conf to a security policy object
pg_name
The name of the portgroup
sec_policy
The vim.DVSTrafficShapingPolicy to apply the config to
sec_policy_conf
The out s... | [
"def",
"_apply_dvportgroup_security_policy",
"(",
"pg_name",
",",
"sec_policy",
",",
"sec_policy_conf",
")",
":",
"log",
".",
"trace",
"(",
"'Building portgroup\\'s \\'%s\\' security policy '",
",",
"pg_name",
")",
"if",
"'allow_promiscuous'",
"in",
"sec_policy_conf",
":"... | Applies the values in sec_policy_conf to a security policy object
pg_name
The name of the portgroup
sec_policy
The vim.DVSTrafficShapingPolicy to apply the config to
sec_policy_conf
The out shaping config | [
"Applies",
"the",
"values",
"in",
"sec_policy_conf",
"to",
"a",
"security",
"policy",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4318-L4341 |
34,514 | saltstack/salt | salt/modules/vsphere.py | _apply_dvportgroup_teaming | def _apply_dvportgroup_teaming(pg_name, teaming, teaming_conf):
'''
Applies the values in teaming_conf to a teaming policy object
pg_name
The name of the portgroup
teaming
The vim.VmwareUplinkPortTeamingPolicy to apply the config to
teaming_conf
The teaming config
'''
... | python | def _apply_dvportgroup_teaming(pg_name, teaming, teaming_conf):
'''
Applies the values in teaming_conf to a teaming policy object
pg_name
The name of the portgroup
teaming
The vim.VmwareUplinkPortTeamingPolicy to apply the config to
teaming_conf
The teaming config
'''
... | [
"def",
"_apply_dvportgroup_teaming",
"(",
"pg_name",
",",
"teaming",
",",
"teaming_conf",
")",
":",
"log",
".",
"trace",
"(",
"'Building portgroup\\'s \\'%s\\' teaming'",
",",
"pg_name",
")",
"if",
"'notify_switches'",
"in",
"teaming_conf",
":",
"teaming",
".",
"not... | Applies the values in teaming_conf to a teaming policy object
pg_name
The name of the portgroup
teaming
The vim.VmwareUplinkPortTeamingPolicy to apply the config to
teaming_conf
The teaming config | [
"Applies",
"the",
"values",
"in",
"teaming_conf",
"to",
"a",
"teaming",
"policy",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4344-L4410 |
34,515 | saltstack/salt | salt/modules/vsphere.py | _apply_dvportgroup_config | def _apply_dvportgroup_config(pg_name, pg_spec, pg_conf):
'''
Applies the values in conf to a distributed portgroup spec
pg_name
The name of the portgroup
pg_spec
The vim.DVPortgroupConfigSpec to apply the config to
pg_conf
The portgroup config
'''
log.trace('Build... | python | def _apply_dvportgroup_config(pg_name, pg_spec, pg_conf):
'''
Applies the values in conf to a distributed portgroup spec
pg_name
The name of the portgroup
pg_spec
The vim.DVPortgroupConfigSpec to apply the config to
pg_conf
The portgroup config
'''
log.trace('Build... | [
"def",
"_apply_dvportgroup_config",
"(",
"pg_name",
",",
"pg_spec",
",",
"pg_conf",
")",
":",
"log",
".",
"trace",
"(",
"'Building portgroup\\'s \\'%s\\' spec'",
",",
"pg_name",
")",
"if",
"'name'",
"in",
"pg_conf",
":",
"pg_spec",
".",
"name",
"=",
"pg_conf",
... | Applies the values in conf to a distributed portgroup spec
pg_name
The name of the portgroup
pg_spec
The vim.DVPortgroupConfigSpec to apply the config to
pg_conf
The portgroup config | [
"Applies",
"the",
"values",
"in",
"conf",
"to",
"a",
"distributed",
"portgroup",
"spec"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4413-L4464 |
34,516 | saltstack/salt | salt/modules/vsphere.py | create_dvportgroup | def create_dvportgroup(portgroup_dict, portgroup_name, dvs,
service_instance=None):
'''
Creates a distributed virtual portgroup.
Note: The ``portgroup_name`` param will override any name already set
in ``portgroup_dict``.
portgroup_dict
Dictionary with the config val... | python | def create_dvportgroup(portgroup_dict, portgroup_name, dvs,
service_instance=None):
'''
Creates a distributed virtual portgroup.
Note: The ``portgroup_name`` param will override any name already set
in ``portgroup_dict``.
portgroup_dict
Dictionary with the config val... | [
"def",
"create_dvportgroup",
"(",
"portgroup_dict",
",",
"portgroup_name",
",",
"dvs",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Creating portgroup\\'%s\\' in dvs \\'%s\\' '",
"'with dict = %s'",
",",
"portgroup_name",
",",
"dvs",
","... | Creates a distributed virtual portgroup.
Note: The ``portgroup_name`` param will override any name already set
in ``portgroup_dict``.
portgroup_dict
Dictionary with the config values the portgroup should be created with
(example in salt.states.dvs).
portgroup_name
Name of the ... | [
"Creates",
"a",
"distributed",
"virtual",
"portgroup",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4470-L4515 |
34,517 | saltstack/salt | salt/modules/vsphere.py | update_dvportgroup | def update_dvportgroup(portgroup_dict, portgroup, dvs, service_instance=True):
'''
Updates a distributed virtual portgroup.
portgroup_dict
Dictionary with the values the portgroup should be update with
(example in salt.states.dvs).
portgroup
Name of the portgroup to be updated.... | python | def update_dvportgroup(portgroup_dict, portgroup, dvs, service_instance=True):
'''
Updates a distributed virtual portgroup.
portgroup_dict
Dictionary with the values the portgroup should be update with
(example in salt.states.dvs).
portgroup
Name of the portgroup to be updated.... | [
"def",
"update_dvportgroup",
"(",
"portgroup_dict",
",",
"portgroup",
",",
"dvs",
",",
"service_instance",
"=",
"True",
")",
":",
"log",
".",
"trace",
"(",
"'Updating portgroup\\'%s\\' in dvs \\'%s\\' '",
"'with dict = %s'",
",",
"portgroup",
",",
"dvs",
",",
"portg... | Updates a distributed virtual portgroup.
portgroup_dict
Dictionary with the values the portgroup should be update with
(example in salt.states.dvs).
portgroup
Name of the portgroup to be updated.
dvs
Name of the DVS containing the portgroups.
service_instance
... | [
"Updates",
"a",
"distributed",
"virtual",
"portgroup",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4521-L4575 |
34,518 | saltstack/salt | salt/modules/vsphere.py | remove_dvportgroup | def remove_dvportgroup(portgroup, dvs, service_instance=None):
'''
Removes a distributed virtual portgroup.
portgroup
Name of the portgroup to be removed.
dvs
Name of the DVS containing the portgroups.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.... | python | def remove_dvportgroup(portgroup, dvs, service_instance=None):
'''
Removes a distributed virtual portgroup.
portgroup
Name of the portgroup to be removed.
dvs
Name of the DVS containing the portgroups.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.... | [
"def",
"remove_dvportgroup",
"(",
"portgroup",
",",
"dvs",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Removing portgroup\\'%s\\' in dvs \\'%s\\''",
",",
"portgroup",
",",
"dvs",
")",
"proxy_type",
"=",
"get_proxy_type",
"(",
")",
... | Removes a distributed virtual portgroup.
portgroup
Name of the portgroup to be removed.
dvs
Name of the DVS containing the portgroups.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphe... | [
"Removes",
"a",
"distributed",
"virtual",
"portgroup",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4581-L4617 |
34,519 | saltstack/salt | salt/modules/vsphere.py | _get_policy_dict | def _get_policy_dict(policy):
'''Returns a dictionary representation of a policy'''
profile_dict = {'name': policy.name,
'description': policy.description,
'resource_type': policy.resourceType.resourceType}
subprofile_dicts = []
if isinstance(policy, pbm.profile.C... | python | def _get_policy_dict(policy):
'''Returns a dictionary representation of a policy'''
profile_dict = {'name': policy.name,
'description': policy.description,
'resource_type': policy.resourceType.resourceType}
subprofile_dicts = []
if isinstance(policy, pbm.profile.C... | [
"def",
"_get_policy_dict",
"(",
"policy",
")",
":",
"profile_dict",
"=",
"{",
"'name'",
":",
"policy",
".",
"name",
",",
"'description'",
":",
"policy",
".",
"description",
",",
"'resource_type'",
":",
"policy",
".",
"resourceType",
".",
"resourceType",
"}",
... | Returns a dictionary representation of a policy | [
"Returns",
"a",
"dictionary",
"representation",
"of",
"a",
"policy"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4620-L4654 |
34,520 | saltstack/salt | salt/modules/vsphere.py | list_storage_policies | def list_storage_policies(policy_names=None, service_instance=None):
'''
Returns a list of storage policies.
policy_names
Names of policies to list. If None, all policies are listed.
Default is None.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
... | python | def list_storage_policies(policy_names=None, service_instance=None):
'''
Returns a list of storage policies.
policy_names
Names of policies to list. If None, all policies are listed.
Default is None.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
... | [
"def",
"list_storage_policies",
"(",
"policy_names",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"profile_manager",
"=",
"salt",
".",
"utils",
".",
"pbm",
".",
"get_profile_manager",
"(",
"service_instance",
")",
"if",
"not",
"policy_names",
":"... | Returns a list of storage policies.
policy_names
Names of policies to list. If None, all policies are listed.
Default is None.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_stora... | [
"Returns",
"a",
"list",
"of",
"storage",
"policies",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4660-L4685 |
34,521 | saltstack/salt | salt/modules/vsphere.py | list_default_vsan_policy | def list_default_vsan_policy(service_instance=None):
'''
Returns the default vsan storage policy.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_storage_policies
salt '*' vsphere.list... | python | def list_default_vsan_policy(service_instance=None):
'''
Returns the default vsan storage policy.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_storage_policies
salt '*' vsphere.list... | [
"def",
"list_default_vsan_policy",
"(",
"service_instance",
"=",
"None",
")",
":",
"profile_manager",
"=",
"salt",
".",
"utils",
".",
"pbm",
".",
"get_profile_manager",
"(",
"service_instance",
")",
"policies",
"=",
"salt",
".",
"utils",
".",
"pbm",
".",
"get_... | Returns the default vsan storage policy.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_storage_policies
salt '*' vsphere.list_storage_policy policy_names=[policy_name] | [
"Returns",
"the",
"default",
"vsan",
"storage",
"policy",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4691-L4713 |
34,522 | saltstack/salt | salt/modules/vsphere.py | list_capability_definitions | def list_capability_definitions(service_instance=None):
'''
Returns a list of the metadata of all capabilities in the vCenter.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_capabilities
'... | python | def list_capability_definitions(service_instance=None):
'''
Returns a list of the metadata of all capabilities in the vCenter.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_capabilities
'... | [
"def",
"list_capability_definitions",
"(",
"service_instance",
"=",
"None",
")",
":",
"profile_manager",
"=",
"salt",
".",
"utils",
".",
"pbm",
".",
"get_profile_manager",
"(",
"service_instance",
")",
"ret_list",
"=",
"[",
"_get_capability_definition_dict",
"(",
"c... | Returns a list of the metadata of all capabilities in the vCenter.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_capabilities | [
"Returns",
"a",
"list",
"of",
"the",
"metadata",
"of",
"all",
"capabilities",
"in",
"the",
"vCenter",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4730-L4745 |
34,523 | saltstack/salt | salt/modules/vsphere.py | _apply_policy_config | def _apply_policy_config(policy_spec, policy_dict):
'''Applies a policy dictionary to a policy spec'''
log.trace('policy_dict = %s', policy_dict)
if policy_dict.get('name'):
policy_spec.name = policy_dict['name']
if policy_dict.get('description'):
policy_spec.description = policy_dict['d... | python | def _apply_policy_config(policy_spec, policy_dict):
'''Applies a policy dictionary to a policy spec'''
log.trace('policy_dict = %s', policy_dict)
if policy_dict.get('name'):
policy_spec.name = policy_dict['name']
if policy_dict.get('description'):
policy_spec.description = policy_dict['d... | [
"def",
"_apply_policy_config",
"(",
"policy_spec",
",",
"policy_dict",
")",
":",
"log",
".",
"trace",
"(",
"'policy_dict = %s'",
",",
"policy_dict",
")",
"if",
"policy_dict",
".",
"get",
"(",
"'name'",
")",
":",
"policy_spec",
".",
"name",
"=",
"policy_dict",
... | Applies a policy dictionary to a policy spec | [
"Applies",
"a",
"policy",
"dictionary",
"to",
"a",
"policy",
"spec"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4748-L4794 |
34,524 | saltstack/salt | salt/modules/vsphere.py | list_default_storage_policy_of_datastore | def list_default_storage_policy_of_datastore(datastore, service_instance=None):
'''
Returns a list of datastores assign the the storage policies.
datastore
Name of the datastore to assign.
The datastore needs to be visible to the VMware entity the proxy
points to.
service_insta... | python | def list_default_storage_policy_of_datastore(datastore, service_instance=None):
'''
Returns a list of datastores assign the the storage policies.
datastore
Name of the datastore to assign.
The datastore needs to be visible to the VMware entity the proxy
points to.
service_insta... | [
"def",
"list_default_storage_policy_of_datastore",
"(",
"datastore",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Listing the default storage policy of datastore \\'%s\\''",
",",
"datastore",
")",
"# Find datastore",
"target_ref",
"=",
"_get_p... | Returns a list of datastores assign the the storage policies.
datastore
Name of the datastore to assign.
The datastore needs to be visible to the VMware entity the proxy
points to.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
... | [
"Returns",
"a",
"list",
"of",
"datastores",
"assign",
"the",
"the",
"storage",
"policies",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4883-L4911 |
34,525 | saltstack/salt | salt/modules/vsphere.py | list_datacenters_via_proxy | def list_datacenters_via_proxy(datacenter_names=None, service_instance=None):
'''
Returns a list of dict representations of VMware datacenters.
Connection is done via the proxy details.
Supported proxies: esxdatacenter
datacenter_names
List of datacenter names.
Default is None.
... | python | def list_datacenters_via_proxy(datacenter_names=None, service_instance=None):
'''
Returns a list of dict representations of VMware datacenters.
Connection is done via the proxy details.
Supported proxies: esxdatacenter
datacenter_names
List of datacenter names.
Default is None.
... | [
"def",
"list_datacenters_via_proxy",
"(",
"datacenter_names",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"if",
"not",
"datacenter_names",
":",
"dc_refs",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_datacenters",
"(",
"service_instance",
... | Returns a list of dict representations of VMware datacenters.
Connection is done via the proxy details.
Supported proxies: esxdatacenter
datacenter_names
List of datacenter names.
Default is None.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
... | [
"Returns",
"a",
"list",
"of",
"dict",
"representations",
"of",
"VMware",
"datacenters",
".",
"Connection",
"is",
"done",
"via",
"the",
"proxy",
"details",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4963-L4996 |
34,526 | saltstack/salt | salt/modules/vsphere.py | _get_cluster_dict | def _get_cluster_dict(cluster_name, cluster_ref):
'''
Returns a cluster dict representation from
a vim.ClusterComputeResource object.
cluster_name
Name of the cluster
cluster_ref
Reference to the cluster
'''
log.trace('Building a dictionary representation of cluster \'%s\'... | python | def _get_cluster_dict(cluster_name, cluster_ref):
'''
Returns a cluster dict representation from
a vim.ClusterComputeResource object.
cluster_name
Name of the cluster
cluster_ref
Reference to the cluster
'''
log.trace('Building a dictionary representation of cluster \'%s\'... | [
"def",
"_get_cluster_dict",
"(",
"cluster_name",
",",
"cluster_ref",
")",
":",
"log",
".",
"trace",
"(",
"'Building a dictionary representation of cluster \\'%s\\''",
",",
"cluster_name",
")",
"props",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_properties_of_... | Returns a cluster dict representation from
a vim.ClusterComputeResource object.
cluster_name
Name of the cluster
cluster_ref
Reference to the cluster | [
"Returns",
"a",
"cluster",
"dict",
"representation",
"from",
"a",
"vim",
".",
"ClusterComputeResource",
"object",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L5023-L5101 |
34,527 | saltstack/salt | salt/modules/vsphere.py | list_cluster | def list_cluster(datacenter=None, cluster=None, service_instance=None):
'''
Returns a dict representation of an ESX cluster.
datacenter
Name of datacenter containing the cluster.
Ignored if already contained by proxy details.
Default value is None.
cluster
Name of clust... | python | def list_cluster(datacenter=None, cluster=None, service_instance=None):
'''
Returns a dict representation of an ESX cluster.
datacenter
Name of datacenter containing the cluster.
Ignored if already contained by proxy details.
Default value is None.
cluster
Name of clust... | [
"def",
"list_cluster",
"(",
"datacenter",
"=",
"None",
",",
"cluster",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"proxy_type",
"=",
"get_proxy_type",
"(",
")",
"if",
"proxy_type",
"==",
"'esxdatacenter'",
":",
"dc_ref",
"=",
"_get_proxy_targ... | Returns a dict representation of an ESX cluster.
datacenter
Name of datacenter containing the cluster.
Ignored if already contained by proxy details.
Default value is None.
cluster
Name of cluster.
Ignored if already contained by proxy details.
Default value is ... | [
"Returns",
"a",
"dict",
"representation",
"of",
"an",
"ESX",
"cluster",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L5107-L5147 |
34,528 | saltstack/salt | salt/modules/vsphere.py | create_cluster | def create_cluster(cluster_dict, datacenter=None, cluster=None,
service_instance=None):
'''
Creates a cluster.
Note: cluster_dict['name'] will be overridden by the cluster param value
config_dict
Dictionary with the config values of the new cluster.
datacenter
N... | python | def create_cluster(cluster_dict, datacenter=None, cluster=None,
service_instance=None):
'''
Creates a cluster.
Note: cluster_dict['name'] will be overridden by the cluster param value
config_dict
Dictionary with the config values of the new cluster.
datacenter
N... | [
"def",
"create_cluster",
"(",
"cluster_dict",
",",
"datacenter",
"=",
"None",
",",
"cluster",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"# Validate cluster dictionary",
"schema",
"=",
"ESXClusterConfigSchema",
".",
"serialize",
"(",
")",
"try",
... | Creates a cluster.
Note: cluster_dict['name'] will be overridden by the cluster param value
config_dict
Dictionary with the config values of the new cluster.
datacenter
Name of datacenter containing the cluster.
Ignored if already contained by proxy details.
Default value ... | [
"Creates",
"a",
"cluster",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L5285-L5374 |
34,529 | saltstack/salt | salt/modules/vsphere.py | update_cluster | def update_cluster(cluster_dict, datacenter=None, cluster=None,
service_instance=None):
'''
Updates a cluster.
config_dict
Dictionary with the config values of the new cluster.
datacenter
Name of datacenter containing the cluster.
Ignored if already contained... | python | def update_cluster(cluster_dict, datacenter=None, cluster=None,
service_instance=None):
'''
Updates a cluster.
config_dict
Dictionary with the config values of the new cluster.
datacenter
Name of datacenter containing the cluster.
Ignored if already contained... | [
"def",
"update_cluster",
"(",
"cluster_dict",
",",
"datacenter",
"=",
"None",
",",
"cluster",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"# Validate cluster dictionary",
"schema",
"=",
"ESXClusterConfigSchema",
".",
"serialize",
"(",
")",
"try",
... | Updates a cluster.
config_dict
Dictionary with the config values of the new cluster.
datacenter
Name of datacenter containing the cluster.
Ignored if already contained by proxy details.
Default value is None.
cluster
Name of cluster.
Ignored if already cont... | [
"Updates",
"a",
"cluster",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L5381-L5486 |
34,530 | saltstack/salt | salt/modules/vsphere.py | create_vmfs_datastore | def create_vmfs_datastore(datastore_name, disk_id, vmfs_major_version,
safety_checks=True, service_instance=None):
'''
Creates a ESXi host disk group with the specified cache and capacity disks.
datastore_name
The name of the datastore to be created.
disk_id
T... | python | def create_vmfs_datastore(datastore_name, disk_id, vmfs_major_version,
safety_checks=True, service_instance=None):
'''
Creates a ESXi host disk group with the specified cache and capacity disks.
datastore_name
The name of the datastore to be created.
disk_id
T... | [
"def",
"create_vmfs_datastore",
"(",
"datastore_name",
",",
"disk_id",
",",
"vmfs_major_version",
",",
"safety_checks",
"=",
"True",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"'Validating vmfs datastore input'",
")",
"schema",
"=",
... | Creates a ESXi host disk group with the specified cache and capacity disks.
datastore_name
The name of the datastore to be created.
disk_id
The disk id (canonical name) on which the datastore is created.
vmfs_major_version
The VMFS major version.
safety_checks
Specify... | [
"Creates",
"a",
"ESXi",
"host",
"disk",
"group",
"with",
"the",
"specified",
"cache",
"and",
"capacity",
"disks",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L5578-L5625 |
34,531 | saltstack/salt | salt/modules/vsphere.py | rename_datastore | def rename_datastore(datastore_name, new_datastore_name,
service_instance=None):
'''
Renames a datastore. The datastore needs to be visible to the proxy.
datastore_name
Current datastore name.
new_datastore_name
New datastore name.
service_instance
Ser... | python | def rename_datastore(datastore_name, new_datastore_name,
service_instance=None):
'''
Renames a datastore. The datastore needs to be visible to the proxy.
datastore_name
Current datastore name.
new_datastore_name
New datastore name.
service_instance
Ser... | [
"def",
"rename_datastore",
"(",
"datastore_name",
",",
"new_datastore_name",
",",
"service_instance",
"=",
"None",
")",
":",
"# Argument validation",
"log",
".",
"trace",
"(",
"'Renaming datastore %s to %s'",
",",
"datastore_name",
",",
"new_datastore_name",
")",
"targe... | Renames a datastore. The datastore needs to be visible to the proxy.
datastore_name
Current datastore name.
new_datastore_name
New datastore name.
service_instance
Service instance (vim.ServiceInstance) of the vCenter/ESXi host.
Default is None.
.. code-block:: bash
... | [
"Renames",
"a",
"datastore",
".",
"The",
"datastore",
"needs",
"to",
"be",
"visible",
"to",
"the",
"proxy",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L5631-L5662 |
34,532 | saltstack/salt | salt/modules/vsphere.py | remove_datastore | def remove_datastore(datastore, service_instance=None):
'''
Removes a datastore. If multiple datastores an error is raised.
datastore
Datastore name
service_instance
Service instance (vim.ServiceInstance) of the vCenter/ESXi host.
Default is None.
.. code-block:: bash
... | python | def remove_datastore(datastore, service_instance=None):
'''
Removes a datastore. If multiple datastores an error is raised.
datastore
Datastore name
service_instance
Service instance (vim.ServiceInstance) of the vCenter/ESXi host.
Default is None.
.. code-block:: bash
... | [
"def",
"remove_datastore",
"(",
"datastore",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Removing datastore \\'%s\\''",
",",
"datastore",
")",
"target",
"=",
"_get_proxy_target",
"(",
"service_instance",
")",
"datastores",
"=",
"sal... | Removes a datastore. If multiple datastores an error is raised.
datastore
Datastore name
service_instance
Service instance (vim.ServiceInstance) of the vCenter/ESXi host.
Default is None.
.. code-block:: bash
salt '*' vsphere.remove_datastore ds_name | [
"Removes",
"a",
"datastore",
".",
"If",
"multiple",
"datastores",
"an",
"error",
"is",
"raised",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L5668-L5696 |
34,533 | saltstack/salt | salt/modules/vsphere.py | list_licenses | def list_licenses(service_instance=None):
'''
Lists all licenses on a vCenter.
service_instance
Service instance (vim.ServiceInstance) of the vCenter/ESXi host.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_licenses
'''
log.trace('Retrieving all licenses'... | python | def list_licenses(service_instance=None):
'''
Lists all licenses on a vCenter.
service_instance
Service instance (vim.ServiceInstance) of the vCenter/ESXi host.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_licenses
'''
log.trace('Retrieving all licenses'... | [
"def",
"list_licenses",
"(",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Retrieving all licenses'",
")",
"licenses",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_licenses",
"(",
"service_instance",
")",
"ret_dict",
"=",
"[",
... | Lists all licenses on a vCenter.
service_instance
Service instance (vim.ServiceInstance) of the vCenter/ESXi host.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_licenses | [
"Lists",
"all",
"licenses",
"on",
"a",
"vCenter",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L5702-L5723 |
34,534 | saltstack/salt | salt/modules/vsphere.py | add_license | def add_license(key, description, safety_checks=True,
service_instance=None):
'''
Adds a license to the vCenter or ESXi host
key
License key.
description
License description added in as a label.
safety_checks
Specify whether to perform safety check or to sk... | python | def add_license(key, description, safety_checks=True,
service_instance=None):
'''
Adds a license to the vCenter or ESXi host
key
License key.
description
License description added in as a label.
safety_checks
Specify whether to perform safety check or to sk... | [
"def",
"add_license",
"(",
"key",
",",
"description",
",",
"safety_checks",
"=",
"True",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Adding license \\'%s\\''",
",",
"key",
")",
"salt",
".",
"utils",
".",
"vmware",
".",
"add_... | Adds a license to the vCenter or ESXi host
key
License key.
description
License description added in as a label.
safety_checks
Specify whether to perform safety check or to skip the checks and try
performing the required task
service_instance
Service instance ... | [
"Adds",
"a",
"license",
"to",
"the",
"vCenter",
"or",
"ESXi",
"host"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L5729-L5754 |
34,535 | saltstack/salt | salt/modules/vsphere.py | _get_entity | def _get_entity(service_instance, entity):
'''
Returns the entity associated with the entity dict representation
Supported entities: cluster, vcenter
Expected entity format:
.. code-block:: python
cluster:
{'type': 'cluster',
'datacenter': <datacenter_name>,
... | python | def _get_entity(service_instance, entity):
'''
Returns the entity associated with the entity dict representation
Supported entities: cluster, vcenter
Expected entity format:
.. code-block:: python
cluster:
{'type': 'cluster',
'datacenter': <datacenter_name>,
... | [
"def",
"_get_entity",
"(",
"service_instance",
",",
"entity",
")",
":",
"log",
".",
"trace",
"(",
"'Retrieving entity: %s'",
",",
"entity",
")",
"if",
"entity",
"[",
"'type'",
"]",
"==",
"'cluster'",
":",
"dc_ref",
"=",
"salt",
".",
"utils",
".",
"vmware",... | Returns the entity associated with the entity dict representation
Supported entities: cluster, vcenter
Expected entity format:
.. code-block:: python
cluster:
{'type': 'cluster',
'datacenter': <datacenter_name>,
'cluster': <cluster_name>}
vcenter:
... | [
"Returns",
"the",
"entity",
"associated",
"with",
"the",
"entity",
"dict",
"representation"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L5757-L5789 |
34,536 | saltstack/salt | salt/modules/vsphere.py | _validate_entity | def _validate_entity(entity):
'''
Validates the entity dict representation
entity
Dictionary representation of an entity.
See ``_get_entity`` docstrings for format.
'''
#Validate entity:
if entity['type'] == 'cluster':
schema = ESXClusterEntitySchema.serialize()
eli... | python | def _validate_entity(entity):
'''
Validates the entity dict representation
entity
Dictionary representation of an entity.
See ``_get_entity`` docstrings for format.
'''
#Validate entity:
if entity['type'] == 'cluster':
schema = ESXClusterEntitySchema.serialize()
eli... | [
"def",
"_validate_entity",
"(",
"entity",
")",
":",
"#Validate entity:",
"if",
"entity",
"[",
"'type'",
"]",
"==",
"'cluster'",
":",
"schema",
"=",
"ESXClusterEntitySchema",
".",
"serialize",
"(",
")",
"elif",
"entity",
"[",
"'type'",
"]",
"==",
"'vcenter'",
... | Validates the entity dict representation
entity
Dictionary representation of an entity.
See ``_get_entity`` docstrings for format. | [
"Validates",
"the",
"entity",
"dict",
"representation"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L5792-L5812 |
34,537 | saltstack/salt | salt/modules/vsphere.py | list_assigned_licenses | def list_assigned_licenses(entity, entity_display_name, license_keys=None,
service_instance=None):
'''
Lists the licenses assigned to an entity
entity
Dictionary representation of an entity.
See ``_get_entity`` docstrings for format.
entity_display_name
... | python | def list_assigned_licenses(entity, entity_display_name, license_keys=None,
service_instance=None):
'''
Lists the licenses assigned to an entity
entity
Dictionary representation of an entity.
See ``_get_entity`` docstrings for format.
entity_display_name
... | [
"def",
"list_assigned_licenses",
"(",
"entity",
",",
"entity_display_name",
",",
"license_keys",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Listing assigned licenses of entity %s'",
",",
"entity",
")",
"_validate_entity",
... | Lists the licenses assigned to an entity
entity
Dictionary representation of an entity.
See ``_get_entity`` docstrings for format.
entity_display_name
Entity name used in logging
license_keys:
List of license keys to be retrieved. Default is None.
service_instance
... | [
"Lists",
"the",
"licenses",
"assigned",
"to",
"an",
"entity"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L5819-L5858 |
34,538 | saltstack/salt | salt/modules/vsphere.py | assign_license | def assign_license(license_key, license_name, entity, entity_display_name,
safety_checks=True, service_instance=None):
'''
Assigns a license to an entity
license_key
Key of the license to assign
See ``_get_entity`` docstrings for format.
license_name
Display ... | python | def assign_license(license_key, license_name, entity, entity_display_name,
safety_checks=True, service_instance=None):
'''
Assigns a license to an entity
license_key
Key of the license to assign
See ``_get_entity`` docstrings for format.
license_name
Display ... | [
"def",
"assign_license",
"(",
"license_key",
",",
"license_name",
",",
"entity",
",",
"entity_display_name",
",",
"safety_checks",
"=",
"True",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Assigning license %s to entity %s'",
",",
"l... | Assigns a license to an entity
license_key
Key of the license to assign
See ``_get_entity`` docstrings for format.
license_name
Display name of license
entity
Dictionary representation of an entity
entity_display_name
Entity name used in logging
safety_ch... | [
"Assigns",
"a",
"license",
"to",
"an",
"entity"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L5865-L5908 |
34,539 | saltstack/salt | salt/modules/vsphere.py | list_disks | def list_disks(disk_ids=None, scsi_addresses=None, service_instance=None):
'''
Returns a list of dict representations of the disks in an ESXi host.
The list of disks can be filtered by disk canonical names or
scsi addresses.
disk_ids:
List of disk canonical names to be retrieved. Default is... | python | def list_disks(disk_ids=None, scsi_addresses=None, service_instance=None):
'''
Returns a list of dict representations of the disks in an ESXi host.
The list of disks can be filtered by disk canonical names or
scsi addresses.
disk_ids:
List of disk canonical names to be retrieved. Default is... | [
"def",
"list_disks",
"(",
"disk_ids",
"=",
"None",
",",
"scsi_addresses",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"host_ref",
"=",
"_get_proxy_target",
"(",
"service_instance",
")",
"hostname",
"=",
"__proxy__",
"[",
"'esxi.get_details'",
"]... | Returns a list of dict representations of the disks in an ESXi host.
The list of disks can be filtered by disk canonical names or
scsi addresses.
disk_ids:
List of disk canonical names to be retrieved. Default is None.
scsi_addresses
List of scsi addresses of disks to be retrieved. Def... | [
"Returns",
"a",
"list",
"of",
"dict",
"representations",
"of",
"the",
"disks",
"in",
"an",
"ESXi",
"host",
".",
"The",
"list",
"of",
"disks",
"can",
"be",
"filtered",
"by",
"disk",
"canonical",
"names",
"or",
"scsi",
"addresses",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L5964-L6008 |
34,540 | saltstack/salt | salt/modules/vsphere.py | erase_disk_partitions | def erase_disk_partitions(disk_id=None, scsi_address=None,
service_instance=None):
'''
Erases the partitions on a disk.
The disk can be specified either by the canonical name, or by the
scsi_address.
disk_id
Canonical name of the disk.
Either ``disk_id`` or... | python | def erase_disk_partitions(disk_id=None, scsi_address=None,
service_instance=None):
'''
Erases the partitions on a disk.
The disk can be specified either by the canonical name, or by the
scsi_address.
disk_id
Canonical name of the disk.
Either ``disk_id`` or... | [
"def",
"erase_disk_partitions",
"(",
"disk_id",
"=",
"None",
",",
"scsi_address",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"if",
"not",
"disk_id",
"and",
"not",
"scsi_address",
":",
"raise",
"ArgumentValueError",
"(",
"'Either \\'disk_id\\' or ... | Erases the partitions on a disk.
The disk can be specified either by the canonical name, or by the
scsi_address.
disk_id
Canonical name of the disk.
Either ``disk_id`` or ``scsi_address`` needs to be specified
(``disk_id`` supersedes ``scsi_address``.
scsi_address
Scsi ... | [
"Erases",
"the",
"partitions",
"on",
"a",
"disk",
".",
"The",
"disk",
"can",
"be",
"specified",
"either",
"by",
"the",
"canonical",
"name",
"or",
"by",
"the",
"scsi_address",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6014-L6063 |
34,541 | saltstack/salt | salt/modules/vsphere.py | list_disk_partitions | def list_disk_partitions(disk_id=None, scsi_address=None,
service_instance=None):
'''
Lists the partitions on a disk.
The disk can be specified either by the canonical name, or by the
scsi_address.
disk_id
Canonical name of the disk.
Either ``disk_id`` or `... | python | def list_disk_partitions(disk_id=None, scsi_address=None,
service_instance=None):
'''
Lists the partitions on a disk.
The disk can be specified either by the canonical name, or by the
scsi_address.
disk_id
Canonical name of the disk.
Either ``disk_id`` or `... | [
"def",
"list_disk_partitions",
"(",
"disk_id",
"=",
"None",
",",
"scsi_address",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"if",
"not",
"disk_id",
"and",
"not",
"scsi_address",
":",
"raise",
"ArgumentValueError",
"(",
"'Either \\'disk_id\\' or \... | Lists the partitions on a disk.
The disk can be specified either by the canonical name, or by the
scsi_address.
disk_id
Canonical name of the disk.
Either ``disk_id`` or ``scsi_address`` needs to be specified
(``disk_id`` supersedes ``scsi_address``.
scsi_address`
Scsi ... | [
"Lists",
"the",
"partitions",
"on",
"a",
"disk",
".",
"The",
"disk",
"can",
"be",
"specified",
"either",
"by",
"the",
"canonical",
"name",
"or",
"by",
"the",
"scsi_address",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6069-L6132 |
34,542 | saltstack/salt | salt/modules/vsphere.py | list_diskgroups | def list_diskgroups(cache_disk_ids=None, service_instance=None):
'''
Returns a list of disk group dict representation on an ESXi host.
The list of disk groups can be filtered by the cache disks
canonical names. If no filtering is applied, all disk groups are returned.
cache_disk_ids:
List o... | python | def list_diskgroups(cache_disk_ids=None, service_instance=None):
'''
Returns a list of disk group dict representation on an ESXi host.
The list of disk groups can be filtered by the cache disks
canonical names. If no filtering is applied, all disk groups are returned.
cache_disk_ids:
List o... | [
"def",
"list_diskgroups",
"(",
"cache_disk_ids",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"host_ref",
"=",
"_get_proxy_target",
"(",
"service_instance",
")",
"hostname",
"=",
"__proxy__",
"[",
"'esxi.get_details'",
"]",
"(",
")",
"[",
"'esxi_... | Returns a list of disk group dict representation on an ESXi host.
The list of disk groups can be filtered by the cache disks
canonical names. If no filtering is applied, all disk groups are returned.
cache_disk_ids:
List of cache disk canonical names of the disk groups to be retrieved.
Defa... | [
"Returns",
"a",
"list",
"of",
"disk",
"group",
"dict",
"representation",
"on",
"an",
"ESXi",
"host",
".",
"The",
"list",
"of",
"disk",
"groups",
"can",
"be",
"filtered",
"by",
"the",
"cache",
"disks",
"canonical",
"names",
".",
"If",
"no",
"filtering",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6138-L6172 |
34,543 | saltstack/salt | salt/modules/vsphere.py | create_diskgroup | def create_diskgroup(cache_disk_id, capacity_disk_ids, safety_checks=True,
service_instance=None):
'''
Creates disk group on an ESXi host with the specified cache and
capacity disks.
cache_disk_id
The canonical name of the disk to be used as a cache. The disk must be
... | python | def create_diskgroup(cache_disk_id, capacity_disk_ids, safety_checks=True,
service_instance=None):
'''
Creates disk group on an ESXi host with the specified cache and
capacity disks.
cache_disk_id
The canonical name of the disk to be used as a cache. The disk must be
... | [
"def",
"create_diskgroup",
"(",
"cache_disk_id",
",",
"capacity_disk_ids",
",",
"safety_checks",
"=",
"True",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Validating diskgroup input'",
")",
"schema",
"=",
"DiskGroupsDiskIdSchema",
".",... | Creates disk group on an ESXi host with the specified cache and
capacity disks.
cache_disk_id
The canonical name of the disk to be used as a cache. The disk must be
ssd.
capacity_disk_ids
A list containing canonical names of the capacity disks. Must contain at
least one id.... | [
"Creates",
"disk",
"group",
"on",
"an",
"ESXi",
"host",
"with",
"the",
"specified",
"cache",
"and",
"capacity",
"disks",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6179-L6241 |
34,544 | saltstack/salt | salt/modules/vsphere.py | remove_diskgroup | def remove_diskgroup(cache_disk_id, data_accessibility=True,
service_instance=None):
'''
Remove the diskgroup with the specified cache disk.
cache_disk_id
The canonical name of the cache disk.
data_accessibility
Specifies whether to ensure data accessibility. Defau... | python | def remove_diskgroup(cache_disk_id, data_accessibility=True,
service_instance=None):
'''
Remove the diskgroup with the specified cache disk.
cache_disk_id
The canonical name of the cache disk.
data_accessibility
Specifies whether to ensure data accessibility. Defau... | [
"def",
"remove_diskgroup",
"(",
"cache_disk_id",
",",
"data_accessibility",
"=",
"True",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Validating diskgroup input'",
")",
"host_ref",
"=",
"_get_proxy_target",
"(",
"service_instance",
")"... | Remove the diskgroup with the specified cache disk.
cache_disk_id
The canonical name of the cache disk.
data_accessibility
Specifies whether to ensure data accessibility. Default value is True.
service_instance
Service instance (vim.ServiceInstance) of the vCenter/ESXi host.
... | [
"Remove",
"the",
"diskgroup",
"with",
"the",
"specified",
"cache",
"disk",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6380-L6413 |
34,545 | saltstack/salt | salt/modules/vsphere.py | get_host_cache | def get_host_cache(service_instance=None):
'''
Returns the host cache configuration on the proxy host.
service_instance
Service instance (vim.ServiceInstance) of the vCenter/ESXi host.
Default is None.
.. code-block:: bash
salt '*' vsphere.get_host_cache
'''
# Default ... | python | def get_host_cache(service_instance=None):
'''
Returns the host cache configuration on the proxy host.
service_instance
Service instance (vim.ServiceInstance) of the vCenter/ESXi host.
Default is None.
.. code-block:: bash
salt '*' vsphere.get_host_cache
'''
# Default ... | [
"def",
"get_host_cache",
"(",
"service_instance",
"=",
"None",
")",
":",
"# Default to getting all disks if no filtering is done",
"ret_dict",
"=",
"{",
"}",
"host_ref",
"=",
"_get_proxy_target",
"(",
"service_instance",
")",
"hostname",
"=",
"__proxy__",
"[",
"'esxi.ge... | Returns the host cache configuration on the proxy host.
service_instance
Service instance (vim.ServiceInstance) of the vCenter/ESXi host.
Default is None.
.. code-block:: bash
salt '*' vsphere.get_host_cache | [
"Returns",
"the",
"host",
"cache",
"configuration",
"on",
"the",
"proxy",
"host",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6419-L6444 |
34,546 | saltstack/salt | salt/modules/vsphere.py | configure_host_cache | def configure_host_cache(enabled, datastore=None, swap_size_MiB=None,
service_instance=None):
'''
Configures the host cache on the selected host.
enabled
Boolean flag specifying whether the host cache is enabled.
datastore
Name of the datastore that contains th... | python | def configure_host_cache(enabled, datastore=None, swap_size_MiB=None,
service_instance=None):
'''
Configures the host cache on the selected host.
enabled
Boolean flag specifying whether the host cache is enabled.
datastore
Name of the datastore that contains th... | [
"def",
"configure_host_cache",
"(",
"enabled",
",",
"datastore",
"=",
"None",
",",
"swap_size_MiB",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"'Validating host cache input'",
")",
"schema",
"=",
"SimpleHostCacheSchema",... | Configures the host cache on the selected host.
enabled
Boolean flag specifying whether the host cache is enabled.
datastore
Name of the datastore that contains the host cache. Must be set if
enabled is ``true``.
swap_size_MiB
Swap size in Mibibytes. Needs to be set if ena... | [
"Configures",
"the",
"host",
"cache",
"on",
"the",
"selected",
"host",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6451-L6502 |
34,547 | saltstack/salt | salt/modules/vsphere.py | _check_hosts | def _check_hosts(service_instance, host, host_names):
'''
Helper function that checks to see if the host provided is a vCenter Server or
an ESXi host. If it's an ESXi host, returns a list of a single host_name.
If a host reference isn't found, we're trying to find a host object for a vCenter
server... | python | def _check_hosts(service_instance, host, host_names):
'''
Helper function that checks to see if the host provided is a vCenter Server or
an ESXi host. If it's an ESXi host, returns a list of a single host_name.
If a host reference isn't found, we're trying to find a host object for a vCenter
server... | [
"def",
"_check_hosts",
"(",
"service_instance",
",",
"host",
",",
"host_names",
")",
":",
"if",
"not",
"host_names",
":",
"host_name",
"=",
"_get_host_ref",
"(",
"service_instance",
",",
"host",
")",
"if",
"host_name",
":",
"host_names",
"=",
"[",
"host",
"]... | Helper function that checks to see if the host provided is a vCenter Server or
an ESXi host. If it's an ESXi host, returns a list of a single host_name.
If a host reference isn't found, we're trying to find a host object for a vCenter
server. Raises a CommandExecutionError in this case, as we need host ref... | [
"Helper",
"function",
"that",
"checks",
"to",
"see",
"if",
"the",
"host",
"provided",
"is",
"a",
"vCenter",
"Server",
"or",
"an",
"ESXi",
"host",
".",
"If",
"it",
"s",
"an",
"ESXi",
"host",
"returns",
"a",
"list",
"of",
"a",
"single",
"host_name",
"."
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6505-L6525 |
34,548 | saltstack/salt | salt/modules/vsphere.py | _format_coredump_stdout | def _format_coredump_stdout(cmd_ret):
'''
Helper function to format the stdout from the get_coredump_network_config function.
cmd_ret
The return dictionary that comes from a cmd.run_all call.
'''
ret_dict = {}
for line in cmd_ret['stdout'].splitlines():
line = line.strip().lower... | python | def _format_coredump_stdout(cmd_ret):
'''
Helper function to format the stdout from the get_coredump_network_config function.
cmd_ret
The return dictionary that comes from a cmd.run_all call.
'''
ret_dict = {}
for line in cmd_ret['stdout'].splitlines():
line = line.strip().lower... | [
"def",
"_format_coredump_stdout",
"(",
"cmd_ret",
")",
":",
"ret_dict",
"=",
"{",
"}",
"for",
"line",
"in",
"cmd_ret",
"[",
"'stdout'",
"]",
".",
"splitlines",
"(",
")",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
".",
"lower",
"(",
")",
"if",
... | Helper function to format the stdout from the get_coredump_network_config function.
cmd_ret
The return dictionary that comes from a cmd.run_all call. | [
"Helper",
"function",
"to",
"format",
"the",
"stdout",
"from",
"the",
"get_coredump_network_config",
"function",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6528-L6555 |
34,549 | saltstack/salt | salt/modules/vsphere.py | _format_firewall_stdout | def _format_firewall_stdout(cmd_ret):
'''
Helper function to format the stdout from the get_firewall_status function.
cmd_ret
The return dictionary that comes from a cmd.run_all call.
'''
ret_dict = {'success': True,
'rulesets': {}}
for line in cmd_ret['stdout'].splitlin... | python | def _format_firewall_stdout(cmd_ret):
'''
Helper function to format the stdout from the get_firewall_status function.
cmd_ret
The return dictionary that comes from a cmd.run_all call.
'''
ret_dict = {'success': True,
'rulesets': {}}
for line in cmd_ret['stdout'].splitlin... | [
"def",
"_format_firewall_stdout",
"(",
"cmd_ret",
")",
":",
"ret_dict",
"=",
"{",
"'success'",
":",
"True",
",",
"'rulesets'",
":",
"{",
"}",
"}",
"for",
"line",
"in",
"cmd_ret",
"[",
"'stdout'",
"]",
".",
"splitlines",
"(",
")",
":",
"if",
"line",
"."... | Helper function to format the stdout from the get_firewall_status function.
cmd_ret
The return dictionary that comes from a cmd.run_all call. | [
"Helper",
"function",
"to",
"format",
"the",
"stdout",
"from",
"the",
"get_firewall_status",
"function",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6558-L6575 |
34,550 | saltstack/salt | salt/modules/vsphere.py | _format_syslog_config | def _format_syslog_config(cmd_ret):
'''
Helper function to format the stdout from the get_syslog_config function.
cmd_ret
The return dictionary that comes from a cmd.run_all call.
'''
ret_dict = {'success': cmd_ret['retcode'] == 0}
if cmd_ret['retcode'] != 0:
ret_dict['message'... | python | def _format_syslog_config(cmd_ret):
'''
Helper function to format the stdout from the get_syslog_config function.
cmd_ret
The return dictionary that comes from a cmd.run_all call.
'''
ret_dict = {'success': cmd_ret['retcode'] == 0}
if cmd_ret['retcode'] != 0:
ret_dict['message'... | [
"def",
"_format_syslog_config",
"(",
"cmd_ret",
")",
":",
"ret_dict",
"=",
"{",
"'success'",
":",
"cmd_ret",
"[",
"'retcode'",
"]",
"==",
"0",
"}",
"if",
"cmd_ret",
"[",
"'retcode'",
"]",
"!=",
"0",
":",
"ret_dict",
"[",
"'message'",
"]",
"=",
"cmd_ret",... | Helper function to format the stdout from the get_syslog_config function.
cmd_ret
The return dictionary that comes from a cmd.run_all call. | [
"Helper",
"function",
"to",
"format",
"the",
"stdout",
"from",
"the",
"get_syslog_config",
"function",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6578-L6597 |
34,551 | saltstack/salt | salt/modules/vsphere.py | _get_host_ref | def _get_host_ref(service_instance, host, host_name=None):
'''
Helper function that returns a host object either from the host location or the host_name.
If host_name is provided, that is the host_object that will be returned.
The function will first search for hosts by DNS Name. If no hosts are found,... | python | def _get_host_ref(service_instance, host, host_name=None):
'''
Helper function that returns a host object either from the host location or the host_name.
If host_name is provided, that is the host_object that will be returned.
The function will first search for hosts by DNS Name. If no hosts are found,... | [
"def",
"_get_host_ref",
"(",
"service_instance",
",",
"host",
",",
"host_name",
"=",
"None",
")",
":",
"search_index",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_inventory",
"(",
"service_instance",
")",
".",
"searchIndex",
"# First, try to find the host ... | Helper function that returns a host object either from the host location or the host_name.
If host_name is provided, that is the host_object that will be returned.
The function will first search for hosts by DNS Name. If no hosts are found, it will
try searching by IP Address. | [
"Helper",
"function",
"that",
"returns",
"a",
"host",
"object",
"either",
"from",
"the",
"host",
"location",
"or",
"the",
"host_name",
".",
"If",
"host_name",
"is",
"provided",
"that",
"is",
"the",
"host_object",
"that",
"will",
"be",
"returned",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6607-L6627 |
34,552 | saltstack/salt | salt/modules/vsphere.py | _get_host_disks | def _get_host_disks(host_reference):
'''
Helper function that returns a dictionary containing a list of SSD and Non-SSD disks.
'''
storage_system = host_reference.configManager.storageSystem
disks = storage_system.storageDeviceInfo.scsiLun
ssds = []
non_ssds = []
for disk in disks:
... | python | def _get_host_disks(host_reference):
'''
Helper function that returns a dictionary containing a list of SSD and Non-SSD disks.
'''
storage_system = host_reference.configManager.storageSystem
disks = storage_system.storageDeviceInfo.scsiLun
ssds = []
non_ssds = []
for disk in disks:
... | [
"def",
"_get_host_disks",
"(",
"host_reference",
")",
":",
"storage_system",
"=",
"host_reference",
".",
"configManager",
".",
"storageSystem",
"disks",
"=",
"storage_system",
".",
"storageDeviceInfo",
".",
"scsiLun",
"ssds",
"=",
"[",
"]",
"non_ssds",
"=",
"[",
... | Helper function that returns a dictionary containing a list of SSD and Non-SSD disks. | [
"Helper",
"function",
"that",
"returns",
"a",
"dictionary",
"containing",
"a",
"list",
"of",
"SSD",
"and",
"Non",
"-",
"SSD",
"disks",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6644-L6663 |
34,553 | saltstack/salt | salt/modules/vsphere.py | _reset_syslog_config_params | def _reset_syslog_config_params(host, username, password, cmd, resets, valid_resets,
protocol=None, port=None, esxi_host=None, credstore=None):
'''
Helper function for reset_syslog_config that resets the config and populates the return dictionary.
'''
ret_dict = {}
al... | python | def _reset_syslog_config_params(host, username, password, cmd, resets, valid_resets,
protocol=None, port=None, esxi_host=None, credstore=None):
'''
Helper function for reset_syslog_config that resets the config and populates the return dictionary.
'''
ret_dict = {}
al... | [
"def",
"_reset_syslog_config_params",
"(",
"host",
",",
"username",
",",
"password",
",",
"cmd",
",",
"resets",
",",
"valid_resets",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"esxi_host",
"=",
"None",
",",
"credstore",
"=",
"None",
")",
... | Helper function for reset_syslog_config that resets the config and populates the return dictionary. | [
"Helper",
"function",
"for",
"reset_syslog_config",
"that",
"resets",
"the",
"config",
"and",
"populates",
"the",
"return",
"dictionary",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6728-L6758 |
34,554 | saltstack/salt | salt/modules/vsphere.py | _set_syslog_config_helper | def _set_syslog_config_helper(host, username, password, syslog_config, config_value,
protocol=None, port=None, reset_service=None, esxi_host=None, credstore=None):
'''
Helper function for set_syslog_config that sets the config and populates the return dictionary.
'''
cmd = ... | python | def _set_syslog_config_helper(host, username, password, syslog_config, config_value,
protocol=None, port=None, reset_service=None, esxi_host=None, credstore=None):
'''
Helper function for set_syslog_config that sets the config and populates the return dictionary.
'''
cmd = ... | [
"def",
"_set_syslog_config_helper",
"(",
"host",
",",
"username",
",",
"password",
",",
"syslog_config",
",",
"config_value",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"reset_service",
"=",
"None",
",",
"esxi_host",
"=",
"None",
",",
"cred... | Helper function for set_syslog_config that sets the config and populates the return dictionary. | [
"Helper",
"function",
"for",
"set_syslog_config",
"that",
"sets",
"the",
"config",
"and",
"populates",
"the",
"return",
"dictionary",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L6761-L6799 |
34,555 | saltstack/salt | salt/modules/vsphere.py | _get_proxy_target | def _get_proxy_target(service_instance):
'''
Returns the target object of a proxy.
If the object doesn't exist a VMwareObjectRetrievalError is raised
service_instance
Service instance (vim.ServiceInstance) of the vCenter/ESXi host.
'''
proxy_type = get_proxy_type()
if not salt.util... | python | def _get_proxy_target(service_instance):
'''
Returns the target object of a proxy.
If the object doesn't exist a VMwareObjectRetrievalError is raised
service_instance
Service instance (vim.ServiceInstance) of the vCenter/ESXi host.
'''
proxy_type = get_proxy_type()
if not salt.util... | [
"def",
"_get_proxy_target",
"(",
"service_instance",
")",
":",
"proxy_type",
"=",
"get_proxy_type",
"(",
")",
"if",
"not",
"salt",
".",
"utils",
".",
"vmware",
".",
"is_connection_to_a_vcenter",
"(",
"service_instance",
")",
":",
"raise",
"CommandExecutionError",
... | Returns the target object of a proxy.
If the object doesn't exist a VMwareObjectRetrievalError is raised
service_instance
Service instance (vim.ServiceInstance) of the vCenter/ESXi host. | [
"Returns",
"the",
"target",
"object",
"of",
"a",
"proxy",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7134-L7177 |
34,556 | saltstack/salt | salt/modules/vsphere.py | _get_esxdatacenter_proxy_details | def _get_esxdatacenter_proxy_details():
'''
Returns the running esxdatacenter's proxy details
'''
det = __salt__['esxdatacenter.get_details']()
return det.get('vcenter'), det.get('username'), det.get('password'), \
det.get('protocol'), det.get('port'), det.get('mechanism'), \
... | python | def _get_esxdatacenter_proxy_details():
'''
Returns the running esxdatacenter's proxy details
'''
det = __salt__['esxdatacenter.get_details']()
return det.get('vcenter'), det.get('username'), det.get('password'), \
det.get('protocol'), det.get('port'), det.get('mechanism'), \
... | [
"def",
"_get_esxdatacenter_proxy_details",
"(",
")",
":",
"det",
"=",
"__salt__",
"[",
"'esxdatacenter.get_details'",
"]",
"(",
")",
"return",
"det",
".",
"get",
"(",
"'vcenter'",
")",
",",
"det",
".",
"get",
"(",
"'username'",
")",
",",
"det",
".",
"get",... | Returns the running esxdatacenter's proxy details | [
"Returns",
"the",
"running",
"esxdatacenter",
"s",
"proxy",
"details"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7180-L7187 |
34,557 | saltstack/salt | salt/modules/vsphere.py | _get_esxcluster_proxy_details | def _get_esxcluster_proxy_details():
'''
Returns the running esxcluster's proxy details
'''
det = __salt__['esxcluster.get_details']()
return det.get('vcenter'), det.get('username'), det.get('password'), \
det.get('protocol'), det.get('port'), det.get('mechanism'), \
det.get(... | python | def _get_esxcluster_proxy_details():
'''
Returns the running esxcluster's proxy details
'''
det = __salt__['esxcluster.get_details']()
return det.get('vcenter'), det.get('username'), det.get('password'), \
det.get('protocol'), det.get('port'), det.get('mechanism'), \
det.get(... | [
"def",
"_get_esxcluster_proxy_details",
"(",
")",
":",
"det",
"=",
"__salt__",
"[",
"'esxcluster.get_details'",
"]",
"(",
")",
"return",
"det",
".",
"get",
"(",
"'vcenter'",
")",
",",
"det",
".",
"get",
"(",
"'username'",
")",
",",
"det",
".",
"get",
"("... | Returns the running esxcluster's proxy details | [
"Returns",
"the",
"running",
"esxcluster",
"s",
"proxy",
"details"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7190-L7198 |
34,558 | saltstack/salt | salt/modules/vsphere.py | _get_esxi_proxy_details | def _get_esxi_proxy_details():
'''
Returns the running esxi's proxy details
'''
det = __proxy__['esxi.get_details']()
host = det.get('host')
if det.get('vcenter'):
host = det['vcenter']
esxi_hosts = None
if det.get('esxi_host'):
esxi_hosts = [det['esxi_host']]
return ... | python | def _get_esxi_proxy_details():
'''
Returns the running esxi's proxy details
'''
det = __proxy__['esxi.get_details']()
host = det.get('host')
if det.get('vcenter'):
host = det['vcenter']
esxi_hosts = None
if det.get('esxi_host'):
esxi_hosts = [det['esxi_host']]
return ... | [
"def",
"_get_esxi_proxy_details",
"(",
")",
":",
"det",
"=",
"__proxy__",
"[",
"'esxi.get_details'",
"]",
"(",
")",
"host",
"=",
"det",
".",
"get",
"(",
"'host'",
")",
"if",
"det",
".",
"get",
"(",
"'vcenter'",
")",
":",
"host",
"=",
"det",
"[",
"'vc... | Returns the running esxi's proxy details | [
"Returns",
"the",
"running",
"esxi",
"s",
"proxy",
"details"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7201-L7214 |
34,559 | saltstack/salt | salt/modules/vsphere.py | get_vm | def get_vm(name, datacenter=None, vm_properties=None, traversal_spec=None,
parent_ref=None, service_instance=None):
'''
Returns vm object properties.
name
Name of the virtual machine.
datacenter
Datacenter name
vm_properties
List of vm properties.
traversal... | python | def get_vm(name, datacenter=None, vm_properties=None, traversal_spec=None,
parent_ref=None, service_instance=None):
'''
Returns vm object properties.
name
Name of the virtual machine.
datacenter
Datacenter name
vm_properties
List of vm properties.
traversal... | [
"def",
"get_vm",
"(",
"name",
",",
"datacenter",
"=",
"None",
",",
"vm_properties",
"=",
"None",
",",
"traversal_spec",
"=",
"None",
",",
"parent_ref",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"virtual_machine",
"=",
"salt",
".",
"utils... | Returns vm object properties.
name
Name of the virtual machine.
datacenter
Datacenter name
vm_properties
List of vm properties.
traversal_spec
Traversal Spec object(s) for searching.
parent_ref
Container Reference object for searching under a given object... | [
"Returns",
"vm",
"object",
"properties",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7219-L7250 |
34,560 | saltstack/salt | salt/modules/vsphere.py | get_vm_config_file | def get_vm_config_file(name, datacenter, placement, datastore,
service_instance=None):
'''
Queries the virtual machine config file and returns
vim.host.DatastoreBrowser.SearchResults object on success None on failure
name
Name of the virtual machine
datacenter
... | python | def get_vm_config_file(name, datacenter, placement, datastore,
service_instance=None):
'''
Queries the virtual machine config file and returns
vim.host.DatastoreBrowser.SearchResults object on success None on failure
name
Name of the virtual machine
datacenter
... | [
"def",
"get_vm_config_file",
"(",
"name",
",",
"datacenter",
",",
"placement",
",",
"datastore",
",",
"service_instance",
"=",
"None",
")",
":",
"browser_spec",
"=",
"vim",
".",
"host",
".",
"DatastoreBrowser",
".",
"SearchSpec",
"(",
")",
"directory",
"=",
... | Queries the virtual machine config file and returns
vim.host.DatastoreBrowser.SearchResults object on success None on failure
name
Name of the virtual machine
datacenter
Datacenter name
datastore
Datastore where the virtual machine files are stored
service_instance
... | [
"Queries",
"the",
"virtual",
"machine",
"config",
"file",
"and",
"returns",
"vim",
".",
"host",
".",
"DatastoreBrowser",
".",
"SearchResults",
"object",
"on",
"success",
"None",
"on",
"failure"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7255-L7307 |
34,561 | saltstack/salt | salt/modules/vsphere.py | _apply_hardware_version | def _apply_hardware_version(hardware_version, config_spec, operation='add'):
'''
Specifies vm container version or schedules upgrade,
returns True on change and False if nothing have been changed.
hardware_version
Hardware version string eg. vmx-08
config_spec
Configuration spec ob... | python | def _apply_hardware_version(hardware_version, config_spec, operation='add'):
'''
Specifies vm container version or schedules upgrade,
returns True on change and False if nothing have been changed.
hardware_version
Hardware version string eg. vmx-08
config_spec
Configuration spec ob... | [
"def",
"_apply_hardware_version",
"(",
"hardware_version",
",",
"config_spec",
",",
"operation",
"=",
"'add'",
")",
":",
"log",
".",
"trace",
"(",
"'Configuring virtual machine hardware '",
"'version version=%s'",
",",
"hardware_version",
")",
"if",
"operation",
"==",
... | Specifies vm container version or schedules upgrade,
returns True on change and False if nothing have been changed.
hardware_version
Hardware version string eg. vmx-08
config_spec
Configuration spec object
operation
Defines the operation which should be used,
the possi... | [
"Specifies",
"vm",
"container",
"version",
"or",
"schedules",
"upgrade",
"returns",
"True",
"on",
"change",
"and",
"False",
"if",
"nothing",
"have",
"been",
"changed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7310-L7335 |
34,562 | saltstack/salt | salt/modules/vsphere.py | _apply_cpu_config | def _apply_cpu_config(config_spec, cpu_props):
'''
Sets CPU core count to the given value
config_spec
vm.ConfigSpec object
cpu_props
CPU properties dict
'''
log.trace('Configuring virtual machine CPU '
'settings cpu_props=%s', cpu_props)
if 'count' in cpu_prop... | python | def _apply_cpu_config(config_spec, cpu_props):
'''
Sets CPU core count to the given value
config_spec
vm.ConfigSpec object
cpu_props
CPU properties dict
'''
log.trace('Configuring virtual machine CPU '
'settings cpu_props=%s', cpu_props)
if 'count' in cpu_prop... | [
"def",
"_apply_cpu_config",
"(",
"config_spec",
",",
"cpu_props",
")",
":",
"log",
".",
"trace",
"(",
"'Configuring virtual machine CPU '",
"'settings cpu_props=%s'",
",",
"cpu_props",
")",
"if",
"'count'",
"in",
"cpu_props",
":",
"config_spec",
".",
"numCPUs",
"=",... | Sets CPU core count to the given value
config_spec
vm.ConfigSpec object
cpu_props
CPU properties dict | [
"Sets",
"CPU",
"core",
"count",
"to",
"the",
"given",
"value"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7338-L7359 |
34,563 | saltstack/salt | salt/modules/vsphere.py | _apply_memory_config | def _apply_memory_config(config_spec, memory):
'''
Sets memory size to the given value
config_spec
vm.ConfigSpec object
memory
Memory size and unit
'''
log.trace('Configuring virtual machine memory '
'settings memory=%s', memory)
if 'size' in memory and 'unit'... | python | def _apply_memory_config(config_spec, memory):
'''
Sets memory size to the given value
config_spec
vm.ConfigSpec object
memory
Memory size and unit
'''
log.trace('Configuring virtual machine memory '
'settings memory=%s', memory)
if 'size' in memory and 'unit'... | [
"def",
"_apply_memory_config",
"(",
"config_spec",
",",
"memory",
")",
":",
"log",
".",
"trace",
"(",
"'Configuring virtual machine memory '",
"'settings memory=%s'",
",",
"memory",
")",
"if",
"'size'",
"in",
"memory",
"and",
"'unit'",
"in",
"memory",
":",
"try",
... | Sets memory size to the given value
config_spec
vm.ConfigSpec object
memory
Memory size and unit | [
"Sets",
"memory",
"size",
"to",
"the",
"given",
"value"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7362-L7388 |
34,564 | saltstack/salt | salt/modules/vsphere.py | get_advanced_configs | def get_advanced_configs(vm_name, datacenter, service_instance=None):
'''
Returns extra config parameters from a virtual machine advanced config list
vm_name
Virtual machine name
datacenter
Datacenter name where the virtual machine is available
service_instance
vCenter ser... | python | def get_advanced_configs(vm_name, datacenter, service_instance=None):
'''
Returns extra config parameters from a virtual machine advanced config list
vm_name
Virtual machine name
datacenter
Datacenter name where the virtual machine is available
service_instance
vCenter ser... | [
"def",
"get_advanced_configs",
"(",
"vm_name",
",",
"datacenter",
",",
"service_instance",
"=",
"None",
")",
":",
"current_config",
"=",
"get_vm_config",
"(",
"vm_name",
",",
"datacenter",
"=",
"datacenter",
",",
"objects",
"=",
"True",
",",
"service_instance",
... | Returns extra config parameters from a virtual machine advanced config list
vm_name
Virtual machine name
datacenter
Datacenter name where the virtual machine is available
service_instance
vCenter service instance for connection and configuration | [
"Returns",
"extra",
"config",
"parameters",
"from",
"a",
"virtual",
"machine",
"advanced",
"config",
"list"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7394-L7411 |
34,565 | saltstack/salt | salt/modules/vsphere.py | _apply_advanced_config | def _apply_advanced_config(config_spec, advanced_config, vm_extra_config=None):
'''
Sets configuration parameters for the vm
config_spec
vm.ConfigSpec object
advanced_config
config key value pairs
vm_extra_config
Virtual machine vm_ref.config.extraConfig object
'''
... | python | def _apply_advanced_config(config_spec, advanced_config, vm_extra_config=None):
'''
Sets configuration parameters for the vm
config_spec
vm.ConfigSpec object
advanced_config
config key value pairs
vm_extra_config
Virtual machine vm_ref.config.extraConfig object
'''
... | [
"def",
"_apply_advanced_config",
"(",
"config_spec",
",",
"advanced_config",
",",
"vm_extra_config",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Configuring advanced configuration '",
"'parameters %s'",
",",
"advanced_config",
")",
"if",
"isinstance",
"(",
"adv... | Sets configuration parameters for the vm
config_spec
vm.ConfigSpec object
advanced_config
config key value pairs
vm_extra_config
Virtual machine vm_ref.config.extraConfig object | [
"Sets",
"configuration",
"parameters",
"for",
"the",
"vm"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7414-L7440 |
34,566 | saltstack/salt | salt/modules/vsphere.py | set_advanced_configs | def set_advanced_configs(vm_name, datacenter, advanced_configs,
service_instance=None):
'''
Appends extra config parameters to a virtual machine advanced config list
vm_name
Virtual machine name
datacenter
Datacenter name where the virtual machine is available
... | python | def set_advanced_configs(vm_name, datacenter, advanced_configs,
service_instance=None):
'''
Appends extra config parameters to a virtual machine advanced config list
vm_name
Virtual machine name
datacenter
Datacenter name where the virtual machine is available
... | [
"def",
"set_advanced_configs",
"(",
"vm_name",
",",
"datacenter",
",",
"advanced_configs",
",",
"service_instance",
"=",
"None",
")",
":",
"current_config",
"=",
"get_vm_config",
"(",
"vm_name",
",",
"datacenter",
"=",
"datacenter",
",",
"objects",
"=",
"True",
... | Appends extra config parameters to a virtual machine advanced config list
vm_name
Virtual machine name
datacenter
Datacenter name where the virtual machine is available
advanced_configs
Dictionary with advanced parameter key value pairs
service_instance
vCenter servic... | [
"Appends",
"extra",
"config",
"parameters",
"to",
"a",
"virtual",
"machine",
"advanced",
"config",
"list"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7446-L7483 |
34,567 | saltstack/salt | salt/modules/vsphere.py | _delete_advanced_config | def _delete_advanced_config(config_spec, advanced_config, vm_extra_config):
'''
Removes configuration parameters for the vm
config_spec
vm.ConfigSpec object
advanced_config
List of advanced config keys to be deleted
vm_extra_config
Virtual machine vm_ref.config.extraConfig... | python | def _delete_advanced_config(config_spec, advanced_config, vm_extra_config):
'''
Removes configuration parameters for the vm
config_spec
vm.ConfigSpec object
advanced_config
List of advanced config keys to be deleted
vm_extra_config
Virtual machine vm_ref.config.extraConfig... | [
"def",
"_delete_advanced_config",
"(",
"config_spec",
",",
"advanced_config",
",",
"vm_extra_config",
")",
":",
"log",
".",
"trace",
"(",
"'Removing advanced configuration '",
"'parameters %s'",
",",
"advanced_config",
")",
"if",
"isinstance",
"(",
"advanced_config",
",... | Removes configuration parameters for the vm
config_spec
vm.ConfigSpec object
advanced_config
List of advanced config keys to be deleted
vm_extra_config
Virtual machine vm_ref.config.extraConfig object | [
"Removes",
"configuration",
"parameters",
"for",
"the",
"vm"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7486-L7512 |
34,568 | saltstack/salt | salt/modules/vsphere.py | delete_advanced_configs | def delete_advanced_configs(vm_name, datacenter, advanced_configs,
service_instance=None):
'''
Removes extra config parameters from a virtual machine
vm_name
Virtual machine name
datacenter
Datacenter name where the virtual machine is available
advanced... | python | def delete_advanced_configs(vm_name, datacenter, advanced_configs,
service_instance=None):
'''
Removes extra config parameters from a virtual machine
vm_name
Virtual machine name
datacenter
Datacenter name where the virtual machine is available
advanced... | [
"def",
"delete_advanced_configs",
"(",
"vm_name",
",",
"datacenter",
",",
"advanced_configs",
",",
"service_instance",
"=",
"None",
")",
":",
"datacenter_ref",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_datacenter",
"(",
"service_instance",
",",
"datacent... | Removes extra config parameters from a virtual machine
vm_name
Virtual machine name
datacenter
Datacenter name where the virtual machine is available
advanced_configs
List of advanced config values to be removed
service_instance
vCenter service instance for connection... | [
"Removes",
"extra",
"config",
"parameters",
"from",
"a",
"virtual",
"machine"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7518-L7547 |
34,569 | saltstack/salt | salt/modules/vsphere.py | _get_scsi_controller_key | def _get_scsi_controller_key(bus_number, scsi_ctrls):
'''
Returns key number of the SCSI controller keys
bus_number
Controller bus number from the adapter
scsi_ctrls
List of SCSI Controller objects (old+newly created)
'''
# list of new/old VirtualSCSIController objects, both ne... | python | def _get_scsi_controller_key(bus_number, scsi_ctrls):
'''
Returns key number of the SCSI controller keys
bus_number
Controller bus number from the adapter
scsi_ctrls
List of SCSI Controller objects (old+newly created)
'''
# list of new/old VirtualSCSIController objects, both ne... | [
"def",
"_get_scsi_controller_key",
"(",
"bus_number",
",",
"scsi_ctrls",
")",
":",
"# list of new/old VirtualSCSIController objects, both new and old objects",
"# should contain a key attribute key should be a negative integer in case",
"# of a new object",
"keys",
"=",
"[",
"ctrl",
".... | Returns key number of the SCSI controller keys
bus_number
Controller bus number from the adapter
scsi_ctrls
List of SCSI Controller objects (old+newly created) | [
"Returns",
"key",
"number",
"of",
"the",
"SCSI",
"controller",
"keys"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7550-L7568 |
34,570 | saltstack/salt | salt/modules/vsphere.py | _create_adapter_type | def _create_adapter_type(network_adapter, adapter_type,
network_adapter_label=''):
'''
Returns a vim.vm.device.VirtualEthernetCard object specifying a virtual
ethernet card information
network_adapter
None or VirtualEthernet object
adapter_type
String, type... | python | def _create_adapter_type(network_adapter, adapter_type,
network_adapter_label=''):
'''
Returns a vim.vm.device.VirtualEthernetCard object specifying a virtual
ethernet card information
network_adapter
None or VirtualEthernet object
adapter_type
String, type... | [
"def",
"_create_adapter_type",
"(",
"network_adapter",
",",
"adapter_type",
",",
"network_adapter_label",
"=",
"''",
")",
":",
"log",
".",
"trace",
"(",
"'Configuring virtual machine network '",
"'adapter adapter_type=%s'",
",",
"adapter_type",
")",
"if",
"adapter_type",
... | Returns a vim.vm.device.VirtualEthernetCard object specifying a virtual
ethernet card information
network_adapter
None or VirtualEthernet object
adapter_type
String, type of adapter
network_adapter_label
string, network adapter name | [
"Returns",
"a",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualEthernetCard",
"object",
"specifying",
"a",
"virtual",
"ethernet",
"card",
"information"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7646-L7690 |
34,571 | saltstack/salt | salt/modules/vsphere.py | _create_network_backing | def _create_network_backing(network_name, switch_type, parent_ref):
'''
Returns a vim.vm.device.VirtualDevice.BackingInfo object specifying a
virtual ethernet card backing information
network_name
string, network name
switch_type
string, type of switch
parent_ref
Paren... | python | def _create_network_backing(network_name, switch_type, parent_ref):
'''
Returns a vim.vm.device.VirtualDevice.BackingInfo object specifying a
virtual ethernet card backing information
network_name
string, network name
switch_type
string, type of switch
parent_ref
Paren... | [
"def",
"_create_network_backing",
"(",
"network_name",
",",
"switch_type",
",",
"parent_ref",
")",
":",
"log",
".",
"trace",
"(",
"'Configuring virtual machine network backing network_name=%s '",
"'switch_type=%s parent=%s'",
",",
"network_name",
",",
"switch_type",
",",
"s... | Returns a vim.vm.device.VirtualDevice.BackingInfo object specifying a
virtual ethernet card backing information
network_name
string, network name
switch_type
string, type of switch
parent_ref
Parent reference to search for network | [
"Returns",
"a",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDevice",
".",
"BackingInfo",
"object",
"specifying",
"a",
"virtual",
"ethernet",
"card",
"backing",
"information"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7693-L7740 |
34,572 | saltstack/salt | salt/modules/vsphere.py | _create_ide_controllers | def _create_ide_controllers(ide_controllers):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing
IDE controllers
ide_controllers
IDE properties
'''
ide_ctrls = []
keys = range(-200, -250, -1)
if ide_controllers:
devs = [ide['adapter'] for ide in i... | python | def _create_ide_controllers(ide_controllers):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing
IDE controllers
ide_controllers
IDE properties
'''
ide_ctrls = []
keys = range(-200, -250, -1)
if ide_controllers:
devs = [ide['adapter'] for ide in i... | [
"def",
"_create_ide_controllers",
"(",
"ide_controllers",
")",
":",
"ide_ctrls",
"=",
"[",
"]",
"keys",
"=",
"range",
"(",
"-",
"200",
",",
"-",
"250",
",",
"-",
"1",
")",
"if",
"ide_controllers",
":",
"devs",
"=",
"[",
"ide",
"[",
"'adapter'",
"]",
... | Returns a list of vim.vm.device.VirtualDeviceSpec objects representing
IDE controllers
ide_controllers
IDE properties | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"objects",
"representing",
"IDE",
"controllers"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7894-L7910 |
34,573 | saltstack/salt | salt/modules/vsphere.py | _create_sata_controllers | def _create_sata_controllers(sata_controllers):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing
SATA controllers
sata_controllers
SATA properties
'''
sata_ctrls = []
keys = range(-15000, -15050, -1)
if sata_controllers:
devs = [sata['adapter'] ... | python | def _create_sata_controllers(sata_controllers):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing
SATA controllers
sata_controllers
SATA properties
'''
sata_ctrls = []
keys = range(-15000, -15050, -1)
if sata_controllers:
devs = [sata['adapter'] ... | [
"def",
"_create_sata_controllers",
"(",
"sata_controllers",
")",
":",
"sata_ctrls",
"=",
"[",
"]",
"keys",
"=",
"range",
"(",
"-",
"15000",
",",
"-",
"15050",
",",
"-",
"1",
")",
"if",
"sata_controllers",
":",
"devs",
"=",
"[",
"sata",
"[",
"'adapter'",
... | Returns a list of vim.vm.device.VirtualDeviceSpec objects representing
SATA controllers
sata_controllers
SATA properties | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"objects",
"representing",
"SATA",
"controllers"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L7948-L7964 |
34,574 | saltstack/salt | salt/modules/vsphere.py | _set_network_adapter_mapping | def _set_network_adapter_mapping(domain, gateway, ip_addr, subnet_mask, mac):
'''
Returns a vim.vm.customization.AdapterMapping object containing the IP
properties of a network adapter card
domain
Domain of the host
gateway
Gateway address
ip_addr
IP address
subne... | python | def _set_network_adapter_mapping(domain, gateway, ip_addr, subnet_mask, mac):
'''
Returns a vim.vm.customization.AdapterMapping object containing the IP
properties of a network adapter card
domain
Domain of the host
gateway
Gateway address
ip_addr
IP address
subne... | [
"def",
"_set_network_adapter_mapping",
"(",
"domain",
",",
"gateway",
",",
"ip_addr",
",",
"subnet_mask",
",",
"mac",
")",
":",
"adapter_mapping",
"=",
"vim",
".",
"vm",
".",
"customization",
".",
"AdapterMapping",
"(",
")",
"adapter_mapping",
".",
"macAddress",... | Returns a vim.vm.customization.AdapterMapping object containing the IP
properties of a network adapter card
domain
Domain of the host
gateway
Gateway address
ip_addr
IP address
subnet_mask
Subnet mask
mac
MAC address of the guest | [
"Returns",
"a",
"vim",
".",
"vm",
".",
"customization",
".",
"AdapterMapping",
"object",
"containing",
"the",
"IP",
"properties",
"of",
"a",
"network",
"adapter",
"card"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8091-L8124 |
34,575 | saltstack/salt | salt/modules/vsphere.py | _apply_serial_port | def _apply_serial_port(serial_device_spec, key, operation='add'):
'''
Returns a vim.vm.device.VirtualSerialPort representing a serial port
component
serial_device_spec
Serial device properties
key
Unique key of the device
operation
Add or edit the given device
.. ... | python | def _apply_serial_port(serial_device_spec, key, operation='add'):
'''
Returns a vim.vm.device.VirtualSerialPort representing a serial port
component
serial_device_spec
Serial device properties
key
Unique key of the device
operation
Add or edit the given device
.. ... | [
"def",
"_apply_serial_port",
"(",
"serial_device_spec",
",",
"key",
",",
"operation",
"=",
"'add'",
")",
":",
"log",
".",
"trace",
"(",
"'Creating serial port adapter=%s type=%s connectable=%s yield=%s'",
",",
"serial_device_spec",
"[",
"'adapter'",
"]",
",",
"serial_de... | Returns a vim.vm.device.VirtualSerialPort representing a serial port
component
serial_device_spec
Serial device properties
key
Unique key of the device
operation
Add or edit the given device
.. code-block:: bash
serial_ports:
adapter: 'Serial port 1'
... | [
"Returns",
"a",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualSerialPort",
"representing",
"a",
"serial",
"port",
"component"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8127-L8194 |
34,576 | saltstack/salt | salt/modules/vsphere.py | _create_disks | def _create_disks(service_instance, disks, scsi_controllers=None, parent=None):
'''
Returns a list of disk specs representing the disks to be created for a
virtual machine
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
disks
List of... | python | def _create_disks(service_instance, disks, scsi_controllers=None, parent=None):
'''
Returns a list of disk specs representing the disks to be created for a
virtual machine
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
disks
List of... | [
"def",
"_create_disks",
"(",
"service_instance",
",",
"disks",
",",
"scsi_controllers",
"=",
"None",
",",
"parent",
"=",
"None",
")",
":",
"disk_specs",
"=",
"[",
"]",
"keys",
"=",
"range",
"(",
"-",
"2000",
",",
"-",
"2050",
",",
"-",
"1",
")",
"if"... | Returns a list of disk specs representing the disks to be created for a
virtual machine
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
disks
List of disks with properties
scsi_controllers
List of SCSI controllers
parent
... | [
"Returns",
"a",
"list",
"of",
"disk",
"specs",
"representing",
"the",
"disks",
"to",
"be",
"created",
"for",
"a",
"virtual",
"machine"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8197-L8285 |
34,577 | saltstack/salt | salt/modules/vsphere.py | _create_scsi_devices | def _create_scsi_devices(scsi_devices):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing
SCSI controllers
scsi_devices:
List of SCSI device properties
'''
keys = range(-1000, -1050, -1)
scsi_specs = []
if scsi_devices:
devs = [scsi['adapter'] fo... | python | def _create_scsi_devices(scsi_devices):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing
SCSI controllers
scsi_devices:
List of SCSI device properties
'''
keys = range(-1000, -1050, -1)
scsi_specs = []
if scsi_devices:
devs = [scsi['adapter'] fo... | [
"def",
"_create_scsi_devices",
"(",
"scsi_devices",
")",
":",
"keys",
"=",
"range",
"(",
"-",
"1000",
",",
"-",
"1050",
",",
"-",
"1",
")",
"scsi_specs",
"=",
"[",
"]",
"if",
"scsi_devices",
":",
"devs",
"=",
"[",
"scsi",
"[",
"'adapter'",
"]",
"for"... | Returns a list of vim.vm.device.VirtualDeviceSpec objects representing
SCSI controllers
scsi_devices:
List of SCSI device properties | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"objects",
"representing",
"SCSI",
"controllers"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8288-L8312 |
34,578 | saltstack/salt | salt/modules/vsphere.py | _create_network_adapters | def _create_network_adapters(network_interfaces, parent=None):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing
the interfaces to be created for a virtual machine
network_interfaces
List of network interfaces and properties
parent
Parent object reference
... | python | def _create_network_adapters(network_interfaces, parent=None):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing
the interfaces to be created for a virtual machine
network_interfaces
List of network interfaces and properties
parent
Parent object reference
... | [
"def",
"_create_network_adapters",
"(",
"network_interfaces",
",",
"parent",
"=",
"None",
")",
":",
"network_specs",
"=",
"[",
"]",
"nics_settings",
"=",
"[",
"]",
"keys",
"=",
"range",
"(",
"-",
"4000",
",",
"-",
"4050",
",",
"-",
"1",
")",
"if",
"net... | Returns a list of vim.vm.device.VirtualDeviceSpec objects representing
the interfaces to be created for a virtual machine
network_interfaces
List of network interfaces and properties
parent
Parent object reference
.. code-block: bash
interfaces:
adapter: 'Network ad... | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"objects",
"representing",
"the",
"interfaces",
"to",
"be",
"created",
"for",
"a",
"virtual",
"machine"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8315-L8359 |
34,579 | saltstack/salt | salt/modules/vsphere.py | _create_serial_ports | def _create_serial_ports(serial_ports):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing the
serial ports to be created for a virtual machine
serial_ports
Serial port properties
'''
ports = []
keys = range(-9000, -9050, -1)
if serial_ports:
devs... | python | def _create_serial_ports(serial_ports):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing the
serial ports to be created for a virtual machine
serial_ports
Serial port properties
'''
ports = []
keys = range(-9000, -9050, -1)
if serial_ports:
devs... | [
"def",
"_create_serial_ports",
"(",
"serial_ports",
")",
":",
"ports",
"=",
"[",
"]",
"keys",
"=",
"range",
"(",
"-",
"9000",
",",
"-",
"9050",
",",
"-",
"1",
")",
"if",
"serial_ports",
":",
"devs",
"=",
"[",
"serial",
"[",
"'adapter'",
"]",
"for",
... | Returns a list of vim.vm.device.VirtualDeviceSpec objects representing the
serial ports to be created for a virtual machine
serial_ports
Serial port properties | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"objects",
"representing",
"the",
"serial",
"ports",
"to",
"be",
"created",
"for",
"a",
"virtual",
"machine"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8362-L8378 |
34,580 | saltstack/salt | salt/modules/vsphere.py | _get_device_by_key | def _get_device_by_key(devices, key):
'''
Returns the device with the given key, raises error if the device is
not found.
devices
list of vim.vm.device.VirtualDevice objects
key
Unique key of device
'''
device_keys = [d for d in devices if d.key == key]
if device_keys:
... | python | def _get_device_by_key(devices, key):
'''
Returns the device with the given key, raises error if the device is
not found.
devices
list of vim.vm.device.VirtualDevice objects
key
Unique key of device
'''
device_keys = [d for d in devices if d.key == key]
if device_keys:
... | [
"def",
"_get_device_by_key",
"(",
"devices",
",",
"key",
")",
":",
"device_keys",
"=",
"[",
"d",
"for",
"d",
"in",
"devices",
"if",
"d",
".",
"key",
"==",
"key",
"]",
"if",
"device_keys",
":",
"return",
"device_keys",
"[",
"0",
"]",
"else",
":",
"rai... | Returns the device with the given key, raises error if the device is
not found.
devices
list of vim.vm.device.VirtualDevice objects
key
Unique key of device | [
"Returns",
"the",
"device",
"with",
"the",
"given",
"key",
"raises",
"error",
"if",
"the",
"device",
"is",
"not",
"found",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8422-L8439 |
34,581 | saltstack/salt | salt/modules/vsphere.py | _get_device_by_label | def _get_device_by_label(devices, label):
'''
Returns the device with the given label, raises error if the device is
not found.
devices
list of vim.vm.device.VirtualDevice objects
key
Unique key of device
'''
device_labels = [d for d in devices if d.deviceInfo.label == labe... | python | def _get_device_by_label(devices, label):
'''
Returns the device with the given label, raises error if the device is
not found.
devices
list of vim.vm.device.VirtualDevice objects
key
Unique key of device
'''
device_labels = [d for d in devices if d.deviceInfo.label == labe... | [
"def",
"_get_device_by_label",
"(",
"devices",
",",
"label",
")",
":",
"device_labels",
"=",
"[",
"d",
"for",
"d",
"in",
"devices",
"if",
"d",
".",
"deviceInfo",
".",
"label",
"==",
"label",
"]",
"if",
"device_labels",
":",
"return",
"device_labels",
"[",
... | Returns the device with the given label, raises error if the device is
not found.
devices
list of vim.vm.device.VirtualDevice objects
key
Unique key of device | [
"Returns",
"the",
"device",
"with",
"the",
"given",
"label",
"raises",
"error",
"if",
"the",
"device",
"is",
"not",
"found",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8442-L8459 |
34,582 | saltstack/salt | salt/modules/vsphere.py | _convert_units | def _convert_units(devices):
'''
Updates the size and unit dictionary values with the new unit values
devices
List of device data objects
'''
if devices:
for device in devices:
if 'unit' in device and 'size' in device:
device.update(
s... | python | def _convert_units(devices):
'''
Updates the size and unit dictionary values with the new unit values
devices
List of device data objects
'''
if devices:
for device in devices:
if 'unit' in device and 'size' in device:
device.update(
s... | [
"def",
"_convert_units",
"(",
"devices",
")",
":",
"if",
"devices",
":",
"for",
"device",
"in",
"devices",
":",
"if",
"'unit'",
"in",
"device",
"and",
"'size'",
"in",
"device",
":",
"device",
".",
"update",
"(",
"salt",
".",
"utils",
".",
"vmware",
"."... | Updates the size and unit dictionary values with the new unit values
devices
List of device data objects | [
"Updates",
"the",
"size",
"and",
"unit",
"dictionary",
"values",
"with",
"the",
"new",
"unit",
"values"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8462-L8476 |
34,583 | saltstack/salt | salt/modules/vsphere.py | _update_disks | def _update_disks(disks_old_new):
'''
Changes the disk size and returns the config spec objects in a list.
The controller property cannot be updated, because controller address
identifies the disk by the unit and bus number properties.
disks_diffs
List of old and new disk properties, the pr... | python | def _update_disks(disks_old_new):
'''
Changes the disk size and returns the config spec objects in a list.
The controller property cannot be updated, because controller address
identifies the disk by the unit and bus number properties.
disks_diffs
List of old and new disk properties, the pr... | [
"def",
"_update_disks",
"(",
"disks_old_new",
")",
":",
"disk_changes",
"=",
"[",
"]",
"if",
"disks_old_new",
":",
"devs",
"=",
"[",
"disk",
"[",
"'old'",
"]",
"[",
"'address'",
"]",
"for",
"disk",
"in",
"disks_old_new",
"]",
"log",
".",
"trace",
"(",
... | Changes the disk size and returns the config spec objects in a list.
The controller property cannot be updated, because controller address
identifies the disk by the unit and bus number properties.
disks_diffs
List of old and new disk properties, the properties are dictionary
objects | [
"Changes",
"the",
"disk",
"size",
"and",
"returns",
"the",
"config",
"spec",
"objects",
"in",
"a",
"list",
".",
"The",
"controller",
"property",
"cannot",
"be",
"updated",
"because",
"controller",
"address",
"identifies",
"the",
"disk",
"by",
"the",
"unit",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8793-L8840 |
34,584 | saltstack/salt | salt/modules/vsphere.py | _update_scsi_devices | def _update_scsi_devices(scsis_old_new, current_disks):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec specifying the scsi
properties as input the old and new configs are defined in a dictionary.
scsi_diffs
List of old and new scsi properties
'''
device_config_specs = []
if ... | python | def _update_scsi_devices(scsis_old_new, current_disks):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec specifying the scsi
properties as input the old and new configs are defined in a dictionary.
scsi_diffs
List of old and new scsi properties
'''
device_config_specs = []
if ... | [
"def",
"_update_scsi_devices",
"(",
"scsis_old_new",
",",
"current_disks",
")",
":",
"device_config_specs",
"=",
"[",
"]",
"if",
"scsis_old_new",
":",
"devs",
"=",
"[",
"scsi",
"[",
"'old'",
"]",
"[",
"'adapter'",
"]",
"for",
"scsi",
"in",
"scsis_old_new",
"... | Returns a list of vim.vm.device.VirtualDeviceSpec specifying the scsi
properties as input the old and new configs are defined in a dictionary.
scsi_diffs
List of old and new scsi properties | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"specifying",
"the",
"scsi",
"properties",
"as",
"input",
"the",
"old",
"and",
"new",
"configs",
"are",
"defined",
"in",
"a",
"dictionary",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8843-L8900 |
34,585 | saltstack/salt | salt/modules/vsphere.py | _update_serial_ports | def _update_serial_ports(serial_old_new):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a
deployed serial port configuration to the new given config
serial_old_new
Dictionary with old and new keys which contains the current and the
next config for a serial ... | python | def _update_serial_ports(serial_old_new):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a
deployed serial port configuration to the new given config
serial_old_new
Dictionary with old and new keys which contains the current and the
next config for a serial ... | [
"def",
"_update_serial_ports",
"(",
"serial_old_new",
")",
":",
"serial_changes",
"=",
"[",
"]",
"if",
"serial_old_new",
":",
"devs",
"=",
"[",
"serial",
"[",
"'old'",
"]",
"[",
"'adapter'",
"]",
"for",
"serial",
"in",
"serial_old_new",
"]",
"log",
".",
"t... | Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a
deployed serial port configuration to the new given config
serial_old_new
Dictionary with old and new keys which contains the current and the
next config for a serial port device | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"specifying",
"to",
"edit",
"a",
"deployed",
"serial",
"port",
"configuration",
"to",
"the",
"new",
"given",
"config"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8944-L8966 |
34,586 | saltstack/salt | salt/modules/vsphere.py | _update_cd_drives | def _update_cd_drives(drives_old_new, controllers=None, parent=None):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a
deployed cd drive configuration to the new given config
drives_old_new
Dictionary with old and new keys which contains the current and the
nex... | python | def _update_cd_drives(drives_old_new, controllers=None, parent=None):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a
deployed cd drive configuration to the new given config
drives_old_new
Dictionary with old and new keys which contains the current and the
nex... | [
"def",
"_update_cd_drives",
"(",
"drives_old_new",
",",
"controllers",
"=",
"None",
",",
"parent",
"=",
"None",
")",
":",
"cd_changes",
"=",
"[",
"]",
"if",
"drives_old_new",
":",
"devs",
"=",
"[",
"drive",
"[",
"'old'",
"]",
"[",
"'adapter'",
"]",
"for"... | Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a
deployed cd drive configuration to the new given config
drives_old_new
Dictionary with old and new keys which contains the current and the
next config for a cd drive
controllers
Controller device list
paren... | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"specifying",
"to",
"edit",
"a",
"deployed",
"cd",
"drive",
"configuration",
"to",
"the",
"new",
"given",
"config"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8969-L9009 |
34,587 | saltstack/salt | salt/modules/vsphere.py | _delete_device | def _delete_device(device):
'''
Returns a vim.vm.device.VirtualDeviceSpec specifying to remove a virtual
machine device
device
Device data type object
'''
log.trace('Deleting device with type %s', type(device))
device_spec = vim.vm.device.VirtualDeviceSpec()
device_spec.operatio... | python | def _delete_device(device):
'''
Returns a vim.vm.device.VirtualDeviceSpec specifying to remove a virtual
machine device
device
Device data type object
'''
log.trace('Deleting device with type %s', type(device))
device_spec = vim.vm.device.VirtualDeviceSpec()
device_spec.operatio... | [
"def",
"_delete_device",
"(",
"device",
")",
":",
"log",
".",
"trace",
"(",
"'Deleting device with type %s'",
",",
"type",
"(",
"device",
")",
")",
"device_spec",
"=",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"(",
")",
"device_spec",
".",
... | Returns a vim.vm.device.VirtualDeviceSpec specifying to remove a virtual
machine device
device
Device data type object | [
"Returns",
"a",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"specifying",
"to",
"remove",
"a",
"virtual",
"machine",
"device"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9012-L9024 |
34,588 | saltstack/salt | salt/modules/vsphere.py | create_vm | def create_vm(vm_name, cpu, memory, image, version, datacenter, datastore,
placement, interfaces, disks, scsi_devices, serial_ports=None,
ide_controllers=None, sata_controllers=None, cd_drives=None,
advanced_configs=None, service_instance=None):
'''
Creates a virtual ma... | python | def create_vm(vm_name, cpu, memory, image, version, datacenter, datastore,
placement, interfaces, disks, scsi_devices, serial_ports=None,
ide_controllers=None, sata_controllers=None, cd_drives=None,
advanced_configs=None, service_instance=None):
'''
Creates a virtual ma... | [
"def",
"create_vm",
"(",
"vm_name",
",",
"cpu",
",",
"memory",
",",
"image",
",",
"version",
",",
"datacenter",
",",
"datastore",
",",
"placement",
",",
"interfaces",
",",
"disks",
",",
"scsi_devices",
",",
"serial_ports",
"=",
"None",
",",
"ide_controllers"... | Creates a virtual machine container.
CLI Example:
.. code-block:: bash
salt vm_minion vsphere.create_vm vm_name=vmname cpu='{count: 2, nested: True}' ...
vm_name
Name of the virtual machine
cpu
Properties of CPUs for freshly created machines
memory
Memory size f... | [
"Creates",
"a",
"virtual",
"machine",
"container",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9030-L9225 |
34,589 | saltstack/salt | salt/modules/vsphere.py | register_vm | def register_vm(name, datacenter, placement, vmx_path, service_instance=None):
'''
Registers a virtual machine to the inventory with the given vmx file.
Returns comments and change list
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
placement
... | python | def register_vm(name, datacenter, placement, vmx_path, service_instance=None):
'''
Registers a virtual machine to the inventory with the given vmx file.
Returns comments and change list
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
placement
... | [
"def",
"register_vm",
"(",
"name",
",",
"datacenter",
",",
"placement",
",",
"vmx_path",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Registering virtual machine with properties '",
"'datacenter=%s, placement=%s, vmx_path=%s'",
",",
"datac... | Registers a virtual machine to the inventory with the given vmx file.
Returns comments and change list
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
placement
Placement dictionary of the virtual machine, host or cluster
vmx_path:
Fu... | [
"Registers",
"a",
"virtual",
"machine",
"to",
"the",
"inventory",
"with",
"the",
"given",
"vmx",
"file",
".",
"Returns",
"comments",
"and",
"change",
"list"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9417-L9487 |
34,590 | saltstack/salt | salt/modules/vsphere.py | power_on_vm | def power_on_vm(name, datacenter=None, service_instance=None):
'''
Powers on a virtual machine specified by it's name.
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
... | python | def power_on_vm(name, datacenter=None, service_instance=None):
'''
Powers on a virtual machine specified by it's name.
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
... | [
"def",
"power_on_vm",
"(",
"name",
",",
"datacenter",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Powering on virtual machine %s'",
",",
"name",
")",
"vm_properties",
"=",
"[",
"'name'",
",",
"'summary.runtime.powerSt... | Powers on a virtual machine specified by it's name.
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.po... | [
"Powers",
"on",
"a",
"virtual",
"machine",
"specified",
"by",
"it",
"s",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9493-L9529 |
34,591 | saltstack/salt | salt/modules/vsphere.py | _remove_vm | def _remove_vm(name, datacenter, service_instance, placement=None,
power_off=None):
'''
Helper function to remove a virtual machine
name
Name of the virtual machine
service_instance
vCenter service instance for connection and configuration
datacenter
Datacen... | python | def _remove_vm(name, datacenter, service_instance, placement=None,
power_off=None):
'''
Helper function to remove a virtual machine
name
Name of the virtual machine
service_instance
vCenter service instance for connection and configuration
datacenter
Datacen... | [
"def",
"_remove_vm",
"(",
"name",
",",
"datacenter",
",",
"service_instance",
",",
"placement",
"=",
"None",
",",
"power_off",
"=",
"None",
")",
":",
"results",
"=",
"{",
"}",
"if",
"placement",
":",
"(",
"resourcepool_object",
",",
"placement_object",
")",
... | Helper function to remove a virtual machine
name
Name of the virtual machine
service_instance
vCenter service instance for connection and configuration
datacenter
Datacenter of the virtual machine
placement
Placement information of the virtual machine | [
"Helper",
"function",
"to",
"remove",
"a",
"virtual",
"machine"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9574-L9613 |
34,592 | saltstack/salt | salt/modules/vsphere.py | delete_vm | def delete_vm(name, datacenter, placement=None, power_off=False,
service_instance=None):
'''
Deletes a virtual machine defined by name and placement
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
placement
Placement information ... | python | def delete_vm(name, datacenter, placement=None, power_off=False,
service_instance=None):
'''
Deletes a virtual machine defined by name and placement
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
placement
Placement information ... | [
"def",
"delete_vm",
"(",
"name",
",",
"datacenter",
",",
"placement",
"=",
"None",
",",
"power_off",
"=",
"False",
",",
"service_instance",
"=",
"None",
")",
":",
"results",
"=",
"{",
"}",
"schema",
"=",
"ESXVirtualMachineDeleteSchema",
".",
"serialize",
"("... | Deletes a virtual machine defined by name and placement
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
placement
Placement information of the virtual machine
service_instance
vCenter service instance for connection and configuration
... | [
"Deletes",
"a",
"virtual",
"machine",
"defined",
"by",
"name",
"and",
"placement"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9619-L9657 |
34,593 | saltstack/salt | salt/utils/azurearm.py | _determine_auth | def _determine_auth(**kwargs):
'''
Acquire Azure ARM Credentials
'''
if 'profile' in kwargs:
azure_credentials = __salt__['config.option'](kwargs['profile'])
kwargs.update(azure_credentials)
service_principal_creds_kwargs = ['client_id', 'secret', 'tenant']
user_pass_creds_kwarg... | python | def _determine_auth(**kwargs):
'''
Acquire Azure ARM Credentials
'''
if 'profile' in kwargs:
azure_credentials = __salt__['config.option'](kwargs['profile'])
kwargs.update(azure_credentials)
service_principal_creds_kwargs = ['client_id', 'secret', 'tenant']
user_pass_creds_kwarg... | [
"def",
"_determine_auth",
"(",
"*",
"*",
"kwargs",
")",
":",
"if",
"'profile'",
"in",
"kwargs",
":",
"azure_credentials",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"kwargs",
"[",
"'profile'",
"]",
")",
"kwargs",
".",
"update",
"(",
"azure_credential... | Acquire Azure ARM Credentials | [
"Acquire",
"Azure",
"ARM",
"Credentials"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L72-L137 |
34,594 | saltstack/salt | salt/utils/azurearm.py | get_client | def get_client(client_type, **kwargs):
'''
Dynamically load the selected client and return a management client object
'''
client_map = {'compute': 'ComputeManagement',
'authorization': 'AuthorizationManagement',
'dns': 'DnsManagement',
'storage': 'St... | python | def get_client(client_type, **kwargs):
'''
Dynamically load the selected client and return a management client object
'''
client_map = {'compute': 'ComputeManagement',
'authorization': 'AuthorizationManagement',
'dns': 'DnsManagement',
'storage': 'St... | [
"def",
"get_client",
"(",
"client_type",
",",
"*",
"*",
"kwargs",
")",
":",
"client_map",
"=",
"{",
"'compute'",
":",
"'ComputeManagement'",
",",
"'authorization'",
":",
"'AuthorizationManagement'",
",",
"'dns'",
":",
"'DnsManagement'",
",",
"'storage'",
":",
"'... | Dynamically load the selected client and return a management client object | [
"Dynamically",
"load",
"the",
"selected",
"client",
"and",
"return",
"a",
"management",
"client",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L140-L197 |
34,595 | saltstack/salt | salt/utils/azurearm.py | log_cloud_error | def log_cloud_error(client, message, **kwargs):
'''
Log an azurearm cloud error exception
'''
try:
cloud_logger = getattr(log, kwargs.get('azurearm_log_level'))
except (AttributeError, TypeError):
cloud_logger = getattr(log, 'error')
cloud_logger(
'An AzureARM %s CloudE... | python | def log_cloud_error(client, message, **kwargs):
'''
Log an azurearm cloud error exception
'''
try:
cloud_logger = getattr(log, kwargs.get('azurearm_log_level'))
except (AttributeError, TypeError):
cloud_logger = getattr(log, 'error')
cloud_logger(
'An AzureARM %s CloudE... | [
"def",
"log_cloud_error",
"(",
"client",
",",
"message",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"cloud_logger",
"=",
"getattr",
"(",
"log",
",",
"kwargs",
".",
"get",
"(",
"'azurearm_log_level'",
")",
")",
"except",
"(",
"AttributeError",
",",
"T... | Log an azurearm cloud error exception | [
"Log",
"an",
"azurearm",
"cloud",
"error",
"exception"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L200-L215 |
34,596 | saltstack/salt | salt/utils/azurearm.py | paged_object_to_list | def paged_object_to_list(paged_object):
'''
Extract all pages within a paged object as a list of dictionaries
'''
paged_return = []
while True:
try:
page = next(paged_object)
paged_return.append(page.as_dict())
except CloudError:
raise
exce... | python | def paged_object_to_list(paged_object):
'''
Extract all pages within a paged object as a list of dictionaries
'''
paged_return = []
while True:
try:
page = next(paged_object)
paged_return.append(page.as_dict())
except CloudError:
raise
exce... | [
"def",
"paged_object_to_list",
"(",
"paged_object",
")",
":",
"paged_return",
"=",
"[",
"]",
"while",
"True",
":",
"try",
":",
"page",
"=",
"next",
"(",
"paged_object",
")",
"paged_return",
".",
"append",
"(",
"page",
".",
"as_dict",
"(",
")",
")",
"exce... | Extract all pages within a paged object as a list of dictionaries | [
"Extract",
"all",
"pages",
"within",
"a",
"paged",
"object",
"as",
"a",
"list",
"of",
"dictionaries"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L218-L232 |
34,597 | saltstack/salt | salt/utils/azurearm.py | create_object_model | def create_object_model(module_name, object_name, **kwargs):
'''
Assemble an object from incoming parameters.
'''
object_kwargs = {}
try:
model_module = importlib.import_module('azure.mgmt.{0}.models'.format(module_name))
# pylint: disable=invalid-name
Model = getattr(model_... | python | def create_object_model(module_name, object_name, **kwargs):
'''
Assemble an object from incoming parameters.
'''
object_kwargs = {}
try:
model_module = importlib.import_module('azure.mgmt.{0}.models'.format(module_name))
# pylint: disable=invalid-name
Model = getattr(model_... | [
"def",
"create_object_model",
"(",
"module_name",
",",
"object_name",
",",
"*",
"*",
"kwargs",
")",
":",
"object_kwargs",
"=",
"{",
"}",
"try",
":",
"model_module",
"=",
"importlib",
".",
"import_module",
"(",
"'azure.mgmt.{0}.models'",
".",
"format",
"(",
"mo... | Assemble an object from incoming parameters. | [
"Assemble",
"an",
"object",
"from",
"incoming",
"parameters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L235-L278 |
34,598 | saltstack/salt | salt/utils/azurearm.py | compare_list_of_dicts | def compare_list_of_dicts(old, new, convert_id_to_name=None):
'''
Compare lists of dictionaries representing Azure objects. Only keys found in the "new" dictionaries are compared to
the "old" dictionaries, since getting Azure objects from the API returns some read-only data which should not be
used in t... | python | def compare_list_of_dicts(old, new, convert_id_to_name=None):
'''
Compare lists of dictionaries representing Azure objects. Only keys found in the "new" dictionaries are compared to
the "old" dictionaries, since getting Azure objects from the API returns some read-only data which should not be
used in t... | [
"def",
"compare_list_of_dicts",
"(",
"old",
",",
"new",
",",
"convert_id_to_name",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"convert_id_to_name",
":",
"convert_id_to_name",
"=",
"[",
"]",
"if",
"not",
"isinstance",
"(",
"new",
",",
"list",... | Compare lists of dictionaries representing Azure objects. Only keys found in the "new" dictionaries are compared to
the "old" dictionaries, since getting Azure objects from the API returns some read-only data which should not be
used in the comparison. A list of parameter names can be passed in order to compare... | [
"Compare",
"lists",
"of",
"dictionaries",
"representing",
"Azure",
"objects",
".",
"Only",
"keys",
"found",
"in",
"the",
"new",
"dictionaries",
"are",
"compared",
"to",
"the",
"old",
"dictionaries",
"since",
"getting",
"Azure",
"objects",
"from",
"the",
"API",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L281-L332 |
34,599 | saltstack/salt | salt/cloud/clouds/gce.py | get_dependencies | def get_dependencies():
'''
Warn if dependencies aren't met.
'''
if LIBCLOUD_IMPORT_ERROR:
log.error("Failure when importing LibCloud: ", exc_info=LIBCLOUD_IMPORT_ERROR)
log.error("Note: The libcloud dependency is called 'apache-libcloud' on PyPi/pip.")
return config.check_driver_dep... | python | def get_dependencies():
'''
Warn if dependencies aren't met.
'''
if LIBCLOUD_IMPORT_ERROR:
log.error("Failure when importing LibCloud: ", exc_info=LIBCLOUD_IMPORT_ERROR)
log.error("Note: The libcloud dependency is called 'apache-libcloud' on PyPi/pip.")
return config.check_driver_dep... | [
"def",
"get_dependencies",
"(",
")",
":",
"if",
"LIBCLOUD_IMPORT_ERROR",
":",
"log",
".",
"error",
"(",
"\"Failure when importing LibCloud: \"",
",",
"exc_info",
"=",
"LIBCLOUD_IMPORT_ERROR",
")",
"log",
".",
"error",
"(",
"\"Note: The libcloud dependency is called 'apach... | Warn if dependencies aren't met. | [
"Warn",
"if",
"dependencies",
"aren",
"t",
"met",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L159-L169 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.