Add renameto tags to prepare for deprecating team and query API params (#39847)

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** For #39344

# Details

As a first step to deprecating API params like `team_id` in favor of
`fleet_id` and `query_id` in favor of `report_id`, this PR adds
`renameto` tags to all deprecated keys. There is no logic in this PR to
actually use these tags in any way. The logic and test fixes will be in
the next PR, but in the interest of keeping things manageable I'm
pushing this out first.

There were definitely params with "query" in them that we don't want to
change (mainly osquery-related), and I think I kept them all out but
it's worth double-checking here. The team -> fleet changes are pretty
safe in comparison.

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [ ] 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.
Deferring changelog to PR with logic changes

## Testing

- [ ] Added/updated automated tests
This should be a no-op.  All existing tests shoud pass.
- [X] QA'd all new/changed functionality manually
This commit is contained in:
Scott Gress
2026-02-17 10:00:59 -06:00
committed by GitHub
parent 1c93a5aef3
commit e14bfd60fe
52 changed files with 384 additions and 383 deletions
+7 -7
View File
@@ -36,7 +36,7 @@ type runScriptRequest struct {
ScriptID *uint `json:"script_id"`
ScriptContents string `json:"script_contents"`
ScriptName string `json:"script_name"`
TeamID uint `json:"team_id"`
TeamID uint `json:"team_id" renameto:"fleet_id"`
}
type runScriptResponse struct {
@@ -74,7 +74,7 @@ type runScriptSyncRequest struct {
ScriptID *uint `json:"script_id"`
ScriptContents string `json:"script_contents"`
ScriptName string `json:"script_name"`
TeamID uint `json:"team_id"`
TeamID uint `json:"team_id" renameto:"fleet_id"`
}
type runScriptSyncResponse struct {
@@ -634,7 +634,7 @@ func (svc *Service) DeleteScript(ctx context.Context, scriptID uint) error {
////////////////////////////////////////////////////////////////////////////////
type listScriptsRequest struct {
TeamID *uint `query:"team_id,optional"`
TeamID *uint `query:"team_id,optional" renameto:"fleet_id"`
ListOptions fleet.ListOptions `url:"list_options"`
}
@@ -941,8 +941,8 @@ func (svc *Service) GetHostScriptDetails(ctx context.Context, hostID uint, opt f
////////////////////////////////////////////////////////////////////////////////
type batchSetScriptsRequest struct {
TeamID *uint `json:"-" query:"team_id,optional"`
TeamName *string `json:"-" query:"team_name,optional"`
TeamID *uint `json:"-" query:"team_id,optional" renameto:"fleet_id"`
TeamName *string `json:"-" query:"team_name,optional" renameto:"fleet_name"`
DryRun bool `json:"-" query:"dry_run,optional"` // if true, apply validation but do not save changes
Scripts []fleet.ScriptPayload `json:"scripts"`
}
@@ -959,7 +959,7 @@ type batchScriptExecutionStatusRequest struct {
}
type batchScriptExecutionListRequest struct {
TeamID uint `query:"team_id,required"`
TeamID uint `query:"team_id,required" renameto:"fleet_id"`
Status *string `query:"status,optional"`
Page *uint `query:"page,optional"`
PerPage *uint `query:"per_page,optional"`
@@ -976,7 +976,7 @@ type (
batchScriptExecutionSummaryResponse struct {
ScriptID uint `json:"script_id" db:"script_id"`
ScriptName string `json:"script_name" db:"script_name"`
TeamID *uint `json:"team_id" db:"team_id"`
TeamID *uint `json:"team_id" db:"team_id" renameto:"fleet_id"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
NumTargeted *uint `json:"targeted" db:"num_targeted"`
NumPending *uint `json:"pending" db:"num_pending"`