def fqdn(deployment, validity):
    """
    Generates a report in order to determine the number of FQDNs covered by Lemur issued certificates.
    """
    headers = [
        "FQDN",
        "Root Domain",
        "Issuer",
        "Owner",
        "Validity End",
        "Total Length (days), Time Until Expiration (days)",
    ]
    rows = []

    for cert in fqdns(validity=validity, deployment=deployment).all():
        for domain in cert.domains:
            rows.append(
                [
                    domain.name,
                    ".".join(domain.name.split(".")[1:]),
                    cert.issuer,
                    cert.owner,
                    cert.not_after,
                    cert.validity_range.days,
                    cert.validity_remaining.days,
                ]
            )

    click.echo(tabulate(rows, headers=headers))

    Generates a report in order to determine the number of FQDNs covered by Lemur issued certificates.
    
lemur/reporting/cli.py