binalyze-air-sdk 1.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- binalyze_air/__init__.py +77 -0
- binalyze_air/apis/__init__.py +27 -0
- binalyze_air/apis/authentication.py +27 -0
- binalyze_air/apis/auto_asset_tags.py +75 -0
- binalyze_air/apis/endpoints.py +22 -0
- binalyze_air/apis/event_subscription.py +97 -0
- binalyze_air/apis/evidence.py +53 -0
- binalyze_air/apis/evidences.py +216 -0
- binalyze_air/apis/interact.py +36 -0
- binalyze_air/apis/params.py +40 -0
- binalyze_air/apis/settings.py +27 -0
- binalyze_air/apis/user_management.py +74 -0
- binalyze_air/apis/users.py +68 -0
- binalyze_air/apis/webhooks.py +231 -0
- binalyze_air/base.py +133 -0
- binalyze_air/client.py +1338 -0
- binalyze_air/commands/__init__.py +146 -0
- binalyze_air/commands/acquisitions.py +387 -0
- binalyze_air/commands/assets.py +363 -0
- binalyze_air/commands/authentication.py +37 -0
- binalyze_air/commands/auto_asset_tags.py +231 -0
- binalyze_air/commands/baseline.py +396 -0
- binalyze_air/commands/cases.py +603 -0
- binalyze_air/commands/event_subscription.py +102 -0
- binalyze_air/commands/evidences.py +988 -0
- binalyze_air/commands/interact.py +58 -0
- binalyze_air/commands/organizations.py +221 -0
- binalyze_air/commands/policies.py +203 -0
- binalyze_air/commands/settings.py +29 -0
- binalyze_air/commands/tasks.py +56 -0
- binalyze_air/commands/triage.py +360 -0
- binalyze_air/commands/user_management.py +126 -0
- binalyze_air/commands/users.py +101 -0
- binalyze_air/config.py +245 -0
- binalyze_air/exceptions.py +50 -0
- binalyze_air/http_client.py +306 -0
- binalyze_air/models/__init__.py +285 -0
- binalyze_air/models/acquisitions.py +251 -0
- binalyze_air/models/assets.py +439 -0
- binalyze_air/models/audit.py +273 -0
- binalyze_air/models/authentication.py +70 -0
- binalyze_air/models/auto_asset_tags.py +117 -0
- binalyze_air/models/baseline.py +232 -0
- binalyze_air/models/cases.py +276 -0
- binalyze_air/models/endpoints.py +76 -0
- binalyze_air/models/event_subscription.py +172 -0
- binalyze_air/models/evidence.py +66 -0
- binalyze_air/models/evidences.py +349 -0
- binalyze_air/models/interact.py +136 -0
- binalyze_air/models/organizations.py +294 -0
- binalyze_air/models/params.py +128 -0
- binalyze_air/models/policies.py +250 -0
- binalyze_air/models/settings.py +84 -0
- binalyze_air/models/tasks.py +149 -0
- binalyze_air/models/triage.py +143 -0
- binalyze_air/models/user_management.py +97 -0
- binalyze_air/models/users.py +82 -0
- binalyze_air/queries/__init__.py +134 -0
- binalyze_air/queries/acquisitions.py +156 -0
- binalyze_air/queries/assets.py +105 -0
- binalyze_air/queries/audit.py +417 -0
- binalyze_air/queries/authentication.py +56 -0
- binalyze_air/queries/auto_asset_tags.py +60 -0
- binalyze_air/queries/baseline.py +185 -0
- binalyze_air/queries/cases.py +293 -0
- binalyze_air/queries/endpoints.py +25 -0
- binalyze_air/queries/event_subscription.py +55 -0
- binalyze_air/queries/evidence.py +140 -0
- binalyze_air/queries/evidences.py +280 -0
- binalyze_air/queries/interact.py +28 -0
- binalyze_air/queries/organizations.py +223 -0
- binalyze_air/queries/params.py +115 -0
- binalyze_air/queries/policies.py +150 -0
- binalyze_air/queries/settings.py +20 -0
- binalyze_air/queries/tasks.py +82 -0
- binalyze_air/queries/triage.py +231 -0
- binalyze_air/queries/user_management.py +83 -0
- binalyze_air/queries/users.py +69 -0
- binalyze_air_sdk-1.0.1.dist-info/METADATA +635 -0
- binalyze_air_sdk-1.0.1.dist-info/RECORD +82 -0
- binalyze_air_sdk-1.0.1.dist-info/WHEEL +5 -0
- binalyze_air_sdk-1.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,396 @@
|
|
1
|
+
"""
|
2
|
+
Baseline-related commands for the Binalyze AIR SDK.
|
3
|
+
"""
|
4
|
+
|
5
|
+
from typing import Dict, Any, Union
|
6
|
+
|
7
|
+
from ..base import Command
|
8
|
+
from ..models.baseline import (
|
9
|
+
Baseline, BaselineProfile, BaselineComparison, BaselineSchedule, BaselineChange,
|
10
|
+
CreateBaselineRequest, UpdateBaselineRequest, CreateBaselineProfileRequest,
|
11
|
+
CompareBaselineRequest
|
12
|
+
)
|
13
|
+
from ..http_client import HTTPClient
|
14
|
+
|
15
|
+
|
16
|
+
class CreateBaselineCommand(Command[Baseline]):
|
17
|
+
"""Command to create a new baseline."""
|
18
|
+
|
19
|
+
def __init__(self, http_client: HTTPClient, request: CreateBaselineRequest):
|
20
|
+
self.http_client = http_client
|
21
|
+
self.request = request
|
22
|
+
|
23
|
+
def execute(self) -> Baseline:
|
24
|
+
"""Execute the command to create a baseline."""
|
25
|
+
data = self.request.model_dump(exclude_none=True)
|
26
|
+
|
27
|
+
response = self.http_client.post("baselines", json_data=data)
|
28
|
+
|
29
|
+
entity_data = response.get("result", {})
|
30
|
+
|
31
|
+
mapped_data = {
|
32
|
+
"id": entity_data.get("_id"),
|
33
|
+
"name": entity_data.get("name"),
|
34
|
+
"description": entity_data.get("description"),
|
35
|
+
"type": entity_data.get("type"),
|
36
|
+
"status": entity_data.get("status", "creating"),
|
37
|
+
"endpoint_id": entity_data.get("endpointId"),
|
38
|
+
"endpoint_name": entity_data.get("endpointName"),
|
39
|
+
"organization_id": entity_data.get("organizationId", 0),
|
40
|
+
"created_at": entity_data.get("createdAt"),
|
41
|
+
"updated_at": entity_data.get("updatedAt"),
|
42
|
+
"created_by": entity_data.get("createdBy"),
|
43
|
+
"item_count": entity_data.get("itemCount", 0),
|
44
|
+
"file_count": entity_data.get("fileCount", 0),
|
45
|
+
"registry_count": entity_data.get("registryCount", 0),
|
46
|
+
"service_count": entity_data.get("serviceCount", 0),
|
47
|
+
"process_count": entity_data.get("processCount", 0),
|
48
|
+
"network_connection_count": entity_data.get("networkConnectionCount", 0),
|
49
|
+
"tags": entity_data.get("tags", []),
|
50
|
+
"profile_id": entity_data.get("profileId"),
|
51
|
+
"profile_name": entity_data.get("profileName"),
|
52
|
+
"last_comparison": entity_data.get("lastComparison"),
|
53
|
+
"comparison_count": entity_data.get("comparisonCount", 0),
|
54
|
+
}
|
55
|
+
|
56
|
+
# Remove None values
|
57
|
+
mapped_data = {k: v for k, v in mapped_data.items() if v is not None}
|
58
|
+
|
59
|
+
return Baseline(**mapped_data)
|
60
|
+
|
61
|
+
|
62
|
+
class UpdateBaselineCommand(Command[Baseline]):
|
63
|
+
"""Command to update an existing baseline."""
|
64
|
+
|
65
|
+
def __init__(self, http_client: HTTPClient, baseline_id: str, request: UpdateBaselineRequest):
|
66
|
+
self.http_client = http_client
|
67
|
+
self.baseline_id = baseline_id
|
68
|
+
self.request = request
|
69
|
+
|
70
|
+
def execute(self) -> Baseline:
|
71
|
+
"""Execute the command to update a baseline."""
|
72
|
+
data = self.request.model_dump(exclude_none=True)
|
73
|
+
|
74
|
+
response = self.http_client.put(f"baselines/{self.baseline_id}", json_data=data)
|
75
|
+
|
76
|
+
entity_data = response.get("result", {})
|
77
|
+
|
78
|
+
mapped_data = {
|
79
|
+
"id": entity_data.get("_id"),
|
80
|
+
"name": entity_data.get("name"),
|
81
|
+
"description": entity_data.get("description"),
|
82
|
+
"type": entity_data.get("type"),
|
83
|
+
"status": entity_data.get("status", "creating"),
|
84
|
+
"endpoint_id": entity_data.get("endpointId"),
|
85
|
+
"endpoint_name": entity_data.get("endpointName"),
|
86
|
+
"organization_id": entity_data.get("organizationId", 0),
|
87
|
+
"created_at": entity_data.get("createdAt"),
|
88
|
+
"updated_at": entity_data.get("updatedAt"),
|
89
|
+
"created_by": entity_data.get("createdBy"),
|
90
|
+
"item_count": entity_data.get("itemCount", 0),
|
91
|
+
"file_count": entity_data.get("fileCount", 0),
|
92
|
+
"registry_count": entity_data.get("registryCount", 0),
|
93
|
+
"service_count": entity_data.get("serviceCount", 0),
|
94
|
+
"process_count": entity_data.get("processCount", 0),
|
95
|
+
"network_connection_count": entity_data.get("networkConnectionCount", 0),
|
96
|
+
"tags": entity_data.get("tags", []),
|
97
|
+
"profile_id": entity_data.get("profileId"),
|
98
|
+
"profile_name": entity_data.get("profileName"),
|
99
|
+
"last_comparison": entity_data.get("lastComparison"),
|
100
|
+
"comparison_count": entity_data.get("comparisonCount", 0),
|
101
|
+
}
|
102
|
+
|
103
|
+
# Remove None values
|
104
|
+
mapped_data = {k: v for k, v in mapped_data.items() if v is not None}
|
105
|
+
|
106
|
+
return Baseline(**mapped_data)
|
107
|
+
|
108
|
+
|
109
|
+
class DeleteBaselineCommand(Command[Dict[str, Any]]):
|
110
|
+
"""Command to delete a baseline."""
|
111
|
+
|
112
|
+
def __init__(self, http_client: HTTPClient, baseline_id: str):
|
113
|
+
self.http_client = http_client
|
114
|
+
self.baseline_id = baseline_id
|
115
|
+
|
116
|
+
def execute(self) -> Dict[str, Any]:
|
117
|
+
"""Execute the command to delete a baseline."""
|
118
|
+
response = self.http_client.delete(f"baselines/{self.baseline_id}")
|
119
|
+
return response
|
120
|
+
|
121
|
+
|
122
|
+
class CompareBaselineCommand(Command[BaselineComparison]):
|
123
|
+
"""Command to run baseline comparison."""
|
124
|
+
|
125
|
+
def __init__(self, http_client: HTTPClient, request: Union[CompareBaselineRequest, Dict[str, Any]]):
|
126
|
+
self.http_client = http_client
|
127
|
+
self.request = request
|
128
|
+
|
129
|
+
def execute(self) -> BaselineComparison:
|
130
|
+
"""Execute the command to run baseline comparison."""
|
131
|
+
# Handle both dict and model objects
|
132
|
+
if isinstance(self.request, dict):
|
133
|
+
data = self.request
|
134
|
+
else:
|
135
|
+
data = self.request.model_dump(exclude_none=True)
|
136
|
+
|
137
|
+
response = self.http_client.post("baselines/compare", json_data=data)
|
138
|
+
|
139
|
+
entity_data = response.get("result", {})
|
140
|
+
|
141
|
+
# Parse changes if present
|
142
|
+
changes = []
|
143
|
+
for change_data in entity_data.get("changes", []):
|
144
|
+
change_mapped = {
|
145
|
+
"id": change_data.get("_id"),
|
146
|
+
"comparison_id": change_data.get("comparisonId"),
|
147
|
+
"change_type": change_data.get("changeType"),
|
148
|
+
"item_type": change_data.get("itemType"),
|
149
|
+
"path": change_data.get("path"),
|
150
|
+
"old_value": change_data.get("oldValue"),
|
151
|
+
"new_value": change_data.get("newValue"),
|
152
|
+
"severity": change_data.get("severity", "medium"),
|
153
|
+
"category": change_data.get("category"),
|
154
|
+
"description": change_data.get("description"),
|
155
|
+
"detected_at": change_data.get("detectedAt"),
|
156
|
+
"risk_score": change_data.get("riskScore", 0.0),
|
157
|
+
}
|
158
|
+
|
159
|
+
# Remove None values
|
160
|
+
change_mapped = {k: v for k, v in change_mapped.items() if v is not None}
|
161
|
+
changes.append(BaselineChange(**change_mapped))
|
162
|
+
|
163
|
+
mapped_data = {
|
164
|
+
"id": entity_data.get("_id"),
|
165
|
+
"baseline_id": entity_data.get("baselineId"),
|
166
|
+
"baseline_name": entity_data.get("baselineName"),
|
167
|
+
"endpoint_id": entity_data.get("endpointId"),
|
168
|
+
"endpoint_name": entity_data.get("endpointName"),
|
169
|
+
"status": entity_data.get("status", "pending"),
|
170
|
+
"started_at": entity_data.get("startedAt"),
|
171
|
+
"completed_at": entity_data.get("completedAt"),
|
172
|
+
"duration": entity_data.get("duration"),
|
173
|
+
"total_changes": entity_data.get("totalChanges", 0),
|
174
|
+
"added_items": entity_data.get("addedItems", 0),
|
175
|
+
"removed_items": entity_data.get("removedItems", 0),
|
176
|
+
"modified_items": entity_data.get("modifiedItems", 0),
|
177
|
+
"moved_items": entity_data.get("movedItems", 0),
|
178
|
+
"high_risk_changes": entity_data.get("highRiskChanges", 0),
|
179
|
+
"medium_risk_changes": entity_data.get("mediumRiskChanges", 0),
|
180
|
+
"low_risk_changes": entity_data.get("lowRiskChanges", 0),
|
181
|
+
"changes": changes,
|
182
|
+
"organization_id": entity_data.get("organizationId", 0),
|
183
|
+
"triggered_by": entity_data.get("triggeredBy"),
|
184
|
+
"error_message": entity_data.get("errorMessage"),
|
185
|
+
}
|
186
|
+
|
187
|
+
# Remove None values
|
188
|
+
mapped_data = {k: v for k, v in mapped_data.items() if v is not None}
|
189
|
+
|
190
|
+
return BaselineComparison(**mapped_data)
|
191
|
+
|
192
|
+
|
193
|
+
class CreateBaselineProfileCommand(Command[BaselineProfile]):
|
194
|
+
"""Command to create a new baseline profile."""
|
195
|
+
|
196
|
+
def __init__(self, http_client: HTTPClient, request: CreateBaselineProfileRequest):
|
197
|
+
self.http_client = http_client
|
198
|
+
self.request = request
|
199
|
+
|
200
|
+
def execute(self) -> BaselineProfile:
|
201
|
+
"""Execute the command to create a baseline profile."""
|
202
|
+
data = self.request.model_dump(exclude_none=True)
|
203
|
+
|
204
|
+
response = self.http_client.post("baselines/profiles", json_data=data)
|
205
|
+
|
206
|
+
entity_data = response.get("result", {})
|
207
|
+
|
208
|
+
mapped_data = {
|
209
|
+
"id": entity_data.get("_id"),
|
210
|
+
"name": entity_data.get("name"),
|
211
|
+
"description": entity_data.get("description"),
|
212
|
+
"settings": entity_data.get("settings", {}),
|
213
|
+
"categories": entity_data.get("categories", []),
|
214
|
+
"exclusions": entity_data.get("exclusions", []),
|
215
|
+
"organization_id": entity_data.get("organizationId", 0),
|
216
|
+
"created_at": entity_data.get("createdAt"),
|
217
|
+
"updated_at": entity_data.get("updatedAt"),
|
218
|
+
"created_by": entity_data.get("createdBy"),
|
219
|
+
"is_default": entity_data.get("isDefault", False),
|
220
|
+
"baseline_count": entity_data.get("baselineCount", 0),
|
221
|
+
}
|
222
|
+
|
223
|
+
# Remove None values
|
224
|
+
mapped_data = {k: v for k, v in mapped_data.items() if v is not None}
|
225
|
+
|
226
|
+
return BaselineProfile(**mapped_data)
|
227
|
+
|
228
|
+
|
229
|
+
class UpdateBaselineProfileCommand(Command[BaselineProfile]):
|
230
|
+
"""Command to update an existing baseline profile."""
|
231
|
+
|
232
|
+
def __init__(self, http_client: HTTPClient, profile_id: str, request: CreateBaselineProfileRequest):
|
233
|
+
self.http_client = http_client
|
234
|
+
self.profile_id = profile_id
|
235
|
+
self.request = request
|
236
|
+
|
237
|
+
def execute(self) -> BaselineProfile:
|
238
|
+
"""Execute the command to update a baseline profile."""
|
239
|
+
data = self.request.model_dump(exclude_none=True)
|
240
|
+
|
241
|
+
response = self.http_client.put(f"baselines/profiles/{self.profile_id}", json_data=data)
|
242
|
+
|
243
|
+
entity_data = response.get("result", {})
|
244
|
+
|
245
|
+
mapped_data = {
|
246
|
+
"id": entity_data.get("_id"),
|
247
|
+
"name": entity_data.get("name"),
|
248
|
+
"description": entity_data.get("description"),
|
249
|
+
"settings": entity_data.get("settings", {}),
|
250
|
+
"categories": entity_data.get("categories", []),
|
251
|
+
"exclusions": entity_data.get("exclusions", []),
|
252
|
+
"organization_id": entity_data.get("organizationId", 0),
|
253
|
+
"created_at": entity_data.get("createdAt"),
|
254
|
+
"updated_at": entity_data.get("updatedAt"),
|
255
|
+
"created_by": entity_data.get("createdBy"),
|
256
|
+
"is_default": entity_data.get("isDefault", False),
|
257
|
+
"baseline_count": entity_data.get("baselineCount", 0),
|
258
|
+
}
|
259
|
+
|
260
|
+
# Remove None values
|
261
|
+
mapped_data = {k: v for k, v in mapped_data.items() if v is not None}
|
262
|
+
|
263
|
+
return BaselineProfile(**mapped_data)
|
264
|
+
|
265
|
+
|
266
|
+
class DeleteBaselineProfileCommand(Command[Dict[str, Any]]):
|
267
|
+
"""Command to delete a baseline profile."""
|
268
|
+
|
269
|
+
def __init__(self, http_client: HTTPClient, profile_id: str):
|
270
|
+
self.http_client = http_client
|
271
|
+
self.profile_id = profile_id
|
272
|
+
|
273
|
+
def execute(self) -> Dict[str, Any]:
|
274
|
+
"""Execute the command to delete a baseline profile."""
|
275
|
+
response = self.http_client.delete(f"baselines/profiles/{self.profile_id}")
|
276
|
+
return response
|
277
|
+
|
278
|
+
|
279
|
+
class CreateBaselineScheduleCommand(Command[BaselineSchedule]):
|
280
|
+
"""Command to create a baseline schedule."""
|
281
|
+
|
282
|
+
def __init__(self, http_client: HTTPClient, baseline_id: str, schedule_data: Dict[str, Any]):
|
283
|
+
self.http_client = http_client
|
284
|
+
self.baseline_id = baseline_id
|
285
|
+
self.schedule_data = schedule_data
|
286
|
+
|
287
|
+
def execute(self) -> BaselineSchedule:
|
288
|
+
"""Execute the command to create a baseline schedule."""
|
289
|
+
response = self.http_client.post("baselines/schedules", json_data=self.schedule_data)
|
290
|
+
|
291
|
+
entity_data = response.get("result", {})
|
292
|
+
|
293
|
+
mapped_data = {
|
294
|
+
"id": entity_data.get("_id"),
|
295
|
+
"baseline_id": entity_data.get("baselineId"),
|
296
|
+
"baseline_name": entity_data.get("baselineName"),
|
297
|
+
"schedule_type": entity_data.get("scheduleType"),
|
298
|
+
"cron_expression": entity_data.get("cronExpression"),
|
299
|
+
"interval_minutes": entity_data.get("intervalMinutes"),
|
300
|
+
"enabled": entity_data.get("enabled", True),
|
301
|
+
"next_run": entity_data.get("nextRun"),
|
302
|
+
"last_run": entity_data.get("lastRun"),
|
303
|
+
"run_count": entity_data.get("runCount", 0),
|
304
|
+
"organization_id": entity_data.get("organizationId", 0),
|
305
|
+
"created_at": entity_data.get("createdAt"),
|
306
|
+
"updated_at": entity_data.get("updatedAt"),
|
307
|
+
"created_by": entity_data.get("createdBy"),
|
308
|
+
}
|
309
|
+
|
310
|
+
# Remove None values
|
311
|
+
mapped_data = {k: v for k, v in mapped_data.items() if v is not None}
|
312
|
+
|
313
|
+
return BaselineSchedule(**mapped_data)
|
314
|
+
|
315
|
+
|
316
|
+
class DeleteBaselineScheduleCommand(Command[Dict[str, Any]]):
|
317
|
+
"""Command to delete a baseline schedule."""
|
318
|
+
|
319
|
+
def __init__(self, http_client: HTTPClient, schedule_id: str):
|
320
|
+
self.http_client = http_client
|
321
|
+
self.schedule_id = schedule_id
|
322
|
+
|
323
|
+
def execute(self) -> Dict[str, Any]:
|
324
|
+
"""Execute the command to delete a baseline schedule."""
|
325
|
+
response = self.http_client.delete(f"baselines/schedules/{self.schedule_id}")
|
326
|
+
return response
|
327
|
+
|
328
|
+
|
329
|
+
class RefreshBaselineCommand(Command[Baseline]):
|
330
|
+
"""Command to refresh/rebuild a baseline."""
|
331
|
+
|
332
|
+
def __init__(self, http_client: HTTPClient, baseline_id: str):
|
333
|
+
self.http_client = http_client
|
334
|
+
self.baseline_id = baseline_id
|
335
|
+
|
336
|
+
def execute(self) -> Baseline:
|
337
|
+
"""Execute the command to refresh a baseline."""
|
338
|
+
response = self.http_client.post(f"baselines/{self.baseline_id}/refresh")
|
339
|
+
|
340
|
+
entity_data = response.get("result", {})
|
341
|
+
|
342
|
+
mapped_data = {
|
343
|
+
"id": entity_data.get("_id"),
|
344
|
+
"name": entity_data.get("name"),
|
345
|
+
"description": entity_data.get("description"),
|
346
|
+
"type": entity_data.get("type"),
|
347
|
+
"status": entity_data.get("status", "creating"),
|
348
|
+
"endpoint_id": entity_data.get("endpointId"),
|
349
|
+
"endpoint_name": entity_data.get("endpointName"),
|
350
|
+
"organization_id": entity_data.get("organizationId", 0),
|
351
|
+
"created_at": entity_data.get("createdAt"),
|
352
|
+
"updated_at": entity_data.get("updatedAt"),
|
353
|
+
"created_by": entity_data.get("createdBy"),
|
354
|
+
"item_count": entity_data.get("itemCount", 0),
|
355
|
+
"file_count": entity_data.get("fileCount", 0),
|
356
|
+
"registry_count": entity_data.get("registryCount", 0),
|
357
|
+
"service_count": entity_data.get("serviceCount", 0),
|
358
|
+
"process_count": entity_data.get("processCount", 0),
|
359
|
+
"network_connection_count": entity_data.get("networkConnectionCount", 0),
|
360
|
+
"tags": entity_data.get("tags", []),
|
361
|
+
"profile_id": entity_data.get("profileId"),
|
362
|
+
"profile_name": entity_data.get("profileName"),
|
363
|
+
"last_comparison": entity_data.get("lastComparison"),
|
364
|
+
"comparison_count": entity_data.get("comparisonCount", 0),
|
365
|
+
}
|
366
|
+
|
367
|
+
# Remove None values
|
368
|
+
mapped_data = {k: v for k, v in mapped_data.items() if v is not None}
|
369
|
+
|
370
|
+
return Baseline(**mapped_data)
|
371
|
+
|
372
|
+
|
373
|
+
class AcquireBaselineByFilterCommand(Command[Dict[str, Any]]):
|
374
|
+
"""Command to acquire baselines by asset filter criteria."""
|
375
|
+
|
376
|
+
def __init__(self, http_client: HTTPClient, payload: Dict[str, Any]):
|
377
|
+
self.http_client = http_client
|
378
|
+
self.payload = payload
|
379
|
+
|
380
|
+
def execute(self) -> Dict[str, Any]:
|
381
|
+
"""Execute the command to acquire baselines by filter."""
|
382
|
+
response = self.http_client.post("baseline/acquire", json_data=self.payload)
|
383
|
+
return response
|
384
|
+
|
385
|
+
|
386
|
+
class CompareBaselineByEndpointCommand(Command[Dict[str, Any]]):
|
387
|
+
"""Command to compare baseline acquisition tasks by endpoint ID."""
|
388
|
+
|
389
|
+
def __init__(self, http_client: HTTPClient, payload: Dict[str, Any]):
|
390
|
+
self.http_client = http_client
|
391
|
+
self.payload = payload
|
392
|
+
|
393
|
+
def execute(self) -> Dict[str, Any]:
|
394
|
+
"""Execute the command to compare baselines by endpoint."""
|
395
|
+
response = self.http_client.post("baseline/compare", json_data=self.payload)
|
396
|
+
return response
|