From 084206c86d6a38fec5d1d8a5477a7d9dff1ac3a2 Mon Sep 17 00:00:00 2001 From: Peter Annabel Date: Fri, 25 Jul 2025 10:46:11 -0500 Subject: [PATCH] updated models updated readme removed pagination from organizationId endpoint --- README.md | 5 ++- .../endpoints/siem/OrganizationsIdEndpoint.py | 37 +------------------ src/pyhuntress/models/siem/__init__.py | 10 ++--- 3 files changed, 8 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index e545016..8b090c1 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,12 @@ pyHuntress is currently in **development**. Known Issues: ============= - As this project is still a WIP, documentation or code commentary may not always align. -- Huntress Managed SAT is not built +- Huntress Managed SAT post not built Road Map: ============= -- Add Huntress Managed SAT Report +- Add support for post +- Add required parameters when calling completion_certificat endpoint How-to: ============= diff --git a/src/pyhuntress/endpoints/siem/OrganizationsIdEndpoint.py b/src/pyhuntress/endpoints/siem/OrganizationsIdEndpoint.py index 122dc95..41a1ad0 100644 --- a/src/pyhuntress/endpoints/siem/OrganizationsIdEndpoint.py +++ b/src/pyhuntress/endpoints/siem/OrganizationsIdEndpoint.py @@ -1,10 +1,8 @@ from pyhuntress.endpoints.base.huntress_endpoint import HuntressEndpoint from pyhuntress.interfaces import ( IGettable, - IPaginateable, ) from pyhuntress.models.siem import SIEMOrganizations -from pyhuntress.responses.paginated_response import PaginatedResponse from pyhuntress.types import ( JSON, HuntressSIEMRequestParams, @@ -14,43 +12,10 @@ from pyhuntress.types import ( class OrganizationsIdEndpoint( HuntressEndpoint, IGettable[SIEMOrganizations, HuntressSIEMRequestParams], - IPaginateable[SIEMOrganizations, HuntressSIEMRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: HuntressEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SIEMOrganizations) - IPaginateable.__init__(self, SIEMOrganizations) - - def paginated( - self, - page: int, - limit: int, - params: HuntressSIEMRequestParams | None = None, - ) -> PaginatedResponse[SIEMOrganizations]: - """ - Performs a GET request against the /organizations endpoint and returns an initialized PaginatedResponse object. - - Parameters: - page (int): The page number to request. - limit (int): The number of results to return per page. - params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - PaginatedResponse[SIEMOrganizations]: The initialized PaginatedResponse object. - """ - if params: - params["page"] = page - params["limit"] = limit - else: - params = {"page": page, "limit": limit} - return PaginatedResponse( - super()._make_request("GET", params=params), - SIEMOrganizations, - self, - "organizations", - page, - limit, - params, - ) def get( self, @@ -58,7 +23,7 @@ class OrganizationsIdEndpoint( params: HuntressSIEMRequestParams | None = None, ) -> SIEMOrganizations: """ - Performs a GET request against the /organizations endpoint. + Performs a GET request against the /organizations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. diff --git a/src/pyhuntress/models/siem/__init__.py b/src/pyhuntress/models/siem/__init__.py index 656a291..3d183ad 100644 --- a/src/pyhuntress/models/siem/__init__.py +++ b/src/pyhuntress/models/siem/__init__.py @@ -220,13 +220,11 @@ class SIEMReports(HuntressModel): itdr_incidents_reported: int | None = Field(default=None, alias="ITDRIncidentsReported") siem_incidents_reported: int | None = Field(default=None, alias="SIEMIncidentsReported") incidents_resolved: int | None = Field(default=None, alias="IncidentsResolved") - # The following 3 counts are listed as "map" in Huntress' docs, I'm not sure what data type to use here - incident_severity_counts: int | None = Field(default=None, alias="IncidentSeverityCounts") - incident_product_counts: int | None = Field(default=None, alias="IncidentProductCounts") - incident_indicator_counts: int | None = Field(default=None, alias="IncidentIndicatorCounts") + incident_severity_counts: dict[str, int] | None = Field(default=None, alias="IncidentSeverityCounts") + incident_product_counts: dict[str, int] | None = Field(default=None, alias="IncidentProductCounts") + incident_indicator_counts: dict[str, int] | None = Field(default=None, alias="IncidentIndicatorCounts") top_incident_av_threats: list | None = Field(default=None, alias="TopIncidentAVThreats") - # top_incident_hosts is also listed as "map" in their docs - top_incident_hosts: list | None = Field(default=None, alias="TopIncidentHosts") + top_incident_hosts: dict[str, Any] | None = Field(default=None, alias="TopIncidentHosts") potential_threat_indicators: int | None = Field(default=None, alias="PotentialThreatIndicators") agents_count: int | None = Field(default=None, alias="AgentsCount") deployed_canaries_count: int | None = Field(default=None, alias="DeployedCanariesCount")