Java Example of Upgrading a Supervisor Cluster

This example upgrades a Supervisor Cluster.

The following code snippet is part of the UpgradeSupervisorCluster.java sample. Some parts of the original code sample are omitted to save space. You can view the complete and up-to-date version of this sample in the vsphere-automation-sdk-java VMware repository at GitHub.

@Override
	protected void run() throws Exception {

		System.out.println("We are building the Spec for upgrading vSphere supervisor cluster");
		com.vmware.vcenter.namespace_management.software.ClustersTypes.UpgradeSpec spec = new UpgradeSpec();
		spec.setIgnorePrecheckWarnings(true);
		spec.setDesiredVersion(this.desiredVersion);
		this.wcpUpdateService.upgrade(clusterId, spec);
		System.out.println(
				"Invocation is successful for updating vSphere supervisor cluster, check H5C, track the status using GET API");
	}