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
8 changes: 8 additions & 0 deletions crowdsec_service_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,16 @@ class Server(Enum):
'DecisionsGetResponsePage',
'DecisionsSortBy',
'DecisionsSortOrder',
'EngineAssociateTagsRequest',
'EngineAssociateTagsResponse',
'EngineGetResponse',
'EngineGetResponsePage',
'EntityType',
'FingerprintSubscription',
'GetRemediationMetricsResponse',
'HTTPValidationError',
'HubItem',
'HubItems',
'InfoResponse',
'IntegrationCreateRequest',
'IntegrationCreateResponse',
Expand All @@ -113,6 +117,8 @@ class Server(Enum):
'IntegrationUpdateRequest',
'IntegrationUpdateResponse',
'Links',
'LogProcessorGetResponse',
'LogProcessorsGetResponsePage',
'MetricUnits',
'OperatingSystem',
'OriginMetrics',
Expand All @@ -122,6 +128,8 @@ class Server(Enum):
'PublicBlocklistResponse',
'PublicBlocklistResponsePage',
'RawMetrics',
'RemediationComponentGetResponse',
'RemediationComponentsGetResponsePage',
'RemediationMetrics',
'RemediationMetricsData',
'RemediationStats',
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.
279 changes: 257 additions & 22 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-08-13T14:33:55+00:00
# timestamp: 2026-11-03T10:16:00+00:00

from __future__ import annotations

Expand Down Expand Up @@ -253,13 +253,6 @@ class BlocklistCreateRequest(BaseModelSdk):
tags: Annotated[
Optional[List[str]], Field(description='Classification tags', title='Tags')
] = []
store_full_content_in_s3: Annotated[
Optional[bool],
Field(
description='Whether to store the full blocklist content in S3 or not',
title='Store Full Content In S3',
),
] = False


class BlocklistDeleteIPsRequest(BaseModelSdk):
Expand Down Expand Up @@ -451,6 +444,33 @@ class DecisionsSortOrder(StrEnum):
DESC = 'desc'


class EngineAssociateTagsRequest(BaseModelSdk):
model_config = ConfigDict(
extra='forbid',
)
tags: Annotated[
List[str],
Field(description='List of tags to associate with the engine', title='Tags'),
]


class EngineAssociateTagsResponse(BaseModelSdk):
modified_count: Annotated[
Optional[int],
Field(
description='Count of tags associated with the engine',
title='Modified Count',
),
] = 0
errors: Annotated[
Optional[Dict[str, str]],
Field(
description='Tags that could not be associated with the engine with associated error',
title='Errors',
),
] = {}


class EntityType(StrEnum):
ORG = 'org'
TAG = 'tag'
Expand All @@ -465,6 +485,47 @@ class FingerprintSubscription(BaseModelSdk):
id: Annotated[str, Field(description='Fingerprint ID', title='Id')]


class HubItem(BaseModelSdk):
name: Annotated[
Optional[str], Field(description='name of the item', title='Name')
] = None
version: Annotated[
Optional[str], Field(description='version of the item', title='Version')
] = None
status: Annotated[
Optional[str], Field(description='status of the item', title='Status')
] = None


class HubItems(BaseModelSdk):
scenarios: Annotated[
Optional[List[HubItem]], Field(description='scenarios', title='Scenarios')
] = None
parsers: Annotated[
Optional[List[HubItem]], Field(description='parsers', title='Parsers')
] = None
postoverflows: Annotated[
Optional[List[HubItem]],
Field(description='postoverflows', title='Postoverflows'),
] = None
appsec_configs: Annotated[
Optional[List[HubItem]],
Field(
alias='appsec-configs', description='appsec configs', title='Appsec-Configs'
),
] = None
appsec_rules: Annotated[
Optional[List[HubItem]],
Field(alias='appsec-rules', description='appsec rules', title='Appsec-Rules'),
] = None
collections: Annotated[
Optional[List[HubItem]], Field(description='collections', title='Collections')
] = None
contexts: Annotated[
Optional[List[HubItem]], Field(description='contexts', title='Contexts')
] = None


