All URIs are relative to https://cloud.getdbt.com/api/v2
Method | HTTP request | Description |
---|---|---|
create_job | POST /accounts/{accountId}/jobs/ | create job on account |
delete_job_by_id | DELETE /accounts/{accountId}/jobs/{jobId}/ | delete job on account |
get_job_by_id | GET /accounts/{accountId}/jobs/{jobId}/ | get specific job on account |
list_jobs_for_account | GET /accounts/{accountId}/jobs/ | search or list jobs on an account |
trigger_run | POST /accounts/{accountId}/jobs/{jobId}/run/ | trigger run for job |
update_job_by_id | POST /accounts/{accountId}/jobs/{jobId}/ | update job on account |
JobResponse create_job(account_id, body=body)
create job on account
from __future__ import print_function
import time
import dbt_cloud_client
from dbt_cloud_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = dbt_cloud_client.JobsApi(dbt_cloud_client.ApiClient(configuration))
account_id = 56 # int | Numeric ID of the account to create the new Job in
body = dbt_cloud_client.Job() # Job | (optional)
try:
# create job on account
api_response = api_instance.create_job(account_id, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling JobsApi->create_job: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
account_id | int | Numeric ID of the account to create the new Job in | |
body | Job | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
JobResponse delete_job_by_id(account_id, job_id)
delete job on account
from __future__ import print_function
import time
import dbt_cloud_client
from dbt_cloud_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = dbt_cloud_client.JobsApi(dbt_cloud_client.ApiClient(configuration))
account_id = 56 # int | Numeric ID of the Account that the Job belongs to
job_id = 56 # int | Numeric ID of the Job to delete
try:
# delete job on account
api_response = api_instance.delete_job_by_id(account_id, job_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling JobsApi->delete_job_by_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
account_id | int | Numeric ID of the Account that the Job belongs to | |
job_id | int | Numeric ID of the Job to delete |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
JobResponse get_job_by_id(account_id, job_id, order_by=order_by)
get specific job on account
from __future__ import print_function
import time
import dbt_cloud_client
from dbt_cloud_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = dbt_cloud_client.JobsApi(dbt_cloud_client.ApiClient(configuration))
account_id = 56 # int | Numeric ID of the account to retrieve
job_id = 56 # int | Numeric ID of the run to retrieve
order_by = 'order_by_example' # str | Field to order the result by. Use `-` to indicate reverse order. (optional)
try:
# get specific job on account
api_response = api_instance.get_job_by_id(account_id, job_id, order_by=order_by)
pprint(api_response)
except ApiException as e:
print("Exception when calling JobsApi->get_job_by_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
account_id | int | Numeric ID of the account to retrieve | |
job_id | int | Numeric ID of the run to retrieve | |
order_by | str | Field to order the result by. Use `-` to indicate reverse order. | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
JobsResponse list_jobs_for_account(account_id, order_by=order_by)
search or list jobs on an account
from __future__ import print_function
import time
import dbt_cloud_client
from dbt_cloud_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = dbt_cloud_client.JobsApi(dbt_cloud_client.ApiClient(configuration))
account_id = 56 # int | Numeric ID of the account to retrieve
order_by = 'order_by_example' # str | Field to order the result by. Use `-` to indicate reverse order. (optional)
try:
# search or list jobs on an account
api_response = api_instance.list_jobs_for_account(account_id, order_by=order_by)
pprint(api_response)
except ApiException as e:
print("Exception when calling JobsApi->list_jobs_for_account: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
account_id | int | Numeric ID of the account to retrieve | |
order_by | str | Field to order the result by. Use `-` to indicate reverse order. | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RunResponse trigger_run(account_id, job_id, body=body)
trigger run for job
from __future__ import print_function
import time
import dbt_cloud_client
from dbt_cloud_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = dbt_cloud_client.JobsApi(dbt_cloud_client.ApiClient(configuration))
account_id = 56 # int | Numeric ID of the Account that the Job belongs to
job_id = 56 # int | Numeric ID of the Job for which to trigger a run
body = dbt_cloud_client.Body3() # Body3 | (optional)
try:
# trigger run for job
api_response = api_instance.trigger_run(account_id, job_id, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling JobsApi->trigger_run: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
account_id | int | Numeric ID of the Account that the Job belongs to | |
job_id | int | Numeric ID of the Job for which to trigger a run | |
body | Body3 | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
JobResponse update_job_by_id(account_id, job_id, body=body)
update job on account
from __future__ import print_function
import time
import dbt_cloud_client
from dbt_cloud_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = dbt_cloud_client.JobsApi(dbt_cloud_client.ApiClient(configuration))
account_id = 56 # int | Numeric ID of the Account that the Job belongs to
job_id = 56 # int | Numeric ID of the Job to update
body = dbt_cloud_client.Job() # Job | (optional)
try:
# update job on account
api_response = api_instance.update_job_by_id(account_id, job_id, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling JobsApi->update_job_by_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
account_id | int | Numeric ID of the Account that the Job belongs to | |
job_id | int | Numeric ID of the Job to update | |
body | Job | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]