feat: add Get-PiHoleStatsQuerySuggestions - #87
Merged
Merged
Conversation
Adds a Metrics function for GET /queries/suggestions, which returns suggested filter values (domain, client IP/name, upstream, query type, status, reply, DNSSEC status) seen in recent queries - useful for building filters for the /queries endpoint. Includes an integration test verified against a real Pi-hole v6 server, and regenerates the README command reference to include it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
feat: add Get-PiHoleStatsQuerySuggestions
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Adds
Get-PiHoleStatsQuerySuggestionsto theMetricsfolder forGET /queries/suggestions. Returns suggested filter values seen in recent queries — domain, client IP, client name, upstream, query type, status, reply, and DNSSEC status — useful for building filters for the queries endpoint. Follows the module's standard pattern (try/catch/finally with session cleanup,RawOutputswitch,[System.URI]+ mandatory[string]$Passwordparams), is registered in the module's export list, and the README command reference has been regenerated to include it.Test plan
tests/Get-PiHoleStatsQuerySuggestions.Integration.Tests.ps1— all 3 tests pass against the real serverInvoke-ScriptAnalyzer -Path .\PiHoleShell -Recurse— no findingsInvoke-Pester -Path .\testsrun — 11 passed, only the pre-existing unrelatedSet-PiHoleDnsBlockingfailure remains🤖 Generated with Claude Code