Logo

Command Palette

Search for a command to run...

GET/tags/:entity_type/:entity_id
List Tagspublic

Required Parameters

entity_typestring
Type of the entity
entity_idstring
ID of the entity

Get a list of tags for entities (servers & loadbalancers) by entity type and entity ID.

Related Models:TagPagination

Request

GET
/tags/:entity_type/:entity_id
curl -X GET \
  "https://app.cloud66.com/api/3/tags/:entity_type/:entity_id" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Response

{
  "response": [
    {
      "entity_type": "loadbalancer",
      "entity_id": "17823",
      "tags": [
        {
          "value": "foo",
          "reserved": false
        },
        {
          "value": "bar",
          "reserved": false
        }
      ],
      "created_at_iso": "2021-01-04T21:32:33+0000",
      "updated_at_iso": "2021-01-05T11:12:23+0000"
    }
  ],
  "count": 1,
  "pagination": {
    "previous": null,
    "next": null,
    "current": 1,
    "per_page": 30,
    "count": 1,
    "pages": 1
  }
}
POST/tags/:entity_type/:entity_id
Add Tagspublic

Required Parameters

entity_typestring
Type of the entity
entity_idstring
ID of the entity
tagsarray
Array of tag values to be POSTed

Add tags to an entity (server or loadbalancer). Completely replaces tags of the object with tags provided.

Related Models:Tag

Request

POST
/tags/:entity_type/:entity_id
curl -X POST \
  "https://app.cloud66.com/api/3/tags/:entity_type/:entity_id" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "entity_type": "server",
  "entity_id": "57648",
  "tags": "[\"foo\",\"bar\"]"
}'

Response

{
  "response": [
    {
      "entity_type": "loadbalancer",
      "entity_id": "17823",
      "tags": [
        {
          "value": "foo",
          "reserved": false
        },
        {
          "value": "bar",
          "reserved": false
        }
      ],
      "created_at_iso": "2021-01-04T21:32:33+0000",
      "updated_at_iso": "2021-01-05T11:12:23+0000"
    }
  ],
  "count": 1,
  "pagination": {
    "previous": null,
    "next": null,
    "current": 1,
    "per_page": 30,
    "count": 1,
    "pages": 1
  }
}
PATCH/tags/:entity_type/:entity_id

Required Parameters

entity_typestring
Type of the entity
entity_idstring
ID of the entity
operationsarray
An array of operation objects with "op" (add or delete) and "tags" array

Update tags on an entity (server or loadbalancer). Adds or deletes tags based on the operations parameter. Deleting non-existent tags is not an error, will simply be ignored. Performs deletions first, then additions.

Related Models:Tag

Request

PATCH
/tags/:entity_type/:entity_id
curl -X PATCH \
  "https://app.cloud66.com/api/3/tags/:entity_type/:entity_id" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Response

{
  "response": [
    {
      "entity_type": "loadbalancer",
      "entity_id": "17823",
      "tags": [
        {
          "value": "foo",
          "reserved": false
        },
        {
          "value": "bar",
          "reserved": false
        }
      ],
      "created_at_iso": "2021-01-04T21:32:33+0000",
      "updated_at_iso": "2021-01-05T11:12:23+0000"
    }
  ],
  "count": 1,
  "pagination": {
    "previous": null,
    "next": null,
    "current": 1,
    "per_page": 30,
    "count": 1,
    "pages": 1
  }
}
DELETE/tags/:entity_type/:entity_id

Required Parameters

entity_typestring
Type of the entity
entity_idstring
ID of the entity

Delete all tags on an entity (server or loadbalancer).

Related Models:Tag

Request

DELETE
/tags/:entity_type/:entity_id
curl -X DELETE \
  "https://app.cloud66.com/api/3/tags/:entity_type/:entity_id" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Response

{
  "response": [
    {
      "entity_type": "loadbalancer",
      "entity_id": "17823",
      "tags": [],
      "created_at_iso": "2021-01-04T21:32:33+0000",
      "updated_at_iso": "2021-01-05T11:12:23+0000"
    }
  ],
  "count": 1,
  "pagination": {
    "previous": null,
    "next": null,
    "current": 1,
    "per_page": 30,
    "count": 1,
    "pages": 1
  }
}