Skip to content

Commit 9707100

Browse files
authored
Merge pull request #2695 from cloudflare/staging-next
✽ Sync staged changes
2 parents e351641 + 6810580 commit 9707100

1,721 files changed

Lines changed: 11242 additions & 24830 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 2184
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3d7d43f051a510c54ae71adb4b85cbb422565a40942cde4de0c3f8eb6ba8023b.yml
3-
openapi_spec_hash: e85824f16c3ba923a34e514c06dac7cd
4-
config_hash: a84b6a70b6374c30a50b477fe248eb3a
1+
configured_endpoints: 2194
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0ce49e6bb0d3819f135b9a567b661205fdf5df21cff157eab2b7abd7b5b50347.yml
3+
openapi_spec_hash: 512a5bb3a32860590c8949765605d65a
4+
config_hash: 5367ae3e3a9a0d6578c2756965a99e3a

CHANGELOG-v5.0.0-beta.2.md

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# v5.0.0-beta.2
2+
3+
> This is a beta release. The API surface may change before the stable release.
4+
5+
Full diff: [`v5.0.0-beta.1...next`](https://github.com/cloudflare/cloudflare-python/compare/v5.0.0-beta.1...next)
6+
7+
This release adds 163 new methods across 4 new top-level resources and numerous sub-resource
8+
expansions, restructures the `api.md` surface into per-resource files, and includes codegen
9+
updates across all existing resources.
10+
11+
## General Changes
12+
13+
### Client-level `account_id` and `zone_id` configuration
14+
15+
You can now set `account_id` and `zone_id` once on the client instead of passing them to every
16+
method call. When set, these values are used as defaults for all methods that accept them. You
17+
can still override per-call by passing the parameter explicitly.
18+
19+
```python
20+
from cloudflare import Cloudflare
21+
22+
# Set account_id once at the client level
23+
client = Cloudflare(account_id="my-account-id")
24+
25+
# No need to pass account_id on every call
26+
workers = client.workers.scripts.list()
27+
rules = client.rules.lists.list()
28+
```
29+
30+
Both options also read from environment variables:
31+
32+
- `account_id` from `CLOUDFLARE_ACCOUNT_ID`
33+
- `zone_id` from `CLOUDFLARE_ZONE_ID`
34+
35+
```python
36+
# Or configure via environment variables
37+
# export CLOUDFLARE_ACCOUNT_ID=my-account-id
38+
# export CLOUDFLARE_ZONE_ID=my-zone-id
39+
client = Cloudflare()
40+
```
41+
42+
All methods that previously required `account_id` or `zone_id` as a positional/keyword argument
43+
now accept `None` as a default and fall back to the client-level value. If neither is set, a
44+
`ValueError` is raised with a clear message.
45+
46+
## Breaking Changes
47+
48+
### Restructured Resources
49+
50+
- **AISearch**: `aisearch.instances.items` (`get`, `list`) has been replaced by the new
51+
namespace-based architecture under `aisearch.namespaces.instances.items` (see New Resources
52+
below)
53+
54+
- **Registrar**: `registrar.domains` (`get`, `list`, `update`) has been replaced by
55+
`registrar.registrations` with expanded functionality including `create`, `edit`, `get`, `list`,
56+
plus new `registrar.check`, `registrar.search`, `registrar.registration_status.get`, and
57+
`registrar.update_status.get` methods
58+
59+
- **Custom Pages**: `custom_pages` (`get`, `list`, `update`) has been replaced by
60+
`custom_pages.assets` (`create`, `delete`, `get`, `list`, `update`)
61+
62+
### Removed Methods
63+
64+
- `cloudforce_one.threat_events.delete`
65+
66+
## New API Resources
67+
68+
### Top-Level Resources
69+
70+
- **VulnerabilityScanner** -- Full CRUD for vulnerability scanning
71+
- `credential_sets` -- `create`, `delete`, `edit`, `get`, `list`, `update`
72+
- `credential_sets.credentials` -- `create`, `delete`, `edit`, `get`, `list`, `update`
73+
- `scans` -- `create`, `get`, `list`
74+
- `target_environments` -- `create`, `delete`, `edit`, `get`, `list`, `update`
75+
76+
- **GoogleTagGateway** -- Google Tag Gateway configuration
77+
- `config` -- `get`, `update`
78+
79+
- **EmailSending** -- Email sending with subdomain management
80+
- `send`, `send_raw`
81+
- `subdomains` -- `create`, `delete`, `get`, `list`
82+
- `subdomains.dns` -- `get`
83+
84+
- **ResourceTagging** -- Resource tagging and key/value management
85+
- `list`
86+
- `account_tags` -- `delete`, `get`, `update`
87+
- `zone_tags` -- `delete`, `get`, `update`
88+
- `keys` -- `list`
89+
- `values` -- `list`
90+
91+
### New Sub-Resources on Existing Resources
92+
93+
- **AISearch** (restructured) -- Expanded namespace-based architecture
94+
- `aisearch.namespaces` -- `create`, `delete`, `list`, `read`, `search`, `update`,
95+
`chat_completions`
96+
- `aisearch.namespaces.instances` -- `create`, `list`, `read`, `search`, `stats`, `update`,
97+
`chat_completions`
98+
- `aisearch.namespaces.instances.items` -- `chunks`, `create_or_update`, `delete`, `download`,
99+
`get`, `list`, `logs`, `sync`, `upload`
100+
- `aisearch.namespaces.instances.jobs` -- `create`, `get`, `list`, `logs`, `update`
101+
102+
- **APIGateway Labels** -- Label management for API Gateway operations
103+
- `api_gateway.labels` -- `list`
104+
- `api_gateway.labels.managed` -- `get`
105+
- `api_gateway.labels.managed.resources.operation` -- `update`
106+
- `api_gateway.labels.user` -- `bulk_create`, `bulk_delete`, `delete`, `edit`, `get`, `update`
107+
- `api_gateway.labels.user.resources.operation` -- `update`
108+
- `api_gateway.operations.labels` -- `bulk_create`, `bulk_delete`, `bulk_update`, `create`,
109+
`delete`, `update`
110+
111+
- **BrowserRendering** -- DevTools and crawl APIs
112+
- `browser_rendering.crawl` -- `create`, `delete`, `get`
113+
- `browser_rendering.devtools.browser` -- `connect`, `create`, `delete`, `launch`, `protocol`,
114+
`version`
115+
- `browser_rendering.devtools.browser.page` -- `get`
116+
- `browser_rendering.devtools.browser.targets` -- `activate`, `create`, `get`, `list`
117+
- `browser_rendering.devtools.session` -- `get`, `list`
118+
119+
- **Custom Pages Assets** -- Custom page asset management
120+
- `custom_pages.assets` -- `create`, `delete`, `get`, `list`, `update`
121+
122+
- **ACM Custom Trust Store** -- Custom origin trust store
123+
- `acm.custom_trust_store` -- `create`, `delete`, `get`, `list`
124+
125+
- **Workers Observability Destinations** -- Log destinations for Workers observability
126+
- `workers.observability.destinations` -- `create`, `delete`, `list`, `update`
127+
128+
- **Registrar** (expanded) -- Domain registration with full lifecycle management
129+
- `registrar.registrations` -- `create`, `edit`, `get`, `list`
130+
- `registrar.check`, `registrar.search`
131+
- `registrar.registration_status` -- `get`
132+
- `registrar.update_status` -- `get`
133+
134+
- **Zero Trust** additions
135+
- `zero_trust.access.users` -- `create`, `delete`, `get`, `update`
136+
- `zero_trust.devices.ip_profiles` -- `create`, `delete`, `get`, `list`, `update`
137+
- `zero_trust.dex.rules` -- `create`, `delete`, `get`, `list`, `update`
138+
- `zero_trust.dlp.settings` -- `delete`, `edit`, `get`, `update`
139+
- `zero_trust.gateway.pacfiles` -- `create`, `delete`, `get`, `list`, `update`
140+
- `zero_trust.networks.subnets.warp` -- `create`, `delete`, `edit`, `get`
141+
- `zero_trust.tunnels.warp_connector.connections` -- `get`
142+
- `zero_trust.tunnels.warp_connector.connectors` -- `get`
143+
- `zero_trust.tunnels.warp_connector.failover` -- `update`
144+
145+
- **Zones Environments** -- Zone environment management
146+
- `zones.environments` -- `create`, `delete`, `edit`, `list`, `rollback`, `update`
147+
148+
- **Radar** additions
149+
- `radar.agent_readiness` -- `summary`
150+
- `radar.ai.markdown_for_agents` -- `summary`, `timeseries`
151+
- `radar.entities.asns` -- `botnet_threat_feed`
152+
- `radar.post_quantum.origin` -- `summary`, `timeseries_groups`
153+
- `radar.post_quantum.tls` -- `support`
154+
155+
- **Billing Usage** -- PayGo billing usage
156+
- `billing.usage` -- `paygo`
157+
158+
- **Email Security** -- PhishGuard reporting
159+
- `email_security.phishguard.reports` -- `list`
160+
161+
- **Brand Protection** -- v2 endpoints
162+
- `brand_protection.v2` additions
163+
164+
## Bug Fixes
165+
166+
- **fix(dlp)**: Add missing `model_rebuild()`/`update_forward_refs()` calls for
167+
`CustomProfileSharedEntryCustomEntry` and `IntegrationProfileSharedEntryCustomEntry`, fixing
168+
pydantic v1 validation errors on DLP profile types.
169+
- **fix(workers)**: Make `RunQueryParametersNeedleValue` a `BaseModel` with
170+
`arbitrary_types_allowed` to prevent pydantic config errors.
171+
172+
## Internal
173+
174+
- `api.md` has been restructured from a single monolithic file into per-resource files under
175+
`src/cloudflare/resources/*/api.md`. The root `api.md` now contains shared types and links to
176+
each resource's documentation.
177+
- Codegen updates applied across all resources with updated type annotations and method signatures.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ It is generated with [Stainless](https://www.stainless.com/).
1313

1414
Use the Cloudflare MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
1515

16-
[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=cloudflare-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNsb3VkZmxhcmUtbWNwIl0sImVudiI6eyJDTE9VREZMQVJFX0FQSV9UT0tFTiI6IlNuM2xaSlRCWDZra2c3T2RjQlVBeE9POTYzR0VJeUdRcW5GVE9GWVkiLCJDTE9VREZMQVJFX0FQSV9LRVkiOiIxNDRjOWRlZmFjMDQ5NjljN2JmYWQ4ZWZhYThlYTE5NCIsIkNMT1VERkxBUkVfRU1BSUwiOiJ1c2VyQGV4YW1wbGUuY29tIiwiQ0xPVURGTEFSRV9BUElfVVNFUl9TRVJWSUNFX0tFWSI6InYxLjAtMTQ0YzlkZWZhYzA0OTY5YzdiZmFkOGVmLTYzMWE0MWQwMDNhMzJkMjVmZTg3ODA4MWVmMzY1YzQ5NTAzZjdmYWRhNjAwZGE5MzVlMjg1MWExYzczMjYwODRiODVjYmY2NDI5YzRiODU5ZGU4NDc1NzMxZGM5MmE5YzMyOTYzMWU2ZDU5ZTZjNzNkYTdiMTk4NDk3MTcyYjRjZWZlMDcxZDkwZDBmNWQyNzE5IiwiQ0xPVURGTEFSRV9BQ0NPVU5UX0lEIjoiZjAzN2U1N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i8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cloudflare-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22cloudflare-mcp%22%5D%2C%22env%22%3A%7B%22CLOUDFLARE_API_TOKEN%22%3A%22Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY%22%2C%22CLOUDFLARE_API_KEY%22%3A%22144c9defac04969c7bfad8efaa8ea194%22%2C%22CLOUDFLARE_EMAIL%22%3A%22user%40example.com%22%2C%22CLOUDFLARE_API_USER_SERVICE_KEY%22%3A%22v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719%22%2C%22CLOUDFLARE_ACCOUNT_ID%22%3A%22f037e56e89293a057740de681ac9accp%22%2C%22CLOUDFLARE_ZONE_ID%22%3A%22f037e56e89293a057740de681ac9accp%22%7D%7D)
16+
[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=cloudflare-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNsb3VkZmxhcmUtbWNwIl0sImVudiI6eyJDTE9VREZMQVJFX0FQSV9UT0tFTiI6IlNuM2xaSlRCWDZra2c3T2RjQlVBeE9POTYzR0VJeUdRcW5GVE9GWVkiLCJDTE9VREZMQVJFX0FQSV9LRVkiOiIxNDRjOWRlZmFjMDQ5NjljN2JmYWQ4ZWZhYThlYTE5NCIsIkNMT1VERkxBUkVfRU1BSUwiOiJ1c2VyQGV4YW1wbGUuY29tIiwiQ0xPVURGTEFSRV9BUElfVVNFUl9TRVJWSUNFX0tFWSI6InYxLjAtMTQ0YzlkZWZhYzA0OTY5YzdiZmFkOGVmLTYzMWE0MWQwMDNhMzJkMjVmZTg3ODA4MWVmMzY1YzQ5NTAzZjdmYWRhNjAwZGE5M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wNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cloudflare-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22cloudflare-mcp%22%5D%2C%22env%22%3A%7B%22CLOUDFLARE_API_TOKEN%22%3A%22Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY%22%2C%22CLOUDFLARE_API_KEY%22%3A%22144c9defac04969c7bfad8efaa8ea194%22%2C%22CLOUDFLARE_EMAIL%22%3A%22user%40example.com%22%2C%22CLOUDFLARE_API_USER_SERVICE_KEY%22%3A%22v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719%22%7D%7D)
1818

1919
> Note: You may need to set environment variables in your MCP client.
2020

src/cloudflare/_client.py

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,6 @@ class Cloudflare(SyncAPIClient):
311311
api_key: str | None
312312
api_email: str | None
313313
user_service_key: str | None
314-
account_id: str | None
315-
zone_id: str | None
316314

317315
def __init__(
318316
self,
@@ -321,8 +319,6 @@ def __init__(
321319
api_key: str | None = None,
322320
api_email: str | None = None,
323321
user_service_key: str | None = None,
324-
account_id: str | None = None,
325-
zone_id: str | None = None,
326322
base_url: str | httpx.URL | None = None,
327323
api_version: str | None = None,
328324
timeout: float | Timeout | None | NotGiven = not_given,
@@ -350,8 +346,6 @@ def __init__(
350346
- `api_key` from `CLOUDFLARE_API_KEY`
351347
- `api_email` from `CLOUDFLARE_EMAIL`
352348
- `user_service_key` from `CLOUDFLARE_API_USER_SERVICE_KEY`
353-
- `account_id` from `CLOUDFLARE_ACCOUNT_ID`
354-
- `zone_id` from `CLOUDFLARE_ZONE_ID`
355349
"""
356350
if api_token is None:
357351
api_token = os.environ.get("CLOUDFLARE_API_TOKEN")
@@ -369,14 +363,6 @@ def __init__(
369363
user_service_key = os.environ.get("CLOUDFLARE_API_USER_SERVICE_KEY")
370364
self.user_service_key = user_service_key
371365

372-
if account_id is None:
373-
account_id = os.environ.get("CLOUDFLARE_ACCOUNT_ID")
374-
self.account_id = account_id
375-
376-
if zone_id is None:
377-
zone_id = os.environ.get("CLOUDFLARE_ZONE_ID")
378-
self.zone_id = zone_id
379-
380366
if base_url is None:
381367
base_url = os.environ.get("CLOUDFLARE_BASE_URL")
382368
if base_url is None:
@@ -1123,8 +1109,6 @@ def copy(
11231109
api_key: str | None = None,
11241110
api_email: str | None = None,
11251111
user_service_key: str | None = None,
1126-
account_id: str | None = None,
1127-
zone_id: str | None = None,
11281112
base_url: str | httpx.URL | None = None,
11291113
api_version: str | None = None,
11301114
timeout: float | Timeout | None | NotGiven = not_given,
@@ -1163,8 +1147,6 @@ def copy(
11631147
api_key=api_key or self.api_key,
11641148
api_email=api_email or self.api_email,
11651149
user_service_key=user_service_key or self.user_service_key,
1166-
account_id=account_id or self.account_id,
1167-
zone_id=zone_id or self.zone_id,
11681150
base_url=base_url or self.base_url,
11691151
api_version=api_version or self.api_version,
11701152
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
@@ -1179,24 +1161,6 @@ def copy(
11791161
# client.with_options(timeout=10).foo.create(...)
11801162
with_options = copy
11811163

1182-
def _get_account_id_path_param(self) -> str:
1183-
from_client = self.account_id
1184-
if from_client is not None:
1185-
return from_client
1186-
1187-
raise ValueError(
1188-
"Missing account_id argument; Please provide it at the client level, e.g. Cloudflare(account_id='abcd') or per method."
1189-
)
1190-
1191-
def _get_zone_id_path_param(self) -> str:
1192-
from_client = self.zone_id
1193-
if from_client is not None:
1194-
return from_client
1195-
1196-
raise ValueError(
1197-
"Missing zone_id argument; Please provide it at the client level, e.g. Cloudflare(zone_id='abcd') or per method."
1198-
)
1199-
12001164
@override
12011165
def _make_status_error(
12021166
self,
@@ -1237,8 +1201,6 @@ class AsyncCloudflare(AsyncAPIClient):
12371201
api_key: str | None
12381202
api_email: str | None
12391203
user_service_key: str | None
1240-
account_id: str | None
1241-
zone_id: str | None
12421204

12431205
def __init__(
12441206
self,
@@ -1247,8 +1209,6 @@ def __init__(
12471209
api_key: str | None = None,
12481210
api_email: str | None = None,
12491211
user_service_key: str | None = None,
1250-
account_id: str | None = None,
1251-
zone_id: str | None = None,
12521212
base_url: str | httpx.URL | None = None,
12531213
api_version: str | None = None,
12541214
timeout: float | Timeout | None | NotGiven = not_given,
@@ -1276,8 +1236,6 @@ def __init__(
12761236
- `api_key` from `CLOUDFLARE_API_KEY`
12771237
- `api_email` from `CLOUDFLARE_EMAIL`
12781238
- `user_service_key` from `CLOUDFLARE_API_USER_SERVICE_KEY`
1279-
- `account_id` from `CLOUDFLARE_ACCOUNT_ID`
1280-
- `zone_id` from `CLOUDFLARE_ZONE_ID`
12811239
"""
12821240
if api_token is None:
12831241
api_token = os.environ.get("CLOUDFLARE_API_TOKEN")
@@ -1295,14 +1253,6 @@ def __init__(
12951253
user_service_key = os.environ.get("CLOUDFLARE_API_USER_SERVICE_KEY")
12961254
self.user_service_key = user_service_key
12971255

1298-
if account_id is None:
1299-
account_id = os.environ.get("CLOUDFLARE_ACCOUNT_ID")
1300-
self.account_id = account_id
1301-
1302-
if zone_id is None:
1303-
zone_id = os.environ.get("CLOUDFLARE_ZONE_ID")
1304-
self.zone_id = zone_id
1305-
13061256
if base_url is None:
13071257
base_url = os.environ.get("CLOUDFLARE_BASE_URL")
13081258
if base_url is None:
@@ -2049,8 +1999,6 @@ def copy(
20491999
api_key: str | None = None,
20502000
api_email: str | None = None,
20512001
user_service_key: str | None = None,
2052-
account_id: str | None = None,
2053-
zone_id: str | None = None,
20542002
base_url: str | httpx.URL | None = None,
20552003
api_version: str | None = None,
20562004
timeout: float | Timeout | None | NotGiven = not_given,
@@ -2089,8 +2037,6 @@ def copy(
20892037
api_key=api_key or self.api_key,
20902038
api_email=api_email or self.api_email,
20912039
user_service_key=user_service_key or self.user_service_key,
2092-
account_id=account_id or self.account_id,
2093-
zone_id=zone_id or self.zone_id,
20942040
base_url=base_url or self.base_url,
20952041
api_version=api_version or self.api_version,
20962042
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
@@ -2105,24 +2051,6 @@ def copy(
21052051
# client.with_options(timeout=10).foo.create(...)
21062052
with_options = copy
21072053

2108-
def _get_account_id_path_param(self) -> str:
2109-
from_client = self.account_id
2110-
if from_client is not None:
2111-
return from_client
2112-
2113-
raise ValueError(
2114-
"Missing account_id argument; Please provide it at the client level, e.g. AsyncCloudflare(account_id='abcd') or per method."
2115-
)
2116-
2117-
def _get_zone_id_path_param(self) -> str:
2118-
from_client = self.zone_id
2119-
if from_client is not None:
2120-
return from_client
2121-
2122-
raise ValueError(
2123-
"Missing zone_id argument; Please provide it at the client level, e.g. AsyncCloudflare(zone_id='abcd') or per method."
2124-
)
2125-
21262054
@override
21272055
def _make_status_error(
21282056
self,

0 commit comments

Comments
 (0)