listAsns()
List available autonomous systems
Returns targetable ASNs for the selected package. Geo-scoped records include the country, region, or city where the ASN can be selected.
Signature
client.locations.listAsns(options: LocationsListAsnsOptions): Promise<LocationsListAsnsResponse>Parameters
| Name | Type | Requirement | Description |
|---|---|---|---|
code | string | Optional | — |
countryCode | string | Optional | — |
global | boolean | Optional | Set to true to return only globally targetable ASNs. |
limit | number | Optional | Number of results to return per page. |
name | string | Optional | — |
offset | number | Optional | The initial index from which to return the results. |
ordering | string | Optional | Which field to use when ordering the results. |
packageId | string | Required | Package whose targeting availability should be returned. |
search | string | Optional | Case-insensitive partial search across ASN fields: `code` and `name`. Separate multiple terms with spaces or commas; every term must match at least one listed field. |
acceptLanguage | string | Optional | Preferred language for human-readable API errors. Supported languages: en, ru, uk, de, it, fr, es, zh-hans, ja. Regional language tags and quality weights are accepted; unsupported or omitted values use English. |
Example
const result = await client.locations.listAsns({ packageId: "550e8400-e29b-41d4-a716-446655440000"});Returns
PaginatedLocationASNRecordListThe operation completed successfully.
typePaginatedLocationASNRecordList4fields
countnumbernextstringpreviousstringresultsLocationASNRecord[]typeLocationASNRecord3fields
codestringnamestringgeoLocationASNGeoItem[]typeLocationASNGeoItem3fields
countryLocationCodeNametypeLocationCodeName2fields
codestringnamestringregionLocationCodeNametypeLocationCodeName2fields
codestringnamestringcityLocationCodeNametypeLocationCodeName2fields
codestringnamestringThrows
ApiErrorNormalized API, transport, and response processing failure.
kind: "validation"The request arguments or business rules are invalid.kind: "authentication"Authentication credentials are missing, expired, or invalid.kind: "permission"The authenticated account cannot perform this operation.kind: "network"The request could not reach ProxyRequest.kind: "unexpected"The response could not be decoded or did not match the SDK contract.
Advanced variants
client.locations.listAsnsWithResponse(options): Promise<ApiResponse<LocationsListAsnsResponse>>Returns response status, headers, ETag and idempotency metadata with the decoded data.
Signature
client.locations.list_asns(*, code: str | Unset=UNSET, country_code: str | Unset=UNSET, global_: bool | Unset=UNSET, limit: int | Unset=UNSET, name: str | Unset=UNSET, offset: int | Unset=UNSET, ordering: str | Unset=UNSET, package_id: UUID, search: str | Unset=UNSET, accept_language: str | Unset=UNSET) -> PaginatedLocationASNRecordListawait async_client.locations.list_asns(*, code: str | Unset=UNSET, country_code: str | Unset=UNSET, global_: bool | Unset=UNSET, limit: int | Unset=UNSET, name: str | Unset=UNSET, offset: int | Unset=UNSET, ordering: str | Unset=UNSET, package_id: UUID, search: str | Unset=UNSET, accept_language: str | Unset=UNSET) -> PaginatedLocationASNRecordListParameters
| Name | Type | Requirement | Description |
|---|---|---|---|
code | str | Optional | — |
country_code | str | Optional | — |
global | bool | Optional | Set to true to return only globally targetable ASNs. |
limit | int | Optional | Number of results to return per page. |
name | str | Optional | — |
offset | int | Optional | The initial index from which to return the results. |
ordering | str | Optional | Which field to use when ordering the results. |
package_id | str | Required | Package whose targeting availability should be returned. |
search | str | Optional | Case-insensitive partial search across ASN fields: `code` and `name`. Separate multiple terms with spaces or commas; every term must match at least one listed field. |
accept_language | str | Optional | Preferred language for human-readable API errors. Supported languages: en, ru, uk, de, it, fr, es, zh-hans, ja. Regional language tags and quality weights are accepted; unsupported or omitted values use English. |
Example
result = client.locations.list_asns( package_id='550e8400-e29b-41d4-a716-446655440000', )Async example
result = await async_client.locations.list_asns( package_id='550e8400-e29b-41d4-a716-446655440000', )Returns
PaginatedLocationASNRecordListThe operation completed successfully.
classPaginatedLocationASNRecordList4fields
countintresultslist[LocationASNRecord]classLocationASNRecord3fields
codestrnamestrgeolist[LocationASNGeoItem]classLocationASNGeoItem3fields
countryLocationCodeNameclassLocationCodeName2fields
codestrnamestrregionLocationCodeNameclassLocationCodeName2fields
codestrnamestrcityLocationCodeNameclassLocationCodeName2fields
codestrnamestrnext_None | strpreviousNone | strThrows
ApiErrorNormalized API, transport, and response processing failure.
ErrorKind.VALIDATIONThe request arguments or business rules are invalid.ErrorKind.AUTHENTICATIONAuthentication credentials are missing, expired, or invalid.ErrorKind.PERMISSIONThe authenticated account cannot perform this operation.ErrorKind.NETWORKThe request could not reach ProxyRequest.ErrorKind.UNEXPECTEDThe response could not be decoded or did not match the SDK contract.
Advanced variants
client.locations.list_asns_with_response(*, code: str | Unset=UNSET, country_code: str | Unset=UNSET, global_: bool | Unset=UNSET, limit: int | Unset=UNSET, name: str | Unset=UNSET, offset: int | Unset=UNSET, ordering: str | Unset=UNSET, package_id: UUID, search: str | Unset=UNSET, accept_language: str | Unset=UNSET) -> ApiResponse[PaginatedLocationASNRecordList]Returns response status, headers, ETag and idempotency metadata with the decoded data.
Signature
$client->locations()->listAsns($packageId, $code = null, $countryCode = null, $global = null, $limit = null, $name = null, $offset = null, $ordering = null, $search = null, $acceptLanguage = null, string $contentType = self::contentTypes['listAsns'][0])Parameters
| Name | Type | Requirement | Description |
|---|---|---|---|
code | string | Optional | — |
countryCode | string | Optional | — |
global | bool | Optional | Set to true to return only globally targetable ASNs. |
limit | int | Optional | Number of results to return per page. |
name | string | Optional | — |
offset | int | Optional | The initial index from which to return the results. |
ordering | string | Optional | Which field to use when ordering the results. |
packageId | string | Required | Package whose targeting availability should be returned. |
search | string | Optional | Case-insensitive partial search across ASN fields: `code` and `name`. Separate multiple terms with spaces or commas; every term must match at least one listed field. |
acceptLanguage | string | Optional | Preferred language for human-readable API errors. Supported languages: en, ru, uk, de, it, fr, es, zh-hans, ja. Regional language tags and quality weights are accepted; unsupported or omitted values use English. |
Example
$result = $client->locations()->listAsns( packageId: '550e8400-e29b-41d4-a716-446655440000',);Returns
PaginatedLocationASNRecordListThe operation completed successfully.
classPaginatedLocationASNRecordList4fields
countintnextstringpreviousstringresults[LocationASNRecord[]](LocationASNRecord.md)classLocationASNRecord3fields
codestringnamestringgeo[LocationASNGeoItem[]](LocationASNGeoItem.md)classLocationASNGeoItem3fields
countryLocationCodeNameclassLocationCodeName2fields
codestringnamestringregionLocationCodeNameclassLocationCodeName2fields
codestringnamestringcityLocationCodeNameclassLocationCodeName2fields
codestringnamestringThrows
ApiExceptionNormalized API, transport, and response processing failure.
ErrorKind::ValidationThe request arguments or business rules are invalid.ErrorKind::AuthenticationAuthentication credentials are missing, expired, or invalid.ErrorKind::PermissionThe authenticated account cannot perform this operation.ErrorKind::NetworkThe request could not reach ProxyRequest.ErrorKind::UnexpectedThe response could not be decoded or did not match the SDK contract.
InvalidArgumentExceptionA required argument is missing or violates a local SDK constraint.
local validationThe request was rejected before it was sent.
Advanced variants
$client->locations()->listAsnsWithResponse($packageId, $code = null, $countryCode = null, $global = null, $limit = null, $name = null, $offset = null, $ordering = null, $search = null, $acceptLanguage = null, string $contentType = self::contentTypes['listAsns'][0]): \ProxyRequest\ApiResponseReturns an ApiResponse with decoded data and HTTP metadata.
$client->locations()->listAsnsWithHttpInfo($packageId, $code = null, $countryCode = null, $global = null, $limit = null, $name = null, $offset = null, $ordering = null, $search = null, $acceptLanguage = null, string $contentType = self::contentTypes['listAsns'][0])Returns the OpenAPI Generator response tuple.
$client->locations()->listAsnsAsync($packageId, $code = null, $countryCode = null, $global = null, $limit = null, $name = null, $offset = null, $ordering = null, $search = null, $acceptLanguage = null, string $contentType = self::contentTypes['listAsns'][0])Returns a Guzzle promise for the decoded result.
$client->locations()->listAsnsAsyncWithHttpInfo($packageId, $code = null, $countryCode = null, $global = null, $limit = null, $name = null, $offset = null, $ordering = null, $search = null, $acceptLanguage = null, string $contentType = self::contentTypes['listAsns'][0])Returns a Guzzle promise for the response tuple.
$client->locations()->listAsnsRequest($packageId, $code = null, $countryCode = null, $global = null, $limit = null, $name = null, $offset = null, $ordering = null, $search = null, $acceptLanguage = null, string $contentType = self::contentTypes['listAsns'][0])Builds the PSR-7 request without sending it.