๐ท๏ธ 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 -:
- 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.
- 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โ
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โ
Request Headersโ
| Key | Value | Required |
|---|---|---|
Authorization | Valid Access Token | true |
Content-Type | application/json | true |
Request Bodyโ
| Key | Example | Requirements |
|---|---|---|
name | green | required ascii |
color | #00ff80 | optional hexcolor |
Example Requestโ
{
"name": "green",
"color": "#00ff80"
}
Example Responseโ
{
"id": "63f47d1c5bd6eeef8211c83e"
}
List Tagsโ
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โ
Request Headersโ
| Key | Value | Required |
|---|---|---|
Authorization | Valid Access Token | true |
Example Requestโ
Empty body
Example Responseโ
[
{
id: "63ed33eac79248a54ee04831",
name: "greencloud",
color: "#00ff80",
},
{
id: "63fe131f02975e4956238b39",
name: "greencloud2",
color: "#00ff80",
},
{
id: "6404b34817835b5291ae367a",
name: "red",
color: "#00ff80",
},
]
Edit A Tagโ
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โ
Request Headersโ
| Key | Value | Required |
|---|---|---|
Authorization | Valid Access Token | true |
Content-Type | application/json | true |
Request Parametersโ
| Value | Example | Required |
|---|---|---|
| tag id | 63f47d24dab5eb85451f3b61 | true |
Request Bodyโ
| Key | Example | Requirements |
|---|---|---|
name | green | optional ascii |
color | #00ff80 | optional hexcolor |
Example Requestโ
{
"name": "green",
"color": "#00ff80"
}
Example Responseโ
Empty body
Delete Tagโ
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โ
Request Headersโ
| Key | Value | Required |
|---|---|---|
Authorization | Valid Access Token | true |
Request Parametersโ
| Value | Example | Required |
|---|---|---|
| tag id | 63f47d24dab5eb85451f3b61 | true |
Example Requestโ
Empty body
Example Responseโ
Empty body