@@ -107,6 +107,7 @@ def pfx2as(
107107 self ,
108108 * ,
109109 format : Literal ["JSON" , "CSV" ] | NotGiven = NOT_GIVEN ,
110+ longest_prefix_match : bool | NotGiven = NOT_GIVEN ,
110111 origin : int | NotGiven = NOT_GIVEN ,
111112 prefix : str | NotGiven = NOT_GIVEN ,
112113 rpki_status : Literal ["VALID" , "INVALID" , "UNKNOWN" ] | NotGiven = NOT_GIVEN ,
@@ -118,14 +119,17 @@ def pfx2as(
118119 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
119120 ) -> RoutePfx2asResponse :
120121 """
121- Lookup prefix-to-origin mapping on global routing tables.
122+ Lookup prefix-to-ASN mapping on global routing tables.
122123
123124 Args:
124125 format: Format results are returned in.
125126
127+ longest_prefix_match: Return only results with the longest prefix match for the given prefix. For
128+ example, specify a /32 prefix to lookup the origin ASN for an IPv4 address.
129+
126130 origin: Lookup prefixes originated by the given ASN
127131
128- prefix: Lookup origins of the given prefix
132+ prefix: Lookup origin ASNs of the given prefix
129133
130134 rpki_status: Return only results with matching rpki status: valid, invalid or unknown
131135
@@ -147,6 +151,7 @@ def pfx2as(
147151 query = maybe_transform (
148152 {
149153 "format" : format ,
154+ "longest_prefix_match" : longest_prefix_match ,
150155 "origin" : origin ,
151156 "prefix" : prefix ,
152157 "rpki_status" : rpki_status ,
@@ -356,6 +361,7 @@ async def pfx2as(
356361 self ,
357362 * ,
358363 format : Literal ["JSON" , "CSV" ] | NotGiven = NOT_GIVEN ,
364+ longest_prefix_match : bool | NotGiven = NOT_GIVEN ,
359365 origin : int | NotGiven = NOT_GIVEN ,
360366 prefix : str | NotGiven = NOT_GIVEN ,
361367 rpki_status : Literal ["VALID" , "INVALID" , "UNKNOWN" ] | NotGiven = NOT_GIVEN ,
@@ -367,14 +373,17 @@ async def pfx2as(
367373 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
368374 ) -> RoutePfx2asResponse :
369375 """
370- Lookup prefix-to-origin mapping on global routing tables.
376+ Lookup prefix-to-ASN mapping on global routing tables.
371377
372378 Args:
373379 format: Format results are returned in.
374380
381+ longest_prefix_match: Return only results with the longest prefix match for the given prefix. For
382+ example, specify a /32 prefix to lookup the origin ASN for an IPv4 address.
383+
375384 origin: Lookup prefixes originated by the given ASN
376385
377- prefix: Lookup origins of the given prefix
386+ prefix: Lookup origin ASNs of the given prefix
378387
379388 rpki_status: Return only results with matching rpki status: valid, invalid or unknown
380389
@@ -396,6 +405,7 @@ async def pfx2as(
396405 query = await async_maybe_transform (
397406 {
398407 "format" : format ,
408+ "longest_prefix_match" : longest_prefix_match ,
399409 "origin" : origin ,
400410 "prefix" : prefix ,
401411 "rpki_status" : rpki_status ,
0 commit comments