Skip to main content

๐Ÿ‘ทโ€โ™‚๏ธ Builder

Createโ€‹

info

Use this endpoint to send your function to GreenCloud so it can build and deploy it for you. You will recieve a build ID which you can use to check the status of your build.

tip

Make sure to include the architecture type as a parameter when sending your function for it to be built.

When sending your function to be build via the API you must zip the contents of the function folder first.

Caution

You must zip the contents of the function folder rather than the function folder itself.

Endpointโ€‹

POST
https://api.greencloud.dev/v1/build/[functionId]
https://api.greencloud.dev/v1/build/[functionId]

Request Headersโ€‹

KeyValueRequired
AuthorizationValid Access Tokentrue
Content-Typeapplication/octet-streamtrue

Request Parametersโ€‹

KeyExampleRequirements
archamd64required amd64

Request Bodyโ€‹

KeyExampleRequirements
fileMyFunction.ziprequired .zip

Example Requestโ€‹

POST
https://api.greencloud.dev/v1/build/66787c5e84809f8a29ddc2f7?arch=amd64
https://api.greencloud.dev/v1/build/66787c5e84809f8a29ddc2f7?arch=amd64

Example Responseโ€‹

Status: 201 Created
{
"id": "66787d8f694aa083bbdf9aa9"
}

Getโ€‹

info

If you need to retrieve details about your build, use this endpoint by passing the build ID as a URL request parameter. The endpoint will provide you with a list of information related to build of the function.

Endpointโ€‹

GET
https://api.greencloud.dev/v1/build/[buildId]
https://api.greencloud.dev/v1/build/[buildId]

Request Headersโ€‹

KeyValueRequired
AuthorizationValid Access Tokentrue

Request Parametersโ€‹

ValueExampleRequired
build id66787d8f694aa083bbdf9aa9true

Example Requestโ€‹

Empty body

Example Responseโ€‹

Status: 200 OK
{
"functionId": "66787d8f694aa083bbdf9aa9",
"status": "SUCCESS",
"arch": [ "amd64"],
"timeline": [{ "status": "PENDING", "time": "2023-07-24T21:53:08Z" }],
"log": ["โœ… Unzipping successfuly โ†’ fx.zip"]
}

Listโ€‹

info

Use this endpoint to get a list of functions in your GreenCloud account. You can set optional parameters to choose which page of results to view, how many results to view and which specific function you want to inspect.

Endpointโ€‹

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

Request Headersโ€‹

KeyValueRequired
AuthorizationValid Access Tokentrue

Query Parametersโ€‹

KeyExampleRequirements
page2int optional min=1 default=1
limit3int optional min=1 max default=1
functionId"66787d8f694aa083bbdf9aa9"string optional mongodb

Example Requestโ€‹

GET
https://api.greencloud.dev/v1/build/list?page=2&limit=3
https://api.greencloud.dev/v1/build/list?page=2&limit=3
Empty body

Example Responseโ€‹

Status: 200 OK
{
"pageCount": 2,
"pageSize": 3,
"totalCount": 22,
"results": [
{
"id": "666db024694aa083bbdf9aa5",
"functionId": "666da32e84809f8a29ddc2e0",
"status": "SUCCESS",
"createdAt": "2024-06-15T15:15:48Z"
},
{
"id": "666daec1694aa083bbdf9aa4",
"functionId": "666dae5984809f8a29ddc2e1",
"status": "SUCCESS",
"createdAt": "2024-06-15T15:09:53Z"
},
{
"id": "666d6cb4694aa083bbdf9aa0",
"functionId": "666c271e84809f8a29ddc2d4",
"status": "FAILED",
"createdAt": "2024-06-15T10:28:04Z"
}
]
}