vcenter_advanced_option¶
Client for vCenter Server’s own advanced settings (content.setting) via SOAP/pyVmomi.
Counterpart to vim_host_config’s advanced_* functions, but scoped
to the connected vCenter Server itself (config.vpxd.* keys) rather than
a managed HostSystem.
- saltext.vcf.clients.vcenter_advanced_option.advanced_get(opts, key=None, profile=None)[source]¶
Return vCenter Server advanced settings.
When key is provided, returns the current value, or
Noneif the option has never been set.QueryOptionsraisesvim.fault.InvalidName(rather than returning an empty list) for a key that’s never been touched on this vCenter Server — that’s a normal “not set yet” state, not an error, sinceadvanced_set()can still create it.When key is omitted, returns a
{key: value}dict of every setting currently known to vCenter.
- saltext.vcf.clients.vcenter_advanced_option.advanced_set(opts, key, value, profile=None)[source]¶
Set a single vCenter Server advanced setting.
Reuses the
OptionValueobject returned byQueryOptions(mutating its.value) rather than constructing a fresh one from a bare Python value. Some options (e.g.config.vpxd.stats.maxQueryMetrics) are typedxsd:longserver-side; pyVmomi’s SOAP binding infers the XSD type of a freshly-builtvim.option.OptionValue.valuefrom the raw Python type, and a plain Pythonintserializes asxsd:int— which the server rejects withvmodl.fault.InvalidArgument(invalidProperty='value'). Mutating the already-typed object fromQueryOptionspreserves the server’s original type binding. Falls back to a freshOptionValueonly when the key has genuinely never been set before (nothing to type-match against).