cluster_config¶
Client for the vSphere 9 / VCF 9 cluster Configuration Profile API.
On vSphere 9, per-host imperative REST endpoints for services/firewall/NTP/ syslog/advanced settings do not exist. Configuration is instead expressed declaratively at the cluster level via a JSON-schema-shaped profile; the profile applies to every host in the cluster. The relevant endpoints live under:
/api/esx/settings/clusters/{cluster_id}/...
This module wraps the read/write surface of that API. All calls go through
the vCenter session (saltext.vcf.utils.vcenter), so the standard
saltext.vcf.vcenter pillar config is what selects the target vCenter.
The cluster must be enabled for Configuration Profile (vLCM single-image
managed) for the configuration/draft endpoints to work; the
enablement_get() helper reports current status.
- saltext.vcf.clients.cluster_config.enablement_get(opts, cluster, profile=None)[source]¶
Return
{"enabled": bool, ...}for the cluster’s CP enablement.
- saltext.vcf.clients.cluster_config.schema_get(opts, cluster, profile=None)[source]¶
Return the Configuration Profile JSON Schema for the cluster.
The wrapper is
{"schema": <schema-or-str>, "source": ...}. When the schema field is a string, it’s JSON-encoded — caller shouldjson.loadsit.
- saltext.vcf.clients.cluster_config.configuration_get(opts, cluster, profile=None)[source]¶
Return the currently applied configuration document for the cluster.
Returns
Noneif the cluster has no configuration applied yet (vCenter responds 400 witherror_type=INVALID_ARGUMENTfor clusters that are not vLCM-managed; we map that toNoneso callers can branch).
- saltext.vcf.clients.cluster_config.drafts_list(opts, cluster, profile=None)[source]¶
Return the list of configuration drafts on the cluster.
- saltext.vcf.clients.cluster_config.draft_create(opts, cluster, body=None, profile=None)[source]¶
Create a new draft. Returns the draft id (string).
body may be a starter configuration document; if
None, an empty draft is created.
- saltext.vcf.clients.cluster_config.draft_get(opts, cluster, draft_id, profile=None)[source]¶
Return the metadata + configuration of a single draft.
- saltext.vcf.clients.cluster_config.draft_get_configuration(opts, cluster, draft_id, profile=None)[source]¶
Return just the configuration body of a draft.
- saltext.vcf.clients.cluster_config.draft_update_configuration(opts, cluster, draft_id, body, profile=None)[source]¶
Replace the configuration document inside draft_id.
- saltext.vcf.clients.cluster_config.draft_apply(opts, cluster, draft_id, profile=None)[source]¶
Apply a draft (POST with
?action=apply). Returns the apply task id.
- saltext.vcf.clients.cluster_config.last_apply_result(opts, cluster, profile=None)[source]¶
Return the last apply result for the cluster’s configuration.
Returns
Nonewhen the cluster isn’t yet under Configuration Profile management (vCenter responds 400 INVALID_ARGUMENT).