Skip to content

Add new "Run live query" endpoint #14800

@rachaelshaw

Description

@rachaelshaw

Goal

User story
As a Fleet API user,
I want to send a simple POST request to run a live query on a single host
so that I can use an HTTP client that doesn't support sending a body with GET requests.

Changes

Product

  • REST API changes: API design draft PR
    • New API endpoint becomes the documented/recommended "Run live query" endpoint
    • Old endpoint is maintained for backwards compatibility, but removed from docs on fleetdm.com
    • Return results as soon as we have results for all hosts targeted. For example, if the user runs the query on 1 host and Fleet has received the results for this host, return the results instead of waiting the full time configured by FLEET_LIVE_QUERY_REST_PERIOD.
  • Outdated documentation changes: (See PR linked above)

Engineering

ℹ️  Please read this issue carefully and understand it. Pay special attention to UI wireframes, especially "dev notes".

Context

QA

Risk assessment

  • Risk level: Low

Manual testing steps

Testing matrix: new API endpoint, old API endpoint -- since code changes refactored old API endpoint, we need to retest it

Test scenarios for both APIs.

  1. 1 query 1 host
  2. 1 query, multiple hosts
  3. 1 query, multiple hosts (some offline)
  4. 1 query, multiple hosts (all offline)
  5. 1 query, no hosts
  6. 1 query, non-existent host
  7. Non-existent query
  8. Non-authorized query (team user trying to run a query from another team)

Test scenarios for old API:

  1. 2 queries, 2 hosts

Testing notes

Confirmation

  1. Engineer (@____): Added comment to user story confirming succesful completion of QA.
  2. QA (@____): Added comment to user story confirming succesful completion of QA.

Metadata

Metadata

Assignees

Labels

#g-endpoint-opsEndpoint ops product group:productProduct Design department (shows up on 🦢 Drafting board)customer-pingalistoryA user story defining an entire feature~backendBackend-related issue.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions