Gets information about whether a specified geographic location is supported for Amazon Route 53 geolocation resource record sets.
Route 53 does not perform authorization for this API because it retrieves information that is already available to the public.
Use the following syntax to determine whether a continent is supported for geolocation:
GET /2013-04-01/geolocation?continentcode=two-letter abbreviation for a continent
Use the following syntax to determine whether a country is supported for geolocation:
GET /2013-04-01/geolocation?countrycode=two-character country code
Use the following syntax to determine whether a subdivision of a country is supported for geolocation:
GET /2013-04-01/geolocation?countrycode=two-character country code&subdivisioncode=subdivision code
Parameters:
Raises:
Source code in docs_src/capo_route_53/_services/route53.py
| def get_geo_location(
self,
*,
config_overrides: Optional[Route53ClientConfig] = None,
continent_code: Optional[
"capo_route_53.types.geo_location_continent_code.GeoLocationContinentCode"
] = None,
country_code: Optional[
"capo_route_53.types.geo_location_country_code.GeoLocationCountryCode"
] = None,
subdivision_code: Optional[
"capo_route_53.types.geo_location_subdivision_code.GeoLocationSubdivisionCode"
] = None,
) -> "capo_route_53.types.get_geo_location_response.GetGeoLocationResponse":
"""<p>Gets information about whether a specified geographic location is supported for Amazon Route 53 geolocation resource record sets.</p> <p>Route 53 does not perform authorization for this API because it retrieves information that is already available to the public.</p> <p>Use the following syntax to determine whether a continent is supported for geolocation:</p> <p> <code>GET /2013-04-01/geolocation?continentcode=<i>two-letter abbreviation for a continent</i> </code> </p> <p>Use the following syntax to determine whether a country is supported for geolocation:</p> <p> <code>GET /2013-04-01/geolocation?countrycode=<i>two-character country code</i> </code> </p> <p>Use the following syntax to determine whether a subdivision of a country is supported for geolocation:</p> <p> <code>GET /2013-04-01/geolocation?countrycode=<i>two-character country code</i>&subdivisioncode=<i>subdivision code</i> </code> </p>
Args:
continent_code: <p>For geolocation resource record sets, a two-letter abbreviation that identifies a continent. Amazon Route 53 supports the following continent codes:</p> <ul> <li> <p> <b>AF</b>: Africa</p> </li> <li> <p> <b>AN</b>: Antarctica</p> </li> <li> <p> <b>AS</b>: Asia</p> </li> <li> <p> <b>EU</b>: Europe</p> </li> <li> <p> <b>OC</b>: Oceania</p> </li> <li> <p> <b>NA</b>: North America</p> </li> <li> <p> <b>SA</b>: South America</p> </li> </ul>
country_code: <p>Amazon Route 53 uses the two-letter country codes that are specified in <a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO standard 3166-1 alpha-2</a>.</p> <p>Route 53 also supports the country code <b>UA</b> for Ukraine.</p>
subdivision_code: <p>The code for the subdivision, such as a particular state within the United States. For a list of US state abbreviations, see <a href="https://pe.usps.com/text/pub28/28apb.htm">Appendix B: Two–Letter State and Possession Abbreviations</a> on the United States Postal Service website. For a list of all supported subdivision codes, use the <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListGeoLocations.html">ListGeoLocations</a> API.</p>
Raises:
capo_route_53.errors.invalid_input.InvalidInput: <p>The input is not valid.</p>
capo_route_53.errors.no_such_geo_location.NoSuchGeoLocation: <p>Amazon Route 53 doesn't support the specified geographic location. For a list of supported geolocation codes, see the <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_GeoLocation.html">GeoLocation</a> data type.</p>
capo_route_53.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_route_53.types.get_geo_location_request.GetGeoLocationRequest]",
) -> OperationResponse[
"capo_route_53.types.get_geo_location_response.GetGeoLocationResponse"
]:
import capo_route_53._operations.aws_dns_v20130401.get_geo_location
output, http_response = (
capo_route_53._operations.aws_dns_v20130401.get_geo_location.get_geo_location(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetGeoLocation")
)
input_: capo_route_53.types.get_geo_location_request.GetGeoLocationRequest = {}
if continent_code is not None:
input_["continent_code"] = continent_code
if country_code is not None:
input_["country_code"] = country_code
if subdivision_code is not None:
input_["subdivision_code"] = subdivision_code
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|