Skip to content

Follow-up API design for #28389#29200

Merged
rachaelshaw merged 6 commits intodocs-v4.69.0from
28389-api-follow-up
May 27, 2025
Merged

Follow-up API design for #28389#29200
rachaelshaw merged 6 commits intodocs-v4.69.0from
28389-api-follow-up

Conversation

@rachaelshaw
Copy link
Copy Markdown
Member

Adds the summary endpoint for a batch-run script.

@rachaelshaw rachaelshaw marked this pull request as ready for review May 15, 2025 23:03
Comment thread docs/REST API/rest-api.md
Comment thread docs/REST API/rest-api.md Outdated
Comment thread docs/REST API/rest-api.md Outdated
Comment thread docs/REST API/rest-api.md Outdated
@jacobshandling
Copy link
Copy Markdown
Contributor

@sgress454 heads up - for the UI to successfully push to the scripts page, it will need to get the team_id that the batch was run on from the activity.details, so we'll need to update that API response also

Comment thread docs/REST API/rest-api.md Outdated
sgress454 added a commit that referenced this pull request May 22, 2025
# Checklist for submitter

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.
- [X] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [X] Added/updated automated tests
- [X] Manual QA for all new/changed functionality

## Details

This PR adds a new `GET /scripts/batch/summary/:batch_execution_id`
endpoint that returns a summary of the current state of a batch script
execution, including some basic info about the script being executed and
a breakdown of how hosts have responded. See
#29200 for API response.
Co-authored-by: jacobshandling <61553566+jacobshandling@users.noreply.github.com>
Co-authored-by: jacobshandling <61553566+jacobshandling@users.noreply.github.com>
Co-authored-by: jacobshandling <61553566+jacobshandling@users.noreply.github.com>
Comment thread docs/REST API/rest-api.md
Co-authored-by: Scott Gress <scottmgress@gmail.com>
Comment thread docs/REST API/rest-api.md
"targeted": 12599,
"script_id": 555,
"script_name": "my-script.sh",
"team_id": 123
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sgress454 @jacobshandling just realized we'll also want created_at (for the tooltip in the filter UI that's coming up next) — we can add that in the next iteration if we're currently grabbing that from the activity

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're currently grabbing that from the activity

Yep this is what the UI is currently doing, good catch

@rachaelshaw rachaelshaw merged commit 9473438 into docs-v4.69.0 May 27, 2025
6 checks passed
@rachaelshaw rachaelshaw deleted the 28389-api-follow-up branch May 27, 2025 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants