Skip to content

Commit 773e38e

Browse files
feat(api): api update
1 parent ed4999c commit 773e38e

20 files changed

Lines changed: 862 additions & 18 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1809
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee3389d04f6a1ca743c884bcb95e049b8ff0b10f267f781479383a841f3b195e.yml
3-
openapi_spec_hash: 257be0bb563f8f7a70e057108b0f5046
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-276bca934d46de5b631742b9113f5f019380502fa6297cf000ce45b857bafb1c.yml
3+
openapi_spec_hash: 23f19bf20cb0c3ce306a43ebf55f4285
44
config_hash: 9f61e9f02b675e373b140471d52b670c

src/cloudflare/resources/magic_transit/gre_tunnels.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def create(
5757
customer_gre_endpoint: str,
5858
interface_address: str,
5959
name: str,
60+
bgp: gre_tunnel_create_params.BGP | NotGiven = NOT_GIVEN,
6061
description: str | NotGiven = NOT_GIVEN,
6162
health_check: gre_tunnel_create_params.HealthCheck | NotGiven = NOT_GIVEN,
6263
interface_address6: str | NotGiven = NOT_GIVEN,
@@ -129,6 +130,7 @@ def create(
129130
"customer_gre_endpoint": customer_gre_endpoint,
130131
"interface_address": interface_address,
131132
"name": name,
133+
"bgp": bgp,
132134
"description": description,
133135
"health_check": health_check,
134136
"interface_address6": interface_address6,
@@ -495,6 +497,7 @@ async def create(
495497
customer_gre_endpoint: str,
496498
interface_address: str,
497499
name: str,
500+
bgp: gre_tunnel_create_params.BGP | NotGiven = NOT_GIVEN,
498501
description: str | NotGiven = NOT_GIVEN,
499502
health_check: gre_tunnel_create_params.HealthCheck | NotGiven = NOT_GIVEN,
500503
interface_address6: str | NotGiven = NOT_GIVEN,
@@ -567,6 +570,7 @@ async def create(
567570
"customer_gre_endpoint": customer_gre_endpoint,
568571
"interface_address": interface_address,
569572
"name": name,
573+
"bgp": bgp,
570574
"description": description,
571575
"health_check": health_check,
572576
"interface_address6": interface_address6,

src/cloudflare/resources/magic_transit/ipsec_tunnels.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def create(
6262
cloudflare_endpoint: str,
6363
interface_address: str,
6464
name: str,
65+
bgp: ipsec_tunnel_create_params.BGP | NotGiven = NOT_GIVEN,
6566
customer_endpoint: str | NotGiven = NOT_GIVEN,
6667
description: str | NotGiven = NOT_GIVEN,
6768
health_check: ipsec_tunnel_create_params.HealthCheck | NotGiven = NOT_GIVEN,
@@ -135,6 +136,7 @@ def create(
135136
"cloudflare_endpoint": cloudflare_endpoint,
136137
"interface_address": interface_address,
137138
"name": name,
139+
"bgp": bgp,
138140
"customer_endpoint": customer_endpoint,
139141
"description": description,
140142
"health_check": health_check,
@@ -162,6 +164,7 @@ def update(
162164
cloudflare_endpoint: str,
163165
interface_address: str,
164166
name: str,
167+
bgp: ipsec_tunnel_update_params.BGP | NotGiven = NOT_GIVEN,
165168
customer_endpoint: str | NotGiven = NOT_GIVEN,
166169
description: str | NotGiven = NOT_GIVEN,
167170
health_check: ipsec_tunnel_update_params.HealthCheck | NotGiven = NOT_GIVEN,
@@ -239,6 +242,7 @@ def update(
239242
"cloudflare_endpoint": cloudflare_endpoint,
240243
"interface_address": interface_address,
241244
"name": name,
245+
"bgp": bgp,
242246
"customer_endpoint": customer_endpoint,
243247
"description": description,
244248
"health_check": health_check,
@@ -553,6 +557,7 @@ async def create(
553557
cloudflare_endpoint: str,
554558
interface_address: str,
555559
name: str,
560+
bgp: ipsec_tunnel_create_params.BGP | NotGiven = NOT_GIVEN,
556561
customer_endpoint: str | NotGiven = NOT_GIVEN,
557562
description: str | NotGiven = NOT_GIVEN,
558563
health_check: ipsec_tunnel_create_params.HealthCheck | NotGiven = NOT_GIVEN,
@@ -626,6 +631,7 @@ async def create(
626631
"cloudflare_endpoint": cloudflare_endpoint,
627632
"interface_address": interface_address,
628633
"name": name,
634+
"bgp": bgp,
629635
"customer_endpoint": customer_endpoint,
630636
"description": description,
631637
"health_check": health_check,
@@ -653,6 +659,7 @@ async def update(
653659
cloudflare_endpoint: str,
654660
interface_address: str,
655661
name: str,
662+
bgp: ipsec_tunnel_update_params.BGP | NotGiven = NOT_GIVEN,
656663
customer_endpoint: str | NotGiven = NOT_GIVEN,
657664
description: str | NotGiven = NOT_GIVEN,
658665
health_check: ipsec_tunnel_update_params.HealthCheck | NotGiven = NOT_GIVEN,
@@ -730,6 +737,7 @@ async def update(
730737
"cloudflare_endpoint": cloudflare_endpoint,
731738
"interface_address": interface_address,
732739
"name": name,
740+
"bgp": bgp,
733741
"customer_endpoint": customer_endpoint,
734742
"description": description,
735743
"health_check": health_check,

src/cloudflare/types/magic_transit/gre_tunnel_bulk_update_response.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,64 @@
1111
__all__ = [
1212
"GRETunnelBulkUpdateResponse",
1313
"ModifiedGRETunnel",
14+
"ModifiedGRETunnelBGP",
15+
"ModifiedGRETunnelBGPStatus",
1416
"ModifiedGRETunnelHealthCheck",
1517
"ModifiedGRETunnelHealthCheckTarget",
1618
"ModifiedGRETunnelHealthCheckTargetMagicHealthCheckTarget",
1719
]
1820

1921

22+
class ModifiedGRETunnelBGP(BaseModel):
23+
customer_asn: int
24+
"""ASN used on the customer end of the BGP session"""
25+
26+
extra_prefixes: Optional[List[str]] = None
27+
"""
28+
Prefixes in this list will be advertised to the customer device, in addition to
29+
the routes in the Magic routing table.
30+
"""
31+
32+
md5_key: Optional[str] = None
33+
"""MD5 key to use for session authentication.
34+
35+
Note that _this is not a security measure_. MD5 is not a valid security
36+
mechanism, and the key is not treated as a secret value. This is _only_
37+
supported for preventing misconfiguration, not for defending against malicious
38+
attacks.
39+
40+
The MD5 key, if set, must be of non-zero length and consist only of the
41+
following types of character:
42+
43+
- ASCII alphanumerics: `[a-zA-Z0-9]`
44+
- Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= \\||`
45+
46+
In other words, MD5 keys may contain any printable ASCII character aside from
47+
newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return
48+
(0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests
49+
specifying an MD5 key with one or more of these disallowed characters will be
50+
rejected.
51+
"""
52+
53+
54+
class ModifiedGRETunnelBGPStatus(BaseModel):
55+
state: Literal["BGP_DOWN", "BGP_UP", "BGP_ESTABLISHING"]
56+
57+
tcp_established: bool
58+
59+
updated_at: datetime
60+
61+
bgp_state: Optional[str] = None
62+
63+
cf_speaker_ip: Optional[str] = None
64+
65+
cf_speaker_port: Optional[int] = None
66+
67+
customer_speaker_ip: Optional[str] = None
68+
69+
customer_speaker_port: Optional[int] = None
70+
71+
2072
class ModifiedGRETunnelHealthCheckTargetMagicHealthCheckTarget(BaseModel):
2173
effective: Optional[str] = None
2274
"""The effective health check target.
@@ -91,6 +143,10 @@ class ModifiedGRETunnel(BaseModel):
91143
less, and cannot share a name with another GRE tunnel.
92144
"""
93145

146+
bgp: Optional[ModifiedGRETunnelBGP] = None
147+
148+
bgp_status: Optional[ModifiedGRETunnelBGPStatus] = None
149+
94150
created_on: Optional[datetime] = None
95151
"""The date and time the tunnel was created."""
96152

src/cloudflare/types/magic_transit/gre_tunnel_create_params.py

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@
22

33
from __future__ import annotations
44

5-
from typing import Union
5+
from typing import List, Union
66
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
77

88
from ..._utils import PropertyInfo
99
from .health_check_rate import HealthCheckRate
1010
from .health_check_type import HealthCheckType
1111

12-
__all__ = ["GRETunnelCreateParams", "HealthCheck", "HealthCheckTarget", "HealthCheckTargetMagicHealthCheckTarget"]
12+
__all__ = [
13+
"GRETunnelCreateParams",
14+
"BGP",
15+
"HealthCheck",
16+
"HealthCheckTarget",
17+
"HealthCheckTargetMagicHealthCheckTarget",
18+
]
1319

1420

1521
class GRETunnelCreateParams(TypedDict, total=False):
@@ -36,6 +42,8 @@ class GRETunnelCreateParams(TypedDict, total=False):
3642
less, and cannot share a name with another GRE tunnel.
3743
"""
3844

45+
bgp: BGP
46+
3947
description: str
4048
"""An optional description of the GRE tunnel."""
4149

@@ -61,6 +69,38 @@ class GRETunnelCreateParams(TypedDict, total=False):
6169
x_magic_new_hc_target: Annotated[bool, PropertyInfo(alias="x-magic-new-hc-target")]
6270

6371

72+
class BGP(TypedDict, total=False):
73+
customer_asn: Required[int]
74+
"""ASN used on the customer end of the BGP session"""
75+
76+
extra_prefixes: List[str]
77+
"""
78+
Prefixes in this list will be advertised to the customer device, in addition to
79+
the routes in the Magic routing table.
80+
"""
81+
82+
md5_key: str
83+
"""MD5 key to use for session authentication.
84+
85+
Note that _this is not a security measure_. MD5 is not a valid security
86+
mechanism, and the key is not treated as a secret value. This is _only_
87+
supported for preventing misconfiguration, not for defending against malicious
88+
attacks.
89+
90+
The MD5 key, if set, must be of non-zero length and consist only of the
91+
following types of character:
92+
93+
- ASCII alphanumerics: `[a-zA-Z0-9]`
94+
- Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= \\||`
95+
96+
In other words, MD5 keys may contain any printable ASCII character aside from
97+
newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return
98+
(0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests
99+
specifying an MD5 key with one or more of these disallowed characters will be
100+
rejected.
101+
"""
102+
103+
64104
class HealthCheckTargetMagicHealthCheckTarget(TypedDict, total=False):
65105
saved: str
66106
"""The saved health check target.

src/cloudflare/types/magic_transit/gre_tunnel_create_response.py

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,71 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Union, Optional
3+
from typing import List, Union, Optional
44
from datetime import datetime
55
from typing_extensions import Literal, TypeAlias
66

77
from ..._models import BaseModel
88
from .health_check_rate import HealthCheckRate
99
from .health_check_type import HealthCheckType
1010

11-
__all__ = ["GRETunnelCreateResponse", "HealthCheck", "HealthCheckTarget", "HealthCheckTargetMagicHealthCheckTarget"]
11+
__all__ = [
12+
"GRETunnelCreateResponse",
13+
"BGP",
14+
"BGPStatus",
15+
"HealthCheck",
16+
"HealthCheckTarget",
17+
"HealthCheckTargetMagicHealthCheckTarget",
18+
]
19+
20+
21+
class BGP(BaseModel):
22+
customer_asn: int
23+
"""ASN used on the customer end of the BGP session"""
24+
25+
extra_prefixes: Optional[List[str]] = None
26+
"""
27+
Prefixes in this list will be advertised to the customer device, in addition to
28+
the routes in the Magic routing table.
29+
"""
30+
31+
md5_key: Optional[str] = None
32+
"""MD5 key to use for session authentication.
33+
34+
Note that _this is not a security measure_. MD5 is not a valid security
35+
mechanism, and the key is not treated as a secret value. This is _only_
36+
supported for preventing misconfiguration, not for defending against malicious
37+
attacks.
38+
39+
The MD5 key, if set, must be of non-zero length and consist only of the
40+
following types of character:
41+
42+
- ASCII alphanumerics: `[a-zA-Z0-9]`
43+
- Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= \\||`
44+
45+
In other words, MD5 keys may contain any printable ASCII character aside from
46+
newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return
47+
(0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests
48+
specifying an MD5 key with one or more of these disallowed characters will be
49+
rejected.
50+
"""
51+
52+
53+
class BGPStatus(BaseModel):
54+
state: Literal["BGP_DOWN", "BGP_UP", "BGP_ESTABLISHING"]
55+
56+
tcp_established: bool
57+
58+
updated_at: datetime
59+
60+
bgp_state: Optional[str] = None
61+
62+
cf_speaker_ip: Optional[str] = None
63+
64+
cf_speaker_port: Optional[int] = None
65+
66+
customer_speaker_ip: Optional[str] = None
67+
68+
customer_speaker_port: Optional[int] = None
1269

1370

1471
class HealthCheckTargetMagicHealthCheckTarget(BaseModel):
@@ -85,6 +142,10 @@ class GRETunnelCreateResponse(BaseModel):
85142
less, and cannot share a name with another GRE tunnel.
86143
"""
87144

145+
bgp: Optional[BGP] = None
146+
147+
bgp_status: Optional[BGPStatus] = None
148+
88149
created_on: Optional[datetime] = None
89150
"""The date and time the tunnel was created."""
90151

0 commit comments

Comments
 (0)