Ir al contenido
v2.7

Functions

Functions: crear, desplegar, ejecutar y seguir las ejecuciones.

Functions: crear, desplegar, ejecutar y seguir las ejecuciones.

Clase Functions: 24 métodos (3 en @owbase/web, 24 en @owbase/node). Las descripciones de los métodos están en inglés. Los ejemplos usan la forma de objeto de los parámetros; cambia los valores entre < y > por los tuyos.

Listar functions

GET /functions · página del método

SDK: solo @owbase/node

Get a list of all the project’s functions. You can use the query params to filter your results.

Parámetro Tipo Obligatorio Descripción
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
search string no Search term to filter your list results. Max length: 256 chars.
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Acceso: clave de API con el alcance functions.read.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.list({
queries: [], // optional
search: '<SEARCH>', // optional
total: false, // optional
});

Crear function

POST /functions · página del método

SDK: solo @owbase/node

Create a new function. You can pass a list of permissions to allow different project users or team with access to execute the function using the client API.

El despliegue es solo por subida: los parámetros de repositorio Git quedan fuera (consulta Empaquetar y subir el código).

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars.
name string sí Function name. Max length: 128 chars.
runtime Runtime sí Execution runtime. Valores: node-22 (solo Node 22 en Owbase).
execute string[] no An array of role strings with execution permissions. By default no user is granted with any execute permissions. learn more about roles. Maximum of 100 roles are allowed, each 64 characters long.
events string[] no Events list. Maximum of 100 events are allowed.
schedule string no Schedule CRON syntax. Cannot be combined with interval.
timeout number no Function maximum execution time in seconds.
enabled boolean no Is function enabled? When set to ‘disabled’, users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
logging boolean no When disabled, executions will exclude logs and errors, and will be slightly faster.
entrypoint string no Entrypoint File. This path is relative to the “providerRootDirectory”.
commands string no Build Commands.
scopes ProjectKeyScopes[] no List of scopes allowed for API key auto-generated for every execution. Maximum of 200 scopes are allowed. Valores: project.read, project.write, usage.read, keys.read, keys.write, platforms.read, platforms.write, mocks.read, mocks.write, policies.read, policies.write, project.policies.read, project.policies.write, project.oauth2.read, project.oauth2.write, templates.read, templates.write, stages.read, stages.write, users.read, users.write, sessions.read, sessions.write, teams.read, teams.write, databases.read, databases.write, tables.read, tables.write, columns.read, columns.write, indexes.read, indexes.write, rows.read, rows.write, embeddings.write, collections.read, collections.write, attributes.read, attributes.write, documents.read, documents.write, documentsdb.read, documentsdb.write, documentsdb.collections.read, documentsdb.collections.write, documentsdb.documents.read, documentsdb.documents.write, documentsdb.indexes.read, documentsdb.indexes.write, vectorsdb.read, vectorsdb.write, vectorsdb.collections.read, vectorsdb.collections.write, vectorsdb.documents.read, vectorsdb.documents.write, vectorsdb.indexes.read, vectorsdb.indexes.write, buckets.read, buckets.write, files.read, files.write, tokens.read, tokens.write, functions.read, functions.write, executions.read, executions.write, execution.read, execution.write, sites.read, sites.write, log.read, log.write, providers.read, providers.write, topics.read, topics.write, subscribers.read, subscribers.write, targets.read, targets.write, messages.read, messages.write, rules.read, rules.write, webhooks.read, webhooks.write, monitors.read, monitors.write, alerts.read, locale.read, avatars.read, avatars.write, health.read, assistant.read, migrations.read, migrations.write, schedules.read, schedules.write, vcs.read, vcs.write, insights.read, insights.write, reports.read, reports.write, reviews.read, reviews.write, presences.read, presences.write.
buildSpecification string no Build specification for the function deployments.
runtimeSpecification string no Runtime specification for the function executions.
deploymentRetention number no Days to keep non-active deployments before deletion. Value 0 keeps all deployments unless the server applies a default retention.
interval number no Minutes between scheduled executions. Owbase picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule.
description string no Optional description for the function.

