This example is based on code in the tagging_workflow.py sample file. This file is located in the following vCloud Suite SDK for Python directory: client/samples/src/com/vmware/vcloud/suite/sample/workflow
This example is based on the information that is provided in Creating a Tag Category.
The category create() function returns an identifier that you use when you create a tag for that category. The empty set for the associable types indicates that any object type can be associated with a tag in this category.
import com.vmware.cis.tagging_client from com.vmware.cis.tagging_client import CategoryModel category_stub = tagging_client.Category(my_stub_config) # Set up a tag category create spec. tc_create_spec = category_stub.CreateSpec(name = ‘favorites’, description = ‘My favorite virtual machines’, cardinality = CategoryModel.Cardinality.MULTIPLE, associable_types = set()) # Create the tag category. fav_category_id = category_stub.create(create_spec)