From 7c68c995c8b1557162cf6c5a0eba391224137845 Mon Sep 17 00:00:00 2001 From: Ly Nguyen Date: Thu, 25 Apr 2024 15:50:51 -0700 Subject: [PATCH 1/6] Fix access URLs for Disco API --- .../docs/dbt-cloud-apis/discovery-querying.md | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/website/docs/docs/dbt-cloud-apis/discovery-querying.md b/website/docs/docs/dbt-cloud-apis/discovery-querying.md index 43f421649bb..5ba82041283 100644 --- a/website/docs/docs/dbt-cloud-apis/discovery-querying.md +++ b/website/docs/docs/dbt-cloud-apis/discovery-querying.md @@ -23,24 +23,22 @@ Once you've created a token, you can use it in the Authorization header of reque 1. Create a [service account token](/docs/dbt-cloud-apis/service-tokens) to authorize requests. dbt Cloud Admin users can generate a _Metadata Only_ service token, which can be used to execute a specific query against the Discovery API to authorize requests. -2. Find your API URL using the endpoint `https://metadata.{YOUR_ACCESS_URL}/graphql`. - - * Replace `{YOUR_ACCESS_URL}` with the appropriate [Access URL](/docs/cloud/about-cloud/access-regions-ip-addresses) for your region and plan. For example, if your multi-tenant region is North America, your endpoint is `https://metadata.cloud.getdbt.com/graphql`. If your multi-tenant region is EMEA, your endpoint is `https://metadata.emea.dbt.com/graphql`. +2. Find the API URL to use from the [Discovery API endpoints](#discovery-api-endpoints) table. 3. For specific query points, refer to the [schema documentation](/docs/dbt-cloud-apis/discovery-schema-job). ## Run queries using HTTP requests -You can run queries by sending a `POST` request to the `https://metadata.YOUR_ACCESS_URL/graphql` endpoint, making sure to replace: -* `YOUR_ACCESS_URL` with the [appropriate Access URL](/docs/cloud/about-cloud/access-regions-ip-addresses) for your region and plan. +You can run queries by sending a `POST` request to the Discovery API, making sure to replace: +* `YOUR_API_URL` with the appropriate [Discovery API endpoint](#discovery-api-endpoints) for your region and plan. * `YOUR_TOKEN` in the Authorization header with your actual API token. Be sure to include the Token prefix. * `QUERY_BODY` with a GraphQL query, for example `{ "query": "" }` * `VARIABLES` with a dictionary of your GraphQL query variables, such as a job ID or a filter. * `ENDPOINT` with the endpoint you're querying, such as environment. ```shell - curl 'https://metadata.YOUR_ACCESS_URL/graphql' \ + curl 'YOUR_API_URL' \ -H 'authorization: Bearer YOUR_TOKEN' \ -H 'content-type: application/json' -X POST @@ -51,7 +49,7 @@ Python example: ```python response = requests.post( - 'YOUR_ACCESS_URL', + 'YOUR_API_URL', headers={"authorization": "Bearer "+YOUR_TOKEN, "content-type": "application/json"}, json={"query": QUERY_BODY, "variables": VARIABLES} ) @@ -64,6 +62,18 @@ Every query will require an environment ID or job ID. You can get the ID from a There are several illustrative example queries on this page. For more examples, refer to [Use cases and examples for the Discovery API](/docs/dbt-cloud-apis/discovery-use-cases-and-examples). +## Discovery API endpoints + +The following are the endpoints for accessing the Discovery API. Use the one that's appropriate for your region and plan. + +| Deployment type | Discovery API URL | +| --------------- | ------------------- | +| North America multi-tenant | https://metadata.cloud.getdbt.com/api/graphql | +| EMEA multi-tenant | https://metadata.emea.dbt.com/api/graphql | +| APAC multi-tenant | https://metatdata.au.dbt.com/api/graphql | +| Multi-cell | `https://YOUR_ACCOUNT_PREFIX.metadata.REGION.dbt.com/graphql`

Replace `YOUR_ACCOUNT_PREFIX` with your specific account identifier and `REGION` with your location, which could be `us1.dbt.com`. |
+| Single-tenant | `https://YOUR_ACCESS_URL.metadata/api/graphql`

