microsandbox-core 0.8.2__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.
@@ -0,0 +1,549 @@
1
+ """microsandbox — Python SDK for secure, fast microVM-based sandboxing."""
2
+
3
+ from microsandbox_core._native import (
4
+ BranchOutcome,
5
+ CheckpointCaptureResult,
6
+ CheckpointRemoveResult,
7
+ Checkpoints,
8
+ Context,
9
+ ExecEvent,
10
+ ExecHandle,
11
+ ExecOutput,
12
+ ExecSink,
13
+ ExternalMountWarning,
14
+ ForkOutcome,
15
+ FsEntry,
16
+ FsMetadata,
17
+ FsReadStream,
18
+ FsWriteSink,
19
+ Image,
20
+ ImageConfigDetail,
21
+ ImageDetail,
22
+ ImageHandle,
23
+ ImageLayerDetail,
24
+ ImagePruneReport,
25
+ Job,
26
+ JobAttachment,
27
+ JobLogStream,
28
+ LogEntry,
29
+ LogStream,
30
+ MemoryCacheEntry,
31
+ MemoryCacheReport,
32
+ MetricsStream,
33
+ PullEvent,
34
+ PullSession,
35
+ Sandbox,
36
+ Sandboxes,
37
+ SandboxFsOps,
38
+ SandboxMetrics,
39
+ SandboxPage,
40
+ SandboxPingResult,
41
+ SandboxSshOps,
42
+ SandboxStopResult,
43
+ SandboxTouchResult,
44
+ Service,
45
+ ServicePage,
46
+ SftpClient,
47
+ SnapshotArchive,
48
+ SnapshotCopyBuilder,
49
+ SnapshotCreateResult,
50
+ SnapshotImportResult,
51
+ SnapshotRemoveResult,
52
+ Snapshots,
53
+ SshClient,
54
+ SshOutput,
55
+ SshServer,
56
+ Storage,
57
+ StorageCategoryUsage,
58
+ StorageItemUsage,
59
+ StorageRecovery,
60
+ StorageUsage,
61
+ Volume,
62
+ Volumes,
63
+ all_sandbox_metrics,
64
+ version,
65
+ )
66
+ from microsandbox_core._native import (
67
+ Snapshot as Checkpoint,
68
+ )
69
+ from microsandbox_core._native import (
70
+ SnapshotGroup as Snapshot,
71
+ )
72
+ from microsandbox_core._native import (
73
+ set_runtime_libkrunfw_path as set_libkrunfw_path,
74
+ )
75
+ from microsandbox_core.agent import (
76
+ FLAG_SESSION_START,
77
+ FLAG_SHUTDOWN,
78
+ FLAG_TERMINAL,
79
+ AgentClient,
80
+ AgentStream,
81
+ )
82
+ from microsandbox_core.errors import (
83
+ CloudHttpError,
84
+ ExecFailedError,
85
+ ExecTimeoutError,
86
+ FilesystemError,
87
+ ImageInUseError,
88
+ ImageNotFoundError,
89
+ ImagePullFailedError,
90
+ InvalidConfigError,
91
+ IoError,
92
+ JobError,
93
+ MetricsDisabledError,
94
+ MetricsUnavailableError,
95
+ MicrosandboxError,
96
+ ModificationNotConfirmedError,
97
+ NetworkPolicyError,
98
+ NoDefaultCommandError,
99
+ PathNotFoundError,
100
+ PublishedSnapshotArtifact,
101
+ ResizeTimeoutError,
102
+ ResizeWaitError,
103
+ ResizeWaitFailure,
104
+ RuntimeIncompleteError,
105
+ RuntimeNotInstalledError,
106
+ SandboxAlreadyExistsError,
107
+ SandboxNotFoundError,
108
+ SandboxNotRunningError,
109
+ SandboxReplacedError,
110
+ SandboxStillRunningError,
111
+ SandboxStopTimedOutError,
112
+ SecretViolationError,
113
+ ServiceAlreadyExistsError,
114
+ ServiceError,
115
+ ServiceNotFoundError,
116
+ SnapshotGroupRemovalRecoveryError,
117
+ SnapshotImportError,
118
+ SnapshotMigrationError,
119
+ SnapshotRemovalRecoveryError,
120
+ SnapshotSourceRecoveryError,
121
+ SnapshotVerificationError,
122
+ StopTimeoutError,
123
+ TlsError,
124
+ UnsupportedError,
125
+ UnsupportedOperationError,
126
+ VolumeNotFoundError,
127
+ )
128
+ from microsandbox_core.inspection import (
129
+ SandboxConfigInspection,
130
+ SandboxInspectionSpec,
131
+ SandboxRuntimeInspection,
132
+ )
133
+ from microsandbox_core.jobs import (
134
+ JobCompletedEvent,
135
+ JobEvent,
136
+ JobExit,
137
+ JobGapEvent,
138
+ JobInfo,
139
+ JobLogEntry,
140
+ JobOutputEvent,
141
+ JobOutputSource,
142
+ JobPage,
143
+ JobState,
144
+ )
145
+ from microsandbox_core.setup import (
146
+ InstallOptions,
147
+ ResolvedRuntime,
148
+ RuntimeConfig,
149
+ RuntimeOrigin,
150
+ ensure_runtime,
151
+ install_runtime,
152
+ is_runtime_installed,
153
+ resolve_runtime,
154
+ )
155
+ from microsandbox_core.storage_diagnosis import (
156
+ StorageCandidate,
157
+ StorageDiagnosis,
158
+ StorageDiagnosticStatus,
159
+ StorageInspection,
160
+ StorageSandboxDiagnosis,
161
+ diagnose_storage,
162
+ )
163
+ from microsandbox_core.types import (
164
+ Action,
165
+ ChangeKind,
166
+ ChangeState,
167
+ ComputeType,
168
+ ConfigPlannedChange,
169
+ ContextKind,
170
+ CpuPlacement,
171
+ CpuResizeTarget,
172
+ DeploymentProfile,
173
+ DestGroup,
174
+ Destination,
175
+ Direction,
176
+ DiskCompactionDiskResult,
177
+ DiskCompactionResult,
178
+ DiskImageFormat,
179
+ ExecEventType,
180
+ ExecOptions,
181
+ ExitStatus,
182
+ FlatClone,
183
+ FsEntryKind,
184
+ GiB,
185
+ GuestFlush,
186
+ HostPermissions,
187
+ HttpConfig,
188
+ ImageArchiveFormat,
189
+ ImageSource,
190
+ ImageSourceKind,
191
+ InitConfig,
192
+ InitOptions,
193
+ LogLevel,
194
+ LogReadSource,
195
+ LogSource,
196
+ MemoryResizeTarget,
197
+ MiB,
198
+ ModificationConflict,
199
+ ModificationDisposition,
200
+ ModificationPolicy,
201
+ ModificationWarning,
202
+ MountConfig,
203
+ MountKind,
204
+ NamedVolumeMode,
205
+ Network,
206
+ NetworkDestination,
207
+ NetworkDestinationKind,
208
+ NetworkPolicy,
209
+ NetworkProfile,
210
+ NetworkRateLimiter,
211
+ OutboundProxy,
212
+ Patch,
213
+ PatchConfig,
214
+ PatchKind,
215
+ PlannedChange,
216
+ PlannedChangeKind,
217
+ PortBinding,
218
+ PortEndpoint,
219
+ PortProtocol,
220
+ Protocol,
221
+ PullEventType,
222
+ PullPolicy,
223
+ RateLimiter,
224
+ RegistryAuth,
225
+ ResizeObservation,
226
+ ResizeOperation,
227
+ ResizeOutcome,
228
+ ResizeTarget,
229
+ ResourceConvergenceState,
230
+ ResourceKind,
231
+ ResourceResizeStatus,
232
+ Rlimit,
233
+ RlimitResource,
234
+ RootDisk,
235
+ RootDiskConfig,
236
+ RootDiskKind,
237
+ Rule,
238
+ SandboxInfo,
239
+ SandboxModificationPlan,
240
+ SandboxModificationResult,
241
+ SandboxStatus,
242
+ ScopedUpstreamCACert,
243
+ ScopedVerifyUpstream,
244
+ Secret,
245
+ SecretChangeKind,
246
+ SecretEntry,
247
+ SecretModifySpec,
248
+ SecretPlannedChange,
249
+ SecretSource,
250
+ SecretSubstitution,
251
+ SecurityProfile,
252
+ ServiceErrorReason,
253
+ ServiceStatus,
254
+ ServiceTarget,
255
+ Size,
256
+ SnapshotFormat,
257
+ SnapshotGroupInfo,
258
+ SnapshotScope,
259
+ SnapshotSourceBinding,
260
+ SnapshotSourceStatus,
261
+ SnapshotStateKind,
262
+ StatVirtualization,
263
+ Stdin,
264
+ StdinMode,
265
+ TlsConfig,
266
+ TokenBucket,
267
+ ViolationAction,
268
+ VolumeInfo,
269
+ VolumeKind,
270
+ VsockRoute,
271
+ VsockSocketType,
272
+ )
273
+
274
+ # Register package discovery separately from explicit user overrides. Rust checks
275
+ # the resolved runtime home before this candidate on each resolution.
276
+ from .contexts import LocalContext, RemoteContext
277
+
278
+
279
+
280
+ __all__ = [
281
+ "SandboxConfigInspection",
282
+ "SandboxInspectionSpec",
283
+ "SandboxRuntimeInspection",
284
+ "Job",
285
+ "JobAttachment",
286
+ "JobLogStream",
287
+ "JobError",
288
+ "JobCompletedEvent",
289
+ "JobGapEvent",
290
+ "JobOutputEvent",
291
+ "JobOutputSource",
292
+ "JobEvent",
293
+ "JobExit",
294
+ "JobInfo",
295
+ "JobLogEntry",
296
+ "JobPage",
297
+ "JobState",
298
+ # Backend selection
299
+ # Sandbox lifecycle (native)
300
+ "Sandbox",
301
+ "SandboxPage",
302
+ "SandboxStopResult",
303
+ "SandboxPingResult",
304
+ "SandboxTouchResult",
305
+ "ExternalMountWarning",
306
+ "BranchOutcome",
307
+ "ForkOutcome",
308
+ "PullSession",
309
+ "SandboxStatus",
310
+ "SandboxInfo",
311
+ "ModificationPolicy",
312
+ "SandboxModificationPlan",
313
+ "DiskCompactionDiskResult",
314
+ "DiskCompactionResult",
315
+ "ConfigPlannedChange",
316
+ "SecretPlannedChange",
317
+ "PlannedChange",
318
+ "SecretModifySpec",
319
+ "ModificationConflict",
320
+ "ModificationWarning",
321
+ "ResourceResizeStatus",
322
+ "ResizeOutcome",
323
+ "ResizeObservation",
324
+ "ResizeOperation",
325
+ "ResizeTarget",
326
+ "CpuResizeTarget",
327
+ "MemoryResizeTarget",
328
+ "SandboxModificationResult",
329
+ "ChangeKind",
330
+ "SecretChangeKind",
331
+ "ModificationDisposition",
332
+ "ResourceKind",
333
+ "ResourceConvergenceState",
334
+ "PlannedChangeKind",
335
+ "SandboxSshOps",
336
+ "SftpClient",
337
+ "SshClient",
338
+ "SshOutput",
339
+ "SshServer",
340
+ # Low-level agent client
341
+ "AgentClient",
342
+ "AgentStream",
343
+ "FLAG_TERMINAL",
344
+ "FLAG_SESSION_START",
345
+ "FLAG_SHUTDOWN",
346
+ # Execution (native)
347
+ "ExecHandle",
348
+ "ExecOptions",
349
+ "ExecOutput",
350
+ "ExecSink",
351
+ "LogEntry",
352
+ "LogStream",
353
+ "MetricsStream",
354
+ "ExitStatus",
355
+ "Stdin",
356
+ "StdinMode",
357
+ "Rlimit",
358
+ "RlimitResource",
359
+ # Native execution and pull progress events
360
+ "ExecEvent",
361
+ "ExecEventType",
362
+ "PullEvent",
363
+ "PullEventType",
364
+ # Filesystem (native)
365
+ "SandboxFsOps",
366
+ "FsReadStream",
367
+ "FsWriteSink",
368
+ "FsEntry",
369
+ "FsMetadata",
370
+ # Filesystem (Python enums)
371
+ "FsEntryKind",
372
+ # Volumes
373
+ "Volume",
374
+ # Services
375
+ "Service",
376
+ "ServicePage",
377
+ "ServiceTarget",
378
+ "ServiceStatus",
379
+ "ServiceErrorReason",
380
+ "ChangeState",
381
+ "MountConfig",
382
+ "MountKind",
383
+ "StatVirtualization",
384
+ "HostPermissions",
385
+ "VolumeInfo",
386
+ "VolumeKind",
387
+ "NamedVolumeMode",
388
+ # Snapshots
389
+ "Snapshot",
390
+ "Checkpoint",
391
+ "SnapshotCreateResult",
392
+ "SnapshotImportResult",
393
+ "CheckpointCaptureResult",
394
+ "CheckpointRemoveResult",
395
+ "SnapshotRemoveResult",
396
+ "SnapshotGroupInfo",
397
+ "SnapshotSourceBinding",
398
+ "SnapshotSourceStatus",
399
+ "SnapshotArchive",
400
+ "SnapshotCopyBuilder",
401
+ "SnapshotStateKind",
402
+ "SnapshotFormat",
403
+ "SnapshotScope",
404
+ "GuestFlush",
405
+ # Network
406
+ "Network",
407
+ "NetworkPolicy",
408
+ "NetworkProfile",
409
+ "NetworkRateLimiter",
410
+ "OutboundProxy",
411
+ "SecretSource",
412
+ "Rule",
413
+ "Destination",
414
+ "NetworkDestination",
415
+ "NetworkDestinationKind",
416
+ "Action",
417
+ "Direction",
418
+ "Protocol",
419
+ "PortBinding",
420
+ "PortEndpoint",
421
+ "PortProtocol",
422
+ "VsockRoute",
423
+ "VsockSocketType",
424
+ "DestGroup",
425
+ "RateLimiter",
426
+ "TokenBucket",
427
+ # Secrets & TLS
428
+ "Secret",
429
+ "SecretEntry",
430
+ "SecretSubstitution",
431
+ "ScopedUpstreamCACert",
432
+ "ScopedVerifyUpstream",
433
+ "HttpConfig",
434
+ "TlsConfig",
435
+ "ViolationAction",
436
+ # Images / rootfs
437
+ "Image",
438
+ "ImageHandle",
439
+ "ImageDetail",
440
+ "ImageConfigDetail",
441
+ "ImageLayerDetail",
442
+ "ImagePruneReport",
443
+ "ImageSource",
444
+ "ImageSourceKind",
445
+ "ImageArchiveFormat",
446
+ "RootDisk",
447
+ "RootDiskConfig",
448
+ "RootDiskKind",
449
+ "DiskImageFormat",
450
+ "FlatClone",
451
+ "PullPolicy",
452
+ "CpuPlacement",
453
+ "RegistryAuth",
454
+ # Storage accounting and runtime-cache cleanup
455
+ "Storage",
456
+ "StorageRecovery",
457
+ "StorageUsage",
458
+ "StorageCategoryUsage",
459
+ "StorageItemUsage",
460
+ "MemoryCacheEntry",
461
+ "MemoryCacheReport",
462
+ "LogLevel",
463
+ "DeploymentProfile",
464
+ "SecurityProfile",
465
+ "LogSource",
466
+ "LogReadSource",
467
+ # Patches
468
+ "Patch",
469
+ "PatchConfig",
470
+ "PatchKind",
471
+ # Init handoff
472
+ "InitConfig",
473
+ "InitOptions",
474
+ # Metrics
475
+ "SandboxMetrics",
476
+ "all_sandbox_metrics",
477
+ # Size helpers
478
+ "Size",
479
+ "MiB",
480
+ "GiB",
481
+ # Errors
482
+ "MicrosandboxError",
483
+ "InvalidConfigError",
484
+ "NoDefaultCommandError",
485
+ "RuntimeNotInstalledError",
486
+ "RuntimeIncompleteError",
487
+ "CloudHttpError",
488
+ "ModificationNotConfirmedError",
489
+ "SandboxNotFoundError",
490
+ "SandboxReplacedError",
491
+ "SandboxNotRunningError",
492
+ "SandboxAlreadyExistsError",
493
+ "SandboxStillRunningError",
494
+ "SandboxStopTimedOutError",
495
+ "ExecTimeoutError",
496
+ "StopTimeoutError",
497
+ "ResizeTimeoutError",
498
+ "ResizeWaitError",
499
+ "ResizeWaitFailure",
500
+ "ExecFailedError",
501
+ "FilesystemError",
502
+ "PathNotFoundError",
503
+ "VolumeNotFoundError",
504
+ "ServiceNotFoundError",
505
+ "ServiceAlreadyExistsError",
506
+ "ServiceError",
507
+ "ImageInUseError",
508
+ "ImageNotFoundError",
509
+ "ImagePullFailedError",
510
+ "NetworkPolicyError",
511
+ "SecretViolationError",
512
+ "SnapshotMigrationError",
513
+ "SnapshotSourceRecoveryError",
514
+ "SnapshotImportError",
515
+ "SnapshotVerificationError",
516
+ "SnapshotRemovalRecoveryError",
517
+ "SnapshotGroupRemovalRecoveryError",
518
+ "PublishedSnapshotArtifact",
519
+ "TlsError",
520
+ "IoError",
521
+ "MetricsDisabledError",
522
+ "MetricsUnavailableError",
523
+ "UnsupportedOperationError",
524
+ "UnsupportedError",
525
+ # Setup
526
+ "diagnose_storage",
527
+ "StorageCandidate",
528
+ "StorageDiagnosis",
529
+ "StorageDiagnosticStatus",
530
+ "StorageInspection",
531
+ "StorageSandboxDiagnosis",
532
+ "resolve_runtime",
533
+ "is_runtime_installed",
534
+ "install_runtime",
535
+ "ensure_runtime",
536
+ "RuntimeConfig",
537
+ "InstallOptions",
538
+ "ResolvedRuntime",
539
+ "RuntimeOrigin",
540
+ "set_libkrunfw_path",
541
+ "ComputeType",
542
+ "ContextKind",
543
+ "version",
544
+ ]
545
+
546
+
547
+ __all__ += [
548
+ "Context", "LocalContext", "RemoteContext", "Sandboxes", "Volumes", "Snapshots", "Checkpoints",
549
+ ]