Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
257 lines (180 loc) · 7.22 KB

File metadata and controls

257 lines (180 loc) · 7.22 KB
Copy raw file
Download raw file
Outline
Edit and raw actions
sidebar_position
10

➡️ 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.

Create

::::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.

::::

Endpoint

Request Headers

Key Value Required
Authorization Valid Access Token true
Content-Type application/json true

Request Body

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

Example Request

{
	"functionId": "664f8feb91f33bfb994dcfd2",
	"nextId": "664f8feb91f33bfb994dcfd3",
	"tag": ['63fe131f02975e4956238b39', '63fe131f02975e4956238b40'],
	"status": 200,
	"includeResult": true,
	"description": "saveResultToStorage"
}

Example Response

{
	"id": "63f47d24dab5eb85451f3b61",
}

Get

::::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.

::::

Endpoint

Request Headers

Key Value Required
Authorization Valid Access Token true
Content-Type application/json true

Request Parameters

Key Example Requirements
trigger Id 664f8feb91f33bfb994dcfd2 triggerId

Example Request

Empty body

Example Response

{
  "functionId": "65cbc89aaa892059d49e06cf",
  "nextId": "65cbc89aaa892059d49e06cf",
  "tags": [{ "id": "65cbc88e41cbcffabfacefd4", "name": "greencloud", "color": "#00ff80" }],
  "status": 200,
  "includeResult": true,
  "description": "saveResultToStorage",
  "createdAt": "2024-05-24T00:13:08Z"
}

List

::::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.

::::

Endpoint

Request Headers

Key Value Required
Authorization Valid Access Token true
Content-Type application/json true

Request Body

Key Example Requirements
page 1 optional min=1 integer default 1
limit 3 optional min=3 max=20 integer default 10
functionId 664f8feb91f33bfb994dcfd3 optional

Example Request

{
	"page": 1,
	"limit": 2,
	"functionId": "664f8feb91f33bfb994dcfd2",
}

Example Response

{
  "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"
	}]
}

Edit

::::info Use this endpoint to edit a trigger. You have the option to include tags and a description. ::::

Endpoint

Request Headers

Key Value Required
Authorization Valid Access Token true
Content-Type application/json true

Request Body

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

Example Request

{
	"tag": ['63fe131f02975e4956238b39', '63fe131f02975e4956238b40'],
	"status": 200,
	"includeResult": true,
	"description": "saveResultToStorage"
}

Example Response

{
	Empty body
}

Delete

::::info Use this endpoint to delete a trigger from the GreenCloud system. ::::

Endpoint

Request Headers

Key Value Required
Authorization Valid Access Token true

Request Parameters

Value Example Required
trigger id 65dd290735dd849401eacc8f true

Example Request

Empty body

Example Response

Empty body
Morty Proxy This is a proxified and sanitized view of the page, visit original site.