v1

latestSwagger 2.0Apache22026-07-178513.9 KB

Deploy a new function.

post/functions

Request body

namestring required

Name of deployed function

imagestring required

Docker image in accessible registry

scriptstring required

Script to be executed inside the function coded in base64

envVarsobject

Overrides to environmental variables

labelsobject

An dictionary of labels used by the back-end for making scheduling or routing decisions

annotationsobject

An dictionary of annotations used by the back-end for management, orchestration, events and build tasks

constraintsstring[]
networkstring

Docker swarm network, usually func_functions

secretsstring[]
registryAuthstring

Private registry base64-encoded basic auth (as present in ~/.docker/config.json)

Example request

{
  "image": "functions/nodeinfo:latest",
  "name": "nodeinfo",
  "envVars": {
    "key": "envVars"
  },
  "annotations": {
    "key1": "annotation1",
    "key2": "annotation2"
  },
  "registryAuth": "dXNlcjpwYXNzd29yZA==",
  "requests": {
    "memory": "128M",
    "cpu": "0.01"
  },
  "constraints": [
    "node.platform.os == linux",
    "node.platform.os == linux"
  ],
  "secrets": [
    "secret-name-1",
    "secret-name-1"
  ],
  "script": "ZWNobyAiaXQgd29ya3MhIg==",
  "limits": {
    "memory": "128M",
    "cpu": "0.01"
  },
  "labels": {
    "key1": "label1",
    "key2": "label2"
  },
  "network": "func_functions"
}

Response

Accepted