Class List Method List File List

# Class: Com::Vmware::Cis::Tagging::Tag

Inherits:
  VAPI::Bindings::VapiService
  - Object
  - VAPI::Bindings::VapiService
  - Com::Vmware::Cis::Tagging::Tag
  show all
Defined in:
  /build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb

## Overview

The ``Com::Vmware::Cis::Tagging::Tag`` class provides methods to create, read, update, delete, and enumerate tags.

## Defined Under Namespace

Classes: CreateSpec, UpdateSpec

## Instance Method Summary (collapse)

- - (Void) add_to_used_by(tag_id, used_by_entity)

  Adds the ``used_by_entity`` to the :attr:`Com::Vmware::Cis::Tagging::TagModel.used_by` subscribers set .

- - (String) create(create_spec)

  Creates a tag.

- - (Void) delete(tag_id)

  Deletes an existing tag.

- - (Com::Vmware::Cis::Tagging::TagModel) get(tag_id)

  Fetches the tag information for the given tag identifier.

- - (Tag) initialize(config) constructor

  Constructs a new instance.

- - (Array<String>) list

  Enumerates the tags in the system.

- - (Array<String>) list_tags_for_category(category_id)

  Enumerates all tags for the given category.

- - (Array<String>) list_used_tags(used_by_entity)

  Enumerates all tags for which the ``used_by_entity`` is part of the :attr:`Com::Vmware::Cis::Tagging::TagModel.used_by` subscribers set .

- - (Void) remove_from_used_by(tag_id, used_by_entity)

  Removes the ``used_by_entity`` from the :attr:`Com::Vmware::Cis::Tagging::TagModel.used_by` subscribers set.

- - (Void) revoke_propagating_permissions(tag_id)

  Revokes all propagating permissions on the given tag.

- - (Void) update(tag_id, update_spec)

  Updates an existing tag.

## Constructor Details

### - (`Tag`) initialize(config)

Constructs a new instance.

Parameters:

- config (`VAPI::Bindings::StubConfig`) —

  A hash with the api provider details.

    581
    582
    583
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 581

    def initialize(config)
        super(config, @@service_info)
    end

## Instance Method Details

### - (`Void`) add_to_used_by(tag_id, used_by_entity)

Adds the ``used_by_entity`` to the :attr:`Com::Vmware::Cis::Tagging::TagModel.used_by` subscribers set . If the ``used_by_entity`` is already in the set , then this becomes a no-op. To invoke this method , you need the modify :attr:`Com::Vmware::Cis::Tagging::TagModel.used_by` privilege on the tag.

Parameters:

- tag_id (`String`) —

  The identifier of the input tag.

