The vSAN Management SDK for Perl provides libraries, sample code, and API reference for developing custom Perl clients against the vSAN Management API. The vSAN Management SDK for Perl depends on viperl of similar release level, which is the Perl SDK for the vSphere API. You use viperl for logging in to vCenter Server and for retrieving vCenter Server managed objects. VI Perl Toolkit, which is a client-side framework from VMware that simplifies the programming effort associated with the VI API.
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.
Perl Bindings
You can access the vSAN Management API by using the VIM25VsanmgmtRuntime.pm and VIM25VsanmgmtStub.pm files that are located under the bindings directory. To use the Perl bindings, place these files on a path where Perl can find them.
Running the Sample Applications
The vSAN Management SDK for Perl 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.pl depends on the VsanapiUtil.pm, which provides a utility library for retrieving vSAN managed objects.
To test the vCenter Server side API, run the following sample:
vsanapisample.pl --url https://<host>:<port>/sdk/vimService --username <username> --password <mypassword> --cluster_name <cluster name> vsanapisample.pl --url https://<host>:<port>/sdk/vimService --username <username> --password <mypassword> --cluster_moid <cluster manager object ID>
Use this sample to test the iSCSI target service:
vsaniscsisample.pl --url https://<host>:<port>/sdk/vimService --username <username> --password <mypassword> --cluster_name <cluster name> vsaniscsisample.pl --url https://<host>:<port>/sdk/vimService --username <username> --password <mypassword> --cluster_moid <cluster manager object ID>
To test the ESXi side API:
vsanapisample.pl --url https://<host>:<port>/sdk -username <username> --password <mypassword>
To view information about the parameters, use --help.