mirror of
https://github.com/brygphilomena/pyhuntress.git
synced 2025-11-04 16:27:30 +00:00
updated models
updated readme removed pagination from organizationId endpoint
This commit is contained in:
parent
9bf56f734b
commit
084206c86d
@ -17,11 +17,12 @@ pyHuntress is currently in **development**.
|
|||||||
Known Issues:
|
Known Issues:
|
||||||
=============
|
=============
|
||||||
- As this project is still a WIP, documentation or code commentary may not always align.
|
- 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:
|
Road Map:
|
||||||
=============
|
=============
|
||||||
- Add Huntress Managed SAT Report
|
- Add support for post
|
||||||
|
- Add required parameters when calling completion_certificat endpoint
|
||||||
|
|
||||||
How-to:
|
How-to:
|
||||||
=============
|
=============
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
from pyhuntress.endpoints.base.huntress_endpoint import HuntressEndpoint
|
from pyhuntress.endpoints.base.huntress_endpoint import HuntressEndpoint
|
||||||
from pyhuntress.interfaces import (
|
from pyhuntress.interfaces import (
|
||||||
IGettable,
|
IGettable,
|
||||||
IPaginateable,
|
|
||||||
)
|
)
|
||||||
from pyhuntress.models.siem import SIEMOrganizations
|
from pyhuntress.models.siem import SIEMOrganizations
|
||||||
from pyhuntress.responses.paginated_response import PaginatedResponse
|
|
||||||
from pyhuntress.types import (
|
from pyhuntress.types import (
|
||||||
JSON,
|
JSON,
|
||||||
HuntressSIEMRequestParams,
|
HuntressSIEMRequestParams,
|
||||||
@ -14,43 +12,10 @@ from pyhuntress.types import (
|
|||||||
class OrganizationsIdEndpoint(
|
class OrganizationsIdEndpoint(
|
||||||
HuntressEndpoint,
|
HuntressEndpoint,
|
||||||
IGettable[SIEMOrganizations, HuntressSIEMRequestParams],
|
IGettable[SIEMOrganizations, HuntressSIEMRequestParams],
|
||||||
IPaginateable[SIEMOrganizations, HuntressSIEMRequestParams],
|
|
||||||
):
|
):
|
||||||
def __init__(self, client, parent_endpoint=None) -> None:
|
def __init__(self, client, parent_endpoint=None) -> None:
|
||||||
HuntressEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint)
|
HuntressEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint)
|
||||||
IGettable.__init__(self, SIEMOrganizations)
|
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(
|
def get(
|
||||||
self,
|
self,
|
||||||
@ -58,7 +23,7 @@ class OrganizationsIdEndpoint(
|
|||||||
params: HuntressSIEMRequestParams | None = None,
|
params: HuntressSIEMRequestParams | None = None,
|
||||||
) -> SIEMOrganizations:
|
) -> SIEMOrganizations:
|
||||||
"""
|
"""
|
||||||
Performs a GET request against the /organizations endpoint.
|
Performs a GET request against the /organizations/{id} endpoint.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
data (dict[str, Any]): The data to send in the request body.
|
data (dict[str, Any]): The data to send in the request body.
|
||||||
|
|||||||
@ -220,13 +220,11 @@ class SIEMReports(HuntressModel):
|
|||||||
itdr_incidents_reported: int | None = Field(default=None, alias="ITDRIncidentsReported")
|
itdr_incidents_reported: int | None = Field(default=None, alias="ITDRIncidentsReported")
|
||||||
siem_incidents_reported: int | None = Field(default=None, alias="SIEMIncidentsReported")
|
siem_incidents_reported: int | None = Field(default=None, alias="SIEMIncidentsReported")
|
||||||
incidents_resolved: int | None = Field(default=None, alias="IncidentsResolved")
|
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: dict[str, int] | None = Field(default=None, alias="IncidentSeverityCounts")
|
||||||
incident_severity_counts: int | None = Field(default=None, alias="IncidentSeverityCounts")
|
incident_product_counts: dict[str, int] | None = Field(default=None, alias="IncidentProductCounts")
|
||||||
incident_product_counts: int | None = Field(default=None, alias="IncidentProductCounts")
|
incident_indicator_counts: dict[str, int] | None = Field(default=None, alias="IncidentIndicatorCounts")
|
||||||
incident_indicator_counts: int | None = Field(default=None, alias="IncidentIndicatorCounts")
|
|
||||||
top_incident_av_threats: list | None = Field(default=None, alias="TopIncidentAVThreats")
|
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: dict[str, Any] | None = Field(default=None, alias="TopIncidentHosts")
|
||||||
top_incident_hosts: list | None = Field(default=None, alias="TopIncidentHosts")
|
|
||||||
potential_threat_indicators: int | None = Field(default=None, alias="PotentialThreatIndicators")
|
potential_threat_indicators: int | None = Field(default=None, alias="PotentialThreatIndicators")
|
||||||
agents_count: int | None = Field(default=None, alias="AgentsCount")
|
agents_count: int | None = Field(default=None, alias="AgentsCount")
|
||||||
deployed_canaries_count: int | None = Field(default=None, alias="DeployedCanariesCount")
|
deployed_canaries_count: int | None = Field(default=None, alias="DeployedCanariesCount")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user