Skip to main content

prefect_dbt.cloud.credentials

Module containing credentials for interacting with dbt Cloud

Classes

DbtCloudCredentials

Credentials block for credential use across dbt Cloud tasks and flows. Attributes:
  • api_key: API key to authenticate with the dbt Cloud administrative API. Refer to the Authentication docs for retrieving the API key.
  • account_id: ID of dbt Cloud account with which to interact.
  • domain: Domain at which the dbt Cloud API is hosted.
Examples: Load stored dbt Cloud credentials:
Use DbtCloudCredentials instance to trigger a job run:
Load saved dbt Cloud credentials within a flow:
Methods:

get_administrative_client

Returns a newly instantiated client for working with the dbt Cloud administrative API. Returns:
  • An authenticated dbt Cloud administrative API client.

get_client

Returns a newly instantiated client for working with the dbt Cloud API. Args:
  • client_type: Type of client to return. Accepts either ‘administrative’ or ‘metadata’.
Returns:
  • The authenticated client of the requested type.

get_metadata_client

Returns a newly instantiated client for working with the dbt Cloud metadata API. Returns:
  • An authenticated dbt Cloud metadata API client.