tags
collection provides information about tags in a Red Hat Enterprise Virtualization environment. An API user accesses this information through the rel="tags"
link obtained from the entry point URI (see Chapter 4, Entry Point).
Element | Type | Description | Properties |
---|---|---|---|
host
| GUID | A reference to the host which the tag is attached. See Chapter 12, Hosts. |
![]() |
user
| GUID | A reference to the user which the tag is attached. See Chapter 19, Users. |
![]() |
vm
| GUID | A reference to the VM which the tag is attached. See Chapter 13, Virtual Machines. |
![]() |
parent
| complex | A reference to the VM which the tag is attached. |
<tag id="f436ebfc-67f2-41bd-8ec6-902b6f7dcb5e" href="/api/tags/f436ebfc-67f2-41bd-8ec6-902b6f7dcb5e"> <name>Finance</name> <description>Resources for the Finance department</description> <parent> <tag id="-1" href="/api/tags/-1"/> </parent> </tag>
name
element. The name
, description
and parent
elements are updatable post-creation.
link rel="tags"
from a host
, user
or vms
represents the set of tags associated with the entity.
tag
representations are as described in Chapter 20, Tags, except they also contain a host id
, user id
or vm id
reference to the entity in question.
POST
ing a tag reference (identifying the tag either by its id
or name
) to the collection.
POST /api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720/tags HTTP/1.1 Accept: application/xml Content-Type: application/xml <tag> <name>Finance</name> </tag> HTTP/1.1 201 Created Content-Type: application/xml <tag id="f436ebfc-67f2-41bd-8ec6-902b6f7dcb5e" href="/api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720/tags/ f436ebfc-67f2-41bd-8ec6-902b6f7dcb5e"> <name>Finance</name> <description>Resources for the Finance department</description> <vm id="5114bb3e-a4e6-44b2-b783-b3eea7d84720" href="/api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720"/> </tag>
DELETE
request to the appropriate element in the collection.
DELETE /api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720/tags/f436ebfc-67f2-41bd-8ec6-902b6f7dcb5e HTTP/1.1 HTTP/1.1 204 No Content
collection/search
URI template for the appropriate collection should be used to search for entities matching tag=MyTag
.
GET /api/vms?search=tag%3DFinance HTTP/1.1 Accept: application/xml HTTP/1.1 200 OK Content-Type: application/xml <vms> <vm id="5114bb3e-a4e6-44b2-b783-b3eea7d84720" href="/api/vms/5114bb3e-a4e6-44b2-b783-b3eea7d84720"> ... </vm> ... </vms>