POST /create (registers a new function)
name required type description Nameyes string Name of the function (globally unique) Runtimeyes string Base container runtime (e.g., python310)MemoryMByes int Memory (in MB) reserved for each function instance CPUDemandfloat Max CPU cores (or fractions of) allocated to function instances (e.g., 1.0means up to 1 core,-1.0means no cap)Handler(yes) string Function entrypoint in the source package; syntax and semantics depend on the chosen runtime (e.g., module.function_name). Not needed ifRuntimeiscustomTarFunctionCode(yes) string Source code package as a base64-encoded TAR archive. Not needed if RuntimeiscustomCustomImagestring If Runtimeiscustom: custom container image to use
http code content-type response comments 200application/json{ "Created": "function_name" }404text/plainInvalid runtime.Chosen Runtimedoes not exist409text/plainFunction already exists 503text/plainCreation failed
POST /update (registers a new function or updates one)
See /create above. The only difference is that /update does not return any
error if a function with the same name already exists.
POST /delete (deletes an existing function)
name required type description Nameyes string Name of the function
http code content-type response comments 200application/json{ "Deleted": "function_name" }404text/plainUnknown function.The function does not exist 503text/plainCreation failed
POST /invoke/ (invokes function <func>)
name required type description Paramsyes dict Key-value specification of invocation parameters CanDoOffloadingbool Whether the request can be offloaded (default: true) Asyncbool Whether the invocation is asynchronous (default: false) QoSClassint ID of the QoS class for the request QoSMaxRespTfloat Desired max response time ReturnOutputbool Whether function std. output and error should be collected (if supported by the function runtime)
http code content-type response comments 200application/jsonSee below. 404text/plainFunction unknown.429text/plainNot served because of excessive load. 500text/plainInvocation failed.
An example response for a successful synchronous request:
{
"Success": true,
"Result": "{\"IsPrime\": false}",
"ResponseTime": 0.712851098,
"IsWarmStart": false,
"InitTime": 0.709491144,
"OffloadLatency": 0,
"Duration": 0.003351790000000021,
"SchedAction": ""
}
Result contains the object returned by the function upon completion.
The other fields provide lower-level information. For instance, Duration
reports the execution time of the function (in seconds), excluding all the
communication and initialization overheads. IsWarmStart indicates whether
a warm container has been used for the request.
An example response for a successful asynchronous request:
{
"ReqId": "isprime-98330239242748"
}
ReqId can be used later to poll the execution results.
GET /poll/ (polls the results of <reqId>)
<reqId> is the request identifier, as returned by /invoke.
http code content-type response comments 200application/jsonSee response to synchronous requests. 404text/plainResults not found. 500text/plainCould not retrieve results500text/plainFailed to connect to Global Registry
POST /prewarm (prewarms instances for a function)
name required type description Functionyes string Name of the function Instancesyes int Instances to spawn (0 to only pull the image) ForceImagePullbool Always check for image updates, even if a local copy exists
http code content-type response comments 200application/json{ "Prewarmed": N }The number of prewarmed instances is returned. It might be less than Instancesdue to resource shortage.404text/plainUnknown function.The function does not exist 503text/plainPrewarming failed
GET /status (get current status of the node)
None
http code content-type response comments 200application/jsonSee response example. 500text/plainCould not retrieve results
An example response for a successful request:
{
"Url": "http://192.168.1.23:1323",
"AvailableWarmContainers": {
"isprime": 1,
"sleepSec": 2
},
"AvailableMemMB": 3072,
"AvailableCPUs": 8,
"Coordinates": {
"Vec": [
0,
0,
0
],
"Error": 1.5,
"Height": 0.00001
},
"LoadAvg": [
1.34,
1.43,
0.94
]
}
AvailableMemMB and AvailableCPUs indicate the currently amount of memory
and CPUs (intended as vCPUs or fractions of them) that can be allocated to new
requests in the node. Coordinates.Vec reports the coordinates of this node
in the virtual coordinate space computed by Vivaldi algorithm.
GET /functions (get list of registered functions)
None
http code content-type response comments 200application/jsonList of names of existing functions. 500text/plainCould not retrieve results
Note that functions are globally registered in the system. Therefore, the same list is returned by every node in the same cluster.