VMware Storage Policy SDK Examples

The VMware Storage Policy SDK contains Java examples that show how to create and use VMware storage policies.
This manual describes examples from the VMware Storage Policy SDK. It also describes examples from the vCenter Single Sign-On SDK that support the client connection to the Storage Policy Server. This manual includes the following single sign-on examples:
The following table lists the sample files in the VMware Storage Policy SDK.
VMware Storage Profile SDK Sample File
Location
Examples
Description
SDK/spbm/java/JAXWS/samples/com/vmware/spbm/samples/
AboutInfo.java
Obtains identifying data about the Storage Policy Server.
CheckCompliance.java
Checks the compliance of profiles associated with virtual machines and virtual disks.
CreateProfile.java
Creates a requirement profile.
CreateVSANProfile.java
Creates a new storage profile with one rule-set based on vSAN capabilities.
DeleteProfile.java
Deletes a requirement profile.
EditProfile.java
Adds or deletes subprofiles from a tag-based storage profile.
FcdAssociateProfile.java
Attaches a first class disk (FCD) to a virtual machine and associates the given storage profile with the FCD.
ListProfiles.java
Retrieves all of the storage profiles known to the system.
ViewProfile.java
Prints the contents of a tag-based storage profile.
VMClone.java
Deploys multiple instances of a virtual machine template to a datacenter. The clone specification has an associated storage profile.
VMCreate.java
Creates a virtual machine. The virtual machine configuration specification has an associated storage profile.
VMRelocate.java
Used to relocate a virtual machine's virtual disks to a datastore compliant with the given storage profile.
SDK/spbm/java/JAXWS/samples/com/vmware/spbm/connection/
BasicConnection.java
Establishes an authenticated session with a VMware SSO Server,
vCenter Server
, and Storage Policy Server.
ConnectedServiceBase.java
Connection base class for client application implementations.
Connection.java
Storage Policy sample support; utility class that sets up a Storage Policy Server connection.
ConnectionException.java
Base exception class for exceptions thrown by connection classes.
ConnectionMalformedUrlException.java
URL exception.
KeepAlive.java
Keep-alive utility class; maintains the
vCenter Server
connection.
VcSessionHandler.java
Utility class; inserts vCenter session cookie into SOAP header.