class InfoResponse(BaseModelSdk):
organization_id: Annotated[
str, Field(description='The organization ID', title='Organization Id')
Expand Down Expand Up @@ -544,6 +605,50 @@ class PricingTiers(StrEnum):
PLATINUM = 'platinum'


class RemediationComponentGetResponse(BaseModelSdk):
id: Annotated[str, Field(description='ID of the remediation component', title='Id')]
organization_id: Annotated[
str, Field(description='ID of the owner organization', title='Organization Id')
]
created_at: Annotated[
datetime,
Field(
description='Time the remediation component was created', title='Created At'
),
]
entity_type: Annotated[
Optional[EntityType], Field(description='Type of the entity')
] = 'remediation_component'
name: Annotated[
str, Field(description='Name of the remediation component', title='Name')
]
version: Annotated[
Optional[str],
Field(description='Version of the remediation component', title='Version'),
] = None
type: Annotated[
Optional[str],
Field(description='Type of the remediation component', title='Type'),
] = None
last_pull: Annotated[
Optional[datetime],
Field(
description='Last time the remediation component pulled from CAPI',
title='Last Pull',
),
] = None
os: Optional[OperatingSystem] = None


class RemediationComponentsGetResponsePage(BaseModelSdk):
items: Annotated[List[RemediationComponentGetResponse], Field(title='Items')]
total: Annotated[Optional[Total], Field(title='Total')] = None
page: Annotated[Optional[Page], Field(title='Page')] = None
size: Annotated[Optional[Size], Field(title='Size')] = None
pages: Annotated[Optional[Pages], Field(title='Pages')] = None
links: Links


class RemediationMetricsData(BaseModelSdk):
value: Annotated[
Union[int, float], Field(description='Value of the metric', title='Value')
Expand Down Expand Up @@ -1417,7 +1522,7 @@ class BlocklistsUploadBlocklistContentQueryParameters(BaseModelSdk):
Optional[datetime],
Field(
description='Blocklist expiration',
examples=['2026-08-13T14:31:02.942186+00:00'],
examples=['2026-11-03T10:13:59.883208+00:00'],
title='Expiration',
),
] = None
Expand All @@ -1443,12 +1548,6 @@ class BlocklistsAddIpsToBlocklistPathParameters(BaseModelSdk):
]


class BlocklistsOverwriteIpsPathParameters(BaseModelSdk):
blocklist_id: Annotated[
str, Field(examples=['5f9d88b9e5c4f5b9a3d3e8b1'], title='Blocklist Id')
]


class BlocklistsDeleteIpsFromBlocklistPathParameters(BaseModelSdk):
blocklist_id: Annotated[
str, Field(examples=['5f9d88b9e5c4f5b9a3d3e8b1'], title='Blocklist Id')
Expand Down Expand Up @@ -1815,6 +1914,45 @@ class EnginesGetEnginesQueryParameters(BaseModelSdk):
] = 50


class EnginesGetEnginePathParameters(BaseModelSdk):
engine_id: Annotated[str, Field(title='Engine Id')]


class EnginesAssociateTagsWithEnginePathParameters(BaseModelSdk):
engine_id: Annotated[str, Field(title='Engine Id')]


class EnginesDisassociateTagsWithEnginePathParameters(BaseModelSdk):
engine_id: Annotated[str, Field(title='Engine Id')]
tag_name: Annotated[str, Field(title='Tag Name')]


class EnginesGetEngineLogProcessorsQueryParameters(BaseModelSdk):
page: Annotated[
Optional[int], Field(description='Page number', ge=1, title='Page')
] = 1
size: Annotated[
Optional[int], Field(description='Page size', ge=1, le=100, title='Size')
] = 50


class EnginesGetEngineLogProcessorsPathParameters(BaseModelSdk):
engine_id: Annotated[str, Field(title='Engine Id')]


class EnginesGetEngineRemediationComponentsQueryParameters(BaseModelSdk):
page: Annotated[
Optional[int], Field(description='Page number', ge=1, title='Page')
] = 1
size: Annotated[
Optional[int], Field(description='Page size', ge=1, le=100, title='Size')
] = 50


class EnginesGetEngineRemediationComponentsPathParameters(BaseModelSdk):
engine_id: Annotated[str, Field(title='Engine Id')]


