hosting

Functions

0.000001 USD

Call

POST /v1/function/Call

Call a function by name

Request

namestring

Name of the function

requestobject

Request body that will be passed to the function

Response

responseobject

Response body that the function returned

Request

Response

{
    "response": {
        "message": "Hello Alice!"
    }
}

0.000001 USD

Delete

POST /v1/function/Delete

Delete a function by name

Request

namestring

The name of the function

Response

{}

Request

Response

{}

1 USD

Deploy

POST /v1/function/Deploy

Deploy a group of functions

Request

branchstring

branch to deploy. defaults to master

entrypointstring

entry point, ie. handler name in the source code if not provided, defaults to the name parameter

env_varsobject

environment variables to pass in at runtime

namestring

function name

regionstring

region to deploy in. defaults to europe-west1

repostring

github url for a repo

runtimestring

runtime/lanaguage of the function e.g php74, nodejs6, nodejs8, nodejs10, nodejs12, nodejs14, nodejs16, dotnet3, java11, ruby26, ruby27, go111, go113, go116, python37, python38, python39

sourcestring

inline source code

subfolderstring

optional subfolder path

Response

functionobject

Request

Response

{
    "function": {
        "id": "helloworld",
        "name": "helloworld",
        "repo": "https://github.com/m3o/m3o",
        "branch": "main",
        "entrypoint": "Helloworld",
        "subfolder": "examples/go-function",
        "runtime": "go116",
        "region": "europe-west1",
        "env_vars": {},
        "status": "Deploying",
        "url": "https://helloworld.m3o.sh",
        "created": "2021-12-16T17:27:09.230134479Z",
        "updated": ""
    }
}

0.000001 USD

Describe

POST /v1/function/Describe

Get the info for a deployed function

Request

namestring

The name of the function

Response

functionobject

The function requested

Request

Response

{
    "function": {
        "id": "helloworld",
        "name": "helloworld",
        "repo": "https://github.com/m3o/m3o",
        "branch": "main",
        "entrypoint": "Helloworld",
        "subfolder": "examples/go-function",
        "runtime": "go116",
        "region": "europe-west1",
        "env_vars": {},
        "status": "Deploying",
        "url": "https://helloworld.m3o.sh",
        "created": "2021-12-16T17:27:09.230134479Z",
        "updated": ""
    }
}

0.000001 USD

List

POST /v1/function/List

List all the deployed functions

Request

{}

Response

functionsarray

List of functions deployed

Request

Response

{
    "functions": [
        {
            "id": "helloworld",
            "name": "helloworld",
            "repo": "https://github.com/m3o/m3o",
            "branch": "main",
            "entrypoint": "Helloworld",
            "subfolder": "examples/go-function",
            "runtime": "go116",
            "region": "europe-west1",
            "env_vars": {},
            "status": "Deploying",
            "url": "https://helloworld.m3o.sh",
            "created": "2021-12-16T17:27:09.230134479Z",
            "updated": ""
        }
    ]
}

0.000001 USD

Logs

POST /v1/function/Logs

Get the logs for a function

Request

logs_typestring

type of logs to retrieve, currently supported options - "build"

namestring

the name of the function

Response

logsstring

Request

Response

{
    "logs": "starting build \"a85d3407-bcbf-472e-bb52-f6ddbc9cdff8\"\n\nStep #2 - \"post-buildpack\": Retagging eu.gcr.io/m3o-apis/gcf/europe-west1/540f08ba-4d25-449e-b629-c926d647d42f:domtestfn_version-1 as eu.gcr.io/m3o-apis/gcf/europe-west1/540f08ba-4d25-449e-b629-c926d647d42f:latest\nStep #2 - \"post-buildpack\": Image eu.gcr.io/m3o-apis/gcf/europe-west1/540f08ba-4d25-449e-b629-c926d647d42f:domtestfn_version-1 copied to eu.gcr.io/m3o-apis/gcf/europe-west1/540f08ba-4d25-449e-b629-c926d647d42f:latest\nStep #2 - \"post-buildpack\": Image eu.gcr.io/m3o-apis/gcf/europe-west1/540f08ba-4d25-449e-b629-c926d647d42f/cache:a85d3407-bcbf-472e-bb52-f6ddbc9cdff8 does not exist\nStep #2 - \"post-buildpack\": Already have image (with digest): eu.gcr.io/fn-img/utilities/buildpack-shim:base_20220304_18_04_RC00"
}

0.000001 USD

Proxy

POST /v1/function/Proxy

Return the backend url for proxying

Request

idstring

id of the function

Response

urlstring

backend url

Request

Response

{
    "url": "https://europe-west1-m3o-apis.cloudfunctions.net/helloworld"
}

0.000001 USD

Regions

POST /v1/function/Regions

Return a list of supported regions

Request

{}

Response

regionsarray

Request

Response

{
    "regions": [
        "asia-east1",
        "europe-west1",
        "us-central1",
        "us-east1",
        "us-west1"
    ]
}

5 USD

Reserve

POST /v1/function/Reserve

Reserve function names and resources beyond free quota

Request

namestring

name of your app e.g helloworld

Response

reservationobject

The app reservation

Request

Response

{
    "reservation": {
        "name": "helloworld",
        "owner": "micro/40e5d9aa-1185-4add-b248-ce4d72ff7947",
        "token": "c580be106204d103df461bb3a3075aefedda5f85",
        "created": "2021-12-16T19:19:29.615737412Z",
        "expires": "2022-12-16T19:19:29.615737502Z"
    }
}

0.000001 USD

Runtimes

POST /v1/function/Runtimes

Return a list of supported runtimes

Request

{}

Response

runtimesarray

Request

Response

{
    "runtimes": [
        "nodejs16",
        "python39",
        "go116",
        "java11",
        "dotnet3",
        "ruby27",
        "php74"
    ]
}

0.000001 USD

Update

POST /v1/function/Update

Update a function. Downloads the source, builds and redeploys

Request

namestring

function name

sourcestring

inline source code

Response

{}

Request

Response

{}