prefect_dbt.cloud.clients
Module containing clients for interacting with the dbt Cloud API
Classes
DbtCloudAdministrativeClient
Client for interacting with the dbt cloud Administrative API.
Args:
api_key: API key to authenticate with the dbt Cloud administrative API.account_id: ID of dbt Cloud account with which to interact.domain: Domain at which the dbt Cloud API is hosted.
call_endpoint
path: The partial path for the request (e.g. /projects/). Will be appended onto the base URL as determined by the client configuration.http_method: HTTP method to call on the endpoint.params: Query parameters to include in the request.json: JSON serializable body to send in the request.
- The response from the dbt Cloud administrative API.
create_job
project_id: Numeric ID of the project for the job.environment_id: Numeric ID of the environment for the job.name: Name of the job.execute_steps: List of dbt commands to execute (e.g. [“dbt run”, “dbt test”]).**kwargs: Additional job configuration options (e.g. triggers, settings).
- The response from the dbt Cloud administrative API.
delete_job
job_id: Numeric ID of the job to delete.
- The response from the dbt Cloud administrative API.
get_job
job_id: Numeric ID of the job.order_by: Field to order the result by. Use - to indicate reverse order.
- The response from the dbt Cloud administrative API.
get_run
run_id: The ID of the run to get details for.include_related: List of related fields to pull with the run. Valid values are “trigger”, “job”, “debug_logs”, and “run_steps”. If “debug_logs” is not provided in a request, then the included debug logs will be truncated to the last 1,000 lines of the debug log output file.
- The response from the dbt Cloud administrative API.
get_run_artifact
run_id: The ID of the run to list run artifacts for.path: The relative path to the run artifact (e.g. manifest.json, catalog.json, run_results.json)step: The index of the step in the run to query for artifacts. The first step in the run has the index 1. If the step parameter is omitted, then this method will return the artifacts compiled for the last step in the run.
- The response from the dbt Cloud administrative API.
list_run_artifacts
run_id: The ID of the run to list run artifacts for.step: The index of the step in the run to query for artifacts. The first step in the run has the index 1. If the step parameter is omitted, then this method will return the artifacts compiled for the last step in the run.
- The response from the dbt Cloud administrative API.
trigger_job_run
job_id: The ID of the job to trigger.options: An optional TriggerJobRunOptions instance to specify overrides for the triggered job run.
- The response from the dbt Cloud administrative API.
DbtCloudMetadataClient
Client for interacting with the dbt cloud Administrative API.
Args:
api_key: API key to authenticate with the dbt Cloud administrative API.domain: Domain at which the dbt Cloud API is hosted.
query
query: The GraphQL query to run.variables: The values of any variables defined in the GraphQL query.operation_name: The name of the operation to run if multiple operations are defined in the provided query.
- The result of the GraphQL query.