curl --request POST \
--url https://api.quiva.ai/compute/functions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-function",
"description": "A serverless function",
"compute_asset": {
"collection_topic": "my-namespace",
"handler": "index.handler",
"assets": [
{
"asset_name": "index.js",
"asset_type": "file",
"asset_value": "Y29uc29sZS5sb2coIkhlbGxvLCBXb3JsZCEiKTsK",
"link": false
}
],
"timeout": 30000,
"read_only_fs": true
},
"monitor_config": {
"ttl": 604800000,
"store_payload": true
},
"schema": {
"input": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
},
"output": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
'{
"body": {
"description": "A serverless function",
"name": "my-function",
"runtime": "nodejs",
"subject": "ms.compute.my-namespace.function.123456789",
"type": "created",
"modified": 1714378974,
"compute_asset": {
"collection_topic": "my-namespace",
"service": "123456789",
"runtime": "nodejs",
"handler": "index.handler",
"timeout": 30000,
"read_only_fs": true
},
"monitor_config": {
"ttl": 604800000,
"store_payload": true
},
"schema": {
"input": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
},
"output": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}Creates a new serverless function
curl --request POST \
--url https://api.quiva.ai/compute/functions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-function",
"description": "A serverless function",
"compute_asset": {
"collection_topic": "my-namespace",
"handler": "index.handler",
"assets": [
{
"asset_name": "index.js",
"asset_type": "file",
"asset_value": "Y29uc29sZS5sb2coIkhlbGxvLCBXb3JsZCEiKTsK",
"link": false
}
],
"timeout": 30000,
"read_only_fs": true
},
"monitor_config": {
"ttl": 604800000,
"store_payload": true
},
"schema": {
"input": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
},
"output": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
'{
"body": {
"description": "A serverless function",
"name": "my-function",
"runtime": "nodejs",
"subject": "ms.compute.my-namespace.function.123456789",
"type": "created",
"modified": 1714378974,
"compute_asset": {
"collection_topic": "my-namespace",
"service": "123456789",
"runtime": "nodejs",
"handler": "index.handler",
"timeout": 30000,
"read_only_fs": true
},
"monitor_config": {
"ttl": 604800000,
"store_payload": true
},
"schema": {
"input": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
},
"output": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Function to create
Function created successfully
Show child attributes