Acceso: clave de API con el alcance functions.write.

@owbase/node
import { Client, Functions, Runtime, ProjectKeyScopes } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.create({
functionId: '<FUNCTION_ID>',
name: '<NAME>',
runtime: Runtime.Node22,
execute: ['any'], // optional
events: [], // optional
schedule: '0 0 * * *', // optional
timeout: 1, // optional
enabled: false, // optional
logging: false, // optional
entrypoint: '<ENTRYPOINT>', // optional
commands: '<COMMANDS>', // optional
scopes: [ProjectKeyScopes.ProjectRead], // optional
buildSpecification: 's-1vcpu-512mb', // optional
runtimeSpecification: 's-1vcpu-512mb', // optional
deploymentRetention: 0, // optional
interval: 0, // optional
description: '<DESCRIPTION>', // optional
});

Listar runtimes

GET /functions/runtimes · página del método

SDK: solo @owbase/node

Get a list of all runtimes that are currently active on your instance.

Parámetro Tipo Obligatorio Descripción
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Acceso: clave de API sin alcance específico.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.listRuntimes({
total: false, // optional
});

Listar especificaciones

GET /functions/specifications · página del método

SDK: solo @owbase/node

List allowed function specifications for this instance.

Parámetro Tipo Obligatorio Descripción
type string no Specification type to list. Can be one of: runtimes, builds. Defaults to runtimes.
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Acceso: clave de API con el alcance functions.read.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.listSpecifications({
type: 'runtimes', // optional
total: false, // optional
});

Obtener function

GET /functions/{functionId} · página del método

SDK: solo @owbase/node

Get a function by its unique ID.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID.

Acceso: clave de API con el alcance functions.read.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.get({
functionId: '<FUNCTION_ID>',
});

Actualizar function

PUT /functions/{functionId} · página del método

SDK: solo @owbase/node

Update function by its unique ID.

El despliegue es solo por subida: los parámetros de repositorio Git quedan fuera (consulta Empaquetar y subir el código).

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID.
name string sí Function name. Max length: 128 chars.
runtime Runtime no Execution runtime. Valores: node-22 (solo Node 22 en Owbase).
execute string[] no An array of role strings with execution permissions. By default no user is granted with any execute permissions. learn more about roles. Maximum of 100 roles are allowed, each 64 characters long.
events string[] no Events list. Maximum of 100 events are allowed.
schedule string no Schedule CRON syntax. Cannot be combined with interval.
timeout number no Maximum execution time in seconds.
enabled boolean no Is function enabled? When set to ‘disabled’, users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
logging boolean no When disabled, executions will exclude logs and errors, and will be slightly faster.
entrypoint string no Entrypoint File. This path is relative to the “providerRootDirectory”.
commands string no Build Commands.
scopes ProjectKeyScopes[] no List of scopes allowed for API Key auto-generated for every execution. Maximum of 200 scopes are allowed. Valores: project.read, project.write, usage.read, keys.read, keys.write, platforms.read, platforms.write, mocks.read, mocks.write, policies.read, policies.write, project.policies.read, project.policies.write, project.oauth2.read, project.oauth2.write, templates.read, templates.write, stages.read, stages.write, users.read, users.write, sessions.read, sessions.write, teams.read, teams.write, databases.read, databases.write, tables.read, tables.write, columns.read, columns.write, indexes.read, indexes.write, rows.read, rows.write, embeddings.write, collections.read, collections.write, attributes.read, attributes.write, documents.read, documents.write, documentsdb.read, documentsdb.write, documentsdb.collections.read, documentsdb.collections.write, documentsdb.documents.read, documentsdb.documents.write, documentsdb.indexes.read, documentsdb.indexes.write, vectorsdb.read, vectorsdb.write, vectorsdb.collections.read, vectorsdb.collections.write, vectorsdb.documents.read, vectorsdb.documents.write, vectorsdb.indexes.read, vectorsdb.indexes.write, buckets.read, buckets.write, files.read, files.write, tokens.read, tokens.write, functions.read, functions.write, executions.read, executions.write, execution.read, execution.write, sites.read, sites.write, log.read, log.write, providers.read, providers.write, topics.read, topics.write, subscribers.read, subscribers.write, targets.read, targets.write, messages.read, messages.write, rules.read, rules.write, webhooks.read, webhooks.write, monitors.read, monitors.write, alerts.read, locale.read, avatars.read, avatars.write, health.read, assistant.read, migrations.read, migrations.write, schedules.read, schedules.write, vcs.read, vcs.write, insights.read, insights.write, reports.read, reports.write, reviews.read, reviews.write, presences.read, presences.write.
buildSpecification string no Build specification for the function deployments.
runtimeSpecification string no Runtime specification for the function executions.
deploymentRetention number no Days to keep non-active deployments before deletion. Value 0 keeps all deployments unless the server applies a default retention.
interval number no Minutes between scheduled executions. Owbase picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule. When omitted, the current interval is kept unless schedule is set.
description string no Optional description for the function.

