Class: Com::Vmware::Cis::Tagging::TagAssociation

Inherits:
VAPI::Bindings::VapiService
  • Object
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::TagAssociation`` class provides methods to attach, detach, and query tags.

Defined Under Namespace

Classes: BatchResult, ObjectToTags, TagToObjects

Instance Method Summary (collapse)

Constructor Details

- (TagAssociation) initialize(config)

Constructs a new instance.

Parameters:

  • config (VAPI::Bindings::StubConfig)

    A hash with the api provider details.



1013
1014
1015
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 1013

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

Instance Method Details

- (Void) attach(tag_id, object_id)

Attaches the given tag to the input object. The tag needs to meet the cardinality ( :attr:`Com::Vmware::Cis::Tagging::CategoryModel.cardinality` ) and associability ( :attr:`Com::Vmware::Cis::Tagging::CategoryModel.associable_types` ) criteria in order to be eligible for attachment. If the tag is already attached to the object, then this method is a no-op and an error will not be thrown. To invoke this method , you need the attach tag privilege on the tag and the read privilege on the object.

Parameters:

Returns:

  • (Void)

Raises:



1031
1032
1033
1034
1035
1036
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 1031

def attach(tag_id, object_id)
    invoke_with_info(@@attach_info, {
        'tag_id' => tag_id,
        'object_id' => object_id,
    })
end

- (Com::Vmware::Cis::Tagging::TagAssociation::BatchResult) attach_multiple_tags_to_object(object_id, tag_ids)

Attaches the given tags to the input object. If a tag is already attached to the object, then the individual method is a no-op and an error will not be added to :attr:`Com::Vmware::Cis::Tagging::TagAssociation::BatchResult.error_messages` . To invoke this method , you need the read privilege on the object and the attach tag privilege on each tag.

Parameters:

Returns:

Raises:



1049
1050
1051
1052
1053
1054
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 1049

def attach_multiple_tags_to_object(object_id, tag_ids)
    invoke_with_info(@@attach_multiple_tags_to_object_info, {
        'object_id' => object_id,
        'tag_ids' => tag_ids,
    })
end

- (Com::Vmware::Cis::Tagging::TagAssociation::BatchResult) attach_tag_to_multiple_objects(tag_id, object_ids)

Attaches the given tag to the input objects. If a tag is already attached to the object, then the individual method is a no-op and an error will not be added to :attr:`Com::Vmware::Cis::Tagging::TagAssociation::BatchResult.error_messages` . To invoke this method , you need the attach tag privilege on the tag and the read privilege on each object.

Parameters:

Returns:

Raises:



1069
1070
1071
1072
1073
1074
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 1069

def attach_tag_to_multiple_objects(tag_id, object_ids)
    invoke_with_info(@@attach_tag_to_multiple_objects_info, {
        'tag_id' => tag_id,
        'object_ids' => object_ids,
    })
end

- (Void) detach(tag_id, object_id)

Detaches the tag from the given object. If the tag is already removed from the object, then this method is a no-op and an error will not be thrown. To invoke this method , you need the attach tag privilege on the tag and the read privilege on the object.

Parameters:

Returns:

  • (Void)

Raises:



1088
1089
1090
1091
1092
1093
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 1088

def detach(tag_id, object_id)
    invoke_with_info(@@detach_info, {
        'tag_id' => tag_id,
        'object_id' => object_id,
    })
end

- (Com::Vmware::Cis::Tagging::TagAssociation::BatchResult) detach_multiple_tags_from_object(object_id, tag_ids)

Detaches the given tags from the input object. If a tag is already removed from the object, then the individual method is a no-op and an error will not be added to :attr:`Com::Vmware::Cis::Tagging::TagAssociation::BatchResult.error_messages` . To invoke this method , you need the read privilege on the object and the attach tag privilege each tag.

Parameters:

Returns:

Raises:



1106
1107
1108
1109
1110
1111
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 1106

def detach_multiple_tags_from_object(object_id, tag_ids)
    invoke_with_info(@@detach_multiple_tags_from_object_info, {
        'object_id' => object_id,
        'tag_ids' => tag_ids,
    })
end