class MetricsGetMetricsRemediationQueryParameters(BaseModelSdk):
start_date: Annotated[
Optional[datetime],
Expand Down Expand Up @@ -2866,19 +3004,39 @@ class EngineGetResponse(BaseModelSdk):
datetime, Field(description='Time the engine was created', title='Created At')
]
entity_type: Annotated[
Optional[EntityType], Field(description='Type of the entity')
Optional[EntityType], Field(description='Type of the entity, fixed to `engine`')
] = 'engine'
blocklists: Annotated[
Optional[List[CapiEntitiesListsSubscriberEntityBlocklistSubscription]],
Field(title='Blocklists'),
Field(
description='List of blocklist subscriptions for the engine',
title='Blocklists',
),
] = []
allowlists: Annotated[
Optional[List[AllowlistSubscription]], Field(title='Allowlists')
Optional[List[AllowlistSubscription]],
Field(
description='List of allowlist subscriptions for the engine',
title='Allowlists',
),
] = []
version: Annotated[Optional[str], Field(title='Version')] = None
enrolled_at: Annotated[Optional[datetime], Field(title='Enrolled At')] = None
os: Optional[OperatingSystem] = None
meta: Annotated[Optional[Dict[str, Any]], Field(title='Meta')] = {}
version: Annotated[
Optional[str], Field(description='Version of the engine', title='Version')
] = None
enrolled_at: Annotated[
Optional[datetime],
Field(description='Time the engine was enrolled', title='Enrolled At'),
] = None
os: Annotated[
Optional[OperatingSystem], Field(description='Operating system of the engine')
] = None
meta: Annotated[
Optional[Dict[str, Any]],
Field(
description='Metadata for the engine, including feature flags, console options, and datasources',
title='Meta',
),
] = {}
last_pull: Annotated[
Optional[datetime],
Field(description='Last time the engine pulled CAPI', title='Last Pull'),
Expand All @@ -2891,10 +3049,20 @@ class EngineGetResponse(BaseModelSdk):
Optional[datetime],
Field(description='Last time the engine logged in CAPI', title='Last Login'),
] = None
last_ip: Annotated[
Optional[str],
Field(description='Last IP address used by the engine', title='Last Ip'),
] = None
tags: Annotated[
Optional[List[str]],
Field(description='List of tags associated with the engine', title='Tags'),
] = []
scenarios: Annotated[
Optional[List[str]],
Field(
description='List of scenarios installed on the engine', title='Scenarios'
),
] = None


class EngineGetResponsePage(BaseModelSdk):
Expand Down Expand Up @@ -3262,6 +3430,73 @@ class IntegrationUpdateResponse(BaseModelSdk):
] = None


class LogProcessorGetResponse(BaseModelSdk):
id: Annotated[str, Field(description='ID of the log processor', title='Id')]
organization_id: Annotated[
str, Field(description='ID of the owner organization', title='Organization Id')
]
created_at: Annotated[
datetime,
Field(description='Time the log processor was created', title='Created At'),
]
entity_type: Annotated[
Optional[EntityType], Field(description='Type of the entity')
] = 'log_processor'
name: Annotated[str, Field(description='Name of the log processor', title='Name')]
version: Annotated[
Optional[str],
Field(description='Version of the log processor', title='Version'),
] = None
last_push: Annotated[
Optional[datetime],
Field(
description='Last time the log processor pushed to CAPI', title='Last Push'
),
] = None
last_update: Annotated[
Optional[datetime],
Field(
description='Last time the log processor was updated in CAPI',
title='Last Update',
),
] = None
last_heartbeat: Annotated[
Optional[datetime],
Field(
description='Last time the log processor sent a heartbeat to CAPI',
title='Last Heartbeat',
),
] = None
feature_flags: Annotated[
Optional[List[str]],
Field(
description='Feature flags associated with the log processor',
title='Feature Flags',
),
] = []
hub_items: Annotated[
Optional[HubItems],
Field(description='Hub items associated with the log processor'),
] = None
os: Optional[OperatingSystem] = None
datasources: Annotated[
Optional[Dict[str, int]],
Field(
description='Datasources associated with the log processor',
title='Datasources',
),
] = None


class LogProcessorsGetResponsePage(BaseModelSdk):
items: Annotated[List[LogProcessorGetResponse], Field(title='Items')]
total: Annotated[Optional[Total], Field(title='Total')] = None
page: Annotated[Optional[Page], Field(title='Page')] = None
size: Annotated[Optional[Size], Field(title='Size')] = None
pages: Annotated[Optional[Pages], Field(title='Pages')] = None
links: Links


class OriginMetrics(BaseModelSdk):
origin: Annotated[
Optional[Union[BlocklistOrigin, str]],
Expand Down
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 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.
Loading