Skip to content
Coritan Docs

Organization API: Organization deployments: Drains

The 5 Organization API operations for drains.

View as Markdown

Part of Organization deployments.

GET /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/drains

The deployment's drains, oldest first, and limit: allowed (the plan's deploy_log_drains for the account, null when no plan limits it), used (drains on the account's deployments), plans_apply, deployment_used and deployment_max. A drain's url hides its query values; its secret is never shown again.

Name In Type Required
deployment_uuid path string (uuid) yes
org_slug path string yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

A drain that forwards the lines collected from now on

Section titled A drain that forwards the lines collected from now on

POST /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/drains

A drain that forwards the lines collected from now on. http: an https:// address that receives POSTs of NDJSON signed with X-Coritan-Signature: t=<unix>,v1=<hex HMAC-SHA256(secret, "<t>." + body)>; without secret one is generated and returned this once as secret. syslog: syslog+tls://host:port, RFC 5424 over TLS, with no secret. The address may not be private, reserved or the platform's own. 402 past deploy_log_drains; 409 past the per-deployment cap.

Name In Type Required
deployment_uuid path string (uuid) yes
org_slug path string yes

application/json (required)

Field Type Required Description
kind string yes http (HTTPS, signed) or syslog (over TLS)
url string yes https://... for http; syslog+tls://host:port for syslog
secret string or null no http only: the signing secret; left out, one is generated and shown once
filters DrainFilters or null no
filters.processes array of string no Process names (web, worker, ...); empty: every process
filters.environments array of string no production and/or preview; empty: both
enabled boolean no
Status Meaning
201 Success.
422 The request is not valid. detail lists each problem.

PATCH /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/drains/{drain_id}

Change what was sent: url (checked as on creation), enabled, filters, and for an http drain secret or rotate_secret (a generated secret, returned this once). A new address or a drain enabled again starts with no failures counted and no error.

Name In Type Required
deployment_uuid path string (uuid) yes
drain_id path integer yes
org_slug path string yes

application/json (required)

Field Type Required Description
url string or null no
enabled boolean or null no
filters DrainFilters or null no
filters.processes array of string no Process names (web, worker, ...); empty: every process
filters.environments array of string no production and/or preview; empty: both
secret string or null no http only: a new signing secret
rotate_secret boolean no http only: generate a new secret, shown once
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

Remove the drain; nothing more is sent to it

Section titled Remove the drain; nothing more is sent to it

DELETE /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/drains/{drain_id}

Remove the drain; nothing more is sent to it.

Name In Type Required
deployment_uuid path string (uuid) yes
drain_id path integer yes
org_slug path string yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

POST /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/drains/{drain_id}/test

Send one sample line now, shaped as the forwarded ones (test: true), and keep the outcome on the drain: delivered, status (the HTTP answer, when there was one), error. A disabled drain may be tested before it is enabled again.

Name In Type Required
deployment_uuid path string (uuid) yes
drain_id path integer yes
org_slug path string yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.