integration_log_drains
Creates, updates, deletes, gets or lists an integration_log_drains resource.
Overview​
| Name | integration_log_drains |
| Type | Resource |
| Id | vercel.log_drains.integration_log_drains |
Fields​
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the log drain. Always prefixed with ld_ (example: ld_nBuA7zCID8g4QZ8g) |
name | string | The name of the log drain (example: My first log drain) |
client_id | string | The oauth2 client application id that created this log drain (example: oac_xRhY4LAB7yLhUADD69EvV7ct) (wire: clientId) |
configuration_id | string | The client configuration this log drain was created with (example: icfg_3bwCLgxL8qt5kjRLcv2Dit7F) (wire: configurationId) |
owner_id | string | The identifier of the team or user whose events will trigger the log drain (example: kr1PsOIzqEL5Xg6M4VZcZosf) (wire: ownerId) |
project_id | string | (example: AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb) (wire: projectId) |
branch | string | The branch regexp of log drain (example: feature/*) |
created_at | number | A timestamp that tells you when the log drain was created (wire: createdAt) |
created_from | string | Whether the log drain was created by an integration or by a user (integration, self-served) (example: integration) (wire: createdFrom) |
delivery_format | string | The delivery log format (json, ndjson, protobuf) (example: json) (wire: deliveryFormat) |
environments | array | The environment of log drain |
headers | object | The headers to send with the request (example: {"Authorization": "Bearer 123"}) |
project_ids | array | The identifier of the projects this log drain is associated with (example: AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb) (wire: projectIds) |
sampling_rate | number | The sampling rate of log drain (wire: samplingRate) |
source | | |
sources | array | The sources from which logs are currently being delivered to this log drain. |
url | string | The URL to call when logs are generated (example: https:​//example.com/log-drain) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | team_id, slug | 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. | |
create | insert | name, url | team_id, slug | 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. |
delete | delete | id | team_id, slug | 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. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the log drain to be deleted |
slug | string | The Team slug to perform the request on behalf of. |
team_id | string | The Team identifier to perform the request on behalf of. (wire: teamId) |
SELECT examples​
- list
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.
SELECT
id,
name,
client_id,
configuration_id,
owner_id,
project_id,
branch,
created_at,
created_from,
delivery_format,
environments,
headers,
project_ids,
sampling_rate,
source,
sources,
url
FROM vercel.log_drains.integration_log_drains
WHERE team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;
INSERT examples​
- create
- Manifest
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.
INSERT INTO vercel.log_drains.integration_log_drains (
name,
project_ids,
secret,
delivery_format,
url,
sources,
headers,
environments,
team_id,
slug
)
SELECT
'{{ name }}' /* required */,
'{{ project_ids }}',
'{{ secret }}',
'{{ delivery_format }}',
'{{ url }}' /* required */,
'{{ sources }}',
'{{ headers }}',
'{{ environments }}',
'{{ team_id }}',
'{{ slug }}'
RETURNING
id,
name,
client_id,
configuration_id,
owner_id,
project_id,
branch,
created_at,
created_from,
delivery_format,
environments,
headers,
project_ids,
sampling_rate,
source,
sources,
url
;
# Description fields are for documentation purposes
- name: integration_log_drains
props:
- name: name
value: "{{ name }}"
description: |
The name of the log drain
- name: project_ids
value:
- "{{ project_ids }}"
- name: secret
value: "{{ secret }}"
description: |
A secret to sign log drain notification headers so a consumer can verify their authenticity
- name: delivery_format
value: "{{ delivery_format }}"
description: |
The delivery log format
valid_values: ['json', 'ndjson']
- name: url
value: "{{ url }}"
description: |
The url where you will receive logs. The protocol must be `https://` or `http://` when type is `json` and `ndjson`.
- name: sources
value:
- "{{ sources }}"
- name: headers
value: "{{ headers }}"
description: |
Headers to be sent together with the request
- name: environments
value:
- "{{ environments }}"
- name: team_id
value: "{{ team_id }}"
description: The Team identifier to perform the request on behalf of.
description: The Team identifier to perform the request on behalf of.
- name: slug
value: "{{ slug }}"
description: The Team slug to perform the request on behalf of.
description: The Team slug to perform the request on behalf of.
DELETE examples​
- delete
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.
DELETE FROM vercel.log_drains.integration_log_drains
WHERE id = '{{ id }}' --required
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;