> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/infrastructure-as-code-management/iacm-api-reference/ansible/get-ansible-host-stats.md).

# Get Ansible Host Stats

Get aggregated statistics for a specific host.

```json
{"openapi":"3.0.3","info":{"title":"Infrastructure as Code Management","version":"0.1.0"},"tags":[{"name":"ansible","description":"Ansible Service handles the API for ansible entities."}],"servers":[{"url":"http://localhost:80"}],"paths":{"/api/orgs/{org}/projects/{project}/ansible/hosts/{id}/stats":{"get":{"tags":["ansible"],"summary":"Get Ansible Host Stats","description":"Get aggregated statistics for a specific host.","operationId":"ansible#get-host-stats","parameters":[{"name":"org","in":"path","description":"Org is the organisation identifier.","required":true,"schema":{"type":"string","description":"Org is the organisation identifier.","minLength":1,"maxLength":128}},{"name":"project","in":"path","description":"Project is the project identifier.","required":true,"schema":{"type":"string","description":"Project is the project identifier.","minLength":1,"maxLength":128}},{"name":"id","in":"path","description":"The unique identifier for this host","required":true,"schema":{"type":"string","description":"The unique identifier for this host"}},{"name":"Harness-Account","in":"header","description":"Account is the internal customer account ID.","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Account is the internal customer account ID.","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetHostStatsResponse"}}}},"400":{"description":"BadRequestError: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"401":{"description":"UnauthorizedError: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"403":{"description":"ForbiddenError: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"404":{"description":"NotFoundError: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"408":{"description":"TimeoutError: Request Timeout response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"409":{"description":"ConflictError: Conflict response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"423":{"description":"LockedError: Locked response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"499":{"description":"ContextCancelledError:  response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}},"502":{"description":"BadGatewayError: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/AnsibleError"}}}}}}}},"components":{"schemas":{"GetHostStatsResponse":{"type":"object","properties":{"avg_tasks_last_5_runs":{"type":"number","description":"Average number of tasks executed across the last 5 runs","format":"double"},"failures_7d":{"type":"integer","description":"Number of failed runs (status failures or unreachable) in the last 7 days","format":"int64"},"last_playbook":{"type":"array","items":{"type":"string"},"description":"Playbooks from the most recent execution against this host"},"last_playbook_at":{"type":"integer","description":"Timestamp (ms) of the most recent execution against this host","format":"int64"},"success_rate_30d":{"type":"number","description":"Percentage of successful runs in the last 30 days (0-100)","format":"double"},"total_runs_30d":{"type":"integer","description":"Total number of runs in the last 30 days","format":"int64"}},"required":["success_rate_30d","total_runs_30d","failures_7d","avg_tasks_last_5_runs"]},"AnsibleError":{"type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?"},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem."},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem."},"name":{"type":"string","description":"Name is the name of this class of errors."},"temporary":{"type":"boolean","description":"Is the error temporary?"},"timeout":{"type":"boolean","description":"Is the error a timeout?"}},"required":["name","id","message","temporary","timeout","fault"]}}}}
```
