Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
The intended audience of this file is for py42 consumers -- as such, changes that don't affect
how a consumer would use the library (e.g. adding unit tests, updating documentation, etc) are not captured here.

## Unreleased

### Deprecated

- All Incydr functionality is deprecated. Use the Incydr SDK instead: https://developer.code42.com/

## 1.27.3 - 2024-12-18

## Removed
Expand Down
6 changes: 5 additions & 1 deletion docs/methoddocs/alertrules.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Alert Rules
# Alert Rules (DEPRECATED)

```{eval-rst}
.. warning:: Incydr functionality is **deprecated**. Use the resources at https://developer.code42.com/ instead.
```

```{eval-rst}
.. autoclass:: py42.clients.alertrules.AlertRulesClient
Expand Down
6 changes: 5 additions & 1 deletion docs/methoddocs/alerts.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Alerts
# Alerts (DEPRECATED)

```{eval-rst}
.. warning:: Incydr functionality is **deprecated**. Use the resources at https://developer.code42.com/ instead.
```

```{eval-rst}
.. autoclass:: py42.clients.alerts.AlertsClient
Expand Down
6 changes: 5 additions & 1 deletion docs/methoddocs/auditlogs.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Audit Logs
# Audit Logs (DEPRECATED)

```{eval-rst}
.. warning:: Incydr functionality is **deprecated**. Use the resources at https://developer.code42.com/ instead.
```

```{eval-rst}
.. autoclass:: py42.clients.auditlogs.AuditLogsClient
Expand Down
6 changes: 5 additions & 1 deletion docs/methoddocs/cases.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Cases
# Cases (DEPRECATED)

```{eval-rst}
.. warning:: Incydr functionality is **deprecated**. Use the resources at https://developer.code42.com/ instead.
```

```{eval-rst}
.. autoclass:: py42.clients.cases.CaseStatus
Expand Down
2 changes: 1 addition & 1 deletion docs/methoddocs/fileeventqueries.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# File Event Queries - V1 (DEPRECATED)

```{eval-rst}
.. warning:: V1 file events, saved searches, and queries are **deprecated**.
.. warning:: Incydr functionality is **deprecated**. Use the resources at https://developer.code42.com/ instead.
```

```{eval-rst}
Expand Down
6 changes: 5 additions & 1 deletion docs/methoddocs/fileeventqueriesv2.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# File Event Queries - V2
# File Event Queries - V2 (DEPRECATED)

```{eval-rst}
.. warning:: Incydr functionality is **deprecated**. Use the resources at https://developer.code42.com/ instead.
```

```{eval-rst}
.. autoclass:: py42.sdk.queries.fileevents.v2.file_event_query.FileEventQuery
Expand Down
4 changes: 2 additions & 2 deletions docs/methoddocs/securitydata.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Security Data
# Security Data (DEPRECATED)

```{eval-rst}
.. warning:: V1 file events, saved searches, and queries are **deprecated**.
.. warning:: Incydr functionality is **deprecated**. Use the resources at https://developer.code42.com/ instead.
```

```{eval-rst}
Expand Down
6 changes: 5 additions & 1 deletion docs/methoddocs/sharedqueryfilters.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Shared Query Filters
# Shared Query Filters (DEPRECATED)

```{eval-rst}
.. warning:: Incydr functionality is **deprecated**. Use the resources at https://developer.code42.com/ instead.
```

```{eval-rst}
.. automodule:: py42.sdk.queries.query_filter
Expand Down
6 changes: 5 additions & 1 deletion docs/methoddocs/trustedactivities.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Trusted Activities
# Trusted Activities (DEPRECATED)

```{eval-rst}
.. warning:: Incydr functionality is **deprecated**. Use the resources at https://developer.code42.com/ instead.
```

```{eval-rst}
.. autoclass:: py42.clients.trustedactivities.TrustedActivityType
Expand Down
6 changes: 5 additions & 1 deletion docs/methoddocs/userriskprofile.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# User Risk Profiles
# User Risk Profiles (DEPRECATED)

```{eval-rst}
.. warning:: Incydr functionality is **deprecated**. Use the resources at https://developer.code42.com/ instead.
```

```{eval-rst}
.. autoclass:: py42.clients.userriskprofile.UserRiskProfileClient
Expand Down
6 changes: 5 additions & 1 deletion docs/methoddocs/watchlists.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Watchlists
# Watchlists (DEPRECATED)

