Skip to main content

๐Ÿท๏ธ Tags

We have introduced the idea of tags in GreenCloud. You may be familiar with this concept in other similar services. You simply 'tag' your function with meta data about the function. Once tagged you will be able to the order your functions by tags. Please note, Tags are specific to your account.

Example usages we see for this are -:

  1. You may have many functions in your GreenCloud account. Imagine searching a hundred functions to find one, it could be tedious. Searching using a tag could reduce the number to sift through considerably.
  2. GreenCloud will in future consist of more services ( Storage and Database ) - as such we will allow tags on all resources. Being able to use the same tag name across different services will effectively organise your GreenCloud services.

Create Tagโ€‹

info

Call this endpoint to create a tag in GreenCloud. You pass the name and color in the body of the call. The response from the call is an HTTP 201 response along with a JSON object containing an ID attribute of the newly created tag.

Endpointโ€‹

POST
https://api.greencloud.dev/v1/tag
https://api.greencloud.dev/v1/tag

Request Headersโ€‹

KeyValueRequired
AuthorizationValid Access Tokentrue
Content-Typeapplication/jsontrue

Request Bodyโ€‹

KeyExampleRequirements
namegreenrequired ascii
color#00ff80optional hexcolor

Example Requestโ€‹

{
"name": "green",
"color": "#00ff80"
}

Example Responseโ€‹

Status: 201 Created
{
"id": "63f47d1c5bd6eeef8211c83e"
}

List Tagsโ€‹

info

Call this endpoint to get a list of tags in this GreenCloud account. The succesful response is an HTTP 200 response with the body containing a JSON array of objects representing the Tags.

Endpointโ€‹

GET
https://api.greencloud.dev/v1/tag/list
https://api.greencloud.dev/v1/tag/list

Request Headersโ€‹

KeyValueRequired
AuthorizationValid Access Tokentrue

Example Requestโ€‹

Empty body

Example Responseโ€‹

Status: 200 OK
[
{
id: "63ed33eac79248a54ee04831",
name: "greencloud",
color: "#00ff80",
},
{
id: "63fe131f02975e4956238b39",
name: "greencloud2",
color: "#00ff80",
},
{
id: "6404b34817835b5291ae367a",
name: "red",
color: "#00ff80",
},
]

Edit A Tagโ€‹

info

Use this endpoint to edit a tag. Pass the id of the tag on the URL along with the updated JSON object for the tag. Succesful update results in a 204 response from the server.

Endpointโ€‹

PATCH
https://api.greencloud.dev/v1/tag/[tagId]
https://api.greencloud.dev/v1/tag/[tagId]

Request Headersโ€‹

KeyValueRequired
AuthorizationValid Access Tokentrue
Content-Typeapplication/jsontrue

Request Parametersโ€‹

ValueExampleRequired
tag id63f47d24dab5eb85451f3b61true

Request Bodyโ€‹

KeyExampleRequirements
namegreenoptional ascii
color#00ff80optional hexcolor

Example Requestโ€‹

{
"name": "green",
"color": "#00ff80"
}

Example Responseโ€‹

Status: 204 No Content
Empty body

Delete Tagโ€‹

info

Call this endpoint to delete the tag from the GreenCloud account. Pass the id of the tag as a URL parameter and if successful an HTTP 204 response is returned.

Endpointโ€‹

DELETE
https://api.greencloud.dev/v1/tag/[tagId]
https://api.greencloud.dev/v1/tag/[tagId]

Request Headersโ€‹

KeyValueRequired
AuthorizationValid Access Tokentrue

Request Parametersโ€‹

ValueExampleRequired
tag id63f47d24dab5eb85451f3b61true

Example Requestโ€‹

Empty body

Example Responseโ€‹

Status: 204 No Content
Empty body