Skip to content
Open
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
1 change: 1 addition & 0 deletions crowdsec_service_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class Server(Enum):
'RawMetrics',
'RemediationMetrics',
'RemediationMetricsData',
'RemediationStats',
'Share',
'SourceInfo',
'SourceType',
Expand Down
Binary file modified crowdsec_service_api/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file modified crowdsec_service_api/__pycache__/base_model.cpython-311.pyc
Binary file not shown.
Binary file modified crowdsec_service_api/__pycache__/http_client.cpython-311.pyc
Binary file not shown.
Binary file modified crowdsec_service_api/__pycache__/models.cpython-311.pyc
Binary file not shown.
30 changes: 28 additions & 2 deletions crowdsec_service_api/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: <stdin>
# timestamp: 2026-04-21T09:21:23+00:00
# timestamp: 2026-05-06T08:54:01+00:00

from __future__ import annotations

Expand Down Expand Up @@ -516,6 +516,23 @@ class RemediationMetricsData(BaseModelSdk):
]


class RemediationStats(BaseModelSdk):
dropped_rate: Annotated[
Optional[Dict[str, Optional[float]]],
Field(
description='Percentage of dropped traffic over total processed traffic, per unit, rounded to 2 decimals. Null when no processed traffic was observed for the unit.',
title='Dropped Rate',
),
] = None
allowed_rate: Annotated[
Optional[Dict[str, Optional[float]]],
Field(
description='Percentage of allowed (passed-through) traffic over total processed traffic, per unit, rounded to 2 decimals. Null when no processed traffic was observed for the unit.',
title='Allowed Rate',
),
] = None


class Share(BaseModelSdk):
organization_id: Annotated[str, Field(title='Organization Id')]
permission: Permission
Expand Down Expand Up @@ -1017,34 +1034,39 @@ class ThreatContext(BaseModelSdk):
Optional[Dict[str, int]],
Field(
description='Attacker country distribution (country code → count)',
examples=[{'FR': 18, 'NL': 23, 'US': 36}],
title='Attacker Countries',
),
] = None
defender_countries: Annotated[
Optional[Dict[str, int]],
Field(
description='Defender country distribution (country code → count)',
examples=[{'BE': 13, 'FR': 22, 'NL': 22}],
title='Defender Countries',
),
] = None
industry_types: Annotated[
Optional[Dict[str, int]],
Field(
description='Industry type distribution (type → count)',
examples=[{'commerce': 65, 'government': 5, 'non_profit': 30}],
title='Industry Types',
),
] = None
industry_risk_profiles: Annotated[
Optional[Dict[str, int]],
Field(
description='Industry risk profile distribution (profile → count)',
examples=[{'SOHO': 25, 'public_service': 10, 'technology_business': 65}],
title='Industry Risk Profiles',
),
] = None
attacker_objectives: Annotated[
Optional[Dict[str, int]],
Field(
description='Attacker objective distribution (objective → count)',
examples=[{'data_exfiltration': 10, 'infrastructure_takeover': 90}],
title='Attacker Objectives',
),
] = None
Expand Down Expand Up @@ -1306,7 +1328,7 @@ class BlocklistsUploadBlocklistContentQueryParameters(BaseModelSdk):
Optional[datetime],
Field(
description='Blocklist expiration',
examples=['2026-04-17T08:43:44.302226+00:00'],
examples=['2026-05-06T08:51:29.433616+00:00'],
title='Expiration',
),
] = None
Expand Down Expand Up @@ -4457,3 +4479,7 @@ class ComputedMetrics(BaseModelSdk):
class GetRemediationMetricsResponse(BaseModelSdk):
raw: Annotated[RawMetrics, Field(description='Raw metrics data')]
computed: Annotated[ComputedMetrics, Field(description='Computed metrics data')]
stats: Annotated[
Optional[RemediationStats],
Field(description='Aggregate stats computed over the time window'),
] = None
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified crowdsec_service_api/services/__pycache__/cves.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified crowdsec_service_api/services/__pycache__/hub.cpython-311.pyc
Binary file not shown.
Binary file modified crowdsec_service_api/services/__pycache__/info.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/allowlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Allowlists(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.15.26")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.121.0")

def list_allowlists(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/blocklists.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Blocklists(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.15.26")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.121.0")

def get_blocklists(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/cves.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Cves(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.15.26")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.121.0")

def get_cves(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/decisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Decisions(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.15.26")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.121.0")

def get_decisions(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Fingerprints(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.15.26")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.121.0")

def get_fingerprint_rules(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Hub(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.15.26")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.121.0")

def get_index(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Info(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.15.26")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.121.0")

def get_info(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Integrations(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.15.26")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.121.0")

def get_integrations(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Metrics(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.15.26")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.121.0")

def get_metrics_remediation(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Products(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.15.26")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.121.0")

def get_products(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/tracker_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class TrackerEvents(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.15.26")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.121.0")

def get_exploitation_phase_change_events(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/tracker_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class TrackerTags(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.15.26")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.121.0")

def get_tags(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/vendors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Vendors(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.15.26")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.121.0")

def get_vendors(
self,
Expand Down
8 changes: 8 additions & 0 deletions doc/Models.md
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ raw, computed
|----------|------|-------------|---------|
| raw | RawMetrics | None ||
| computed | ComputedMetrics | None ||
| stats | RemediationStats | None ||

# **HTTPValidationError**
## Properties
Expand Down Expand Up @@ -865,6 +866,13 @@ value, timestamp
| value | Union[int, float] | Value of the metric ||
| timestamp | str | Timestamp of the metric ||

# **RemediationStats**
## Properties
| Property | Type | Description | Example |
|----------|------|-------------|---------|
| dropped_rate | Dropped Rate | Percentage of dropped traffic over total processed traffic, per unit, rounded to 2 decimals. Null when no processed traffic was observed for the unit. ||
| allowed_rate | Allowed Rate | Percentage of allowed (passed-through) traffic over total processed traffic, per unit, rounded to 2 decimals. Null when no processed traffic was observed for the unit. ||

# **Share**
## Required:
organization_id, permission
Expand Down
2 changes: 2 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ You can find a Quickstart about this SDK, following this [documentation](https:/

[RemediationMetricsData](./Models.md#remediationmetricsdata)

[RemediationStats](./Models.md#remediationstats)

[Share](./Models.md#share)

[SourceInfo](./Models.md#sourceinfo)
Expand Down
Loading