VMware

TagAssociation Namespace

The TagAssociation namespace provides commands to attach, detach, and query tags.

List of commands:



Attach Command

dcli com vmware cis tagging tagassociation attach

Description

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

Options

Option Name Type Required Description
tag‑id string Yes The identifier of the input tag. The parameter must be an identifier for the resource type: com.vmware.cis.tagging.Tag.
type string Yes The type of resource being identified (for example com.acme.Person). Namespaces that contain commands for creating and deleting resources typically contain a constant specifying the resource type for the resources being created and deleted. The API metamodel metadata namespaces include a namespace that allows retrieving all the known resource types.
id string Yes The identifier for a resource whose type is specified by DynamicID.type. When clients pass a value of this class as a parameter, the option type must contain the actual resource type. When commands return a value of this class as a output, the option type will contain the actual resource type.

Example

dcli com vmware cis tagging tagassociation attach --tag-id testId --type testString --id testId


AttachMultipleTagsToObject Command

dcli com vmware cis tagging tagassociation attachmultipletagstoobject

Description

Attaches the given tags to the input object. If a tag is already attached to the object, then the individual command is a no-op and an error will not be added to TagAssociation.BatchResult.error-messages. To invoke this command, you need the read privilege on the object and the attach tag privilege on each tag.

Options

Option Name Type Required Description
type string Yes The type of resource being identified (for example com.acme.Person). Namespaces that contain commands for creating and deleting resources typically contain a constant specifying the resource type for the resources being created and deleted. The API metamodel metadata namespaces include a namespace that allows retrieving all the known resource types.
id string Yes The identifier for a resource whose type is specified by DynamicID.type. When clients pass a value of this class as a parameter, the option type must contain the actual resource type. When commands return a value of this class as a output, the option type will contain the actual resource type.
tag‑ids string Yes The identifiers of the input tags. The parameter must contain identifiers for the resource type: com.vmware.cis.tagging.Tag.

Example

dcli com vmware cis tagging tagassociation attachmultipletagstoobject --type testString --id testId --tag-ids testId


AttachTagToMultipleObjects Command

dcli com vmware cis tagging tagassociation attachtagtomultipleobjects

Description

Attaches the given tag to the input objects. If a tag is already attached to the object, then the individual command is a no-op and an error will not be added to TagAssociation.BatchResult.error-messages. To invoke this command, you need the attach tag privilege on the tag and the read privilege on each object.

Options

Option Name Type Required Description
tag‑id string Yes The identifier of the input tag. The parameter must be an identifier for the resource type: com.vmware.cis.tagging.Tag.
type string Yes The type of resource being identified (for example com.acme.Person). Namespaces that contain commands for creating and deleting resources typically contain a constant specifying the resource type for the resources being created and deleted. The API metamodel metadata namespaces include a namespace that allows retrieving all the known resource types.
id string Yes The identifier for a resource whose type is specified by DynamicID.type. When clients pass a value of this class as a parameter, the option type must contain the actual resource type. When commands return a value of this class as a output, the option type will contain the actual resource type.

Example

dcli com vmware cis tagging tagassociation attachtagtomultipleobjects --tag-id testId --type testString --id testId


Detach Command

dcli com vmware cis tagging tagassociation detach

Description

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

Options

Option Name Type Required Description
tag‑id string Yes The identifier of the input tag. The parameter must be an identifier for the resource type: com.vmware.cis.tagging.Tag.
type string Yes The type of resource being identified (for example com.acme.Person). Namespaces that contain commands for creating and deleting resources typically contain a constant specifying the resource type for the resources being created and deleted. The API metamodel metadata namespaces include a namespace that allows retrieving all the known resource types.
id string Yes The identifier for a resource whose type is specified by DynamicID.type. When clients pass a value of this class as a parameter, the option type must contain the actual resource type. When commands return a value of this class as a output, the option type will contain the actual resource type.

Example

dcli com vmware cis tagging tagassociation detach --tag-id testId --type testString --id testId


DetachMultipleTagsFromObject Command

dcli com vmware cis tagging tagassociation detachmultipletagsfromobject

Description

Detaches the given tags from the input object. If a tag is already removed from the object, then the individual command is a no-op and an error will not be added to TagAssociation.BatchResult.error-messages. To invoke this command, you need the read privilege on the object and the attach tag privilege each tag.

Options

Option Name Type Required Description
type string Yes The type of resource being identified (for example com.acme.Person). Namespaces that contain commands for creating and deleting resources typically contain a constant specifying the resource type for the resources being created and deleted. The API metamodel metadata namespaces include a namespace that allows retrieving all the known resource types.
id string Yes The identifier for a resource whose type is specified by DynamicID.type. When clients pass a value of this class as a parameter, the option type must contain the actual resource type. When commands return a value of this class as a output, the option type will contain the actual resource type.
tag‑ids string Yes The identifiers of the input tags. The parameter must contain identifiers for the resource type: com.vmware.cis.tagging.Tag.

