Retrieving volume IDs by tag#

To get the list of IDs of all virtual volumes to which a particular tag is assigned, specify the tag’s key and value and the following address in the request:

http://169.254.169.254/api/tags/volumes-by-tag

Request parameters#

  • key — The tag key.

    • Type: String

    • Required: Yes

  • value — The tag value.

    • Type: String

    • Required: Yes

Examples#

curl -X POST -H 'Content-Type: application/json' -d '{"key": " <tag key>", "value": "<tag value>"}' http://169.254.169.254/api/tags/volumes-by-tag

{"result": ["vol-XXXXXXXX", "vol-XXXXXXXX"]}