Skip to content

get_hosted_zone

get_hosted_zone(
    id: ResourceId, *, config_overrides: Optional[Route53ClientConfig] = None
) -> GetHostedZoneResponse

Gets information about a specified hosted zone including the four name servers assigned to the hosted zone.

returns the VPCs associated with the specified hosted zone and does not reflect the VPC associations by Route 53 Profiles. To get the associations to a Profile, call the ListProfileAssociations API.

Parameters:

  • id (ResourceId) –

    The ID of the hosted zone that you want to get information about.

Raises:

Examples:

To get information about a hosted zone The following example gets information about the Z3M3LMPEXAMPLE hosted zone.

>>> client.get_hosted_zone(id='Z3M3LMPEXAMPLE')
Source code in docs_src/capo_route_53/_services/route53.py
def get_hosted_zone(
    self,
    id: "capo_route_53.types.resource_id.ResourceId",
    *,
    config_overrides: Optional[Route53ClientConfig] = None,
) -> "capo_route_53.types.get_hosted_zone_response.GetHostedZoneResponse":
    """<p>Gets information about a specified hosted zone including the four name servers assigned to the hosted zone.</p> <p> <code></code> returns the VPCs associated with the specified hosted zone and does not reflect the VPC associations by Route 53 Profiles. To get the associations to a Profile, call the <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53profiles_ListProfileAssociations.html">ListProfileAssociations</a> API.</p>

    Args:
        id: <p>The ID of the hosted zone that you want to get information about.</p>

    Raises:
        capo_route_53.errors.invalid_input.InvalidInput: <p>The input is not valid.</p>
        capo_route_53.errors.no_such_hosted_zone.NoSuchHostedZone: <p>No hosted zone exists with the ID that you specified.</p>
        capo_route_53.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To get information about a hosted zone
        The following example gets information about the Z3M3LMPEXAMPLE hosted zone.

        >>> client.get_hosted_zone(id='Z3M3LMPEXAMPLE')
    """

    def _handler(
        req: "OperationRequest[capo_route_53.types.get_hosted_zone_request.GetHostedZoneRequest]",
    ) -> OperationResponse[
        "capo_route_53.types.get_hosted_zone_response.GetHostedZoneResponse"
    ]:
        import capo_route_53._operations.aws_dns_v20130401.get_hosted_zone

        output, http_response = (
            capo_route_53._operations.aws_dns_v20130401.get_hosted_zone.get_hosted_zone(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetHostedZone")
    )
    input_: capo_route_53.types.get_hosted_zone_request.GetHostedZoneRequest = {
        "id": id
    }

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