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. 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.
object‑id‑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.
object‑id‑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 --object-id-type testString --object-id-id testId


Detach Command

dcli com vmware cis tagging tagassociation detach

Description

Detaches the tag from the given object. 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.
object‑id‑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.
object‑id‑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 --object-id-type testString --object-id-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 read privileges 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


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 read privileges.

Options

Option Name Type Required Description
object‑id‑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.
object‑id‑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 --object-id-type testString --object-id-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
object‑id‑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.
object‑id‑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 --object-id-type testString --object-id-id testId