Resource tag
API for tag operations on resources of every type
Version: 0.1.0
Server
- URL:
https://api.kopernik.us/v0- Kopernik.us API server
Paths
/resource/tags
PATCH
Update resource tags
Change the tags of a resource, and report them as the update left them.
An update either replaces the whole set or changes it a tag at a time, and a request carries one of the two,
never both. tags replaces every tag the resource carries, so a tag left out of it is removed and an empty
list removes them all, as DELETE does. addTags and removeTags instead leave every tag they do not name
as it is, and either may be given on its own or both together, so that one request can add and remove at once.
A resource carries one tag per key, so an added tag overwrites whatever is held under its key, and a removed tag is named by its key alone. The tags the update leaves the resource with are counted and measured as a replacement is, so an addition that would take a resource past the tag limit is rejected and changes nothing.
Giving nodePoolUid addresses the tags of that node pool of a Kubernetes cluster rather than the tags of the
cluster, and works the same way.
kopernik.us stores tags itself rather than sending any to the provider, so an update reaches no provider and takes effect at once; it is reported through the resource itself rather than through an Action. The resource is read before the update, so a request naming one that does not exist changes nothing.
Request Body:
Content Type: application/json
Schema: ResourceTagsUpdate
Responses:
-
200: Tags updated
- Content Type:
application/json- Schema: ResourceTagsResponse
- Content Type:
-
400: Argument validation error
- Content Type:
application/json- Schema: ErrorResponse
- Content Type:
-
403: Write access is required
- Content Type:
application/json- Schema: ErrorResponse
- Content Type:
-
404: Resource not found
- Content Type:
application/json- Schema: ErrorResponse
- Content Type:
DELETE
Delete resource tags
Remove every tag of a resource, and report that it carries none. Equivalent to an update with an empty list
of tags, and like it, reaches no provider and takes effect at once. To remove one tag rather than all of
them, submit it as the removeTags of an update.
Giving nodePoolUid removes the tags of that node pool of a Kubernetes cluster rather than the tags of the
cluster.
Removing the tags of a resource that carries none succeeds without change.
Responses:
-
200: Tags removed
- Content Type:
application/json- Schema: ResourceTagsResponse
- Content Type:
-
400: Argument validation error
- Content Type:
application/json- Schema: ErrorResponse
- Content Type:
-
403: Write access is required
- Content Type:
application/json- Schema: ErrorResponse
- Content Type:
-
404: Resource not found
- Content Type:
application/json- Schema: ErrorResponse
- Content Type:
Schemas
ResourceTagsUpdate
Request to change the tags of a resource, either by replacing the whole set or by adding and removing tags one at a time. A request carries tags, or addTags and removeTags, but never both kinds at once, and a request carrying none of them is rejected.
Type: object
Properties:
| Name | Type | Required | Description |
|---|---|---|---|
| tags | array |
Tags the resource is to carry, replacing those it carries now. A tag is either key or key=value, holds no control characters and at most 256 characters, and one resource carries at most 100; one tag is kept per key, so a repeated key keeps the value given last. An empty list removes every tag the resource carries. |
|
| addTags | array |
Tags to set on the resource, leaving every tag they do not name as it is. A tag is written in the same form and held under the same rules as one of tags, and overwrites whatever the resource holds under its key. |
|
| removeTags | array |
Tags to remove from the resource, leaving every tag they do not name as it is. A resource carries one tag per key, so a tag is named by its key alone: env removes whatever the env tag holds, while env=prod is rejected. Removing a tag the resource does not carry succeeds without change, and a key given here cannot also appear in addTags. |
ResourceTagsResponse
Response with the tags of a resource
Composition: allOf
Type: object
Properties:
| Name | Type | Required | Description |
|---|---|---|---|
| grid | string | ✅ | Globally unique identifier of the resource whose tags these are |
| nodePoolUid | string | Unique identifier of the node pool whose tags these are, present only for a request that addressed a node pool rather than the resource itself | |
| tags | array |
✅ | Tags the resource, or the node pool, carries as the request left them |