From b4e5097356a2382747f6a18a4dfb6850fc4ce83b Mon Sep 17 00:00:00 2001 From: noahtalerman <47070608+noahtalerman@users.noreply.github.com> Date: Thu, 29 Apr 2021 11:25:54 -0400 Subject: [PATCH] Draft API changes to api/v1/fleet/hosts/{id} endpoint for software inventory (#669) Update documentation for the `api/v1/fleet/hosts/{id}` endpoint to align with the first iteration of Software inventory #399 in Fleet. --- docs/1-Using-Fleet/3-REST-API.md | 50 ++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/docs/1-Using-Fleet/3-REST-API.md b/docs/1-Using-Fleet/3-REST-API.md index 3854e395ca..7822b9aba7 100644 --- a/docs/1-Using-Fleet/3-REST-API.md +++ b/docs/1-Using-Fleet/3-REST-API.md @@ -587,7 +587,9 @@ None. ### Get host -Returns the information of the specified host. +Returns the information of the specified host. + +The endpoint returns the host's installed `software` if the software inventory feature flag is turned on. This feature flag is turned off by default. [Check out the feature flag documentation](../2-Deployment/2-Configuration.md#feature-flags) for instructions on how to turn on the software inventory feature. `GET /api/v1/fleet/hosts/{id}` @@ -644,7 +646,51 @@ Returns the information of the specified host. "additional": {}, "enroll_secret_name": "bar", "status": "offline", - "display_text": "259404d30eb6" + "display_text": "259404d30eb6", + "labels": [ + { + "created_at": "2021-01-14T16:37:24Z", + "updated_at": "2021-01-14T16:37:24Z", + "id": 6, + "name": "All Hosts", + "description": "All hosts which have enrolled in Fleet", + "query": "select 1;", + "label_type": "builtin", + "label_membership_type": "dynamic" + }, + { + "created_at": "2021-01-14T16:37:24Z", + "updated_at": "2021-01-14T16:37:24Z", + "id": 7, + "name": "macOS", + "description": "All macOS hosts", + "query": "select 1 from os_version where platform = 'darwin';", + "label_type": "builtin", + "label_membership_type": "dynamic" + } + ], + "packs": [ + { + "created_at": "2021-01-17T00:02:35Z", + "updated_at": "2021-01-17T00:02:35Z", + "id": 1, + "name": "osquery_monitoring" + } + ], + "software": [ + { + "id": 1, + "name": "CentOS Linux $releasever - AppStream", + "version": "", + "source": "yum_packages", + }, + { + "id": 2, + "name": "curl", + "version": "7.61.1", + "source": "rpm_packages", + }, + ] } } ```