Modificar Lambda

Actualiza campos soportados de una lambda existente.

Autenticación

Requiere X-Glue-Authentication.

Parámetros de Path

Parámetro Tipo Descripción
lambda_id string Identificador de la lambda

Cuerpo de la Solicitud

Campo Tipo Descripción
name string Nuevo nombre de la lambda
language string javascript, static-html, static-css o static-js
code string Nuevo código fuente o contenido estático
method string Nuevo método HTTP
path string Nuevo path HTTP

Solicitud HTTP

 1PATCH /api/v0/lambdas/f1a2b3c4-d5e6-7890-abcd-ef0123456789 HTTP/1.1
 2Host: api.hola.cloud
 3X-Glue-Authentication: TU_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}

Ejemplo

1curl -X PATCH "https://api.hola.cloud/api/v0/lambdas/f1a2b3c4-d5e6-7890-abcd-ef0123456789" \
2  -H "X-Glue-Authentication: TU_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  }'

Respuesta

 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}

Códigos de Error

Código Descripción
400 Cuerpo de solicitud inválido
401 Autenticación faltante o inválida
404 Lambda no encontrada

Comentarios

Deja un comentario