Skip to content

Commit 7773d8a

Browse files
feat(api): api update
1 parent d43aff4 commit 7773d8a

File tree

5 files changed

+31
-27
lines changed

5 files changed

+31
-27
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1777
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5d3e8222346377faccd40549dbab761650548e52d51c924da09b1607f6ce7cb5.yml
3-
openapi_spec_hash: 88ae18e728960e49b36ba049c8f3d13b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-39ccadcddaa1e181eb29efb2f50fc4d2df982a526c68bc31e34f28e8d4dc2c08.yml
3+
openapi_spec_hash: 34225107db418f33a43166f75ff9c18a
44
config_hash: a35e9eb0436652c704bebf7c0a38085b

src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ def edit(
147147
account_id: str,
148148
prefix_id: str,
149149
asn_prepend_count: int | NotGiven = NOT_GIVEN,
150+
auto_advertise_withdraw: bool | NotGiven = NOT_GIVEN,
150151
on_demand: bgp_prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN,
151-
withdraw_if_no_route: bool | NotGiven = NOT_GIVEN,
152152
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
153153
# The extra values given here take precedence over values defined on the client or passed to this method.
154154
extra_headers: Headers | None = None,
@@ -169,9 +169,10 @@ def edit(
169169
170170
asn_prepend_count: Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute
171171
172-
withdraw_if_no_route: Controls whether the BGP prefix is automatically withdrawn when prefix is
173-
withdrawn from Magic routing table (for Magic Transit customers using Direct
174-
CNI)
172+
auto_advertise_withdraw: Determines if Cloudflare advertises a BYOIP BGP prefix even when there is no
173+
matching BGP prefix in the Magic routing table. When true, Cloudflare will
174+
automatically withdraw the BGP prefix when there are no matching BGP routes, and
175+
will resume advertising when there is at least one matching BGP route.
175176
176177
extra_headers: Send extra headers
177178
@@ -192,8 +193,8 @@ def edit(
192193
body=maybe_transform(
193194
{
194195
"asn_prepend_count": asn_prepend_count,
196+
"auto_advertise_withdraw": auto_advertise_withdraw,
195197
"on_demand": on_demand,
196-
"withdraw_if_no_route": withdraw_if_no_route,
197198
},
198199
bgp_prefix_edit_params.BGPPrefixEditParams,
199200
),
@@ -379,8 +380,8 @@ async def edit(
379380
account_id: str,
380381
prefix_id: str,
381382
asn_prepend_count: int | NotGiven = NOT_GIVEN,
383+
auto_advertise_withdraw: bool | NotGiven = NOT_GIVEN,
382384
on_demand: bgp_prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN,
383-
withdraw_if_no_route: bool | NotGiven = NOT_GIVEN,
384385
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
385386
# The extra values given here take precedence over values defined on the client or passed to this method.
386387
extra_headers: Headers | None = None,
@@ -401,9 +402,10 @@ async def edit(
401402
402403
asn_prepend_count: Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute
403404
404-
withdraw_if_no_route: Controls whether the BGP prefix is automatically withdrawn when prefix is
405-
withdrawn from Magic routing table (for Magic Transit customers using Direct
406-
CNI)
405+
auto_advertise_withdraw: Determines if Cloudflare advertises a BYOIP BGP prefix even when there is no
406+
matching BGP prefix in the Magic routing table. When true, Cloudflare will
407+
automatically withdraw the BGP prefix when there are no matching BGP routes, and
408+
will resume advertising when there is at least one matching BGP route.
407409
408410
extra_headers: Send extra headers
409411
@@ -424,8 +426,8 @@ async def edit(
424426
body=await async_maybe_transform(
425427
{
426428
"asn_prepend_count": asn_prepend_count,
429+
"auto_advertise_withdraw": auto_advertise_withdraw,
427430
"on_demand": on_demand,
428-
"withdraw_if_no_route": withdraw_if_no_route,
429431
},
430432
bgp_prefix_edit_params.BGPPrefixEditParams,
431433
),

src/cloudflare/types/addressing/prefixes/bgp_prefix.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ class BGPPrefix(BaseModel):
5858
asn_prepend_count: Optional[int] = None
5959
"""Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute"""
6060

61+
auto_advertise_withdraw: Optional[bool] = None
62+
"""
63+
Determines if Cloudflare advertises a BYOIP BGP prefix even when there is no
64+
matching BGP prefix in the Magic routing table. When true, Cloudflare will
65+
automatically withdraw the BGP prefix when there are no matching BGP routes, and
66+
will resume advertising when there is at least one matching BGP route.
67+
"""
68+
6169
bgp_signal_opts: Optional[BGPSignalOpts] = None
6270

6371
cidr: Optional[str] = None
@@ -68,10 +76,3 @@ class BGPPrefix(BaseModel):
6876
modified_at: Optional[datetime] = None
6977

7078
on_demand: Optional[OnDemand] = None
71-
72-
withdraw_if_no_route: Optional[bool] = None
73-
"""
74-
Controls whether the BGP prefix is automatically withdrawn when prefix is
75-
withdrawn from Magic routing table (for Magic Transit customers using Direct
76-
CNI)
77-
"""

src/cloudflare/types/addressing/prefixes/bgp_prefix_edit_params.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ class BGPPrefixEditParams(TypedDict, total=False):
1717
asn_prepend_count: int
1818
"""Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute"""
1919

20-
on_demand: OnDemand
21-
22-
withdraw_if_no_route: bool
20+
auto_advertise_withdraw: bool
2321
"""
24-
Controls whether the BGP prefix is automatically withdrawn when prefix is
25-
withdrawn from Magic routing table (for Magic Transit customers using Direct
26-
CNI)
22+
Determines if Cloudflare advertises a BYOIP BGP prefix even when there is no
23+
matching BGP prefix in the Magic routing table. When true, Cloudflare will
24+
automatically withdraw the BGP prefix when there are no matching BGP routes, and
25+
will resume advertising when there is at least one matching BGP route.
2726
"""
2827

28+
on_demand: OnDemand
29+
2930

3031
class OnDemand(TypedDict, total=False):
3132
advertised: bool

tests/api_resources/addressing/prefixes/test_bgp_prefixes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
139139
account_id="258def64c72dae45f3e4c8516e2111f2",
140140
prefix_id="2af39739cc4e3b5910c918468bb89828",
141141
asn_prepend_count=2,
142+
auto_advertise_withdraw=True,
142143
on_demand={"advertised": True},
143-
withdraw_if_no_route=True,
144144
)
145145
assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"])
146146

@@ -382,8 +382,8 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare)
382382
account_id="258def64c72dae45f3e4c8516e2111f2",
383383
prefix_id="2af39739cc4e3b5910c918468bb89828",
384384
asn_prepend_count=2,
385+
auto_advertise_withdraw=True,
385386
on_demand={"advertised": True},
386-
withdraw_if_no_route=True,
387387
)
388388
assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"])
389389

0 commit comments

Comments
 (0)