- used_by_entity (`String`) —

  The name of the user to be added to the :attr:`Com::Vmware::Cis::Tagging::TagModel.used_by` set .

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the tag for the given ``tag_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::TagModel.used_by` field.

    713
    714
    715
    716
    717
    718
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 713

    def add_to_used_by(tag_id, used_by_entity)
        invoke_with_info(@@add_to_used_by_info, {
            'tag_id' => tag_id,
            'used_by_entity' => used_by_entity,
        })
    end

### - (`String`) create(create_spec)

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

Parameters:

- create_spec (`Com::Vmware::Cis::Tagging::Tag::CreateSpec`) —

  Specification for the new tag to be created.

Returns:

- (`String`) —

  The identifier of the created tag.

Raises:

- (`Com::Vmware::Vapi::Std::Errors::AlreadyExists`) —

  if the :attr:`Com::Vmware::Cis::Tagging::Tag::CreateSpec.name` provided in the ``create_spec`` is the name of an already existing tag in the input category.

- (`Com::Vmware::Vapi::Std::Errors::InvalidArgument`) —

  if any of the input information in the ``create_spec`` is invalid.

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the category for in the given ``create_spec`` does not exist in the system.

- (`Com::Vmware::Vapi::Std::Errors::Unauthorized`) —

  if you do not have the privilege to create tag.

    600
    601
    602
    603
    604
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 600

    def create(create_spec)
        invoke_with_info(@@create_info, {
            'create_spec' => create_spec,
        })
    end

### - (`Void`) delete(tag_id)

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

Parameters:

- tag_id (`String`) —

  The identifier of the input tag.

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the tag for the given ``tag_id`` does not exist in the system.

- (`Com::Vmware::Vapi::Std::Errors::Unauthorized`) —

  if you do not have the privilege to delete the tag.

    656
    657
    658
    659
    660
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 656

    def delete(tag_id)
        invoke_with_info(@@delete_info, {
            'tag_id' => tag_id,
        })
    end

### - (`Com::Vmware::Cis::Tagging::TagModel`) get(tag_id)

Fetches the tag information for the given tag identifier. To invoke this method , you need the read privilege on the tag in order to view the tag info.

Parameters:

- tag_id (`String`) —

  The identifier of the input tag.

Returns:

- (`Com::Vmware::Cis::Tagging::TagModel`) —

  The :class:`Com::Vmware::Cis::Tagging::TagModel` that corresponds to ``tag_id`` .

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the tag for the given ``tag_id`` does not exist in the system.

- (`Com::Vmware::Vapi::Std::Errors::Unauthorized`) —

  if the user does not have the privilege to read the tag.

    617
    618
    619
    620
    621
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 617

    def get(tag_id)
        invoke_with_info(@@get_info, {
            'tag_id' => tag_id,
        })
    end

### - (`Array<String>`) list

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

Returns:

- (`Array<String>`) —

  The list of resource identifiers for the tags in the system.

    667
    668
    669
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 667

    def list()
        invoke_with_info(@@list_info)
    end

### - (`Array<String>`) list_tags_for_category(category_id)

Enumerates all tags for the given category. To invoke this method , you need the read privilege on the given category and the individual tags in that category.

Parameters:

- category_id (`String`) —

  The identifier of the input category.

Returns:

- (`Array<String>`) —

  The list of resource identifiers for the tags in the given input category.

Raises:

- (`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.

    695
    696
    697
    698
    699
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 695

    def list_tags_for_category(category_id)
        invoke_with_info(@@list_tags_for_category_info, {
            'category_id' => category_id,
        })
    end

### - (`Array<String>`) list_used_tags(used_by_entity)

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

Parameters:

- used_by_entity (`String`) —

  The field on which the results will be filtered.

Returns:

- (`Array<String>`) —

  The list of resource identifiers for the tags in the system that are used by ``used_by_entity`` .

    678
    679
    680
    681
    682
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 678

    def list_used_tags(used_by_entity)
        invoke_with_info(@@list_used_tags_info, {
            'used_by_entity' => used_by_entity,
        })
    end

### - (`Void`) remove_from_used_by(tag_id, used_by_entity)

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

Parameters:

- tag_id (`String`) —

  The identifier of the input tag.

- used_by_entity (`String`) —

  The name of the user to be removed from the :attr:`Com::Vmware::Cis::Tagging::TagModel.used_by` set .

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the tag for the given ``tag_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::TagModel.used_by` field.

    732
    733
    734
    735
    736
    737
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 732

    def remove_from_used_by(tag_id, used_by_entity)
        invoke_with_info(@@remove_from_used_by_info, {
            'tag_id' => tag_id,
            'used_by_entity' => used_by_entity,
        })
    end

### - (`Void`) revoke_propagating_permissions(tag_id)

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

Parameters:

- tag_id (`String`) —

  The identifier of the input tag.

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the tag for the given ``tag_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 tag.

    749
    750
    751
    752
    753
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 749

    def revoke_propagating_permissions(tag_id)
        invoke_with_info(@@revoke_propagating_permissions_info, {
            'tag_id' => tag_id,
        })
    end

### - (`Void`) update(tag_id, update_spec)

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

Parameters:

- tag_id (`String`) —

  The identifier of the input tag.

- update_spec (`Com::Vmware::Cis::Tagging::Tag::UpdateSpec`) —

  Specification to update the tag.

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::AlreadyExists`) —

  if the :attr:`Com::Vmware::Cis::Tagging::Tag::UpdateSpec.name` provided in the ``update_spec`` is the name of an already existing tag in the same category.

- (`Com::Vmware::Vapi::Std::Errors::InvalidArgument`) —

  if any of the input information in the ``update_spec`` is invalid.

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the tag for the given ``tag_id`` does not exist in the system.

- (`Com::Vmware::Vapi::Std::Errors::Unauthorized`) —

  if you do not have the privilege to update the tag.

    639
    640
    641
    642
    643
    644
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 639

    def update(tag_id, update_spec)
        invoke_with_info(@@update_info, {
            'tag_id' => tag_id,
            'update_spec' => update_spec,
        })
    end