Tag your services
Add labels to your services so you can filter and find them, in the dashboard or through the API.
A tag is a label of your own, such as production or eu-customers, that you put on a service, an instance or a server to find it again. Tags do nothing else: they change no setting and cost nothing.
Before you begin
Section titled Before you begin- A tag uses lowercase letters, digits and hyphens, and starts with a letter or a digit. The dashboard turns spaces into hyphens and capitals into lowercase for you.
- Tags on a service and tags on the instance or server behind it are kept apart. Where tags live explains which list each one filters.
Add a tag
Section titled Add a tag- Open the thing you want to tag:
- A service: its page from Services, or the page of a floating IP, a mail service or an Object Storage service. The Tags card is on the Overview tab.
- A Cloud Compute instance or a Container Apps server: its Settings tab, in the Tags card.
- Type the tag in Add a tag. Under the field, Suggestions offers the tags you already use.
- Press Enter, type a comma, or select Add tag.
The tag is saved at once and appears as a chip above the field.
Remove a tag
Section titled Remove a tag- Open the Tags card that holds the tag.
- Select the cross on the tag's chip. With the field empty, Backspace removes the last tag.
Filter a list by tag
Section titled Filter a list by tag- Open Services, Cloud Compute or Container Apps.
- Select a tag in the row of tags under the search box. The number beside each tag counts the items that have it.
- Select more tags to narrow the list to items that have all of them.
- Select Clear to show everything again.
Where tags live
Section titled Where tags liveA Cloud Compute instance and a Container Apps server each have a service as well: the service carries the plan and the billing. Each keeps its own tags.
| Where you add the tag | Where it shows and filters |
|---|---|
| A service's Overview tab | Services |
| An instance's Settings tab | Cloud Compute |
| A server's Settings tab | Container Apps |
To find an instance or a server from Services, tag its service as well.
Result
Section titled ResultThe tag shows on the item and in its list, where it filters. Through the API, GET /services/?tag= returns only the services with that tag.
Troubleshooting
Section titled Troubleshooting- Could not save the tags with
Tag must be 1–128 chars: lowercase letters, digits, hyphen, underscore - The tag has a character that tags cannot hold, such as a dot, a colon or a slash. Use lowercase letters, digits and hyphens.
- A tag you added on an instance or server is missing from Services
- Instance and server tags filter Cloud Compute and Container Apps. Add the tag on the service's Overview tab too, as Where tags live shows.
Related
Section titled RelatedWith the API
Section titled With the APIEach tag belongs to a source: a type and an ID.
source_type |
source_id |
|---|---|
service |
The service ID, such as 1042. |
vps (or cloud_compute) |
The instance's UUID. |
container_server (or server) |
The server's UUID. |
dns_zone |
The DNS zone's ID. |
proxy_route |
The web proxy's ID. |
Read a source's tags with GET /client/tags/sources/{source_type}/{source_id}:
curl https://api.coritan.com/api/v1/client/tags/sources/service/1042 \
-H "Authorization: Bearer $CORITAN_TOKEN"
{"source_type": "service", "source_id": "1042", "tags": ["production", "web"]}
Add one tag with POST and {"tag": "production"}. Replace every tag at once with PUT and a list of up to 50; an empty list removes them all:
curl -X PUT https://api.coritan.com/api/v1/client/tags/sources/vps/0b6f3e2a-7c41-4d8e-9f25-6a1d3c8e4b70 \
-H "Authorization: Bearer $CORITAN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"tags": ["production", "eu-customers"]}'
Remove one with DELETE /client/tags/sources/{source_type}/{source_id}/{tag}. All three answer with the source's tags after the change, sorted: {"tags": ["eu-customers", "production"]}.
The API lowercases a tag and turns spaces into hyphens. It accepts lowercase letters, digits, hyphens and underscores, 1–128 characters, starting with a letter or a digit. Adding a tag the source already has changes nothing.
GET /client/tags/vocabulary lists the tags you use on one source_type, with how many of your resources carry each:
curl "https://api.coritan.com/api/v1/client/tags/vocabulary?source_type=service" \
-H "Authorization: Bearer $CORITAN_TOKEN"
{"items": [{"tag": "production", "resource_count": 3}, {"tag": "web", "resource_count": 1}], "source_type": "service"}
The errors:
400Unsupported source_type: ...orTagging not enabled for source_type: ...: use a type from the table.404Service not found,Cloud Compute instance not found,Server not found,DNS zone not foundorProxy route not found: the ID is wrong or the item is not yours.400Tag must be 1–128 chars: lowercase letters, digits, hyphen, underscore: the tag breaks the format.422: aPUTsent more than 50 tags.
API operations on this page
| Method | Path | What it does |
|---|---|---|
GET | /api/v1/client/tags/sources/{source_type}/{source_id} | Get resource tags |
POST | /api/v1/client/tags/sources/{source_type}/{source_id} | Add resource tag |
PUT | /api/v1/client/tags/sources/{source_type}/{source_id} | Replace resource tags |
DELETE | /api/v1/client/tags/sources/{source_type}/{source_id}/{tag} | Remove resource tag |
GET | /api/v1/client/tags/vocabulary | Distinct tags on resources you own for a given sourcetype |