This example is based on code in the TaggingWorkflow.java sample file.
This example adds timestamp in a tag description to identify when a resource was last reconfigured. The tag description is updated with the timestamp after the resources is reconfigured.
This example is based on the information that is provided in Updating a Tag.
Note: For a complete and up-to-date version of the Java sample code, see the
vsphere-automation-sdk-java VMware repository at GitHub.
... String newDateTime = Dateformat.getDateInstance().format(new Date()); String newDescription = String.format(“Server tag updated at (%s).”, newDateTime); TagTypes.UpdateSpec updateSpec = new TagTypes.UpdateSpec(); updateSpec.setDescription(newDescription); tagStub.update(myTagId, updateSpec);