Replace `YOUR_ACCESS_URL` with your specific account prefix with the appropriate [Access URL](/docs/cloud/about-cloud/access-regions-ip-addresses) for your region and plan.| + ## Reasonable use Discovery (GraphQL) API usage is subject to request rate and response size limits to maintain the performance and stability of the metadata platform and prevent abuse. From 62606aef219fa0b3d14933d7bd53198c3f5c8b3b Mon Sep 17 00:00:00 2001 From: Ly Nguyen <107218380+nghi-ly@users.noreply.github.com> Date: Thu, 25 Apr 2024 16:28:29 -0700 Subject: [PATCH 2/6] Update website/docs/docs/dbt-cloud-apis/discovery-querying.md Co-authored-by: Eddo W. Hintoso --- website/docs/docs/dbt-cloud-apis/discovery-querying.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/dbt-cloud-apis/discovery-querying.md b/website/docs/docs/dbt-cloud-apis/discovery-querying.md index 5ba82041283..3dfd2952cac 100644 --- a/website/docs/docs/dbt-cloud-apis/discovery-querying.md +++ b/website/docs/docs/dbt-cloud-apis/discovery-querying.md @@ -68,7 +68,7 @@ The following are the endpoints for accessing the Discovery API. Use the one tha | Deployment type | Discovery API URL | | --------------- | ------------------- | -| North America multi-tenant | https://metadata.cloud.getdbt.com/api/graphql | +| North America multi-tenant | https://metadata.cloud.getdbt.com/graphql | | EMEA multi-tenant | https://metadata.emea.dbt.com/api/graphql | | APAC multi-tenant | https://metatdata.au.dbt.com/api/graphql | | Multi-cell | `https://YOUR_ACCOUNT_PREFIX.metadata.REGION.dbt.com/graphql`

Replace `YOUR_ACCOUNT_PREFIX` with your specific account identifier and `REGION` with your location, which could be `us1.dbt.com`. |
From ac43fbb7a024df90d8d086c433f460f74ae95c98 Mon Sep 17 00:00:00 2001 From: Ly Nguyen <107218380+nghi-ly@users.noreply.github.com> Date: Thu, 25 Apr 2024 16:28:43 -0700 Subject: [PATCH 3/6] Update website/docs/docs/dbt-cloud-apis/discovery-querying.md Co-authored-by: Eddo W. Hintoso --- website/docs/docs/dbt-cloud-apis/discovery-querying.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/dbt-cloud-apis/discovery-querying.md b/website/docs/docs/dbt-cloud-apis/discovery-querying.md index 3dfd2952cac..9d8b324b5c8 100644 --- a/website/docs/docs/dbt-cloud-apis/discovery-querying.md +++ b/website/docs/docs/dbt-cloud-apis/discovery-querying.md @@ -69,7 +69,7 @@ The following are the endpoints for accessing the Discovery API. Use the one tha | Deployment type | Discovery API URL | | --------------- | ------------------- | | North America multi-tenant | https://metadata.cloud.getdbt.com/graphql | -| EMEA multi-tenant | https://metadata.emea.dbt.com/api/graphql | +| EMEA multi-tenant | https://metadata.emea.dbt.com/graphql | | APAC multi-tenant | https://metatdata.au.dbt.com/api/graphql | | Multi-cell | `https://YOUR_ACCOUNT_PREFIX.metadata.REGION.dbt.com/graphql`

Replace `YOUR_ACCOUNT_PREFIX` with your specific account identifier and `REGION` with your location, which could be `us1.dbt.com`. |
| Single-tenant | `https://YOUR_ACCESS_URL.metadata/api/graphql`

Replace `YOUR_ACCESS_URL` with your specific account prefix with the appropriate [Access URL](/docs/cloud/about-cloud/access-regions-ip-addresses) for your region and plan.| From 861b9cdd4348058837baca6c99ce49be744de1c0 Mon Sep 17 00:00:00 2001 From: Ly Nguyen <107218380+nghi-ly@users.noreply.github.com> Date: Thu, 25 Apr 2024 16:28:52 -0700 Subject: [PATCH 4/6] Update website/docs/docs/dbt-cloud-apis/discovery-querying.md Co-authored-by: Eddo W. Hintoso --- website/docs/docs/dbt-cloud-apis/discovery-querying.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/dbt-cloud-apis/discovery-querying.md b/website/docs/docs/dbt-cloud-apis/discovery-querying.md index 9d8b324b5c8..6111514cbc5 100644 --- a/website/docs/docs/dbt-cloud-apis/discovery-querying.md +++ b/website/docs/docs/dbt-cloud-apis/discovery-querying.md @@ -70,7 +70,7 @@ The following are the endpoints for accessing the Discovery API. Use the one tha | --------------- | ------------------- | | North America multi-tenant | https://metadata.cloud.getdbt.com/graphql | | EMEA multi-tenant | https://metadata.emea.dbt.com/graphql | -| APAC multi-tenant | https://metatdata.au.dbt.com/api/graphql | +| APAC multi-tenant | https://metadata.au.dbt.com/graphql | | Multi-cell | `https://YOUR_ACCOUNT_PREFIX.metadata.REGION.dbt.com/graphql`

