Modify Lambda

Updates supported fields on an existing lambda.

Authentication

Requires X-Glue-Authentication.

Path Parameters

Parameter Type Description
lambda_id string Lambda identifier

Request Body

Field Type Description
name string New lambda name
language string javascript, static-html, static-css, or static-js
code string New source code or static content
method string New HTTP method
path string New HTTP path

HTTP Request

 1PATCH /api/v0/lambdas/f1a2b3c4-d5e6-7890-abcd-ef0123456789 HTTP/1.1
 2Host: api.hola.cloud
 3X-Glue-Authentication: YOUR_TOKEN
 4Content-Type: application/json
 5
 6{
 7  "name": "hello-updated",
 8  "method": "POST",
 9  "path": "/hello-updated",
10  "code": "export default (req) => ({ body: { message: 'Updated lambda', data: req.body } })"
11}

Example

1curl -X PATCH "https://api.hola.cloud/api/v0/lambdas/f1a2b3c4-d5e6-7890-abcd-ef0123456789" \
2  -H "X-Glue-Authentication: YOUR_TOKEN" \
3  -H "Content-Type: application/json" \
4  -d '{
5    "name": "hello-updated",
6    "method": "POST",
7    "path": "/hello-updated",
8    "code": "export default (req) => ({ body: { message: \"Updated lambda\", data: req.body } })"
9  }'

Response

 1{
 2  "id": "f1a2b3c4-d5e6-7890-abcd-ef0123456789",
 3  "created_timestamp": 1751378400,
 4  "owner": "user_123",
 5  "project_id": "project_456",
 6  "name": "hello-updated",
 7  "language": "javascript",
 8  "code": "export default (req) => ({ body: { message: \"Updated lambda\", data: req.body } })",
 9  "method": "POST",
10  "path": "/hello-updated"
11}

Error Codes

Code Description
400 Invalid request body
401 Missing or invalid authentication
404 Lambda not found

Comments

Leave a comment