Acceso: clave de API con el alcance functions.write.

@owbase/node
import { Client, Functions, Runtime, ProjectKeyScopes } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.update({
functionId: '<FUNCTION_ID>',
name: '<NAME>',
runtime: Runtime.Node22, // optional
execute: ['any'], // optional
events: [], // optional
schedule: '0 0 * * *', // optional
timeout: 1, // optional
enabled: false, // optional
logging: false, // optional
entrypoint: '<ENTRYPOINT>', // optional
commands: '<COMMANDS>', // optional
scopes: [ProjectKeyScopes.ProjectRead], // optional
buildSpecification: 's-1vcpu-512mb', // optional
runtimeSpecification: 's-1vcpu-512mb', // optional
deploymentRetention: 0, // optional
interval: 0, // optional
description: '<DESCRIPTION>', // optional
});

Eliminar function

DELETE /functions/{functionId} · página del método

SDK: solo @owbase/node

Delete a function by its unique ID.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID.

Acceso: clave de API con el alcance functions.write.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.delete({
functionId: '<FUNCTION_ID>',
});

Actualizar despliegue de la function

PATCH /functions/{functionId}/deployment · página del método

SDK: solo @owbase/node

Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID.
deploymentId string sí Deployment ID.

Acceso: clave de API con el alcance functions.write.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.updateFunctionDeployment({
functionId: '<FUNCTION_ID>',
deploymentId: '<DEPLOYMENT_ID>',
});

Listar despliegues

GET /functions/{functionId}/deployments · página del método

SDK: solo @owbase/node

Get a list of all the function’s code deployments. You can use the query params to filter your results.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID.
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
search string no Search term to filter your list results. Max length: 256 chars.
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Acceso: clave de API con el alcance functions.read.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.listDeployments({
functionId: '<FUNCTION_ID>',
queries: [], // optional
search: '<SEARCH>', // optional
total: false, // optional
});

Crear despliegue

POST /functions/{functionId}/deployments · página del método

SDK: solo @owbase/node

Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you’ll need to update the function’s deployment to use your new deployment UID.

This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the Owbase Cloud Functions tutorial.

Use the “command” param to set the entrypoint used to execute your code.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID.
code File (en node, también InputFile) sí Gzip file with your code package. When used with the Owbase CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
activate boolean sí Automatically activate the deployment when it is finished building.
entrypoint string no Entrypoint File.
commands string no Build Commands.
onProgress (progress: UploadProgress) => void no Callback called after each uploaded chunk with the upload progress ($id, progress in percent, sizeUploaded, chunksTotal, chunksUploaded).

Acceso: clave de API con el alcance functions.write.

@owbase/node
import { Client, Functions } from '@owbase/node';
import { InputFile } from '@owbase/node/file';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.createDeployment({
functionId: '<FUNCTION_ID>',
code: InputFile.fromPath('/path/to/file', 'filename'),
activate: false,
entrypoint: '<ENTRYPOINT>', // optional
commands: '<COMMANDS>', // optional
});

Crear despliegue duplicado

POST /functions/{functionId}/deployments/duplicate · página del método

