Skip to content

restore_domain

restore_domain(
    domain_name: DomainName,
    *,
    config_overrides: Optional[Route53DomainsClientConfig] = None,
    consent: Optional[Consent] = None,
) -> RestoreDomainResponse

Restores a domain that has expired, or was deleted, before it becomes available for others to register. The cost of restoring your domain is billed to your Amazon Web Services account.

Not every TLD registry supports restoring domains, and the period during which a domain can be restored varies by TLD. To find out whether your domain can be restored and the period during which you can restore it, see Domains that you can register with Amazon Route 53 in the Amazon Route 53 Developer Guide.

Restoring a domain typically costs more, and sometimes much more, than registering or renewing a domain. To get the restoration price for a domain before you restore it, use GetDomainPrices.

Restoration is asynchronous. The response includes an operation ID that you can use with GetOperationDetail to track the progress of the request. When the restoration succeeds, the domain reappears in the response to ListDomains.

For more information, see Restoring an expired or deleted domain in the Amazon Route 53 Developer Guide.

Parameters:

  • domain_name (DomainName) –

    The name of the domain that you want to restore. The domain must have been registered to the Amazon Web Services account that submits the request.

  • consent (Optional[Consent], default: None ) –

    Specifies the maximum price that you agree to pay to restore the domain name. This element is required if the domain has registry premium pricing, and optional if the domain is priced at the standard rate for its TLD. If you include it and the restoration price is more than MaxPrice, the request fails.

Raises:

  • DuplicateRequest –

    The request is already in progress for the domain.

  • 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.

  • OperationLimitExceeded –

    The number of operations or jobs running exceeded the allowed threshold for the account.

  • 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/route53_domains.py
def restore_domain(
    self,
    domain_name: "capo_route_53_domains.types.domain_name.DomainName",
    *,
    config_overrides: Optional[Route53DomainsClientConfig] = None,
    consent: Optional["capo_route_53_domains.types.consent.Consent"] = None,
) -> "capo_route_53_domains.types.restore_domain_response.RestoreDomainResponse":
    """<p>Restores a domain that has expired, or was deleted, before it becomes available for others to register. The cost of restoring your domain is billed to your Amazon Web Services account.</p> <p>Not every TLD registry supports restoring domains, and the period during which a domain can be restored varies by TLD. To find out whether your domain can be restored and the period during which you can restore it, 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> <important> <p>Restoring a domain typically costs more, and sometimes much more, than registering or renewing a domain. To get the restoration price for a domain before you restore it, use <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_GetDomainPrices.html">GetDomainPrices</a>.</p> </important> <p>Restoration is asynchronous. The response includes an operation ID that you can use with <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_GetOperationDetail.html">GetOperationDetail</a> to track the progress of the request. When the restoration succeeds, the domain reappears in the response to <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_ListDomains.html">ListDomains</a>.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-restore-expired.html">Restoring an expired or deleted domain</a> in the <i>Amazon Route 53 Developer Guide</i>.</p>

    Args:
        domain_name: <p>The name of the domain that you want to restore. The domain must have been registered to the Amazon Web Services account that submits the request.</p>
        consent: <p>Specifies the maximum price that you agree to pay to restore the domain name. This element is required if the domain has registry premium pricing, and optional if the domain is priced at the standard rate for its TLD. If you include it and the restoration price is more than <code>MaxPrice</code>, the request fails.</p>

    Raises:
        capo_route_53_domains.errors.duplicate_request.DuplicateRequest: <p>The request is already in progress for the domain.</p>
        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.operation_limit_exceeded.OperationLimitExceeded: <p>The number of operations or jobs running exceeded the allowed threshold for the account.</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.
    """

    def _handler(
        req: "OperationRequest[capo_route_53_domains.types.restore_domain_request.RestoreDomainRequest]",
    ) -> OperationResponse[
        "capo_route_53_domains.types.restore_domain_response.RestoreDomainResponse"
    ]:
        if req.options.protocol == "awsJson1_1":
            import capo_route_53_domains._operations.route53_domains_v20140515.aws_json1_1.restore_domain

            output, http_response = (
                capo_route_53_domains._operations.route53_domains_v20140515.aws_json1_1.restore_domain.restore_domain(
                    req.options, req.input
                )
            )
        elif req.options.protocol == "rpcv2Cbor":
            import capo_route_53_domains._operations.route53_domains_v20140515.rpcv2_cbor.restore_domain

            output, http_response = (
                capo_route_53_domains._operations.route53_domains_v20140515.rpcv2_cbor.restore_domain.restore_domain(
                    req.options, req.input
                )
            )
        else:
            raise ValueError(f"unknown protocol {req.options.protocol!r}")
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RestoreDomain")
    )
    input_: capo_route_53_domains.types.restore_domain_request.RestoreDomainRequest = {
        "domain_name": domain_name
    }
    if consent is not None:
        input_["consent"] = consent

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output