This example adds a timestamp in a tag description to identify when a resource was last reconfigured. The tag description is updated with the timestamp after the resource is reconfigured.

This example is based on the information that is provided in Updating a Tag.

require 'com/vmware/tagging/vapi'
require 'time'

# 1 - Format the current time.
date_time = Time.now.to_s
description = "Server tag updated at #{date_time}"

# 2 - Set up a tag update spec.
tag_update_spec =
   Com::Vmware::Cis::Tagging::Tag.new $my_stub_config
tag_stub.update($my_tag_id, tag_update_spec)