SDK: solo @owbase/node

Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment’s code will be preserved and used for the new build.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID.
deploymentId string sí Deployment ID.
buildId string no Build unique ID.

Acceso: clave de API con el alcance functions.write.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.createDuplicateDeployment({
functionId: '<FUNCTION_ID>',
deploymentId: '<DEPLOYMENT_ID>',
buildId: '<BUILD_ID>', // optional
});

Obtener despliegue

GET /functions/{functionId}/deployments/{deploymentId} · página del método

SDK: solo @owbase/node

Get a function deployment by its unique ID.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID.
deploymentId string sí Deployment ID.

Acceso: clave de API con el alcance functions.read.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.getDeployment({
functionId: '<FUNCTION_ID>',
deploymentId: '<DEPLOYMENT_ID>',
});

Eliminar despliegue

DELETE /functions/{functionId}/deployments/{deploymentId} · página del método

SDK: solo @owbase/node

Delete a code deployment by its unique ID.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID.
deploymentId string sí Deployment ID.

Acceso: clave de API con el alcance functions.write.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.deleteDeployment({
functionId: '<FUNCTION_ID>',
deploymentId: '<DEPLOYMENT_ID>',
});

Obtener descarga del despliegue

GET /functions/{functionId}/deployments/{deploymentId}/download · página del método

SDK: solo @owbase/node

Get a function deployment content by its unique ID. The endpoint response return with a ‘Content-Disposition: attachment’ header that tells the browser to start downloading the file to user downloads directory.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID.
deploymentId string sí Deployment ID.
type DeploymentDownloadType no Deployment file to download. Can be: “source”, “output”. Valores: source, output.
token string no Presigned source-download token for accessing this deployment without a session (jobs-service).

Acceso: clave de API con el alcance functions.read o sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/node
import { Client, Functions, DeploymentDownloadType } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.getDeploymentDownload({
functionId: '<FUNCTION_ID>',
deploymentId: '<DEPLOYMENT_ID>',
type: DeploymentDownloadType.Source, // optional
token: '<TOKEN>', // optional
});

Actualizar estado del despliegue

PATCH /functions/{functionId}/deployments/{deploymentId}/status · página del método

SDK: solo @owbase/node

Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn’t started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status ‘ready’) or failed. The response includes the final build status and details.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID.
deploymentId string sí Deployment ID.

Acceso: clave de API con el alcance functions.write.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.updateDeploymentStatus({
functionId: '<FUNCTION_ID>',
deploymentId: '<DEPLOYMENT_ID>',
});

Listar ejecuciones

GET /functions/{functionId}/executions · página del método

SDK: @owbase/web y @owbase/node

Get a list of all the current user function execution logs. You can use the query params to filter your results.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID.
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Acceso: clave de API con el alcance executions.read (también acepta execution.read) o sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Functions } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const functions = new Functions(client);
const result = await functions.listExecutions({
functionId: '<FUNCTION_ID>',
queries: [], // optional
total: false, // optional
});
console.log(result);
@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const functions = new Functions(client);
const result = await functions.listExecutions({
functionId: '<FUNCTION_ID>',
queries: [], // optional
total: false, // optional
});

Crear ejecución

POST /functions/{functionId}/executions · página del método

SDK: @owbase/web y @owbase/node

Trigger a function execution. The returned object will return you the current execution status. You can ping the Get Execution endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID.
body string no HTTP body of execution. Default value is empty string.
async boolean no Execute code in the background. Default value is false.
xpath string no HTTP path of execution. Path can include query params. Default value is /
method ExecutionMethod no HTTP method of execution. Default value is POST. Valores: GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD.
headers object no HTTP headers of execution. Defaults to empty.
scheduledAt string no Scheduled execution time in ISO 8601 format. DateTime value must be in future with precision in minutes.

