(logDrains)
- getIntegrationLogDrains - Retrieves a list of Integration log drains
- createLogDrain - Creates a new Integration Log Drain
- deleteIntegrationLogDrain - Deletes the Integration log drain with the provided
id
- getConfigurableLogDrain - Retrieves a Configurable Log Drain
- deleteConfigurableLogDrain - Deletes a Configurable Log Drain
- getAllLogDrains - Retrieves a list of all the Log Drains
- createConfigurableLogDrain - Creates a Configurable Log Drain
Retrieves a list of all Integration log drains that are defined for the authenticated user or team. When using an OAuth2 token, the list is limited to log drains created by the authenticated integration.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.logDrains.getIntegrationLogDrains({});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { logDrainsGetIntegrationLogDrains } from "@vercel/sdk/funcs/logDrainsGetIntegrationLogDrains.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await logDrainsGetIntegrationLogDrains(vercel, {});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.GetIntegrationLogDrainsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.GetIntegrationLogDrainsResponseBody[]>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.SDKError | 4XX, 5XX | */* |
Creates an Integration log drain. This endpoint must be called with an OAuth2 client (integration), since log drains are tied to integrations. If it is called with a different token type it will produce a 400 error.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.logDrains.createLogDrain({
requestBody: {
name: "My first log drain",
secret: "a1Xsfd325fXcs",
deliveryFormat: "json",
url: "https://example.com/log-drain",
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { logDrainsCreateLogDrain } from "@vercel/sdk/funcs/logDrainsCreateLogDrain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await logDrainsCreateLogDrain(vercel, {
requestBody: {
name: "My first log drain",
secret: "a1Xsfd325fXcs",
deliveryFormat: "json",
url: "https://example.com/log-drain",
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.CreateLogDrainRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.CreateLogDrainResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.SDKError | 4XX, 5XX | */* |
Deletes the Integration log drain with the provided id
. When using an OAuth2 Token, the log drain can be deleted only if the integration owns it.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await vercel.logDrains.deleteIntegrationLogDrain({
id: "<id>",
});
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { logDrainsDeleteIntegrationLogDrain } from "@vercel/sdk/funcs/logDrainsDeleteIntegrationLogDrain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await logDrainsDeleteIntegrationLogDrain(vercel, {
id: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.DeleteIntegrationLogDrainRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<void>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Retrieves a Configurable Log Drain. This endpoint must be called with a team AccessToken (integration OAuth2 clients are not allowed). Only log drains owned by the authenticated team can be accessed.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.logDrains.getConfigurableLogDrain({
id: "<id>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { logDrainsGetConfigurableLogDrain } from "@vercel/sdk/funcs/logDrainsGetConfigurableLogDrain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await logDrainsGetConfigurableLogDrain(vercel, {
id: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.GetConfigurableLogDrainRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.GetConfigurableLogDrainResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Deletes a Configurable Log Drain. This endpoint must be called with a team AccessToken (integration OAuth2 clients are not allowed). Only log drains owned by the authenticated team can be deleted.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await vercel.logDrains.deleteConfigurableLogDrain({
id: "<id>",
});
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { logDrainsDeleteConfigurableLogDrain } from "@vercel/sdk/funcs/logDrainsDeleteConfigurableLogDrain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await logDrainsDeleteConfigurableLogDrain(vercel, {
id: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.DeleteConfigurableLogDrainRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<void>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Retrieves a list of all the Log Drains owned by the account. This endpoint must be called with an account AccessToken (integration OAuth2 clients are not allowed). Only log drains owned by the authenticated account can be accessed.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.logDrains.getAllLogDrains({});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { logDrainsGetAllLogDrains } from "@vercel/sdk/funcs/logDrainsGetAllLogDrains.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await logDrainsGetAllLogDrains(vercel, {});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.GetAllLogDrainsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.GetAllLogDrainsResponseBody[]>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.SDKError | 4XX, 5XX | */* |
Creates a configurable log drain. This endpoint must be called with a team AccessToken (integration OAuth2 clients are not allowed)
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.logDrains.createConfigurableLogDrain({
requestBody: {
deliveryFormat: "json",
url: "https://sugary-technician.name",
sources: [
"external",
],
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { logDrainsCreateConfigurableLogDrain } from "@vercel/sdk/funcs/logDrainsCreateConfigurableLogDrain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await logDrainsCreateConfigurableLogDrain(vercel, {
requestBody: {
deliveryFormat: "json",
url: "https://sugary-technician.name",
sources: [
"external",
],
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.CreateConfigurableLogDrainRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.CreateConfigurableLogDrainResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.SDKError | 4XX, 5XX | */* |