VMware vSphere Automation SDK Perl The VMware vSphere Automation SDK for Perl supports the client-side vSphere Automation API for access to vSphere services and capabilities

- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Files Functions
Classes | List of all members
Com::Vmware::Cis::Tagging::Category Class Reference
Inheritance diagram for Com::Vmware::Cis::Tagging::Category:

## Classes
class | CreateSpec
class | UpdateSpec

## Avaliable Methods
public method | remove_from_used_by ()
public method | create ()
public method | revoke_propagating_permissions ()
public method | add_to_used_by ()
public method | list_used_categories ()
public method | get ()
public method | delete ()
public method | new ()
public method | update ()
public method | list ()

## Detailed Description

The `Com::Vmware::Cis::Tagging::Category` interface provides methods to create, read, update, delete, and enumerate categories.

## Member Function Documentation

public method Com::Vmware::Cis::Tagging::Category::add_to_used_by | ( |  | ) |

Adds the `used_by_entity` to the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` subscribers set for the specified category. If the `used_by_entity` is already in the set , then this becomes an idempotent no-op. To invoke this method , you need the modify :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` privilege on the category.

Parameters

  category_id | [REQUIRED] The identifier of the input category. The value must be an identifier for the resource type getQualifiedName(com.vmware.cis.tagging.Category). . The value must be str.
  used_by_entity | [REQUIRED] The name of the user to be added to the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` set . . The value must be String.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the category for the given `category_id` does not exist in the system.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if you do not have the privilege to add an entity to the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` field.

Code:
click to view
# Number of lines of code in add_to_used_by: 11
sub add_to_used_by {
my ($self, %args) = @_;
my $category_id = $args {category_id};
my $used_by_entity = $args {used_by_entity};
$self->validate_args (method_name => 'add_to_used_by',
method_args => \%args);
return $self->invoke (method_name => 'add_to_used_by',
method_args => \%args);
}

public method Com::Vmware::Cis::Tagging::Category::create | ( |  | ) |

Creates a category. To invoke this method , you need the create category privilege.

Parameters

  create_spec | [REQUIRED] Specification for the new category to be created. . The value must be Com::Vmware::Cis::Tagging::Category::CreateSpec.

Return values

  The | identifier of the created category. The value will be an identifier for the resource type getQualifiedName(com.vmware.cis.tagging.Category). The return type will be str

Exceptions

  Com::Vmware::Vapi::Std::Errors::AlreadyExists | if the :attr:`Com::Vmware::Cis::Tagging::Category::CreateSpec.name` provided in the `create_spec` is the name of an already existing category.
  Com::Vmware::Vapi::Std::Errors::InvalidArgument | if any of the information in the `create_spec` is invalid.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if you do not have the privilege to create a category.

Code:
click to view
# Number of lines of code in create: 10
sub create {
my ($self, %args) = @_;
my $create_spec = $args {create_spec};
$self->validate_args (method_name => 'create',
method_args => \%args);
return $self->invoke (method_name => 'create',
method_args => \%args);
}

public method Com::Vmware::Cis::Tagging::Category::delete | ( |  | ) |

Deletes an existing category. To invoke this method , you need the delete privilege on the category.

Parameters

  category_id | [REQUIRED] The identifier of category to be deleted. The value must be an identifier for the resource type getQualifiedName(com.vmware.cis.tagging.Category). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the category for the given `category_id` does not exist in the system.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if you do not have the privilege to delete the category.

Code:
click to view
# Number of lines of code in delete: 10
sub delete {
my ($self, %args) = @_;
my $category_id = $args {category_id};
$self->validate_args (method_name => 'delete',
method_args => \%args);
return $self->invoke (method_name => 'delete',
method_args => \%args);
}

public method Com::Vmware::Cis::Tagging::Category::get | ( |  | ) |

Fetches the category information for the given category identifier. In order to view the category information, you need the read privilege on the category.

Parameters

  category_id | [REQUIRED] The identifier of the input category. The value must be an identifier for the resource type getQualifiedName(com.vmware.cis.tagging.Category). . The value must be str.

Return values

  The | class Com::Vmware::Cis::Tagging::CategoryModel that corresponds to `category_id` . The return type will be Com::Vmware::Cis::Tagging::CategoryModel

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the category for the given `category_id` does not exist in the system.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if you do not have the privilege to read the category.

Code:
click to view
# Number of lines of code in get: 10
sub get {
my ($self, %args) = @_;
my $category_id = $args {category_id};
$self->validate_args (method_name => 'get',
method_args => \%args);
return $self->invoke (method_name => 'get',
method_args => \%args);
}

public method Com::Vmware::Cis::Tagging::Category::list | ( |  | ) |

Enumerates the categories in the system. To invoke this method , you need the read privilege on the individual categories. The list will only contain those categories for which you have read privileges.

Return values

  The | list of resource identifiers for the categories in the system. The value will be an identifier for the resource type getQualifiedName(com.vmware.cis.tagging.Category). The return type will be Array of str

