Skip to content

Commit a54914a

Browse files
authored
Merge pull request #114 from code42/chore/prep-agent-health-release
Prep agent health release
2 parents 5eacf3a + 188811a commit a54914a

File tree

4 files changed

+39
-3
lines changed

4 files changed

+39
-3
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,26 @@
99
how a consumer would use the library or CLI tool (e.g. adding unit tests, updating documentation, etc) are not captured
1010
here.
1111

12+
## 1.2.0 - 2024-3-18
13+
14+
### Added
15+
16+
- The following agent health related fields will be present on the response when retrieving agents:
17+
- `serialNumber`
18+
- `machineId`
19+
- `agentHealthIssueTypes`
20+
- Additional optional args in the SDK's agent client for filtering by agent health.
21+
- `client.agents.v1.get_page()` and `client.agents.v1.get_page()` now accept:
22+
- `agent_healthy: bool` - Retrieve only healthy agents with `True` or only unhealthy agents with `False`. Defaults to returning all agents.
23+
- `agent_health_issue_types: List[str] | str`- Retrieve agents with any of the given health issues. Ex: `NOT_CONNECTING`
24+
- Additional options in the CLI's agent command group for filtering by agent health:
25+
- `incydr agents list` now accepts:
26+
- `--healthy` - Retrieve only healthy agents.
27+
- `--unhealthy` - Retrieve only unhealthy agents.
28+
- Pass a comma separated list of health issue types to the unhealthy option to filter for agents with any of the given health issues. Ex: `--unhealthy NOT_CONNECTING,NOT_SENDING_SECURITY_EVENTS`
29+
- Use `incydr agents list --help` to see more specifics on the new command options.
30+
- See the [SDK documentation](https://developer.code42.com/sdk/clients/agents/) and the [CLI documentation](https://developer.code42.com/cli/cmds/agents/#agents-list) for more details.
31+
1232
## 1.1.2 - 2023-12-11
1333

1434
### Fixed

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Contributing
22

3+
To test changes on a branch that haven't been released yet, you'll have to pull down the branch and
4+
install the SDK/CLI in `editable` mode using `pip intall -e`. Navigate to the `incydr_python` directory and to install from your local path
5+
(rather than from a released version on PyPI) use:
6+
7+
```bash
8+
pip install -e .
9+
```
10+
11+
To install the CLI extension in a similar manner:
12+
13+
```bash
14+
pip install -e .'[cli]'
15+
```
16+
317
## Install hatch
418

519
The Incydr SDK uses [Hatch](https://hatch.pypa.io/latest/) as its Python project manager.

src/_incydr_sdk/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SPDX-FileCopyrightText: 2022-present Code42 Software <integrations@code42.com>
22
#
33
# SPDX-License-Identifier: MIT
4-
__version__ = "1.1.2"
4+
__version__ = "1.2.0"

src/_incydr_sdk/agents/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def get_page(
3838
page_num: int = 1,
3939
page_size: int = 500,
4040
agent_healthy: bool = None,
41-
agent_health_issue_types: List[str] = None,
41+
agent_health_issue_types: Union[List[str], str] = None,
4242
) -> AgentsPage:
4343
"""
4444
Get a page of agents.
@@ -62,7 +62,9 @@ def get_page(
6262
active=active,
6363
agentType=agent_type,
6464
agentHealthy=agent_healthy,
65-
anyOfAgentHealthIssueTypes=agent_health_issue_types,
65+
anyOfAgentHealthIssueTypes=[agent_health_issue_types]
66+
if isinstance(agent_health_issue_types, str)
67+
else agent_health_issue_types,
6668
srtDir=sort_dir,
6769
srtKey=sort_key,
6870
pageSize=page_size,

0 commit comments

Comments
 (0)