{%- if filetype_loop == 0 %}Latest Health Score,Timestamp,Total Count,Good Count,Fair Count,Bad Count,No Health Count,Measured By,Network Layer Category,Layer Health Score,Layer Total Count,Layer Good Count,Layer Fair Count,Layer Bad Count,Layer No Health Count,Layer Total Good Percentage,Layer Good Perecentage,Layer Fair Percentatge,Layer Bad Percentage,Layer No Health Percentage
{%- for layer in health.healthDistirubution %}
{{ health.response[0].healthScore }},{{ health.response[0].time }},{{ health.response[0].totalCount }},{{ health.response[0].goodCount }},{{ health.response[0].fairCount }},{{ health.response[0].badCount }},{{ health.response[0].noHealthCount }},{{ health.measuredBy }},{{ layer.category }},{{ layer.healthScore }},{{ layer.totalCount }},{{ layer.goodCount }},{{ layer.fairCount }},{{ layer.badCount }},{{ layer.noHealthCount }},{{ layer.totalPercentage }},{{ layer.goodPercentage }},{{ layer.fairPercentage }},{{ layer.badPercentage }},{{ layer.noHealthPercentage }}
{%- endfor %}
{%- else %}
{%-     if filetype_loop == 1 %}
# DNAC Network Health
| Latest Health Score | Timestamp | Total Count | Good Count | Fair Count | Bad Count | No Health Count | Measured By | Network Layer Category | Layer Health Score | Layer Total Count | Layer Good Count | Layer Fair Count | Layer Bad Count | Layer No Health Count | Layer Total Good Percentage | Layer Good Perecentage | Layer Fair Percentatge | Layer Bad Percentage | Layer No Health Percentage |
| ------------------- | --------- | ----------- | ---------- | ---------- | --------- | --------------- | ----------- | ---------------------- | ------------------ | ----------------- | ---------------- | ---------------- | --------------- | --------------------- | --------------------------- | ---------------------- | ---------------------- | -------------------- | -------------------------- |
{%- for layer in health.healthDistirubution %}
| {{ health.response[0].healthScore }} | {{ health.response[0].time }} | {{ health.response[0].totalCount }} | {{ health.response[0].goodCount }} | {{ health.response[0].fairCount }} | {{ health.response[0].badCount }} | {{ health.response[0].noHealthCount }} | {{ health.measuredBy }} | {{ layer.category }} | {{ layer.healthScore }} | {{ layer.totalCount }} | {{ layer.goodCount }} | {{ layer.fairCount }} | {{ layer.badCount }} | {{ layer.noHealthCount }} | {{ layer.totalPercentage }} | {{ layer.goodPercentage }} | {{ layer.fairPercentage }} | {{ layer.badPercentage }} | {{ layer.noHealthPercentage }} |
{%- endfor %}
{%-     else %}
{%-         if filetype_loop == 2 %}
<html><body>
<h1>DNAC Network Health</h1>
<table>
  <thead>
    <tr>
      <th>Latest Health Score</th>
      <th>Timestamp</th>
      <th>Total Count</th>
      <th>Good Count</th>
      <th>Fair Count</th>
      <th>Bad Count</th>
      <th>No Health Count</th>
      <th>Measured By</th>
      <th>Network Layer Category</th>
      <th>Layer Health Score</th>
      <th>Layer Total Count</th>
      <th>Layer Good Count</th>
      <th>Layer Fair Count</th>
      <th>Layer Bad Count</th>
      <th>Layer No Health Count</th>
      <th>Layer Total Good Percentage</th>
      <th>Layer Good Perecentage</th>
      <th>Layer Fair Percentatge</th>
      <th>Layer Bad Percentage</th>
      <th>Layer No Health Percentage</th>
    </tr>
  </thead>
  <tbody>
{%- for layer in health.healthDistirubution %}
  <tr>
    <td>{{ health.response[0].healthScore }}</td>
    <td>{{ health.response[0].time }}</td>
    <td>{{ health.response[0].totalCount }}</td>
    <td>{{ health.response[0].goodCount }}</td>
    <td>{{ health.response[0].fairCount }}</td>
    <td>{{ health.response[0].badCount }}</td>
    <td>{{ health.response[0].noHealthCount }}</td>
    <td>{{ health.measuredBy }}</td>
    <td>{{ layer.category }}</td>
    <td>{{ layer.healthScore }}</td>
    <td>{{ layer.totalCount }}</td>
    <td>{{ layer.goodCount }}</td>
    <td>{{ layer.fairCount }}</td>
    <td>{{ layer.badCount }}</td>
    <td>{{ layer.noHealthCount }}</td>
    <td>{{ layer.totalPercentage }}</td>
    <td>{{ layer.goodPercentage }}</td>
    <td>{{ layer.fairPercentage }}</td>
    <td>{{ layer.badPercentage }}</td>
    <td>{{ layer.noHealthPercentage }}</td>
  </tr>
{%- endfor %}
  </tbody>
</table>
</body></html>
{%-         else %}
# Latest Health Score: {{ health.response[0].healthScore }}
## Timestamp: {{ health.response[0].time }}
## Counts
### Total: {{ health.response[0].totalCount }}
### Good: {{ health.response[0].goodCount }}
### Fair: {{ health.response[0].fairCount }}
### Bad: {{ health.response[0].badCount }}
### No Health: {{ health.response[0].noHealthCount }}
## Measured By: {{ health.measuredBy }}
## Network Layers 
{%- for layer in health.healthDistirubution %}
### {{ layer.category }}
#### Health Score: {{ layer.healthScore }}
##### Counts
###### Total: {{ layer.totalCount }}
###### Good: {{ layer.goodCount }}
###### Fair: {{ layer.fairCount }}
###### Bad: {{ layer.badCount }}
###### No Health: {{ layer.noHealthCount }}
##### Percentages
###### Total: {{ layer.totalPercentage }}
###### Good: {{ layer.goodPercentage }}
###### Fair: {{ layer.fairPercentage }}
###### Bad: {{ layer.badPercentage }}
###### No Health: {{ layer.noHealthPercentage }}
{%- endfor %}
{%-         endif %}
{%-     endif %}
{%- endif %}