Code:
click to view
# Number of lines of code in list: 4
sub list {
my ($self, %args) = @_;
return $self->invoke(method_name => 'list', method_args => {});
}

public method Com::Vmware::Cis::Tagging::Category::list_used_categories | ( |  | ) |

Enumerates all categories for which the `used_by_entity` is part of the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` subscribers set . To invoke this method , you need the read privilege on the individual categories.

Parameters

  used_by_entity | [REQUIRED] The field on which the results will be filtered. . The value must be String.

Return values

  The | list of resource identifiers for the categories in the system that are used by `used_by_entity` . The value will be an identifier for the resource type getQualifiedName(com.vmware.cis.tagging.Category). The return type will be Array of str

Code:
click to view
# Number of lines of code in list_used_categories: 10
sub list_used_categories {
my ($self, %args) = @_;
my $used_by_entity = $args {used_by_entity};
$self->validate_args (method_name => 'list_used_categories',
method_args => \%args);
return $self->invoke (method_name => 'list_used_categories',
method_args => \%args);
}

public method Com::Vmware::Cis::Tagging::Category::new | ( |  | ) |

Constructor to initialize the object

Parameters

  api_provider | - protocol connection to use with stubs created by this factory
  StubConfig | - Stub's additional configuration

Return values

  Blessed | object

Code:
click to view
# Number of lines of code in new: 11
sub new {
my ($class, %args) = @_;
$class = ref($class) || $class;
my $stub_config = $args {stub_config};
my $api_provider = $args {api_provider};
my $self = $class->SUPER::new('stub_config' => $stub_config,
'api_provider' => $api_provider);
bless $self, $class;
return $self;
}

public method Com::Vmware::Cis::Tagging::Category::remove_from_used_by | ( |  | ) |

Removes the `used_by_entity` from the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` subscribers set . If the `used_by_entity` is not using this category, then this becomes a no-op. To invoke this method* , you need the modify :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` privilege on the category.

Parameters

  category_id | [REQUIRED] The identifier of the input category. The value must be an identifier for the resource type getQualifiedName(com.vmware.cis.tagging.Category). . The value must be str.
  used_by_entity | [REQUIRED] The name of the user to be removed from the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` set . . The value must be String.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the category for the given `category_id` does not exist in the system.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if you do not have the privilege to remove an entity from the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` field.

Code:
click to view
# Number of lines of code in remove_from_used_by: 11
sub remove_from_used_by {
my ($self, %args) = @_;
my $category_id = $args {category_id};
my $used_by_entity = $args {used_by_entity};
$self->validate_args (method_name => 'remove_from_used_by',
method_args => \%args);
return $self->invoke (method_name => 'remove_from_used_by',
method_args => \%args);
}

public method Com::Vmware::Cis::Tagging::Category::revoke_propagating_permissions | ( |  | ) |

Revokes all propagating permissions on the given category. You should then attach a direct permission with tagging privileges on the given category. To invoke this method , you need category related privileges (direct or propagating) on the concerned category.

Parameters

  category_id | [REQUIRED] The identifier of the input category. The value must be an identifier for the resource type getQualifiedName(com.vmware.cis.tagging.Category). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the category for the given `category_id` does not exist in the system.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if you do not have the privilege to revoke propagating permissions on the category.

Code:
click to view
# Number of lines of code in revoke_propagating_permissions: 10
sub revoke_propagating_permissions {
my ($self, %args) = @_;
my $category_id = $args {category_id};
$self->validate_args (method_name => 'revoke_propagating_permissions',
method_args => \%args);
return $self->invoke (method_name => 'revoke_propagating_permissions',
method_args => \%args);
}

public method Com::Vmware::Cis::Tagging::Category::update | ( |  | ) |

Updates an existing category. To invoke this method , you need the edit privilege on the category.

Parameters

  category_id | [REQUIRED] The identifier of the category to be updated. The value must be an identifier for the resource type getQualifiedName(com.vmware.cis.tagging.Category). . The value must be str.
  update_spec | [REQUIRED] Specification to update the category. . The value must be Com::Vmware::Cis::Tagging::Category::UpdateSpec.

Exceptions

  Com::Vmware::Vapi::Std::Errors::AlreadyExists | if the :attr:`Com::Vmware::Cis::Tagging::Category::UpdateSpec.name` provided in the `update_spec` is the name of an already existing category.
  Com::Vmware::Vapi::Std::Errors::InvalidArgument | if any of the information in the `update_spec` is invalid.
  Com::Vmware::Vapi::Std::Errors::NotFound | if the category for the given `category_id` does not exist in the system.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if you do not have the privilege to update the category.

Code:
click to view
# Number of lines of code in update: 11
sub update {
my ($self, %args) = @_;
my $category_id = $args {category_id};
my $update_spec = $args {update_spec};
$self->validate_args (method_name => 'update',
method_args => \%args);
return $self->invoke (method_name => 'update',
method_args => \%args);
}

The documentation for this class was generated from the following file:

- Com/Vmware/Cis/Tagging/Category.pm