Acceso: clave de API con el alcance executions.write (también acepta execution.write) o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Functions, ExecutionMethod } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const functions = new Functions(client);
const result = await functions.createExecution({
functionId: '<FUNCTION_ID>',
body: '<BODY>', // optional
async: false, // optional
xpath: '<PATH>', // optional
method: ExecutionMethod.GET, // optional
headers: {}, // optional
scheduledAt: '<SCHEDULED_AT>', // optional
});
console.log(result);
@owbase/node
import { Client, Functions, ExecutionMethod } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const functions = new Functions(client);
const result = await functions.createExecution({
functionId: '<FUNCTION_ID>',
body: '<BODY>', // optional
async: false, // optional
xpath: '<PATH>', // optional
method: ExecutionMethod.GET, // optional
headers: {}, // optional
scheduledAt: '<SCHEDULED_AT>', // optional
});

Obtener ejecución

GET /functions/{functionId}/executions/{executionId} · página del método

SDK: @owbase/web y @owbase/node

Get a function execution log by its unique ID.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID.
executionId string sí Execution ID.

Acceso: clave de API con el alcance executions.read (también acepta execution.read) o sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Functions } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const functions = new Functions(client);
const result = await functions.getExecution({
functionId: '<FUNCTION_ID>',
executionId: '<EXECUTION_ID>',
});
console.log(result);
@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const functions = new Functions(client);
const result = await functions.getExecution({
functionId: '<FUNCTION_ID>',
executionId: '<EXECUTION_ID>',
});

Eliminar ejecución

DELETE /functions/{functionId}/executions/{executionId} · página del método

SDK: solo @owbase/node

Delete a function execution by its unique ID.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function ID.
executionId string sí Execution ID.

Acceso: clave de API con el alcance executions.write (también acepta execution.write).

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.deleteExecution({
functionId: '<FUNCTION_ID>',
executionId: '<EXECUTION_ID>',
});

Listar variables

GET /functions/{functionId}/variables · página del método

SDK: solo @owbase/node

Get a list of all variables of a specific function.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function unique ID.
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Acceso: clave de API con el alcance functions.read.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.listVariables({
functionId: '<FUNCTION_ID>',
queries: [], // optional
total: false, // optional
});

Crear variable

POST /functions/{functionId}/variables · página del método

SDK: solo @owbase/node

Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function unique ID.
variableId string sí Variable ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars.
key string sí Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.
value string sí Variable value. Max length: 8192 chars.
secret boolean no Secret variables can be updated or deleted, but only functions can read them during build and runtime.
description string no Optional description for the variable.

Acceso: clave de API con el alcance functions.write.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.createVariable({
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>',
value: '<VALUE>',
secret: false, // optional
description: '<DESCRIPTION>', // optional
});

Obtener variable

GET /functions/{functionId}/variables/{variableId} · página del método

SDK: solo @owbase/node

Get a variable by its unique ID.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function unique ID.
variableId string sí Variable unique ID.

Acceso: clave de API con el alcance functions.read.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.getVariable({
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
});

Actualizar variable

PUT /functions/{functionId}/variables/{variableId} · página del método

SDK: solo @owbase/node

Update variable by its unique ID.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function unique ID.
variableId string sí Variable unique ID.
key string no Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars.
value string no Variable value. Max length: 8192 chars.
secret boolean no Secret variables can be updated or deleted, but only functions can read them during build and runtime.
description string no Optional description for the variable.

Acceso: clave de API con el alcance functions.write.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.updateVariable({
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>', // optional
value: '<VALUE>', // optional
secret: false, // optional
description: '<DESCRIPTION>', // optional
});

Eliminar variable

DELETE /functions/{functionId}/variables/{variableId} · página del método

SDK: solo @owbase/node

Delete a variable by its unique ID.

Parámetro Tipo Obligatorio Descripción
functionId string sí Function unique ID.
variableId string sí Variable unique ID.

Acceso: clave de API con el alcance functions.write.

@owbase/node
import { Client, Functions } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const functions = new Functions(client);
const result = await functions.deleteVariable({
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
});

Las descripciones de esta página vienen de la especificación de la API del servidor (licencia BSD-3-Clause), en inglés, y los ejemplos vienen del generador de SDKs (licencia MIT). Los avisos completos están en el archivo NOTICE de los paquetes @owbase/web y @owbase/node.

¿Te ayudó esta página?