Example

dcli com vmware cis tagging tagassociation detachmultipletagsfromobject --type testString --id testId --tag-ids testId


DetachTagFromMultipleObjects Command

dcli com vmware cis tagging tagassociation detachtagfrommultipleobjects

Description

Detaches the given tag from the input objects. If a tag is already removed from the object, then the individual command is a no-op and an error will not be added to TagAssociation.BatchResult.error-messages. To invoke this command, you need the attach tag privilege on the tag and the read privilege on each object.

Options

Option Name Type Required Description
tag‑id string Yes The identifier of the input tag. The parameter must be an identifier for the resource type: com.vmware.cis.tagging.Tag.
type string Yes The type of resource being identified (for example com.acme.Person). Namespaces that contain commands for creating and deleting resources typically contain a constant specifying the resource type for the resources being created and deleted. The API metamodel metadata namespaces include a namespace that allows retrieving all the known resource types.
id string Yes The identifier for a resource whose type is specified by DynamicID.type. When clients pass a value of this class as a parameter, the option type must contain the actual resource type. When commands return a value of this class as a output, the option type will contain the actual resource type.

Example

dcli com vmware cis tagging tagassociation detachtagfrommultipleobjects --tag-id testId --type testString --id testId


ListAttachedObjects Command

dcli com vmware cis tagging tagassociation listattachedobjects

Description

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

Options

Option Name Type Required Description
tag‑id string Yes The identifier of the input tag. The parameter must be an identifier for the resource type: com.vmware.cis.tagging.Tag.

Example

dcli com vmware cis tagging tagassociation listattachedobjects --tag-id testId


ListAttachedObjectsOnTags Command

dcli com vmware cis tagging tagassociation listattachedobjectsontags

Description

Fetches the list of TagAssociation.TagToObjects describing the input tag identifiers and the objects they are attached to. To invoke this command, you need the read privilege on each input tag. The TagAssociation.TagToObjects.object-ids will only contain those objects for which you have the read privilege.

Options

Option Name Type Required Description
tag‑ids string Yes The identifiers of the input tags. The parameter must contain identifiers for the resource type: com.vmware.cis.tagging.Tag.

Example

dcli com vmware cis tagging tagassociation listattachedobjectsontags --tag-ids testId


ListAttachedTags Command

dcli com vmware cis tagging tagassociation listattachedtags

Description

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

Options

Option Name Type Required Description
type string Yes The type of resource being identified (for example com.acme.Person). Namespaces that contain commands for creating and deleting resources typically contain a constant specifying the resource type for the resources being created and deleted. The API metamodel metadata namespaces include a namespace that allows retrieving all the known resource types.
id string Yes The identifier for a resource whose type is specified by DynamicID.type. When clients pass a value of this class as a parameter, the option type must contain the actual resource type. When commands return a value of this class as a output, the option type will contain the actual resource type.

Example

dcli com vmware cis tagging tagassociation listattachedtags --type testString --id testId


ListAttachedTagsOnObjects Command

dcli com vmware cis tagging tagassociation listattachedtagsonobjects

Description

Fetches the list of TagAssociation.ObjectToTags describing the input object identifiers and the tags attached to each object. To invoke this command, you need the read privilege on each input object. The TagAssociation.ObjectToTags.tag-ids will only contain those tags for which you have the read privilege.

Options

Option Name Type Required Description
type string Yes The type of resource being identified (for example com.acme.Person). Namespaces that contain commands for creating and deleting resources typically contain a constant specifying the resource type for the resources being created and deleted. The API metamodel metadata namespaces include a namespace that allows retrieving all the known resource types.
id string Yes The identifier for a resource whose type is specified by DynamicID.type. When clients pass a value of this class as a parameter, the option type must contain the actual resource type. When commands return a value of this class as a output, the option type will contain the actual resource type.

Example

dcli com vmware cis tagging tagassociation listattachedtagsonobjects --type testString --id testId


ListAttachableTags Command

dcli com vmware cis tagging tagassociation listattachabletags

Description

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 (CategoryModel.cardinality) and associability (CategoryModel.associable-types) constructs. To invoke this command, you need the read privilege on the input object. The list will only contain those tags for which you have read privileges.

Options

Option Name Type Required Description
type string Yes The type of resource being identified (for example com.acme.Person). Namespaces that contain commands for creating and deleting resources typically contain a constant specifying the resource type for the resources being created and deleted. The API metamodel metadata namespaces include a namespace that allows retrieving all the known resource types.
id string Yes The identifier for a resource whose type is specified by DynamicID.type. When clients pass a value of this class as a parameter, the option type must contain the actual resource type. When commands return a value of this class as a output, the option type will contain the actual resource type.

Example

dcli com vmware cis tagging tagassociation listattachabletags --type testString --id testId