Editing a Draft Software Specification
After you have created a draft software specification, use the vSphere Automation APIs to edit its items.
To set a base image to a draft software specification, call the set(cluster_ID, draft_ID,base_image_spec) method of the com.vmware.esx.settings.clusters.software.drafts.software.BaseImage interface and pass as arguments the cluster and draft IDs, and the base image specification. If the draft contains a base image, this method overwrites the existing image. The base image specification contains the version of the bootable ESXi that must be included in the desired state. To retrieve details about the base image that is currently present in a draft, call the get(cluster_ID,draft_ID) method of the BaseImage interface. Pass as arguments the cluster and draft IDs. Use the returned com.vmware.esx.settings.BaseImageInfo object to query the version, display name and version, and the release date of the ESXi.
To add an OEM add-on to a draft software specification, call the set(cluster_ID,draft_ID,addon_spec) method of the com.vmware.esx.settings.clusters.software.drafts.software.AddOn interface. Pass as arguments to this method the cluster and draft IDs, and the add-on specification. If you want to remove an add-on from a draft, call the delete(cluster_ID,draft_ID) method of the AddOn interface and pass as arguments the cluster and draft IDs.
You can add a component, change the version, or delete an existing component from a draft software specification. To change the version of a component included in a draft, call the set(cluster_ID,draft_ID,component_ID,version) method of the com.vmware.esx.settings.clusters.software.drafts.software.Components interface. This method adds the component specified with the component_ID and version arguments to the draft, if it is missing. To remove a component from a draft, call the delete(cluster_ID,draft_ID,component_ID) method. You can change multiple components in a draft by calling the update(cluster_ID,draft_ID,update_spec) method of the Components interface. To specify the components you want to remove, add, or update for a draft, pass a com.vmware.esx.settings.clusters.software.drafts.software.ComponentsTypes.UpdateSpec instance as an argument to this method. You can also use the Components interface to retrieve information about all components present in a draft, or a single component.