Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Hosts and Health diagnostics APIs documentations #3295

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/enterprise-api-ref/health-diagnostic.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This API provides access to health diagnostic information.
```
{
"hostsNeverCollected": 1,
"deletedHostsReport": 1,
"hostNotRecentlyCollected": 0,
"hostsUsingSameIdentity": 0,
"agentNotRunRecently": 2,
Expand All @@ -37,6 +38,7 @@ This API provides access to health diagnostic information.
```
[
"hostsNeverCollected",
"deletedHostsReport",
"notRecentlyCollected",
"hostsUsingSameIdentity",
"agentNotRunRecently",
Expand Down
55 changes: 55 additions & 0 deletions api/enterprise-api-ref/host.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,61 @@ HTTP 200 Ok
}
```

## Restore deleted hosts entry

**URI:** https://hub.cfengine.com/api/hosts/restore-deleted/:host-id

**Method:** POST

Restore host entry in reporting database.

Note: to be able to perform this action related RBAC rule (alias `hosts-undelete.post`) should be enabled.

**Responses:**

| HTTP response code | Description |
|---------------------------|----------------------------|
| 200 OK | Host is found and restored |
| 404 NOT FOUND | Host is not found |
| 500 Internal server error | Internal server error |

**Example request (curl):**
```
curl -k --user <username>:<password> -X POST https://hub.example.com/api/hosts/restore-deleted/SHA=2123f85b38189008ae12be159fb961584dda1249c94efed43fec2c70f233975d
```
**Example response:**

```
HTTP 200 Ok
```

## Permanently delete host entry

**URI:** https://hub.cfengine.com/api/hosts/delete-permanently/:host-id

**Method:** POST

Permanently deletes host entry from the reporting database.

Note: to be able to perform this action related RBAC rule (alias `hosts-delete-permanently.delete`) should be enabled.

**Responses:**

| HTTP response code | Description |
|---------------------------|-----------------------------------------------|
| 200 OK | Deleted host is found and removed permanently |
| 404 NOT FOUND | Host is not found |
| 500 Internal server error | Internal server error |

**Example request (curl):**
```
curl -k --user <username>:<password> -X DELETE https://hub.example.com/api/hosts/delete-permanently/SHA=2123f85b38189008ae12be159fb961584dda1249c94efed43fec2c70f233975d
```
**Example response:**

```
HTTP 200 Ok
```

## List monitoring attributes for host

Expand Down
Loading