unikraft-cloud-plugin-sandbox-api 1.4.0.dev3__tar.gz → 1.4.1.dev0__tar.gz
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.
- {unikraft_cloud_plugin_sandbox_api-1.4.0.dev3 → unikraft_cloud_plugin_sandbox_api-1.4.1.dev0}/PKG-INFO +1 -1
- {unikraft_cloud_plugin_sandbox_api-1.4.0.dev3 → unikraft_cloud_plugin_sandbox_api-1.4.1.dev0}/pyproject.toml +1 -1
- {unikraft_cloud_plugin_sandbox_api-1.4.0.dev3 → unikraft_cloud_plugin_sandbox_api-1.4.1.dev0}/src/unikraft_cloud_plugin_sandbox_api/_meta.py +3 -3
- {unikraft_cloud_plugin_sandbox_api-1.4.0.dev3 → unikraft_cloud_plugin_sandbox_api-1.4.1.dev0}/src/unikraft_cloud_plugin_sandbox_api/commands_gen.py +16 -0
- {unikraft_cloud_plugin_sandbox_api-1.4.0.dev3 → unikraft_cloud_plugin_sandbox_api-1.4.1.dev0}/src/unikraft_cloud_plugin_sandbox_api/models_gen.py +85 -8
- {unikraft_cloud_plugin_sandbox_api-1.4.0.dev3 → unikraft_cloud_plugin_sandbox_api-1.4.1.dev0}/LICENSE.md +0 -0
- {unikraft_cloud_plugin_sandbox_api-1.4.0.dev3 → unikraft_cloud_plugin_sandbox_api-1.4.1.dev0}/README.md +0 -0
- {unikraft_cloud_plugin_sandbox_api-1.4.0.dev3 → unikraft_cloud_plugin_sandbox_api-1.4.1.dev0}/src/unikraft_cloud_plugin_sandbox_api/__init__.py +0 -0
- {unikraft_cloud_plugin_sandbox_api-1.4.0.dev3 → unikraft_cloud_plugin_sandbox_api-1.4.1.dev0}/src/unikraft_cloud_plugin_sandbox_api/fs_gen.py +0 -0
- {unikraft_cloud_plugin_sandbox_api-1.4.0.dev3 → unikraft_cloud_plugin_sandbox_api-1.4.1.dev0}/src/unikraft_cloud_plugin_sandbox_api/py.typed +0 -0
- {unikraft_cloud_plugin_sandbox_api-1.4.0.dev3 → unikraft_cloud_plugin_sandbox_api-1.4.1.dev0}/src/unikraft_cloud_plugin_sandbox_api/transport.py +0 -0
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
# can tell a rebuild of the same sources from a change under the same version.
|
|
6
6
|
|
|
7
7
|
#: The version this package was published as.
|
|
8
|
-
VERSION = "1.4.
|
|
8
|
+
VERSION = "1.4.1.dev0"
|
|
9
9
|
|
|
10
10
|
#: The oldest unikraft-cloud SDK whose ApiClient is a transport for this package.
|
|
11
11
|
SDK_MIN = "0.2.0"
|
|
12
12
|
|
|
13
13
|
#: SHA-256 of the OpenAPI specification.
|
|
14
|
-
SPEC_HASH = "
|
|
14
|
+
SPEC_HASH = "3cc81a908b4ef17924beb38e77276ad003e4b9214d6829b7cbb67cc00bd22db4"
|
|
15
15
|
|
|
16
16
|
#: SHA-256 over the generator's templates and static files.
|
|
17
17
|
TEMPLATES_HASH = "5efe373fc719c482bc42cc6ff89c27852a6bfef78c9e6d841a1f21eab2f97859"
|
|
18
18
|
|
|
19
19
|
#: SHA-256 over the generation configuration: the SDK floor and the generator.
|
|
20
|
-
CONFIG_HASH = "
|
|
20
|
+
CONFIG_HASH = "891a8a541cf8e5d6280c399f0b4ad7c6651b20ff55f6dac7c45252178ddf3d5a"
|
|
@@ -106,6 +106,22 @@ class CommandsApi:
|
|
|
106
106
|
**options,
|
|
107
107
|
)
|
|
108
108
|
|
|
109
|
+
async def release_command_logs(
|
|
110
|
+
self,
|
|
111
|
+
uuid: str,
|
|
112
|
+
*,
|
|
113
|
+
body: models.CommandLogsReleaseRequest,
|
|
114
|
+
**options: Unpack[CallOptions],
|
|
115
|
+
) -> models.EmptyResponse:
|
|
116
|
+
"""Release Command Logs"""
|
|
117
|
+
return await self.transport.request(
|
|
118
|
+
models.EmptyResponse,
|
|
119
|
+
method="POST",
|
|
120
|
+
path=f"/commands/{quote(uuid, safe='')}/logs/release",
|
|
121
|
+
body=body,
|
|
122
|
+
**options,
|
|
123
|
+
)
|
|
124
|
+
|
|
109
125
|
async def resize_command_terminal(
|
|
110
126
|
self,
|
|
111
127
|
uuid: str,
|
|
@@ -34,13 +34,28 @@ class CommandLogsData(BaseModel):
|
|
|
34
34
|
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
35
35
|
|
|
36
36
|
stdout: str | None = None
|
|
37
|
-
"""
|
|
37
|
+
"""
|
|
38
|
+
The requested part of the standard output stream, base64-encoded: from
|
|
39
|
+
the `offset` asked for, or from `stdout_first` when none was (the same
|
|
40
|
+
for `stderr`).
|
|
41
|
+
"""
|
|
38
42
|
stderr: str | None = None
|
|
39
43
|
"""The requested part of the standard error stream, base64-encoded."""
|
|
40
44
|
stdout_available: int | None = None
|
|
41
|
-
"""
|
|
45
|
+
"""
|
|
46
|
+
The total number of bytes the standard output stream has produced so far,
|
|
47
|
+
released ones included: what is still available starts at `stdout_first`.
|
|
48
|
+
"""
|
|
42
49
|
stderr_available: int | None = None
|
|
43
|
-
"""The
|
|
50
|
+
"""The same for the standard error stream."""
|
|
51
|
+
stdout_first: int | None = None
|
|
52
|
+
"""
|
|
53
|
+
The first byte of the standard output stream still available:
|
|
54
|
+
everything before it was released. 0 unless something was; kept once
|
|
55
|
+
the output is a file, and across a restart.
|
|
56
|
+
"""
|
|
57
|
+
stderr_first: int | None = None
|
|
58
|
+
"""The same for the standard error stream."""
|
|
44
59
|
|
|
45
60
|
|
|
46
61
|
class CommandLogsRange(BaseModel):
|
|
@@ -52,15 +67,46 @@ class CommandLogsRange(BaseModel):
|
|
|
52
67
|
# missing one fails at construction rather than at the server.
|
|
53
68
|
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
54
69
|
|
|
55
|
-
offset: int
|
|
56
|
-
"""
|
|
70
|
+
offset: int | None = None
|
|
71
|
+
"""
|
|
72
|
+
The first byte of the stream to return. Omitted, the stream from where
|
|
73
|
+
it starts: byte 0, or what is still available once some was released.
|
|
74
|
+
Given, it may not be below what was released: that is a `416`.
|
|
75
|
+
"""
|
|
57
76
|
limit: int | None = None
|
|
58
77
|
"""
|
|
59
|
-
The maximum number of bytes to return
|
|
60
|
-
|
|
78
|
+
The maximum number of bytes to return; omitted, the rest of the stream.
|
|
79
|
+
A stream comes whole up to what memory can hold, a little over 18 MiB;
|
|
80
|
+
one longer than that, which only a volume allows, is answered in pages of
|
|
81
|
+
that size, `limit` or not.
|
|
61
82
|
"""
|
|
62
83
|
|
|
63
84
|
|
|
85
|
+
class CommandLogsReleaseRequest(BaseModel):
|
|
86
|
+
"""What the client has of each output stream, to release."""
|
|
87
|
+
|
|
88
|
+
# Fields the specification does not describe are kept rather than dropped,
|
|
89
|
+
# so a newly added one survives a round trip and does not break this client.
|
|
90
|
+
# A field the specification requires is required here too, so a request
|
|
91
|
+
# missing one fails at construction rather than at the server.
|
|
92
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
93
|
+
|
|
94
|
+
stdout: int | None = None
|
|
95
|
+
"""
|
|
96
|
+
Free the standard output stream below this byte: the client has it and
|
|
97
|
+
will not ask for it again. A command held at its output ceiling
|
|
98
|
+
(`capped`) carries on once there is room. More than there is frees what
|
|
99
|
+
there is; no more than was released already does nothing, so a retry is
|
|
100
|
+
harmless. Released bytes are gone, from memory and from the log file
|
|
101
|
+
where some had spilled to it: a read's `stdout_first` says where what is
|
|
102
|
+
left starts, and an `offset` below it is a `416`. Once the command has
|
|
103
|
+
exited and its log is a file, a release does nothing: the file is the
|
|
104
|
+
archive, and `stdout_first` stays where releases left it while it ran.
|
|
105
|
+
"""
|
|
106
|
+
stderr: int | None = None
|
|
107
|
+
"""The same for the standard error stream."""
|
|
108
|
+
|
|
109
|
+
|
|
64
110
|
class CommandLogsRequest(BaseModel):
|
|
65
111
|
"""
|
|
66
112
|
The (optional) request body limiting which parts of the output streams are
|
|
@@ -241,6 +287,18 @@ class GetCommandData(BaseModel):
|
|
|
241
287
|
The exit code of the command. It is `null` while the command is still
|
|
242
288
|
running.
|
|
243
289
|
"""
|
|
290
|
+
capped: bool | None = None
|
|
291
|
+
"""
|
|
292
|
+
Whether the command is held at the output ceiling: the memory for output,
|
|
293
|
+
its own share of it (at most 16 MiB) or the sandbox's whole budget across
|
|
294
|
+
commands, is full of output nothing has released, so nothing more of it
|
|
295
|
+
is read and it blocks in its next write. Releasing some (see
|
|
296
|
+
`POST .../logs/release`) lets it carry on. With persistence, output at
|
|
297
|
+
the ceiling goes to the log file instead and the command carries on,
|
|
298
|
+
which is not `capped`: it is only once the volume's share for unread
|
|
299
|
+
output is used up or the volume will not take a spill. Either way `true`
|
|
300
|
+
means a release is the way on. `false` once it has finished.
|
|
301
|
+
"""
|
|
244
302
|
|
|
245
303
|
|
|
246
304
|
class GetCommandResponse(BaseModel):
|
|
@@ -411,6 +469,18 @@ class RunCommandData(BaseModel):
|
|
|
411
469
|
The exit code of the command. It is `null` while the command is still
|
|
412
470
|
running.
|
|
413
471
|
"""
|
|
472
|
+
capped: bool | None = None
|
|
473
|
+
"""
|
|
474
|
+
Whether the command is held at the output ceiling: the memory for output,
|
|
475
|
+
its own share of it (at most 16 MiB) or the sandbox's whole budget across
|
|
476
|
+
commands, is full of output nothing has released, so nothing more of it
|
|
477
|
+
is read and it blocks in its next write. Releasing some (see
|
|
478
|
+
`POST .../logs/release`) lets it carry on. With persistence, output at
|
|
479
|
+
the ceiling goes to the log file instead and the command carries on,
|
|
480
|
+
which is not `capped`: it is only once the volume's share for unread
|
|
481
|
+
output is used up or the volume will not take a spill. Either way `true`
|
|
482
|
+
means a release is the way on. `false` once it has finished.
|
|
483
|
+
"""
|
|
414
484
|
logs: CommandLogsData | None = None
|
|
415
485
|
"""
|
|
416
486
|
Only with `req_timeout_s`: the output, as `GET .../logs` returns it.
|
|
@@ -487,7 +557,13 @@ class RunCommandRequest(BaseModel):
|
|
|
487
557
|
"""
|
|
488
558
|
(OPTIONAL) With `req_timeout_s`: forget the command once it has finished,
|
|
489
559
|
as `DELETE .../{uuid}` would, so that one request is the whole exchange.
|
|
490
|
-
Does nothing on a timeout, when the UUID is still needed
|
|
560
|
+
Does nothing on a timeout, when the UUID is still needed, nor when the
|
|
561
|
+
answer had to leave output behind short of what was asked (no
|
|
562
|
+
`logs_limit`, or one past the bound): a persisted log that spilled past
|
|
563
|
+
the ceiling is answered up to what memory could have held (a little
|
|
564
|
+
over 18 MiB), and the command then stays for `GET .../logs`,
|
|
565
|
+
`stdout_available`/`stderr_available` past what the answer carries
|
|
566
|
+
showing it.
|
|
491
567
|
"""
|
|
492
568
|
|
|
493
569
|
|
|
@@ -568,6 +644,7 @@ CommandLineShell = str
|
|
|
568
644
|
for _model in (
|
|
569
645
|
CommandLogsData,
|
|
570
646
|
CommandLogsRange,
|
|
647
|
+
CommandLogsReleaseRequest,
|
|
571
648
|
CommandLogsRequest,
|
|
572
649
|
CommandLogsResponse,
|
|
573
650
|
CommandResizeRequest,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|