Skip to content

Commit 04b37e9

Browse files
[Aegis, BYOIP] Use APIRequest component (#22389)
* First pass and placeholder component syntax * Fill in component props throughout * Review occurrences and remove old bash codeblock * Revert service-bindings use for cohesiveness with auth explanation * Use output highlight for provisioning state
1 parent 7190aee commit 04b37e9

File tree

3 files changed

+33
-29
lines changed

3 files changed

+33
-29
lines changed

src/content/docs/aegis/setup.mdx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ sidebar:
77
hideIndex: true
88
---
99

10+
import { APIRequest } from "~/components";
11+
1012
You can control Aegis enablement on your zones via API. If you are not familiar with how Cloudflare API works, refer to [Fundamentals](/fundamentals/api/).
1113

1214
:::caution[Availability]
@@ -25,12 +27,17 @@ Cloudflare Aegis is available in early access to Enterprise customers. Contact y
2527
- Specify `aegis` as the setting ID in the URL.
2628
- In the request body, set `enabled` to `true` and use the ID from the previous step as `pool_id`.
2729

28-
```bash
29-
--data '{
30-
"id": "aegis",
31-
"value": {
32-
"enabled": true,
33-
"pool_id": "<YOUR_EGRESS_POOL_ID>"
34-
},
35-
}'
36-
```
30+
<APIRequest
31+
path="/zones/{zone_id}/settings/{setting_id}"
32+
method="PATCH"
33+
json={{
34+
"id": "aegis",
35+
"value": {
36+
"enabled": true,
37+
"pool_id": "<YOUR_EGRESS_POOL_ID>",
38+
},
39+
}}
40+
parameters={{
41+
setting_id: "aegis",
42+
}}
43+
/>

src/content/docs/byoip/address-maps/setup.mdx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar:
66
label: Setup
77
---
88

9-
import { GlossaryTooltip } from "~/components";
9+
import { GlossaryTooltip, APIRequest } from "~/components";
1010

1111
Consider the sections below to learn how to set up address maps.
1212

@@ -65,17 +65,14 @@ Default SNI for Spectrum can only be created via API using the [Create Address M
6565

6666
Do not include any membership in your command. Your API command should resemble the following:
6767

68-
```bash
69-
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/addressing/address_maps \
70-
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
71-
--header "Content-Type: application/json" \
72-
--data '{
73-
"description": "default_sni",
74-
"default_sni": "sni.example.com",
75-
"enabled": false,
76-
"ips": [
77-
"192.0.0.1"
78-
],
79-
"memberships": []
80-
}'
81-
```
68+
<APIRequest
69+
path="/accounts/{account_id}/addressing/address_maps"
70+
method="POST"
71+
json={{
72+
"description": "default_sni",
73+
"default_sni": "sni.example.com",
74+
"enabled": false,
75+
"ips": ["192.0.0.1"],
76+
"memberships": [],
77+
}}
78+
/>

src/content/docs/byoip/service-bindings/magic-transit-with-cdn.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar:
66
label: Magic Transit with CDN
77
---
88

9-
import { Details, Example, TabItem, Tabs, GlossaryTooltip } from "~/components";
9+
import { Details, Example, TabItem, Tabs, GlossaryTooltip, APIRequest } from "~/components";
1010

1111
[Magic Transit](/magic-transit/) customers using BYOIP can also benefit from the performance, reliability, and security that Cloudflare offers for HTTP-based applications.
1212

@@ -94,24 +94,24 @@ curl https://api.cloudflare.com/client/v4/accounts/{account_id}/addressing/prefi
9494
--header "Content-Type: application/json" \
9595
--data '{
9696
"cidr": "203.0.113.100/32",
97-
"service_id": <SERVICE_ID>
97+
"service_id": "<SERVICE_ID>"
9898
}'
9999
```
100100

101101
In the response body, the initial provisioning state should be `provisioning`.
102102

103-
```json
103+
```json output {9}
104104
{
105105
"errors": [],
106106
"messages": [],
107107
"success": true,
108108
"result": {
109109
"cidr": "203.0.113.100/32",
110-
"id": <CDN_SERVICE_BINDING_ID>,
110+
"id": "<CDN_SERVICE_BINDING_ID>",
111111
"provisioning": {
112112
"state": "provisioning"
113113
},
114-
"service_id": <SERVICE_ID>,
114+
"service_id": "<SERVICE_ID>",
115115
"service_name": "CDN"
116116
}
117117
}

0 commit comments

Comments
 (0)