```{eval-rst}
.. warning:: Incydr functionality is **deprecated**. Use the resources at https://developer.code42.com/ instead.
```

```{eval-rst}
.. autoclass:: py42.clients.watchlists.WatchlistType
Expand Down
21 changes: 10 additions & 11 deletions docs/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,29 @@ sdk = py42.sdk.from_local_account("console.us.code42.com", "john.doe@example.com

Explore the complete public documentation for `py42` below.

* [Alerts](methoddocs/alerts.md)
* [Alert Rules](methoddocs/alertrules.md)
* [Archive](methoddocs/archive.md)
* [Audit Logs](methoddocs/auditlogs.md)
* [Backup Sets](methoddocs/backupset.md)
* [Cases](methoddocs/cases.md)
* [Constants](methoddocs/constants.md)
* [Devices](methoddocs/devices.md)
* [Device Settings](methoddocs/devicesettings.md)
* [Exceptions](methoddocs/exceptions.md)
* [(DEPRECATED) File Event Queries - V1](methoddocs/fileeventqueries.md)
* [File Event Queries - V2](methoddocs/fileeventqueriesv2.md)
* [Legal Hold](methoddocs/legalhold.md)
* [Legal Hold - API Clients](methoddocs/legalholdapiclient.md)
* [Orgs](methoddocs/orgs.md)
* [Org Settings](methoddocs/orgsettings.md)
* [Response](methoddocs/response.md)
* [Security Data](methoddocs/securitydata.md)
* [Shared Query Filters](methoddocs/sharedqueryfilters.md)
* [Trusted Activities](methoddocs/trustedactivities.md)
* [Users](methoddocs/users.md)
* [User Risk Profiles](methoddocs/userriskprofile.md)
* [Util](methoddocs/util.md)
* [Watchlists](methoddocs/watchlists.md)
* [(DEPRECATED) Alerts](methoddocs/alerts.md)
* [(DEPRECATED) Alert Rules](methoddocs/alertrules.md)
* [(DEPRECATED) Audit Logs](methoddocs/auditlogs.md)
* [(DEPRECATED) File Event Queries - V1](methoddocs/fileeventqueries.md)
* [(DEPRECATED) File Event Queries - V2](methoddocs/fileeventqueriesv2.md)
* [(DEPRECATED) Security Data](methoddocs/securitydata.md)
* [(DEPRECATED) Shared Query Filters](methoddocs/sharedqueryfilters.md)
* [(DEPRECATED) Trusted Activities](methoddocs/trustedactivities.md)
* [(DEPRECATED) User Risk Profiles](methoddocs/userriskprofile.md)
* [(DEPRECATED) Watchlists](methoddocs/watchlists.md)

```{eval-rst}
.. automodule:: py42.sdk
Expand Down
39 changes: 39 additions & 0 deletions src/py42/clients/alertrules.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
from warnings import warn

from py42 import settings
from py42.exceptions import Py42InternalServerError
from py42.exceptions import Py42InvalidRuleOperationError

# Incydr functionality is deprecated as of 2025-03.


