Skip to content

Commit 9b7b40e

Browse files
Fix incorrect API urls in Deployment Gates code examples (#30925)
* Fix incorrect API urls in Deployment Gates code examples * Update content/en/deployment_gates/setup.md Co-authored-by: Joe Peeples <[email protected]> * Update content/en/deployment_gates/setup.md Co-authored-by: Joe Peeples <[email protected]> --------- Co-authored-by: Joe Peeples <[email protected]>
1 parent e484a2d commit 9b7b40e

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

content/en/deployment_gates/setup.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,11 @@ spec:
239239
{{% /tab %}}
240240
{{% tab "Generic script" %}}
241241

242+
Use this script as a starting point. Be sure to replace the following:
242243

243-
Use this script as a starting point. For the API_URL variable, be sure to replace `<YOUR_DD_SITE>` with your [Datadog site name][1] (for example, {{< region-param key="dd_site" code="true" >}}).
244+
- `<YOUR_DD_SITE>`: Your [Datadog site name][1] (for example, {{< region-param key="dd_site" code="true" >}})
245+
- `<YOUR_API_KEY>`: Your [API key][2]
246+
- `<YOUR_APP_KEY>`: Your [application key][3]
244247

245248
```bash
246249
#!/bin/sh
@@ -386,6 +389,8 @@ The script has the following characteristics:
386389
This is a general behavior, and you should change it based on your personal use case and preferences. The script uses `curl` (to perform the request) and `jq` (to process the returned JSON). If those commands are not available, install them at the beginning of the script (for example, by adding `apk add --no-cache curl jq`).
387390

388391
[1]: /getting_started/site/
392+
[2]: https://app.datadoghq.com/organization-settings/api-keys
393+
[3]: https://app.datadoghq.com/organization-settings/application-keys
389394

390395
{{% /tab %}}
391396
{{% tab "Direct API calls" %}}
@@ -395,10 +400,15 @@ Deployment Gate evaluations are asynchronous, as the evaluation process can take
395400
- First, request a Deployment Gate evaluation, which initiates the process and returns an evaluation ID.
396401
- Then, periodically poll the evaluation status endpoint using the evaluation ID to retrieve the result when the evaluation is complete. Polling every 10-20 seconds is recommended.
397402

398-
A Deployment Gate evaluation can be requested with an API call:
403+
A Deployment Gate evaluation can be requested with an API call.
404+
405+
Be sure to replace the following:
406+
- `<YOUR_DD_SITE>`: Your [Datadog site name][1] (for example, {{< region-param key="dd_site" code="true" >}})
407+
- `<YOUR_API_KEY>`: Your [API key][2]
408+
- `<YOUR_APP_KEY>`: Your [application key][3]
399409

400410
```bash
401-
curl -X POST "https://api.{{< region-param key="dd_site" >}}/api/unstable/deployments/gates/evaluation" \
411+
curl -X POST "https://api.<YOUR_DD_SITE>/api/unstable/deployments/gates/evaluation" \
402412
-H "Content-Type: application/json" \
403413
-H "DD-API-KEY: <YOUR_API_KEY>" \
404414
-H "DD-APPLICATION-KEY: <YOUR_APP_KEY>" \
@@ -438,7 +448,7 @@ The field `data.attributes.evaluation_id` contains the unique identifier for thi
438448
You can fetch the status of a gate evaluation by polling an additional API endpoint using the gate evaluation ID:
439449

440450
```bash
441-
curl -X GET "https://api.{{< region-param key="dd_site" >}}/api/unstable/deployments/gates/evaluation/<evaluation_id>" \
451+
curl -X GET "https://api.<YOUR_DD_SITE>/api/unstable/deployments/gates/evaluation/<evaluation_id>" \
442452
-H "DD-API-KEY: <YOUR_API_KEY>" \
443453
-H "DD-APPLICATION-KEY: <YOUR_APP_KEY>"
444454
```
@@ -455,14 +465,14 @@ When a 200 HTTP response is returned, it has the following format:
455465
"attributes": {
456466
"dry_run": false,
457467
"evaluation_id": "e9d2f04f-4f4b-494b-86e5-52f03e10c8e9",
458-
"evaluation_url": "https://app.{{< region-param key="dd_site" >}}/ci/deployment-gates/evaluations?index=cdgates&query=level%3Agate+%40evaluation_id%3Ae9d2f14f-4f4b-494b-86e5-52f03e10c8e9",
468+
"evaluation_url": "https://app.datadoghq.com/ci/deployment-gates/evaluations?index=cdgates&query=level%3Agate+%40evaluation_id%3Ae9d2f14f-4f4b-494b-86e5-52f03e10c8e9",
459469
"gate_id": "e140302e-0cba-40d2-978c-6780647f8f1c",
460470
"gate_status": "pass",
461471
"rules": [
462472
{
463473
"name": "Check service monitors",
464474
"status": "fail",
465-
"reason": "One or more monitors in ALERT state: https://app.{{< region-param key="dd_site" >}}/monitors/34330981",
475+
"reason": "One or more monitors in ALERT state: https://app.datadoghq.com/monitors/34330981",
466476
"dry_run": true
467477
}
468478
]
@@ -479,6 +489,10 @@ The field `data.attributes.gate_status` contains the result of the evaluation. I
479489

480490
**Note**: If the field `data.attributes.dry_run` is `true`, the field `data.attributes.gate_status` is always `pass`.
481491

492+
[1]: /getting_started/site/
493+
[2]: https://app.datadoghq.com/organization-settings/api-keys
494+
[3]: https://app.datadoghq.com/organization-settings/application-keys
495+
482496
{{% /tab %}}
483497
{{< /tabs >}}
484498

0 commit comments

Comments
 (0)