saltext.vcf.utils.sddc¶
SDDC Manager REST API connection helpers.
Authentication uses Bearer JWT tokens from POST /v1/tokens. The token is
cached per (host, username) pair for the lifetime of the Salt loader session.
Config is read from Salt opts/pillar under saltext.vcf.sddc_manager:
saltext.vcf:
sddc_manager:
host: sddc-manager.vcf.nimbus.internal
username: administrator@vsphere.local
password: VMware123!VMware123!
verify_ssl: false
- saltext.vcf.utils.sddc.get_config(opts, profile=None)[source]¶
Extract SDDC Manager connection config from Salt opts/pillar.
Returns a dict with keys: host, username, password, verify_ssl.
- saltext.vcf.utils.sddc.get_token(opts, profile=None)[source]¶
Acquire and cache a Bearer JWT from SDDC Manager.
Returns the raw token string (without the
Bearerprefix).
- saltext.vcf.utils.sddc.invalidate_token(opts, profile=None)[source]¶
Remove the cached token, forcing re-authentication on next call.
- saltext.vcf.utils.sddc.api_get(opts, path, params=None, profile=None)[source]¶
GET
/v1/<path>from SDDC Manager and return parsed JSON.
- saltext.vcf.utils.sddc.api_post(opts, path, body=None, profile=None)[source]¶
POST JSON body to SDDC Manager and return parsed JSON.
- saltext.vcf.utils.sddc.api_patch(opts, path, body=None, profile=None)[source]¶
PATCH JSON body to SDDC Manager and return parsed JSON.