Skip to content

check_domain_availability async

check_domain_availability(
    domain_name: DomainName,
    *,
    config_overrides: Optional[AsyncRoute53DomainsClientConfig] = None,
    idn_lang_code: Optional[LangCode] = None,
) -> CheckDomainAvailabilityResponse

This operation checks the availability of one domain name. Note that if the availability status of a domain is pending, you must submit another request to determine the availability of the domain name.

Parameters:

  • domain_name (DomainName) –

    The name of the domain that you want to get availability for. The top-level domain (TLD), such as .com, must be a TLD that Route 53 supports. For a list of supported TLDs, see Domains that You Can Register with Amazon Route 53 in the Amazon Route 53 Developer Guide.

    The domain name can contain only the following characters:

    • Letters a through z. Domain names are not case sensitive.

    • Numbers 0 through 9.

    • Hyphen (-). You can't specify a hyphen at the beginning or end of a label.

    • Period (.) to separate the labels in the name, such as the . in example.com.

    Internationalized domain names are not supported for some top-level domains. To determine whether the TLD that you want to use supports internationalized domain names, see Domains that You Can Register with Amazon Route 53. For more information, see Formatting Internationalized Domain Names.

  • idn_lang_code (Optional[LangCode], default: None ) –

    Reserved for future use.

Raises:

  • InvalidInput –

    The requested item is not acceptable. For example, for APIs that accept a domain name, the request might specify a domain name that doesn't belong to the account that submitted the request. For AcceptDomainTransferFromAnotherAwsAccount, the password might be invalid.

  • TLDInMaintenance –

    The top-level domain is currently undergoing maintenance and the request cannot be processed. Try again later.

  • UnsupportedTLD –

    Amazon Route 53 does not support this top-level domain (TLD).

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_route_53_domains/_services/async_route53_domains.py
async def check_domain_availability(
    self,
    domain_name: "capo_route_53_domains.types.domain_name.DomainName",
    *,
    config_overrides: Optional[AsyncRoute53DomainsClientConfig] = None,
    idn_lang_code: Optional[
        "capo_route_53_domains.types.lang_code.LangCode"
    ] = None,
) -> "capo_route_53_domains.types.check_domain_availability_response.CheckDomainAvailabilityResponse":
    """<p>This operation checks the availability of one domain name. Note that if the availability status of a domain is pending, you must submit another request to determine the availability of the domain name.</p>

    Args:
        domain_name: <p>The name of the domain that you want to get availability for. The top-level domain (TLD), such as .com, must be a TLD that Route 53 supports. For a list of supported TLDs, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/registrar-tld-list.html">Domains that You Can Register with Amazon Route 53</a> in the <i>Amazon Route 53 Developer Guide</i>.</p> <p>The domain name can contain only the following characters:</p> <ul> <li> <p>Letters a through z. Domain names are not case sensitive.</p> </li> <li> <p>Numbers 0 through 9.</p> </li> <li> <p>Hyphen (-). You can't specify a hyphen at the beginning or end of a label. </p> </li> <li> <p>Period (.) to separate the labels in the name, such as the <code>.</code> in <code>example.com</code>.</p> </li> </ul> <p>Internationalized domain names are not supported for some top-level domains. To determine whether the TLD that you want to use supports internationalized domain names, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/registrar-tld-list.html">Domains that You Can Register with Amazon Route 53</a>. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html#domain-name-format-idns">Formatting Internationalized Domain Names</a>. </p>
        idn_lang_code: <p>Reserved for future use.</p>

    Raises:
        capo_route_53_domains.errors.invalid_input.InvalidInput: <p>The requested item is not acceptable. For example, for APIs that accept a domain name, the request might specify a domain name that doesn't belong to the account that submitted the request. For <code>AcceptDomainTransferFromAnotherAwsAccount</code>, the password might be invalid.</p>
        capo_route_53_domains.errors.tld_in_maintenance.TLDInMaintenance: <p>The top-level domain is currently undergoing maintenance and the request cannot be processed. Try again later.</p>
        capo_route_53_domains.errors.unsupported_tld.UnsupportedTLD: <p>Amazon Route 53 does not support this top-level domain (TLD).</p>
        capo_route_53_domains.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_route_53_domains.types.check_domain_availability_request.CheckDomainAvailabilityRequest]",
    ) -> AsyncOperationResponse[
        "capo_route_53_domains.types.check_domain_availability_response.CheckDomainAvailabilityResponse"
    ]:
        import capo_route_53_domains._operations.route53_domains_v20140515.check_domain_availability

        (
            output,
            http_response,
        ) = await capo_route_53_domains._operations.route53_domains_v20140515.check_domain_availability.async_check_domain_availability(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CheckDomainAvailability")
    )
    input_: capo_route_53_domains.types.check_domain_availability_request.CheckDomainAvailabilityRequest = {
        "domain_name": domain_name
    }
    if idn_lang_code is not None:
        input_["idn_lang_code"] = idn_lang_code

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output