- (Com::Vmware::Cis::Tagging::TagAssociation::BatchResult) detach_tag_from_multiple_objects(tag_id, object_ids)

Detaches the given tag from the input objects. If a tag is already removed from the object, then the individual method is a no-op and an error will not be added to :attr:`Com::Vmware::Cis::Tagging::TagAssociation::BatchResult.error_messages` . To invoke this method , you need the attach tag privilege on the tag and the read privilege on each object.

Parameters:

Returns:

Raises:



1126
1127
1128
1129
1130
1131
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 1126

def detach_tag_from_multiple_objects(tag_id, object_ids)
    invoke_with_info(@@detach_tag_from_multiple_objects_info, {
        'tag_id' => tag_id,
        'object_ids' => object_ids,
    })
end

- (Array<String>) list_attachable_tags(object_id)

Fetches the list of attachable tags for the given object, omitting the tags that have already been attached. Criteria for attachability is calculated based on tagging cardinality ( :attr:`Com::Vmware::Cis::Tagging::CategoryModel.cardinality` ) and associability ( :attr:`Com::Vmware::Cis::Tagging::CategoryModel.associable_types` ) constructs. To invoke this method , you need the read privilege on the input object. The list will only contain those tags for which you have read privileges.

Parameters:

Returns:

  • (Array<String>)

    The list of tag identifiers that are eligible to be attached to the given object.

Raises:



1200
1201
1202
1203
1204
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 1200

def list_attachable_tags(object_id)
    invoke_with_info(@@list_attachable_tags_info, {
        'object_id' => object_id,
    })
end

- (Array<Com::Vmware::Vapi::Std::DynamicID>) list_attached_objects(tag_id)

Fetches the list of attached objects for the given tag. To invoke this method , you need the read privilege on the input tag. Only those objects for which you have the read privilege will be returned.

Parameters:

  • tag_id (String)

    The identifier of the input tag.

Returns:

Raises:



1144
1145
1146
1147
1148
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 1144

def list_attached_objects(tag_id)
    invoke_with_info(@@list_attached_objects_info, {
        'tag_id' => tag_id,
    })
end

- (Array<Com::Vmware::Cis::Tagging::TagAssociation::TagToObjects>) list_attached_objects_on_tags(tag_ids)

Fetches the list of :class:`Com::Vmware::Cis::Tagging::TagAssociation::TagToObjects` describing the input tag identifiers and the objects they are attached to. To invoke this method , you need the read privilege on each input tag. The :attr:`Com::Vmware::Cis::Tagging::TagAssociation::TagToObjects.object_ids` will only contain those objects for which you have the read privilege.

Parameters:

  • tag_ids (Array<String>)

    The identifiers of the input tags.

Returns:



1157
1158
1159
1160
1161
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 1157

def list_attached_objects_on_tags(tag_ids)
    invoke_with_info(@@list_attached_objects_on_tags_info, {
        'tag_ids' => tag_ids,
    })
end

- (Array<String>) list_attached_tags(object_id)

Fetches the list of tags attached to the given object. To invoke this method , you need the read privilege on the input object. The list will only contain those tags for which you have the read privileges.

Parameters:

Returns:

  • (Array<String>)

    The list of all tag identifiers that correspond to the tags attached to the given object.

Raises:



1172
1173
1174
1175
1176
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 1172

def list_attached_tags(object_id)
    invoke_with_info(@@list_attached_tags_info, {
        'object_id' => object_id,
    })
end

- (Array<Com::Vmware::Cis::Tagging::TagAssociation::ObjectToTags>) list_attached_tags_on_objects(object_ids)

Fetches the list of :class:`Com::Vmware::Cis::Tagging::TagAssociation::ObjectToTags` describing the input object identifiers and the tags attached to each object. To invoke this method , you need the read privilege on each input object. The :attr:`Com::Vmware::Cis::Tagging::TagAssociation::ObjectToTags.tag_ids` will only contain those tags for which you have the read privilege.

Parameters:

Returns:



1185
1186
1187
1188
1189
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 1185

def list_attached_tags_on_objects(object_ids)
    invoke_with_info(@@list_attached_tags_on_objects_info, {
        'object_ids' => object_ids,
    })
end