mirror of
https://github.com/cloudflare/cloudflare-python.git
synced 2026-01-16 23:01:03 +00:00
feat(api): OpenAPI spec update via Stainless API (#134)
This commit is contained in:
parent
cac9284a7b
commit
9ea82d193c
3 changed files with 23 additions and 5 deletions
|
|
@ -107,6 +107,7 @@ class Routes(SyncAPIResource):
|
|||
self,
|
||||
*,
|
||||
format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN,
|
||||
longest_prefix_match: bool | NotGiven = NOT_GIVEN,
|
||||
origin: int | NotGiven = NOT_GIVEN,
|
||||
prefix: str | NotGiven = NOT_GIVEN,
|
||||
rpki_status: Literal["VALID", "INVALID", "UNKNOWN"] | NotGiven = NOT_GIVEN,
|
||||
|
|
@ -118,14 +119,17 @@ class Routes(SyncAPIResource):
|
|||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RoutePfx2asResponse:
|
||||
"""
|
||||
Lookup prefix-to-origin mapping on global routing tables.
|
||||
Lookup prefix-to-ASN mapping on global routing tables.
|
||||
|
||||
Args:
|
||||
format: Format results are returned in.
|
||||
|
||||
longest_prefix_match: Return only results with the longest prefix match for the given prefix. For
|
||||
example, specify a /32 prefix to lookup the origin ASN for an IPv4 address.
|
||||
|
||||
origin: Lookup prefixes originated by the given ASN
|
||||
|
||||
prefix: Lookup origins of the given prefix
|
||||
prefix: Lookup origin ASNs of the given prefix
|
||||
|
||||
rpki_status: Return only results with matching rpki status: valid, invalid or unknown
|
||||
|
||||
|
|
@ -147,6 +151,7 @@ class Routes(SyncAPIResource):
|
|||
query=maybe_transform(
|
||||
{
|
||||
"format": format,
|
||||
"longest_prefix_match": longest_prefix_match,
|
||||
"origin": origin,
|
||||
"prefix": prefix,
|
||||
"rpki_status": rpki_status,
|
||||
|
|
@ -356,6 +361,7 @@ class AsyncRoutes(AsyncAPIResource):
|
|||
self,
|
||||
*,
|
||||
format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN,
|
||||
longest_prefix_match: bool | NotGiven = NOT_GIVEN,
|
||||
origin: int | NotGiven = NOT_GIVEN,
|
||||
prefix: str | NotGiven = NOT_GIVEN,
|
||||
rpki_status: Literal["VALID", "INVALID", "UNKNOWN"] | NotGiven = NOT_GIVEN,
|
||||
|
|
@ -367,14 +373,17 @@ class AsyncRoutes(AsyncAPIResource):
|
|||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> RoutePfx2asResponse:
|
||||
"""
|
||||
Lookup prefix-to-origin mapping on global routing tables.
|
||||
Lookup prefix-to-ASN mapping on global routing tables.
|
||||
|
||||
Args:
|
||||
format: Format results are returned in.
|
||||
|
||||
longest_prefix_match: Return only results with the longest prefix match for the given prefix. For
|
||||
example, specify a /32 prefix to lookup the origin ASN for an IPv4 address.
|
||||
|
||||
origin: Lookup prefixes originated by the given ASN
|
||||
|
||||
prefix: Lookup origins of the given prefix
|
||||
prefix: Lookup origin ASNs of the given prefix
|
||||
|
||||
rpki_status: Return only results with matching rpki status: valid, invalid or unknown
|
||||
|
||||
|
|
@ -396,6 +405,7 @@ class AsyncRoutes(AsyncAPIResource):
|
|||
query=await async_maybe_transform(
|
||||
{
|
||||
"format": format,
|
||||
"longest_prefix_match": longest_prefix_match,
|
||||
"origin": origin,
|
||||
"prefix": prefix,
|
||||
"rpki_status": rpki_status,
|
||||
|
|
|
|||
|
|
@ -13,11 +13,17 @@ class RoutePfx2asParams(TypedDict, total=False):
|
|||
format: Literal["JSON", "CSV"]
|
||||
"""Format results are returned in."""
|
||||
|
||||
longest_prefix_match: Annotated[bool, PropertyInfo(alias="longestPrefixMatch")]
|
||||
"""Return only results with the longest prefix match for the given prefix.
|
||||
|
||||
For example, specify a /32 prefix to lookup the origin ASN for an IPv4 address.
|
||||
"""
|
||||
|
||||
origin: int
|
||||
"""Lookup prefixes originated by the given ASN"""
|
||||
|
||||
prefix: str
|
||||
"""Lookup origins of the given prefix"""
|
||||
"""Lookup origin ASNs of the given prefix"""
|
||||
|
||||
rpki_status: Annotated[Literal["VALID", "INVALID", "UNKNOWN"], PropertyInfo(alias="rpkiStatus")]
|
||||
"""Return only results with matching rpki status: valid, invalid or unknown"""
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ class TestRoutes:
|
|||
def test_method_pfx2as_with_all_params(self, client: Cloudflare) -> None:
|
||||
route = client.radar.bgp.routes.pfx2as(
|
||||
format="JSON",
|
||||
longest_prefix_match=True,
|
||||
origin=0,
|
||||
prefix="1.1.1.0/24",
|
||||
rpki_status="INVALID",
|
||||
|
|
@ -233,6 +234,7 @@ class TestAsyncRoutes:
|
|||
async def test_method_pfx2as_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
route = await async_client.radar.bgp.routes.pfx2as(
|
||||
format="JSON",
|
||||
longest_prefix_match=True,
|
||||
origin=0,
|
||||
prefix="1.1.1.0/24",
|
||||
rpki_status="INVALID",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue