feat: add filtering options to provisioners list #19378
Draft
+605
−37
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.
Summary
In this pull request we're adding support for additional filtering options to the
provisioners list
CLI command and the/provisionerdaemons
API endpoint.Resolves: #18783
Changes
Added CLI Options
--show-offline
: When this option is provided, all provisioner daemons will be returned. This means that when--show-offline
is not provided onlyidle
andbusy
provisioner daemons will be returned.--status=<list_of_statuses>
: When this option is provided with a comma-separated list of valid statuses (idle
,busy
, oroffline
) only provisioner daemons that have these statuses will be returned.--max-age=<duration>
: When this option is provided with a valid duration value (e.g.,24h
,30s
) only provisioner daemons with alast_seen_at
timestamp within the provided max age will be returned.Query Params
?offline=true
: Include offline provisioner daemons in the results. Offline provisioner daemons will be excluded if?offline=false
or if offline is not provided.?status=<list_of_statuses>
: Include provisioner daemons with the specified statuses.?max_age=<duration>
: Include provisioner daemons with alast_seen_at
timestamp within the max age duration.Show Offline vs Offline Status
To list offline provisioner daemons, users can either:
--show-offline
optionOR
offline
in the list of values provided to the--status
option