|
| 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. |
0 commit comments