Skip to main content
paradime.admin.connections manages a workspace’s data warehouse connections. For the GraphQL operations, see Warehouse connections.
Prerequisites
  • These operations are part of the Enterprise plan. On other plans, they raise AdminPlanUpgradeRequiredException.
  • Your API key needs the Warehouse connections admin capability group. To read a connection’s environment, the key also needs Environment admin.
  • The admin client of the paradime-io package. See Admin client.
The examples on this page use this client:

Connection scopes

Every method takes a scope (ConnectionScope) that says who uses the connection: A connection is keyed by scope, environment and connection_id. Without a connection_id, the key uses default.
A DEVELOPMENT_SHARED connection holds only what the workspace shares, such as the Snowflake account and the authentication method. Each user enters their own credentials and schema in their IDE onboarding. The API refuses per-user fields with AdminValidationFailedException. See Per-user fields.

List connections

Iterates over the workspace’s warehouse connections, ordered by environment slug and connection id. Secrets show only as set or not set.
Optional[ConnectionScope]
default:"None"
Only connections of this scope.
Optional[str]
default:"None"
Only this environment’s connections.
Optional[str]
default:"None"
The workspace to read, for a company API key.
int
default:"100"
How many connections to read per request, at most 500.
Iterator[WarehouseConnection]
The connections, read one page at a time.

Test a connection

Opens a connection with these settings and saves nothing. Secrets you leave out come from the saved connection. A DEVELOPMENT_SHARED connection holds no user’s credentials, so the API refuses to test one.
ConnectionAdapter
required
The warehouse settings: one adapter’s input, such as SnowflakeConnectionInput, or a WarehouseAdapterInput. See Adapter inputs.
ConnectionScope
required
SCHEDULER, AGENT, DEVELOPMENT_SHARED or COST.
Optional[str]
default:"None"
The environment’s slug, for SCHEDULER and AGENT. Leave it out for DEVELOPMENT_SHARED and COST.
Optional[str]
default:"None"
The connection’s id in its environment. default when left out.
Optional[str]
default:"None"
A name for the connection.
Optional[str]
default:"None"
The dbtâ„¢ target name that runs see.
Optional[int]
default:"None"
How many threads dbtâ„¢ runs with.
Optional[str]
default:"None"
The workspace to use, for a company API key.
WarehouseConnectionTestResult
The warehouse type that the connection opened (type) and when (tested_at). A warehouse that refuses the connection raises AdminConnectionTestFailedException.

Create a connection

Tests a new connection, then saves it. A warehouse that refuses the connection raises AdminConnectionTestFailedException, and nothing is saved. Sending the same input again returns the stored connection and changes nothing. A connection that exists with other settings raises AdminConflictException: change it with update. Saving a connection redeploys the workspace’s Bolt schedules. A COST connection also starts Radar’s cost sync. A DEVELOPMENT_SHARED connection is saved without a test, and it rewrites every user’s dbt™ profile.
ConnectionAdapter
required
The warehouse settings. See Adapter inputs.
ConnectionScope
required
SCHEDULER, AGENT, DEVELOPMENT_SHARED or COST.
Optional[str]
default:"None"
The environment’s slug, for SCHEDULER and AGENT. Leave it out for DEVELOPMENT_SHARED and COST.
Optional[str]
default:"None"
The connection’s id. default when left out.
Optional[str]
default:"None"
The connection’s name. Required, except for COST, which doesn’t use it.
Optional[str]
default:"None"
The dbt™ target name. Required, except for COST, which doesn’t use it.
Optional[int]
default:"None"
How many threads dbt™ runs with. Required for SCHEDULER and AGENT. COST and DEVELOPMENT_SHARED don’t use it.
Optional[str]
default:"None"
The workspace to change, for a company API key.
WarehouseConnection
The new connection, or the identical one that was stored.
To set the shared part of the Code IDE connection, send only workspace-level fields:

Update a connection

Tests a connection’s new settings, then saves them. adapter replaces the warehouse settings. A secret, name, target_name or threads that you leave out keeps its stored value. Sending the same input again changes nothing. A connection that doesn’t exist raises AdminNotFoundException. A warehouse that refuses the connection raises AdminConnectionTestFailedException, and the stored connection stays. Takes the same arguments as create.
WarehouseConnection
The updated connection.

Delete a connection

Deletes a connection. Deleting it again is not an error. An environment’s default connection can’t be deleted while the environment has other connections.
ConnectionScope
required
SCHEDULER, AGENT, DEVELOPMENT_SHARED or COST.
Optional[str]
default:"None"
The environment’s slug, for SCHEDULER and AGENT.
Optional[str]
default:"None"
The connection’s id. default when left out.
Optional[str]
default:"None"
The workspace to change, for a company API key.
str
The id of the deleted connection.

Set the default connection

Makes a connection its environment’s default.
str
required
The connection’s id in its environment.
ConnectionScope
required
SCHEDULER, AGENT, DEVELOPMENT_SHARED or COST.
Optional[str]
default:"None"
The environment’s slug, for SCHEDULER and AGENT.
Optional[str]
default:"None"
The workspace to change, for a company API key.
WarehouseConnection
The connection, now the default.

Adapter inputs

Pass one adapter’s input, or a WarehouseAdapterInput with exactly one adapter set. Import them from paradime.apis.admin.connections.types. Every field is optional in Python; the API says which ones a connection needs. Text fields take strings only, so pass a port as "5439", not 5439. schema_name is sent to the API as schema. ProfileConnectionInput sets up a warehouse from a dbt™ profile; the API accepts it only for the four warehouse types above.

Per-user fields

A DEVELOPMENT_SHARED connection refuses these fields, because each user sets them in their own IDE onboarding:

Types

model
model