The vSAN Management SDK for Python provides language bindings, sample code, and API reference for developing custom Python clients against the vSAN Management API. The vSAN Management SDK for Python depends on pyVmomi of similar release level, which is the Python SDK for the vSphere API. You use pyVmomi for logging in to vCenter Server and for retrieving vCenter Server managed objects.
You can download pyVmomi from GitHub.
API Reference
The vSAN API reference documentation is included in the /docs directory. To view the API Reference, open index.html with a Web browser.
Python Bindings
You can access the vSAN Management API by using the Python vsanmgmtObjects.py script under the bindings directory.
To use the Python bindings, place vsanmgmtObjects.py on a path where your Python applications import.
Running the Sample Applications
The vSAN Management SDK for Python provides sample applications, which you can find under the samplecode directory.
You can use the sample code to get vSAN managed objects on vCenter Server or ESXi hosts. The code automatically identifies the target server type.
The vsaniscsisamples.py and vsaniscsisamples.py depend on the vsanapiutis.py, which provides utility libraries for retrieving vSAN managed objects.
To run the sample applications, use the following commands:
python vsanapisamples.py -s <host or vCenter Server address> -u <username> -p <password> --cluster <cluster name> python vsaniscsisamples.py -s <host or vCenter Server address> -u <username> -p <password> --cluster <cluster name>
To view information about the parameter usage, use -h or --help.