-
Notifications
You must be signed in to change notification settings - Fork 921
Add API endpoint warnings #47841
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
Draft
spalmesano0
wants to merge
2
commits into
main
Choose a base branch
from
api-warnings
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+7
−2
Draft
Add API endpoint warnings #47841
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3200,6 +3200,8 @@ the `software` table. | |
|
|
||
| > `populate_software` returns a lot of data per host when set, and drastically more data when set to `true` on Fleet Premium. If you need vulnerability details for a large number of hosts, consider setting `populate_software` to `without_vulnerability_details` and pulling vulnerability details from the [Get vulnerability](#get-vulnerability) endpoint, as this returns details once per vulnerability rather than once per vulnerability per host. | ||
|
|
||
| > Searching with `query` and setting `device_mapping=true` are each expensive, and combining them is more so. If you're hitting this endpoint often the best practice is to reduce how frequently you call it to prevent overloading the Fleet server. | ||
|
|
||
| If `software_title_id` is specified, an additional top-level key `"software_title"` is returned with the software title object corresponding to the `software_title_id`. See [List software](#list-software) response payload for details about this object. | ||
|
|
||
| If `software_version_id` is specified, an additional top-level key `"software"` is returned with the software object corresponding to the `software_version_id`. See [List software versions](#list-software-versions) response payload for details about this object. | ||
|
|
@@ -3676,6 +3678,8 @@ Returns the information of the specified host. | |
| | exclude_software | boolean | query | If `true`, the response will not include a list of installed software for the host. | | ||
| | exclude_fleet_maintained_policies | boolean | query | If `true`, will omit Fleet-maintained policies from the policies list. | | ||
|
|
||
| > If you're hitting this endpoint often (e.g. every hour) for a large number of hosts (e.g. 1k+) the best practice is to set the `exclude_software` to `true` to prevent overloading the Fleet server. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @spalmesano0 I think let's move this to the top of this section, right below the "Get host" header. That way we're consistent w/ the "Get host by Fleet Desktop token":
|
||
|
|
||
| #### Example | ||
|
|
||
| `GET /api/v1/fleet/hosts/121` | ||
|
|
@@ -3982,6 +3986,7 @@ If `hostname` is specified when there is more than one host with the same hostna | |
| | exclude_software | boolean | query | If `true`, the response will not include a list of installed software for the host. | | ||
| | exclude_fleet_maintained_policies | boolean | query | If `true`, will omit Fleet-maintained policies from the policies list. | | ||
|
|
||
| > If you're hitting this endpoint often (e.g. every hour) for a large number of hosts (e.g. 1k+) the best practice is to set the `exclude_software` to `true` to prevent overloading the Fleet server. | ||
|
|
||
| #### Example | ||
|
|
||
|
|
@@ -4202,8 +4207,6 @@ If `hostname` is specified when there is more than one host with the same hostna | |
|
|
||
| ### Get host by Fleet Desktop token | ||
|
|
||
| > If you're hitting this endpoint often (e.g. every hour) for a large number of hosts (e.g. 1k+) the best practice is to set the `exclude_software` to `true` to prevent overloading the Fleet server. | ||
|
|
||
| Returns a subset of information about the host specified by `token`. To get all information about a host, use the ["Get host"](#get-host) endpoint. | ||
|
|
||
| This is the API route used by the **My device** page in Fleet Desktop to display information about the host to the end user. | ||
|
|
@@ -4219,6 +4222,8 @@ This endpoint doesn't require API token authentication. Authentication on macOS, | |
| | token | string | path | The host's [Fleet Desktop token](https://fleetdm.com/guides/fleet-desktop#secure-fleet-desktop). For macOS, Windows, and Linux, this is a random UUID that rotates hourly. For iOS and iPadOS, this is the host's hardware UUID. | | ||
| | exclude_software | boolean | query | If `true`, the response will not include a list of installed software for the host. | | ||
|
|
||
| > If you're hitting this endpoint often (e.g. every hour) for a large number of hosts (e.g. 1k+) the best practice is to set the `exclude_software` to `true` to prevent overloading the Fleet server. | ||
|
|
||
| #### Request headers | ||
|
|
||
| This endpoint accepts the `X-Client-Cert-Serial` header for authentication in addition to token authentication. | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spalmesano0 I tweaked the language to add a specific suggestion but totally guessed on once per hour...is it right? Can we give a faster best practice? 30 minutes?
Also, I think let's move this performance warning to the top of the section: https://github.com/fleetdm/fleet/pull/47841/changes#r3437435430
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rfairburn said this was originally triggered after hitting it with ~10 req/sec. I'd defer to him on the infrastructure recommendation, though I imagine once every few minutes wouldn't be bad.
@noahtalerman I think the placement of the
Get host by Fleet Desktop tokenwarning right under the endpoint title may have been a mistake (probably made by me!), as the warnings forList hostsandList software versionswere already under parameters.With that in mind, do you still want me to move the warnings for the four endpoints here and
List software versionsnear the title?