Perl Example of Creating a Tag Category

This example is based on code in the tagging_workflow.pl sample file.

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

Note: For a complete and up-to-date version of the sample code, see the vSphere Automation SDK Perl samples at GitHub.
...

$my_category_stub = $my_stub_factory->create_stub(
                    'service_name' => 'Com::Vmware::Cis::Tagging::Category',
                    'stub_config'  => $my_stub_config);
my $create_spec = new
   Com::Vmware::Cis::Tagging::Category::CreateSpec();
$create_spec->set_name(
              'name' => 'favorites');
$create_spec->set_description(
              'description' => 'My favorite virtual machines');
$create_spec->set_cardinality(
              'cardinality' =>
      Com::Vmware::Cis::Tagging::CategoryModel::Cardinality::MULTIPLE);
$create_spec->set_associable_types( 'associable_types' => [] );
$my_category_id = $my_category_stub->create('create_spec' => $create_spec );