When you download the SDK, you can find the java sample programs and related files in the following directories.
■ SDK\vsphere-ws\java\JAXWS\samples\com\vmware – Top-level directory for Java samples. Details listed in Java Sample Programs.
■ SDK\vsphere-ws\java\JAXWS\samples\com\vmware\security – Credential store utilities
■ SDK\vsphere-ws\java\JAXWS\samples\com\vmware\vim25 – Stub directories. The vim25 directory contains stubs for VirtualCenter 2.5 and later, including vSphere 4.0 and later.
■ SDK\vsphere-ws\java\JAXWS\samples\com\vmware\vm – samples written for a single vm
Retrieves and formats the last event from the host daemon or vpxd. Includes a function that formats the event message. Demonstrates how to create and monitor an EventHistoryCollector. Uses the latestPage property of EventHistoryCollector to filter the events. Standalone client that demonstrates how to perform the following tasks:Creating EventHistoryCollector filtered for a single virtual machine. Prints all managed entities and for each entity its type, reference value, property name, property value, inner object type, inner reference value and inner property value. Deletes a managed entity from the inventory tree. The managed entity can be a virtual machine, a ClusterComputeResource, or a folder. Demonstrates how to use the PropertyCollector to monitor one or more properties of one or more managed objects. In particular this sample monitors one or all virtual machines and all hosts or one host for changes to some basic properties. Demonstrates uses of the licensing API using License managed object reference. Moves a managed entity from its current location in the inventory to a new location in a specified folder Illustrates the use of the PropertyCollector API. Illustrates the use of the SearchIndex API. Connects to the server, logs in, lists the inventory contents (managed entities) at the console, and logs out. Downloads a file from the guest to a specified path on the host where the client is running. Runs a specified program inside a virtual machine. RunProgram re-directs output to a temporary file inside the guest and downloads the output file. Uploads a file from the client machine to a specified location inside the guest operating system. Acquires a session with a vCenter Server or ESX host and prints a cim service ticket and related session information to a file. Adds a virtual NIC to a port group on a virtual switch. Removes a virtual NIC from a port group. Adds a virtual switch to a host. Removes a virtual switch from the host. Adds a port group to a virtual switch. Removes a port group from a virtual switch. Retrieves configuration files, snapshots files, log files, and virtual disk files of a virtual machine and places them on the system on which the program is run. Puts virtual machine files into a specified datacenter and datastore and registers and reconfigures the corresponding virtual machine. Displays available performance counters or other metadata for an ESX/ESXi host. Reads performance measurements from the current time, or from a specified start time, for a specified duration. Writes the available counters of a managed entity into the specified file at the specified location. The managed entity can be a host system, a virtual machine, or a resource pool. Displays performance measurements from the current time at the console. An ESXtop-like sample application that lets administrators specify the CPU and memory counters by name to obtain metrics for a specified host. Demonstrates deleting a ScheduledTask. A fast, memory efficient class that encodes and decodes to and from BASE64 in full accordance with RFC 2045. A command-line tool that provides completenaccess to the credential store backing file on the local machine. Implementation class for CredentialStoreAdmin. Converts the hostname string to lowercase, so that a uniform representation of the hostname is used to obfuscate and de-obfuscate the password. This class provides the same functionality as FileInputStream, except that the close() method is overridden so that FileInputStream class’ close() method does not get called. Accesses the local credential store to obtain a single user account to log in to the specified server. Creates a user account and password and stores them in the local credential store. Runs storage DRS on an SDRS cluster to obtain SDRS recommendations. Demonstrates the OvfManager by exporting VMDKs and OVF Descriptors of all VM's in the vApps. Demonstrates how the OvfManager exports VMDKs from a VM to the localSystem. Use this class to import or deploy an OVF Appliance from a local drive. Use this class to import or deploy an OVF Appliance from a specified URL. Locates an existing virtual machine on the vCenter Server system, makes a template from this virtual machine, and deploys instances of the template onto a datacenter. Creates a virtual machine. Different command-line input creates the virtual machine in different ways. Creates a delta disk on top of an existing virtual disk in a virtual machine, and simultaneously removes the original disk using the reconfigure API. Configures a CDROM for a virtual machine. Also lists information about the CDROMs associated with a virtual machine. Configures a floppy drive for a virtual machine. Also lists information about the floppy drives associated with a virtual machine. Checks whether migration with VMotion is feasible between two hosts. Performs the migration if the hosts are compatible. Consolidates a linked virtual machine by using the VirtualMachine.PromoteDisks method. Reconfigures a virtual machine. Includes reconfiguring the disk size and disk mode.