Docs
/
/

Warehouses mAPI reference

Complete reference documentation for the Warehouses resource.

Warehouses

#

A warehouse is one database in your data warehouse that Knock reads from. Warehouses are shared by every environment.

You can list warehouses and retrieve one by its key. Add a warehouse and change its connection from the dashboard. Passwords and keys are never returned.

Get a warehouse

#

Retrieve a warehouse by its key.

Endpoint

GET/v1/warehouses/{warehouse_key}

Path parameters

warehouse_key
string

The key of the warehouse to retrieve.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

Returns

A warehouse is one database in your data warehouse that Knock reads from. Warehouses belong to the project and are shared by every environment.

connection_error
object(any)

The error from the last connection test, with a code and a message. Null when the last test passed.

connection_settings
object(any)

How Knock connects to the warehouse. The fields depend on the warehouse type, such as host, port, database, and username, or project_id, region, and service_account_email for BigQuery. Secrets are never returned: a Postgres warehouse has password_set and a Databricks warehouse has client_secret_set instead, true once Knock has the secret for the saved connection.

connection_status
enum(string)

The status of the warehouse's connection.

not_configuredkey_not_installedfailedconnectinguntestedconnected
created_at
string(date-time)

When the warehouse was created.

key
string

The unique key of the warehouse.

last_tested_at
string(date-time)

When the connection was last tested.

name
string

The name of the warehouse.

type
enum(string)

The type of data warehouse.

redshiftsnowflakepostgresbigquerydatabricks
updated_at
string(date-time)

When the warehouse was last updated.

List warehouses

#

Returns a paginated list of the project's warehouses. Warehouses are shared by every environment.

Endpoint

GET/v1/warehouses

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

limit
integer

The number of entries to fetch per-page.

Returns

PaginatedWarehouseResponse

A paginated list of Warehouse. Contains a list of entries and page information.

A list of entries.

connection_error
object(any)

The error from the last connection test, with a code and a message. Null when the last test passed.

connection_settings
object(any)

How Knock connects to the warehouse. The fields depend on the warehouse type, such as host, port, database, and username, or project_id, region, and service_account_email for BigQuery. Secrets are never returned: a Postgres warehouse has password_set and a Databricks warehouse has client_secret_set instead, true once Knock has the secret for the saved connection.

connection_status
enum(string)
Required

The status of the warehouse's connection.

not_configuredkey_not_installedfailedconnectinguntestedconnected
created_at
string(date-time)
Required

When the warehouse was created.

key
string
Required

The unique key of the warehouse.

last_tested_at
string(date-time)

When the connection was last tested.

name
string
Required

The name of the warehouse.

type
enum(string)
Required

The type of data warehouse.

redshiftsnowflakepostgresbigquerydatabricks
updated_at
string(date-time)
Required

When the warehouse was last updated.

page_info

The information about a paginated result.

after
string

The cursor to fetch entries after. Will only be present if there are more entries to fetch.

before
string

The cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page.

page_size
integer

The number of entries to fetch per-page.

Test a warehouse's connection

#

Tests the warehouse's connection now, such as after installing its public key in the warehouse. Returns the warehouse with the result in connection_status, connection_error, and last_tested_at. A Postgres or Databricks connection whose last save failed needs its secret again, so upsert it instead.

Endpoint

PUT/v1/warehouses/{warehouse_key}/test

Path parameters

warehouse_key
string

The key of the warehouse to test.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

Returns

WrappedWarehouseResponse

Wraps the Warehouse response under the warehouse key.

warehouse

A warehouse is one database in your data warehouse that Knock reads from. Warehouses belong to the project and are shared by every environment.

connection_error
object(any)

The error from the last connection test, with a code and a message. Null when the last test passed.

connection_settings
object(any)

How Knock connects to the warehouse. The fields depend on the warehouse type, such as host, port, database, and username, or project_id, region, and service_account_email for BigQuery. Secrets are never returned: a Postgres warehouse has password_set and a Databricks warehouse has client_secret_set instead, true once Knock has the secret for the saved connection.

connection_status
enum(string)

The status of the warehouse's connection.

not_configuredkey_not_installedfailedconnectinguntestedconnected
created_at
string(date-time)

When the warehouse was created.

key
string

The unique key of the warehouse.

last_tested_at
string(date-time)

When the connection was last tested.

name
string

The name of the warehouse.

type
enum(string)

The type of data warehouse.

redshiftsnowflakepostgresbigquerydatabricks
updated_at
string(date-time)

