➡️ Trigger (function chain)
When you run a function in GreenCloud you may wish for it to cause another function to run afterwards automatically. You can do this by creating a trigger. Triggers have the option to allow you to pass the result from one function into the function which is automatically called afterwards.
::::info
Use this endpoint to create a trigger which causes a function to execute automatically after another function has been called. You have the option to include tags and a description.
::::
Request Headers
| Key |
Value |
Required |
Authorization |
Valid Access Token |
true |
Content-Type |
application/json |
true |
| Key |
Example |
Requirements |
functionId |
664f8feb91f33bfb994dcfd2 |
required string functionId |
nextId |
664f8feb91f33bfb994dcfd3 |
required string functionId |
status |
200 |
integer httpcode |
tag |
[tag id, tag id, tag id] |
optional dive unique alphanum |
includeResult |
true |
required bool |
description |
saveResultToStorage |
optional printascii max=256 |
{
"functionId": "664f8feb91f33bfb994dcfd2",
"nextId": "664f8feb91f33bfb994dcfd3",
"tag": ['63fe131f02975e4956238b39', '63fe131f02975e4956238b40'],
"status": 200,
"includeResult": true,
"description": "saveResultToStorage"
}
{
"id": "63f47d24dab5eb85451f3b61",
}
::::info
Use this endpoint to retrieve information about a trigger using it's Id.
These include the initial function ID, the subsequent function ID, the tags attached to the trigger, its status result, whether the results of the initial function are fed to the subsequent function, its description and when it was created.
::::
Request Headers
| Key |
Value |
Required |
Authorization |
Valid Access Token |
true |
Content-Type |
application/json |
true |
| Key |
Example |
Requirements |
| trigger Id |
664f8feb91f33bfb994dcfd2 |
triggerId |
{
"functionId": "65cbc89aaa892059d49e06cf",
"nextId": "65cbc89aaa892059d49e06cf",
"tags": [{ "id": "65cbc88e41cbcffabfacefd4", "name": "greencloud", "color": "#00ff80" }],
"status": 200,
"includeResult": true,
"description": "saveResultToStorage",
"createdAt": "2024-05-24T00:13:08Z"
}
::::info
Use this endpoint to get a list of triggers in your GreenCloud account. You can include the function Id to find triggers for that specific function. If the list of triggers is larger than a single page of results you can choose which page of results to view using page. You can also limit the number of triggers listed using limit.
::::
Request Headers
| Key |
Value |
Required |
Authorization |
Valid Access Token |
true |
Content-Type |
application/json |
true |
| Key |
Example |
Requirements |
page |
1 |
optional min=1 integer default 1 |
limit |
3 |
optional min=3 max=20 integer default 10 |
functionId |
664f8feb91f33bfb994dcfd3 |
optional |
{
"page": 1,
"limit": 2,
"functionId": "664f8feb91f33bfb994dcfd2",
}
{
"pageCount": 1,
"pageSize": 1,
"totalCount": 2,
"results": [{
"id": "65dd290735dd849401eacc8e",
"functionId": "664f8feb91f33bfb994dcfd2",
"nextId": "65cbc89aaa892059d49e06cf",
"tags": [{ "id": "65cbc88e41cbcfgibfacefd4", "name": "greencloud", "color": "#00ff80" }],
"status": 200,
"includeResult": true,
"createdAt": "2024-02-27T00:12:55Z"
}
{
"id": "65dd290735dd849401eacc8f",
"functionId": "664f8feb91f33bfb994dcgp4",
"nextId": "65cbc89aaa892059d49e09dz",
"tags": [{ "id": "65cbc88e41cbcfharfacefd4", "name": "webinars", "color": "#00dd80" }],
"status": 200,
"includeResult": false,
"createdAt": "2024-05-25T00:13:42Z"
}]
}
::::info
Use this endpoint to edit a trigger. You have the option to include tags and a description.
::::
Request Headers
| Key |
Value |
Required |
Authorization |
Valid Access Token |
true |
Content-Type |
application/json |
true |
| Key |
Example |
Requirements |
tag |
[tag id, tag id, tag id] |
optional dive unique alphanum |
status |
200 |
integer httpcode |
includeResult |
true |
required bool |
description |
saveResultToStorage |
optional printascii max=256 |
{
"tag": ['63fe131f02975e4956238b39', '63fe131f02975e4956238b40'],
"status": 200,
"includeResult": true,
"description": "saveResultToStorage"
}
::::info
Use this endpoint to delete a trigger from the GreenCloud system.
::::
Request Headers
| Key |
Value |
Required |
Authorization |
Valid Access Token |
true |
| Value |
Example |
Required |
| trigger id |
65dd290735dd849401eacc8f |
true |