Replace `YOUR_ACCOUNT_PREFIX` with your specific account identifier and `REGION` with your location, which could be `us1.dbt.com`. |
| Single-tenant | `https://YOUR_ACCESS_URL.metadata/api/graphql`

Replace `YOUR_ACCESS_URL` with your specific account prefix with the appropriate [Access URL](/docs/cloud/about-cloud/access-regions-ip-addresses) for your region and plan.| From 690f7c0015fc3764533fca5c264d3d73a6f702c9 Mon Sep 17 00:00:00 2001 From: Ly Nguyen <107218380+nghi-ly@users.noreply.github.com> Date: Thu, 25 Apr 2024 16:29:21 -0700 Subject: [PATCH 5/6] Update website/docs/docs/dbt-cloud-apis/discovery-querying.md Co-authored-by: Eddo W. Hintoso --- website/docs/docs/dbt-cloud-apis/discovery-querying.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/dbt-cloud-apis/discovery-querying.md b/website/docs/docs/dbt-cloud-apis/discovery-querying.md index 6111514cbc5..a599236a568 100644 --- a/website/docs/docs/dbt-cloud-apis/discovery-querying.md +++ b/website/docs/docs/dbt-cloud-apis/discovery-querying.md @@ -72,7 +72,7 @@ The following are the endpoints for accessing the Discovery API. Use the one tha | EMEA multi-tenant | https://metadata.emea.dbt.com/graphql | | APAC multi-tenant | https://metadata.au.dbt.com/graphql | | Multi-cell | `https://YOUR_ACCOUNT_PREFIX.metadata.REGION.dbt.com/graphql`

Replace `YOUR_ACCOUNT_PREFIX` with your specific account identifier and `REGION` with your location, which could be `us1.dbt.com`. |
-| Single-tenant | `https://YOUR_ACCESS_URL.metadata/api/graphql`

Replace `YOUR_ACCESS_URL` with your specific account prefix with the appropriate [Access URL](/docs/cloud/about-cloud/access-regions-ip-addresses) for your region and plan.| +| Single-tenant | `https://metadata.YOUR_ACCESS_URL/graphql`

Replace `YOUR_ACCESS_URL` with your specific account prefix with the appropriate [Access URL](/docs/cloud/about-cloud/access-regions-ip-addresses) for your region and plan.| ## Reasonable use From 7e16d49ca5d4b67393df0c21051f225dd9be19b2 Mon Sep 17 00:00:00 2001 From: Ly Nguyen <107218380+nghi-ly@users.noreply.github.com> Date: Thu, 25 Apr 2024 16:29:51 -0700 Subject: [PATCH 6/6] Update website/docs/docs/dbt-cloud-apis/discovery-querying.md Co-authored-by: Eddo W. Hintoso --- website/docs/docs/dbt-cloud-apis/discovery-querying.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/dbt-cloud-apis/discovery-querying.md b/website/docs/docs/dbt-cloud-apis/discovery-querying.md index a599236a568..bd5527273ce 100644 --- a/website/docs/docs/dbt-cloud-apis/discovery-querying.md +++ b/website/docs/docs/dbt-cloud-apis/discovery-querying.md @@ -33,7 +33,7 @@ Once you've created a token, you can use it in the Authorization header of reque You can run queries by sending a `POST` request to the Discovery API, making sure to replace: * `YOUR_API_URL` with the appropriate [Discovery API endpoint](#discovery-api-endpoints) for your region and plan. * `YOUR_TOKEN` in the Authorization header with your actual API token. Be sure to include the Token prefix. -* `QUERY_BODY` with a GraphQL query, for example `{ "query": "" }` +* `QUERY_BODY` with a GraphQL query, for example `{ "query": "", "variables": "" }` * `VARIABLES` with a dictionary of your GraphQL query variables, such as a job ID or a filter. * `ENDPOINT` with the endpoint you're querying, such as environment.