Skip to content

Commit db69c70

Browse files
Merge pull request #3295 from aleksandrychev/ENT-8001
Updated Hosts and Health diagnostics APIs documentations
2 parents 30d51cf + b9b151a commit db69c70

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

api/enterprise-api-ref/health-diagnostic.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ This API provides access to health diagnostic information.
1717
```
1818
{
1919
"hostsNeverCollected": 1,
20+
"deletedHostsReport": 1,
2021
"hostNotRecentlyCollected": 0,
2122
"hostsUsingSameIdentity": 0,
2223
"agentNotRunRecently": 2,
@@ -37,6 +38,7 @@ This API provides access to health diagnostic information.
3738
```
3839
[
3940
"hostsNeverCollected",
41+
"deletedHostsReport",
4042
"notRecentlyCollected",
4143
"hostsUsingSameIdentity",
4244
"agentNotRunRecently",

api/enterprise-api-ref/host.markdown

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,61 @@ HTTP 200 Ok
295295
}
296296
```
297297

298+
## Restore deleted hosts entry
299+
300+
**URI:** https://hub.cfengine.com/api/hosts/restore-deleted/:host-id
301+
302+
**Method:** POST
303+
304+
Restore host entry in reporting database.
305+
306+
Note: to be able to perform this action related RBAC rule (alias `hosts-undelete.post`) should be enabled.
307+
308+
**Responses:**
309+
310+
| HTTP response code | Description |
311+
|---------------------------|----------------------------|
312+
| 200 OK | Host is found and restored |
313+
| 404 NOT FOUND | Host is not found |
314+
| 500 Internal server error | Internal server error |
315+
316+
**Example request (curl):**
317+
```
318+
curl -k --user <username>:<password> -X POST https://hub.example.com/api/hosts/restore-deleted/SHA=2123f85b38189008ae12be159fb961584dda1249c94efed43fec2c70f233975d
319+
```
320+
**Example response:**
321+
322+
```
323+
HTTP 200 Ok
324+
```
325+
326+
## Permanently delete host entry
327+
328+
**URI:** https://hub.cfengine.com/api/hosts/delete-permanently/:host-id
329+
330+
**Method:** POST
331+
332+
Permanently deletes host entry from the reporting database.
333+
334+
Note: to be able to perform this action related RBAC rule (alias `hosts-delete-permanently.delete`) should be enabled.
335+
336+
**Responses:**
337+
338+
| HTTP response code | Description |
339+
|---------------------------|-----------------------------------------------|
340+
| 200 OK | Deleted host is found and removed permanently |
341+
| 404 NOT FOUND | Host is not found |
342+
| 500 Internal server error | Internal server error |
343+
344+
**Example request (curl):**
345+
```
346+
curl -k --user <username>:<password> -X DELETE https://hub.example.com/api/hosts/delete-permanently/SHA=2123f85b38189008ae12be159fb961584dda1249c94efed43fec2c70f233975d
347+
```
348+
**Example response:**
349+
350+
```
351+
HTTP 200 Ok
352+
```
298353

299354
## List monitoring attributes for host
300355

0 commit comments

Comments
 (0)