Skip to content

Integ 3104/date filter#167

Open
ceciliastevens wants to merge 2 commits intomainfrom
INTEG-3104/date-filter
Open

Integ 3104/date filter#167
ceciliastevens wants to merge 2 commits intomainfrom
INTEG-3104/date-filter

Conversation

@ceciliastevens
Copy link
Contributor

Adds missing filters to the agents list commands, including connected/not connected in X number of days, serial number, and agent OS types.

help="Filter agents that have had agent health modified in the last N days (starting from midnight this morning), where N is the value of the parameter.",
)
@click.option(
"--connected-in-last-days",
Copy link
Contributor

Choose a reason for hiding this comment

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

are --connected-in-last-days and --not-connected-in-last-days able to be used at the same time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes!

@johnsonjben
Copy link
Contributor

do we need to update the version file?

@johnsonjben johnsonjben self-requested a review February 6, 2026 18:25
@ceciliastevens
Copy link
Contributor Author

do we need to update the version file?

When we release it, yes. Generally I do the version file update at the same time as the release chore (updating changelog with the date of release etc.)

httpserver_auth: HTTPServer, runner
):
query = [
("anyOfAgentOsTypes", "LINUX"),
Copy link
Contributor

Choose a reason for hiding this comment

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

The query for the other one looked like this: "anyOfAgentOsTypes": ["LINUX", "MAC"],. Are both valid and expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the way that we handle this is when a list is given, we pass the parameter twice, so the url ends up looking like /endpoint?anyOfAgentOsTypes=LINUX&anyOfAgentOsTypes=MAC and so on. The other test tests a query where we give it two values (because of how python dicts work, it's in the serialization logic where this gets converted, otherwise you can't have the same key twice), and here we're only passing one.

Both work successfully in test and in practice.

"--serial-number",
type=str,
default=None,
help="When specified, returns agents that have this serial number.",
Copy link
Contributor

Choose a reason for hiding this comment

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

minor; will more than one agent ever match a given serial number?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you can for example have multiple agent installs sequentially on the same machine (different guids, so different entries on our side, but each will have the same serial number).

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