The vSAN Management SDK for Ruby provides language bindings, sample code, and API reference for developing custom Ruby clients against the vSAN Management API. The vSAN Management SDK for Ruby depends on RbVmomi of similar release level, which is the Ruby SDK for the vSphere API. You use RbVmomi for logging in to vCenter Server and to retrieve vCenter Server managed objects.
VMware does not officially support rbVmomi, but you can download it 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.
Ruby Bindings
You can access the vSAN Management API by using vsanmgmt.api.rb file under the bindings directory. Place the file on a path where Ruby can find it.
Running the Sample Applications
The vSAN Management SDK for Ruby SDK provides sample applications that are located 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 vsanapisamples.rb depends on the vsanapiutis.rb, which provides a utility library for retrieving vSAN managed objects.
To run the Ruby sample applications, use the following commands:
ruby vsanapisamples.rb -o <host or vCenter Server address> -u <username> -p <password> <cluster name> ruby vsaniscsisamples.rb -o <host or vCenter Server address> -u <username> -p <password> <cluster name>
Use -h or --help to view information about the parameters.