Reglas de dominio para functions y sitios.
Clase Proxy: 8 métodos (0 en @owbase/web, 8 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.
listRules
Sección titulada «listRules»Listar reglas
GET /proxy/rules · página del método
SDK: solo @owbase/node
Get a list of all the proxy rules. 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: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch |
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 rules.read.
import { Client, Proxy } 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 proxy = new Proxy(client);
const result = await proxy.listRules({ queries: [], // optional total: false, // optional});createAPIRule
Sección titulada «createAPIRule»Crear regla de API
POST /proxy/rules/api · página del método
SDK: solo @owbase/node
Create a new proxy rule for serving Owbase’s API on custom domain.
Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
domain |
string |
sí | Domain name. |
Acceso: clave de API con el alcance rules.write.
import { Client, Proxy } 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 proxy = new Proxy(client);
const result = await proxy.createAPIRule({ domain: 'example.com',});createFunctionRule
Sección titulada «createFunctionRule»Crear regla de function
POST /proxy/rules/function · página del método
SDK: solo @owbase/node
Create a new proxy rule for executing Owbase Function on custom domain.
Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
domain |
string |
sí | Domain name. |
functionId |
string |
sí | ID of function to be executed. |
branch |
string |
no | Name of VCS branch to deploy changes automatically |
Acceso: clave de API con el alcance rules.write.
import { Client, Proxy } 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 proxy = new Proxy(client);
const result = await proxy.createFunctionRule({ domain: 'example.com', functionId: '<FUNCTION_ID>', branch: '<BRANCH>', // optional});createRedirectRule
Sección titulada «createRedirectRule»Crear regla de redirección
POST /proxy/rules/redirect · página del método
SDK: solo @owbase/node
Create a new proxy rule for to redirect from custom domain to another domain.
Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
domain |
string |
sí | Domain name. |
url |
string |
sí | Target URL of redirection |
statusCode |
StatusCode |
sí | Status code of redirection Valores: 301, 302, 307, 308. |
resourceId |
string |
sí | ID of parent resource. |
resourceType |
ProxyResourceType |
sí | Type of parent resource. Valores: site, function. |
Acceso: clave de API con el alcance rules.write.
import { Client, Proxy, StatusCode, ProxyResourceType } 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 proxy = new Proxy(client);
const result = await proxy.createRedirectRule({ domain: 'example.com', url: 'https://example.com', statusCode: StatusCode.MovedPermanently, resourceId: '<RESOURCE_ID>', resourceType: ProxyResourceType.Site,});createSiteRule
Sección titulada «createSiteRule»Crear regla de sitio
POST /proxy/rules/site · página del método
SDK: solo @owbase/node
Create a new proxy rule for serving Owbase Site on custom domain.
Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
domain |
string |
sí | Domain name. |
siteId |
string |
sí | ID of site to be executed. |
Acceso: clave de API con el alcance rules.write.
import { Client, Proxy } 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 proxy = new Proxy(client);
const result = await proxy.createSiteRule({ domain: 'mi-tienda.sites.owbase.dev', siteId: '<SITE_ID>',});getRule
Sección titulada «getRule»Obtener regla
GET /proxy/rules/{ruleId} · página del método
SDK: solo @owbase/node
Get a proxy rule by its unique ID.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
ruleId |
string |
sí | Rule ID. |
Acceso: clave de API con el alcance rules.read.
import { Client, Proxy } 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 proxy = new Proxy(client);
const result = await proxy.getRule({ ruleId: '<RULE_ID>',});deleteRule
Sección titulada «deleteRule»Eliminar regla
DELETE /proxy/rules/{ruleId} · página del método
SDK: solo @owbase/node
Delete a proxy rule by its unique ID.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
ruleId |
string |
sí | Rule ID. |
Acceso: clave de API con el alcance rules.write.
import { Client, Proxy } 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 proxy = new Proxy(client);
const result = await proxy.deleteRule({ ruleId: '<RULE_ID>',});updateRuleStatus
Sección titulada «updateRuleStatus»Actualizar estado de la regla
PATCH /proxy/rules/{ruleId}/status · página del método
SDK: solo @owbase/node
If not succeeded yet, retry verification process of a proxy rule domain. This endpoint triggers domain verification by checking DNS records. If verification is successful, a TLS certificate will be automatically provisioned for the domain asynchronously in the background.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
ruleId |
string |
sí | Rule ID. |
Acceso: clave de API con el alcance rules.write.
import { Client, Proxy } 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 proxy = new Proxy(client);
const result = await proxy.updateRuleStatus({ ruleId: '<RULE_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.