Skip to content

Commit 227f854

Browse files
authored
Beginning of REST API documentation. Added info for /hosts endpoint. (#29)
The beginning of REST API documentation for Fleet. Added information and example for the /hosts endpoint.
1 parent 0085ba4 commit 227f854

1 file changed

Lines changed: 102 additions & 0 deletions

File tree

‎docs/api/rest-endpoints.md‎

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Fleet REST API endpoints
2+
3+
## Hosts
4+
5+
### List hosts
6+
7+
`GET /api/v1/kolide/hosts`
8+
9+
Parameters
10+
11+
| Name | Type | In | Description |
12+
|-------------------------|---------|-------|------------------------------------------------------------------------------------------|
13+
| page | integer | query | Page number of the results to fetch. |
14+
| per_page | integer | query | Results per page. |
15+
| order_key | string | query | What to order results by. Can be any column in the hosts table. |
16+
| status | string | query | Indicates the status of the hosts to return. Can either be `new`, `online`, `offline`, or `mia`.|
17+
| additional_info_filters | string | query | A comma-delimited list of fields to include in each host's additional information object. See [Fleet Configuration Options](https://github.com/fleetdm/fleet/blob/master/docs/cli/file-format.md#fleet-configuration-options) for an example configuration with hosts' additional information.|
18+
19+
Example
20+
21+
`GET /api/v1/kolide/hosts?page=0&per_page=100&order_key=host_name`
22+
23+
```
24+
{
25+
"hosts": [
26+
{
27+
"created_at": "2020-11-05T05:09:44Z",
28+
"updated_at": "2020-11-05T06:03:39Z",
29+
"id": 1,
30+
"detail_updated_at": "2020-11-05T05:09:45Z",
31+
"label_updated_at": "2020-11-05T05:14:51Z",
32+
"seen_time": "2020-11-05T06:03:39Z",
33+
"hostname": "2ceca32fe484",
34+
"uuid": "392547dc-0000-0000-a87a-d701ff75bc65",
35+
"platform": "centos",
36+
"osquery_version": "2.7.0",
37+
"os_version": "CentOS Linux 7",
38+
"build": "",
39+
"platform_like": "rhel fedora",
40+
"code_name": "",
41+
"uptime": 8305000000000,
42+
"memory": 2084032512,
43+
"cpu_type": "6",
44+
"cpu_subtype": "142",
45+
"cpu_brand": "Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz",
46+
"cpu_physical_cores": 4,
47+
"cpu_logical_cores": 4,
48+
"hardware_vendor": "",
49+
"hardware_model": "",
50+
"hardware_version": "",
51+
"hardware_serial": "",
52+
"computer_name": "2ceca32fe484",
53+
"primary_ip": "",
54+
"primary_mac": "",
55+
"distributed_interval": 10,
56+
"config_tls_refresh": 10,
57+
"logger_tls_period": 8,
58+
"additional": {},
59+
"enroll_secret_name": "default",
60+
"status": "offline",
61+
"display_text": "2ceca32fe484"
62+
},
63+
{
64+
"created_at": "2020-11-05T05:09:44Z",
65+
"updated_at": "2020-11-05T06:03:39Z",
66+
"id": 2,
67+
"detail_updated_at": "2020-11-05T05:09:45Z",
68+
"label_updated_at": "2020-11-05T05:14:52Z",
69+
"seen_time": "2020-11-05T06:03:40Z",
70+
"hostname": "4cc885c20110",
71+
"uuid": "392547dc-0000-0000-a87a-d701ff75bc65",
72+
"platform": "centos",
73+
"osquery_version": "2.7.0",
74+
"os_version": "CentOS 6.8.0",
75+
"build": "",
76+
"platform_like": "rhel",
77+
"code_name": "",
78+
"uptime": 8305000000000,
79+
"memory": 2084032512,
80+
"cpu_type": "6",
81+
"cpu_subtype": "142",
82+
"cpu_brand": "Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz",
83+
"cpu_physical_cores": 4,
84+
"cpu_logical_cores": 4,
85+
"hardware_vendor": "",
86+
"hardware_model": "",
87+
"hardware_version": "",
88+
"hardware_serial": "",
89+
"computer_name": "4cc885c20110",
90+
"primary_ip": "",
91+
"primary_mac": "",
92+
"distributed_interval": 10,
93+
"config_tls_refresh": 10,
94+
"logger_tls_period": 8,
95+
"additional": {},
96+
"enroll_secret_name": "default",
97+
"status": "offline",
98+
"display_text": "4cc885c20110"
99+
},
100+
]
101+
}
102+
```

0 commit comments

Comments
 (0)