class AlertRulesClient:
"""`Rest Documentation <https://developer.code42.com/api/#tag/Rules>`__"""
Expand Down Expand Up @@ -52,6 +56,11 @@ def add_user(self, rule_id, user_id):
Returns
:class:`py42.response.Py42Response`
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
try:
return self._alert_rules_service.add_user(rule_id, user_id)
except Py42InternalServerError as err:
Expand All @@ -74,6 +83,11 @@ def remove_user(self, rule_id, user_id):
Returns
:class:`py42.response.Py42Response`
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
try:
return self._alert_rules_service.remove_user(rule_id, user_id)
except Py42InternalServerError as err:
Expand All @@ -92,6 +106,11 @@ def remove_all_users(self, rule_id):
Returns
:class:`py42.response.Py42Response`
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
try:
return self._alert_rules_service.remove_all_users(rule_id)
except Py42InternalServerError as err:
Expand All @@ -118,6 +137,11 @@ def get_page(
Returns:
:class:`py42.response.Py42Response`
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
page_size = page_size or settings.items_per_page
return self._alerts_service.get_rules_page(
sort_key=sort_key,
Expand All @@ -138,6 +162,11 @@ def get_all(self, sort_key="CreatedAt", sort_direction="DESC"):
generator: An object that iterates over :class:`py42.response.Py42Response` objects
that each contain a page of rules.
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
return self._alerts_service.get_all_rules(
sort_key=sort_key, sort_direction=sort_direction
)
Expand All @@ -152,6 +181,11 @@ def get_all_by_name(self, rule_name):
generator: An object that iterates over :class:`py42.response.Py42Response` objects
that each contain a page of rules with the given name.
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
return self._alerts_service.get_all_rules_by_name(rule_name)

def get_by_observer_id(self, observer_id):
Expand All @@ -163,6 +197,11 @@ def get_by_observer_id(self, observer_id):
Returns
:class:`py42.response.Py42Response`
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
return self._alerts_service.get_rule_by_observer_id(observer_id)


Expand Down
54 changes: 54 additions & 0 deletions src/py42/clients/alerts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from warnings import warn

from py42.sdk.queries.alerts.filters import AlertState

# Incydr functionality is deprecated as of 2025-03.


class AlertsClient:
"""A client to expose alert API.
Expand All @@ -18,6 +22,11 @@ def rules(self):
Returns:
:class:`py42.services.alertrules.AlertRulesClient`
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
return self._alert_rules_client

def search(self, query, page_num=1, page_size=None):
Expand All @@ -35,6 +44,11 @@ def search(self, query, page_num=1, page_size=None):
:class:`py42.response.Py42Response`: A response containing the alerts that match the given
query.
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
return self._alert_service.search(query, page_num, page_size)

def search_all_pages(self, query):
Expand All @@ -49,6 +63,11 @@ def search_all_pages(self, query):
generator: An object that iterates over :class:`py42.response.Py42Response` objects
that each contain a page of alerts that match the given query.
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
return self._alert_service.search_all_pages(query)

def get_details(self, alert_ids):
Expand All @@ -64,6 +83,11 @@ def get_details(self, alert_ids):
Returns:
:class:`py42.response.Py42Response`: A response containing the alert details.
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
return self._alert_service.get_details(alert_ids)

def resolve(self, alert_ids, reason=None):
Expand All @@ -77,6 +101,11 @@ def resolve(self, alert_ids, reason=None):
Returns:
:class:`py42.response.Py42Response`
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
return self._alert_service.update_state(
AlertState.DISMISSED, alert_ids, note=reason
)
Expand All @@ -92,6 +121,11 @@ def reopen(self, alert_ids, reason=None):
Returns:
:class:`py42.response.Py42Response`
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
return self._alert_service.update_state(AlertState.OPEN, alert_ids, note=reason)

def update_state(self, status, alert_ids, note=None):
Expand All @@ -107,6 +141,11 @@ def update_state(self, status, alert_ids, note=None):
Returns:
:class:`py42.response.Py42Response`
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
return self._alert_service.update_state(status, alert_ids, note=note)

def update_note(self, alert_id, note):
Expand All @@ -120,6 +159,11 @@ def update_note(self, alert_id, note):
Returns:
:class:`py42.response.Py42Response`
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
return self._alert_service.update_note(alert_id, note)

def get_aggregate_data(self, alert_id):
Expand All @@ -131,6 +175,11 @@ def get_aggregate_data(self, alert_id):
Returns:
:class:`py42.response.Py42Response`
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
return self._alert_service.get_aggregate_data(alert_id)

def get_all_alert_details(self, query):
Expand All @@ -149,6 +198,11 @@ def get_all_alert_details(self, query):
Returns:
generator: An object that iterates over alert detail items.
"""
warn(
"Incydr functionality is deprecated. Use the Incydr SDK instead.",
DeprecationWarning,
stacklevel=2,
)
query.page_size = 25
sort_key = query.sort_key[0].lower() + query.sort_key[1:]
if sort_key == "alertId":
Expand Down
Loading
Loading