Skip to content

Commit 2b8dc09

Browse files
committed
Fix examples after component update
1 parent f279fc2 commit 2b8dc09

File tree

3 files changed

+22
-74
lines changed

3 files changed

+22
-74
lines changed

src/content/docs/rules/cloud-connector/create-api.mdx

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -75,38 +75,21 @@ To create a new rule and keep all existing rules, you must include them all in y
7575

7676
The following example request will replace all existing Cloud Connector rules with a single rule:
7777

78-
TODO Fix example.
79-
8078
<APIRequest
8179
path="/zones/{zone_id}/cloud_connector/rules"
8280
method="PUT"
83-
json={{
84-
expression: 'http.request.uri.path wildcard "/images/*"',
85-
provider: "cloudflare_r2",
86-
description: "Connect to R2 bucket containing images",
87-
parameters: {
88-
host: "mybucketcustomdomain.example.com",
81+
json={[
82+
{
83+
expression: 'http.request.uri.path wildcard "/images/*"',
84+
provider: "cloudflare_r2",
85+
description: "Connect to R2 bucket containing images",
86+
parameters: {
87+
host: "mybucketcustomdomain.example.com",
88+
},
8989
},
90-
}}
90+
]}
9191
/>
9292

93-
```bash
94-
curl --request PUT \
95-
"https://api.cloudflare.com/client/v4/zones/{zone_id}/cloud_connector/rules" \
96-
--header "Authorization: Bearer <API_TOKEN>" \
97-
--header "Content-Type: application/json" \
98-
--data '[
99-
{
100-
"expression": "http.request.uri.path wildcard \"/images/*\"",
101-
"provider": "cloudflare_r2",
102-
"description": "Connect to R2 bucket containing images",
103-
"parameters": {
104-
"host": "mybucketcustomdomain.example.com"
105-
}
106-
}
107-
]'
108-
```
109-
11093
The required body parameters for each rule are: `expression`, `provider`, and `parameters.host`.
11194

11295
The `provider` value must be one of the following: `cloudflare_r2`, `aws_s3`, `azure_storage`, and `gcp_storage`.

src/content/docs/rules/snippets/create-api.mdx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ The following table summarizes the available operations.
5252

5353
To create or update a Snippet, use the following `PUT` request. The snippet is named `$SNIPPET_NAME` and the body contains the JavaScript code.
5454

55-
TODO Fix example.
56-
5755
<APIRequest
5856
path="/zones/{zone_id}/snippets/{snippet_name}"
5957
method="PUT"
@@ -63,14 +61,6 @@ TODO Fix example.
6361
}}
6462
/>
6563

66-
```bash
67-
curl --request PUT https://api.cloudflare.com/client/v4/zones/{zone_id}/snippets/{snippet_name} \
68-
--header "Authorization: Bearer <API_TOKEN>" \
69-
--header "Content-Type: multipart/form-data" \
70-
71-
--form metadata='{"main_module":"example.js"}'
72-
```
73-
7464
The name of a snippet can only contain the characters `a-z`, `0-9`, and `_` (underscore). The name must be unique in the context of the zone. You cannot change the snippet name after creating the snippet.
7565

7666
The required body parameters are:

src/content/docs/rules/url-forwarding/bulk-redirects/create-api.mdx

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -60,54 +60,29 @@ For more information on list operations, refer to the [Lists API](/waf/tools/lis
6060

6161
Use the [Create list items](/api/resources/rules/subresources/lists/subresources/items/methods/create/) operation to add URL redirect items to the list. Enter the list ID from the previous step in the endpoint URL:
6262

63-
TODO Fix example.
64-
6563
<APIRequest
6664
path="/accounts/{account_id}/rules/lists/{list_id}/items"
6765
method="POST"
6866
parameters={{
6967
list_id: "f848b6ccb07647749411f504d6f88794",
7068
}}
71-
json={{
72-
remove_me: [
73-
{
74-
redirect: {
75-
source_url: "example.com/blog/",
76-
target_url: "https://example.com/blog/latest",
77-
},
69+
json={[
70+
{
71+
redirect: {
72+
source_url: "example.com/blog/",
73+
target_url: "https://example.com/blog/latest",
7874
},
79-
{
80-
redirect: {
81-
source_url: "example.net/",
82-
target_url: "https://example.net/under-construction.html",
83-
status_code: 307,
84-
},
75+
},
76+
{
77+
redirect: {
78+
source_url: "example.net/",
79+
target_url: "https://example.net/under-construction.html",
80+
status_code: 307,
8581
},
86-
],
87-
}}
82+
},
83+
]}
8884
/>
8985

90-
```bash
91-
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/rules/lists/f848b6ccb07647749411f504d6f88794/items \
92-
--header "Authorization: Bearer <API_TOKEN>" \
93-
--header "Content-Type: application/json" \
94-
--data '[
95-
{
96-
"redirect": {
97-
"source_url": "example.com/blog/",
98-
"target_url": "https://example.com/blog/latest"
99-
}
100-
},
101-
{
102-
"redirect": {
103-
"source_url": "example.net/",
104-
"target_url": "https://example.net/under-construction.html",
105-
"status_code": 307
106-
}
107-
}
108-
]'
109-
```
110-
11186
```json output
11287
{
11388
"result": {

0 commit comments

Comments
 (0)