def get_health_check_by_id_parser(root, connection):
    """
    Parses the API responses for the
    :py:meth:`route53.connection.Route53Connection.get_health_check_by_id` method.

    :param lxml.etree._Element root: The root node of the etree parsed
        response from the API.
    :param Route53Connection connection: The connection instance used to
        query the API.
    :rtype: HealthCheck
    :returns: The requested HealthCheck.
    """

    e_zone = root.find('./{*}HealthCheck')
    # This pops out a HealthCheck instance.
    health_check =  parse_health_check(e_zone, connection)
    return health_check
Ejemplo n.º 2
0
def created_health_check_parser(root, connection):
    """
    Parses the API responses for the
    :py:meth:`route53.connection.Route53Connection.create_health_check` method.

    :param lxml.etree._Element root: The root node of the etree parsed
        response from the API.
    :param Route53Connection connection: The connection instance used to
        query the API.
    :rtype: HostedZone
    :returns: The newly created HostedZone.
    """

    health_check_xml = root.find('./{*}HealthCheck')
    # This pops out a HostedZone instance.
    health_check = parse_health_check(health_check_xml, connection)

    return health_check
Ejemplo n.º 3
0
def list_health_checks_parser(root, connection):
    """
    Parses the API responses for the
    :py:meth:`route53.connection.Route53Connection.list_health_checks` method.

    :param lxml.etree._Element root: The root node of the etree parsed
        response from the API.
    :param Route53Connection connection: The connection instance used to
        query the API.
    :rtype: HealthCheck
    :returns: A generator of fully formed HostedZone instances.
    """

    # The rest of the list pagination tags are handled higher up in the stack.
    # We'll just worry about the HostedZones tag, which has HostedZone tags
    # nested beneath it.
    health_checks = root.find('./{*}HealthChecks')

    for health_check in health_checks:
        yield parse_health_check(health_check, connection)