When the warehouse was last updated.

Archive a warehouse

#

Archives a warehouse and removes its connection, so its key can be used again. Refused while a sync in any environment uses the warehouse, so archive those syncs first. Archiving can't be undone.

Requires permission to manage extensions.

Endpoint

DELETE/v1/warehouses/{warehouse_key}

Path parameters

warehouse_key
string

The key of the warehouse to archive.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

Returns

ArchiveWarehouseResponse

The response from archiving a warehouse.

result
string

The result of the archive operation.

Upsert a warehouse

#

Creates a warehouse, or updates its name or connection if it exists. A warehouse belongs to the project and is shared by every environment. Its type can't change after it's created. Connection fields left out keep their current values.

A Postgres password or a Databricks client_secret is write-only: Knock passes it to the warehouse service and never stores or returns it. Send it again with any change to the connection. A save with a secret tests the connection before returning. Otherwise, the connection is tested in the background. Either way, check connection_status for the result, since a failed connection still saves.

Requires permission to manage extensions. On an account that restricts production changes, a warehouse a production sync reads from can't be changed through the API.

Endpoint

PUT/v1/warehouses/{warehouse_key}

Path parameters

warehouse_key
string

The key of the warehouse to upsert.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

Request body

warehouse
WarehouseRequest
Required

A warehouse payload for upsert. Fields left out keep their current values. name and type are required to create a warehouse, and type can't change after. A warehouse can be created without connection_settings and connected later.

connection_settings
object(any)

How Knock connects to the warehouse. The fields depend on the type. Redshift: host, port, database, username, cluster_identifier, region, and iam_role_arn, with optional ssh_tunnel_host, ssh_tunnel_port, ssh_tunnel_username, and ssh_public_key. Snowflake: host, port, database, username, and an optional public_key. Postgres: host, port, database, username, and password, with the same optional SSH tunnel fields as Redshift. BigQuery: project_id, region, and service_account_email. Databricks: host, port, http_path, catalog, client_id, and client_secret. Left out, Knock generates the Snowflake public_key, or the ssh_public_key for an SSH tunnel, and returns it for you to install. The password and client_secret are write-only, and needed again with any change to the connection. Fields left out keep their current values.

name
string

The name of the warehouse.

type
enum(string)

The type of data warehouse.

redshiftsnowflakepostgresbigquerydatabricks

Returns

WrappedWarehouseResponse

Wraps the Warehouse response under the warehouse key.

warehouse

A warehouse is one database in your data warehouse that Knock reads from. Warehouses belong to the project and are shared by every environment.

connection_error
object(any)

The error from the last connection test, with a code and a message. Null when the last test passed.

connection_settings
object(any)

How Knock connects to the warehouse. The fields depend on the warehouse type, such as host, port, database, and username, or project_id, region, and service_account_email for BigQuery. Secrets are never returned: a Postgres warehouse has password_set and a Databricks warehouse has client_secret_set instead, true once Knock has the secret for the saved connection.

connection_status
enum(string)

The status of the warehouse's connection.

not_configuredkey_not_installedfailedconnectinguntestedconnected
created_at
string(date-time)

When the warehouse was created.

key
string

The unique key of the warehouse.

last_tested_at
string(date-time)

When the connection was last tested.

name
string

The name of the warehouse.

type
enum(string)

The type of data warehouse.

redshiftsnowflakepostgresbigquerydatabricks
updated_at
string(date-time)

When the warehouse was last updated.

Warehouse

#

A warehouse is one database in your data warehouse that Knock reads from. Warehouses belong to the project and are shared by every environment.

Attributes

connection_error
object(any)

The error from the last connection test, with a code and a message. Null when the last test passed.

connection_settings
object(any)

How Knock connects to the warehouse. The fields depend on the warehouse type, such as host, port, database, and username, or project_id, region, and service_account_email for BigQuery. Secrets are never returned: a Postgres warehouse has password_set and a Databricks warehouse has client_secret_set instead, true once Knock has the secret for the saved connection.

connection_status
enum(string)

The status of the warehouse's connection.

not_configuredkey_not_installedfailedconnectinguntestedconnected
created_at
string(date-time)

When the warehouse was created.

key
string

The unique key of the warehouse.

last_tested_at
string(date-time)

When the connection was last tested.

name
string

The name of the warehouse.

type
enum(string)

The type of data warehouse.

redshiftsnowflakepostgresbigquerydatabricks
updated_at
string(date-time)

When the warehouse was last updated.

New chat