boxd 0.3.1.dev1099__tar.gz → 0.3.1.dev1131__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.
- {boxd-0.3.1.dev1099/src/boxd.egg-info → boxd-0.3.1.dev1131}/PKG-INFO +55 -1
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/README.md +54 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/pyproject.toml +1 -1
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/__init__.py +10 -0
- boxd-0.3.1.dev1131/src/boxd/_generated/api_pb2.py +740 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/_generated/api_pb2_grpc.py +175 -1
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/_mappers.py +51 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/_regions.py +4 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/_requests.py +26 -1
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/_streaming.py +5 -1
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/models.py +72 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/resources/machines.py +369 -25
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/resources/orgs.py +90 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131/src/boxd.egg-info}/PKG-INFO +55 -1
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_mappers.py +79 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_namespaces.py +366 -3
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_requests.py +47 -0
- boxd-0.3.1.dev1099/src/boxd/_generated/api_pb2.py +0 -724
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/LICENSE +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/setup.cfg +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/_client.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/_credentials.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/_generated/__init__.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/_transport.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/_urls.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/_version_check.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/computer_use.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/errors.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/py.typed +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/resources/__init__.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/resources/account.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/resources/computer.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/resources/credentials.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/resources/disks.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/resources/domains.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/resources/fs.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/resources/regions.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/resources/snapshots.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/resources/teams.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/resources/vars.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd/spec.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd.egg-info/SOURCES.txt +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd.egg-info/dependency_links.txt +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd.egg-info/requires.txt +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/src/boxd.egg-info/top_level.txt +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_computer.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_computer_use.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_create_in_one_call.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_credentials.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_delete_self.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_fs.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_python_versions.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_raw_key.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_regions.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_spec.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_streaming.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_transport.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_urls.py +0 -0
- {boxd-0.3.1.dev1099 → boxd-0.3.1.dev1131}/tests/test_version_check.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: boxd
|
|
3
|
-
Version: 0.3.1.
|
|
3
|
+
Version: 0.3.1.dev1131
|
|
4
4
|
Summary: Python SDK for the boxd cloud VM platform
|
|
5
5
|
Author: Azin
|
|
6
6
|
License-Expression: MIT
|
|
@@ -313,6 +313,7 @@ boxd.machines.set_auto_suspend_timeout(id, 300) # seconds idle; 0 disables
|
|
|
313
313
|
boxd.machines.set_auto_hibernate_timeout(id, 0)
|
|
314
314
|
boxd.machines.set_idle_ignore_outbound(id, True) # only inbound connections keep it awake
|
|
315
315
|
boxd.machines.set_ssh(id, False) # nothing answers SSH; exec still works
|
|
316
|
+
boxd.machines.set_rdp(id, False) # Windows: nothing answers RDP
|
|
316
317
|
boxd.machines.wait_until_ready(id)
|
|
317
318
|
boxd.machines.wait_until_ready(id, timeout=180.0, poll_interval=1.0) # seconds
|
|
318
319
|
boxd.machines.suggest_name()
|
|
@@ -699,6 +700,9 @@ machine.access.ssh_port # int | None — None until allocated
|
|
|
699
700
|
machine.access.domain
|
|
700
701
|
machine.access.url # https://<name>.<domain>
|
|
701
702
|
machine.ssh # bool — False: SSH is off, nothing answers on ssh_port
|
|
703
|
+
machine.os # "linux" | "windows"
|
|
704
|
+
machine.rdp # MachineRdp | None — a Windows machine's RDP; None otherwise:
|
|
705
|
+
# host, port, user, enabled, password_set (never a password)
|
|
702
706
|
|
|
703
707
|
machine.idle.suspend_after # seconds; 0 = that timer is disabled
|
|
704
708
|
machine.idle.hibernate_after
|
|
@@ -751,6 +755,45 @@ Restoring a snapshot replays the machine as it was captured, so `from_snapshot`
|
|
|
751
755
|
goes with `name`, `org` and the sizing options. Combining it with `image`,
|
|
752
756
|
`env`, `cmd`, `restart_policy` or `shared` raises `ValueError`.
|
|
753
757
|
|
|
758
|
+
### Windows machines
|
|
759
|
+
|
|
760
|
+
`os="windows"` creates a Windows machine, where the cluster offers them. Its
|
|
761
|
+
desktop is reached over RDP; `exec`, files and SSH work too (see below).
|
|
762
|
+
`machine.rdp` holds the connection details and never a password: boxd doesn't
|
|
763
|
+
store one, so no password works until you generate one. `reset_password` sets
|
|
764
|
+
a new one in the machine and returns it, once.
|
|
765
|
+
|
|
766
|
+
```python
|
|
767
|
+
machine = boxd.machines.create("win-1", os="windows")
|
|
768
|
+
machine.rdp.host, machine.rdp.port # point an RDP client here
|
|
769
|
+
machine.rdp.user # "Administrator"
|
|
770
|
+
machine.rdp.password_set # False until a password was generated
|
|
771
|
+
r = boxd.machines.rdp.reset_password("win-1")
|
|
772
|
+
r.user, r.password # shown once; a lost one means another reset
|
|
773
|
+
boxd.machines.set_rdp("win-1", False) # nothing answers RDP; open sessions close
|
|
774
|
+
boxd.machines.create("win-2", os="windows", rdp=False) # born with RDP off
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
`reset_password` needs the machine running (one in standby or hibernated is
|
|
778
|
+
woken) and, like `set_rdp`, can't be called from inside the machine itself.
|
|
779
|
+
`rdp` left as None takes the org's default (below), else on. A restore keeps
|
|
780
|
+
the snapshot's RDP setting and password; `os` can't go with `from_snapshot`,
|
|
781
|
+
since the snapshot decides it.
|
|
782
|
+
|
|
783
|
+
`exec` on a Windows machine runs the command line as one PowerShell command, as
|
|
784
|
+
the Administrator, from its home `C:\Users\Administrator`. A list is quoted
|
|
785
|
+
for PowerShell, `cwd` becomes `Set-Location` and `env` becomes `$env:`
|
|
786
|
+
assignments (the SDK reads the machine's OS once to know). `files` and `fs`
|
|
787
|
+
take Windows paths (`C:\...`, or relative to that home). A fork copies the disk
|
|
788
|
+
and boots it as a new machine (its own identity, the source's Administrator
|
|
789
|
+
password), in about a minute; a checkpoint is the disk alone, restored in place
|
|
790
|
+
by a cold boot. The desktop view and computer use aren't available on Windows.
|
|
791
|
+
|
|
792
|
+
```python
|
|
793
|
+
boxd.machines.exec("win-1", "Get-ChildItem", cwd=r"C:\Users\Administrator\Desktop")
|
|
794
|
+
boxd.machines.exec("win-1", ["git", "clone", "https://example.com/repo.git"])
|
|
795
|
+
```
|
|
796
|
+
|
|
754
797
|
### Exec
|
|
755
798
|
|
|
756
799
|
```python
|
|
@@ -1191,6 +1234,7 @@ snapshot.use_count # machines restored from it so far
|
|
|
1191
1234
|
snapshot.storage # "local" | "archiving" | "archived" | "unarchiving"
|
|
1192
1235
|
snapshot.archived # True unless storage is "local": machines can't be created from it
|
|
1193
1236
|
snapshot.region # str | None — where it lives
|
|
1237
|
+
snapshot.os # "linux" | "windows" — a machine created from it has this OS
|
|
1194
1238
|
|
|
1195
1239
|
volume = boxd.disks.list()[0]
|
|
1196
1240
|
volume.id, volume.name, volume.size_bytes
|
|
@@ -1294,6 +1338,16 @@ i.platform_enabled # the platform's setting, thi
|
|
|
1294
1338
|
boxd.orgs.clear_idle_ignore_outbound_default("acme") # existing machines keep theirs
|
|
1295
1339
|
```
|
|
1296
1340
|
|
|
1341
|
+
RDP on new Windows machines has an org default the same way:
|
|
1342
|
+
|
|
1343
|
+
```python
|
|
1344
|
+
r = boxd.orgs.set_rdp_default("acme", enabled=False) # also existing machines, unless
|
|
1345
|
+
r.machines_changed, r.snapshots_changed # new_machines_only=True
|
|
1346
|
+
d = boxd.orgs.get_rdp_default("acme")
|
|
1347
|
+
d.is_set, d.enabled # is_set False = no default: RDP on
|
|
1348
|
+
boxd.orgs.clear_rdp_default("acme") # existing machines keep theirs
|
|
1349
|
+
```
|
|
1350
|
+
|
|
1297
1351
|
An org has a machine limit: how many machines it may have at once. Any member
|
|
1298
1352
|
can read it; the org's owner can ask for a higher one, with their login or an
|
|
1299
1353
|
API key of theirs issued for the org. One request is open at a time, and the
|
|
@@ -278,6 +278,7 @@ boxd.machines.set_auto_suspend_timeout(id, 300) # seconds idle; 0 disables
|
|
|
278
278
|
boxd.machines.set_auto_hibernate_timeout(id, 0)
|
|
279
279
|
boxd.machines.set_idle_ignore_outbound(id, True) # only inbound connections keep it awake
|
|
280
280
|
boxd.machines.set_ssh(id, False) # nothing answers SSH; exec still works
|
|
281
|
+
boxd.machines.set_rdp(id, False) # Windows: nothing answers RDP
|
|
281
282
|
boxd.machines.wait_until_ready(id)
|
|
282
283
|
boxd.machines.wait_until_ready(id, timeout=180.0, poll_interval=1.0) # seconds
|
|
283
284
|
boxd.machines.suggest_name()
|
|
@@ -664,6 +665,9 @@ machine.access.ssh_port # int | None — None until allocated
|
|
|
664
665
|
machine.access.domain
|
|
665
666
|
machine.access.url # https://<name>.<domain>
|
|
666
667
|
machine.ssh # bool — False: SSH is off, nothing answers on ssh_port
|
|
668
|
+
machine.os # "linux" | "windows"
|
|
669
|
+
machine.rdp # MachineRdp | None — a Windows machine's RDP; None otherwise:
|
|
670
|
+
# host, port, user, enabled, password_set (never a password)
|
|
667
671
|
|
|
668
672
|
machine.idle.suspend_after # seconds; 0 = that timer is disabled
|
|
669
673
|
machine.idle.hibernate_after
|
|
@@ -716,6 +720,45 @@ Restoring a snapshot replays the machine as it was captured, so `from_snapshot`
|
|
|
716
720
|
goes with `name`, `org` and the sizing options. Combining it with `image`,
|
|
717
721
|
`env`, `cmd`, `restart_policy` or `shared` raises `ValueError`.
|
|
718
722
|
|
|
723
|
+
### Windows machines
|
|
724
|
+
|
|
725
|
+
`os="windows"` creates a Windows machine, where the cluster offers them. Its
|
|
726
|
+
desktop is reached over RDP; `exec`, files and SSH work too (see below).
|
|
727
|
+
`machine.rdp` holds the connection details and never a password: boxd doesn't
|
|
728
|
+
store one, so no password works until you generate one. `reset_password` sets
|
|
729
|
+
a new one in the machine and returns it, once.
|
|
730
|
+
|
|
731
|
+
```python
|
|
732
|
+
machine = boxd.machines.create("win-1", os="windows")
|
|
733
|
+
machine.rdp.host, machine.rdp.port # point an RDP client here
|
|
734
|
+
machine.rdp.user # "Administrator"
|
|
735
|
+
machine.rdp.password_set # False until a password was generated
|
|
736
|
+
r = boxd.machines.rdp.reset_password("win-1")
|
|
737
|
+
r.user, r.password # shown once; a lost one means another reset
|
|
738
|
+
boxd.machines.set_rdp("win-1", False) # nothing answers RDP; open sessions close
|
|
739
|
+
boxd.machines.create("win-2", os="windows", rdp=False) # born with RDP off
|
|
740
|
+
```
|
|
741
|
+
|
|
742
|
+
`reset_password` needs the machine running (one in standby or hibernated is
|
|
743
|
+
woken) and, like `set_rdp`, can't be called from inside the machine itself.
|
|
744
|
+
`rdp` left as None takes the org's default (below), else on. A restore keeps
|
|
745
|
+
the snapshot's RDP setting and password; `os` can't go with `from_snapshot`,
|
|
746
|
+
since the snapshot decides it.
|
|
747
|
+
|
|
748
|
+
`exec` on a Windows machine runs the command line as one PowerShell command, as
|
|
749
|
+
the Administrator, from its home `C:\Users\Administrator`. A list is quoted
|
|
750
|
+
for PowerShell, `cwd` becomes `Set-Location` and `env` becomes `$env:`
|
|
751
|
+
assignments (the SDK reads the machine's OS once to know). `files` and `fs`
|
|
752
|
+
take Windows paths (`C:\...`, or relative to that home). A fork copies the disk
|
|
753
|
+
and boots it as a new machine (its own identity, the source's Administrator
|
|
754
|
+
password), in about a minute; a checkpoint is the disk alone, restored in place
|
|
755
|
+
by a cold boot. The desktop view and computer use aren't available on Windows.
|
|
756
|
+
|
|
757
|
+
```python
|
|
758
|
+
boxd.machines.exec("win-1", "Get-ChildItem", cwd=r"C:\Users\Administrator\Desktop")
|
|
759
|
+
boxd.machines.exec("win-1", ["git", "clone", "https://example.com/repo.git"])
|
|
760
|
+
```
|
|
761
|
+
|
|
719
762
|
### Exec
|
|
720
763
|
|
|
721
764
|
```python
|
|
@@ -1156,6 +1199,7 @@ snapshot.use_count # machines restored from it so far
|
|
|
1156
1199
|
snapshot.storage # "local" | "archiving" | "archived" | "unarchiving"
|
|
1157
1200
|
snapshot.archived # True unless storage is "local": machines can't be created from it
|
|
1158
1201
|
snapshot.region # str | None — where it lives
|
|
1202
|
+
snapshot.os # "linux" | "windows" — a machine created from it has this OS
|
|
1159
1203
|
|
|
1160
1204
|
volume = boxd.disks.list()[0]
|
|
1161
1205
|
volume.id, volume.name, volume.size_bytes
|
|
@@ -1259,6 +1303,16 @@ i.platform_enabled # the platform's setting, thi
|
|
|
1259
1303
|
boxd.orgs.clear_idle_ignore_outbound_default("acme") # existing machines keep theirs
|
|
1260
1304
|
```
|
|
1261
1305
|
|
|
1306
|
+
RDP on new Windows machines has an org default the same way:
|
|
1307
|
+
|
|
1308
|
+
```python
|
|
1309
|
+
r = boxd.orgs.set_rdp_default("acme", enabled=False) # also existing machines, unless
|
|
1310
|
+
r.machines_changed, r.snapshots_changed # new_machines_only=True
|
|
1311
|
+
d = boxd.orgs.get_rdp_default("acme")
|
|
1312
|
+
d.is_set, d.enabled # is_set False = no default: RDP on
|
|
1313
|
+
boxd.orgs.clear_rdp_default("acme") # existing machines keep theirs
|
|
1314
|
+
```
|
|
1315
|
+
|
|
1262
1316
|
An org has a machine limit: how many machines it may have at once. Any member
|
|
1263
1317
|
can read it; the org's owner can ask for a higher one, with their login or an
|
|
1264
1318
|
API key of theirs issued for the org. One request is open at a time, and the
|
|
@@ -74,7 +74,9 @@ from .models import (
|
|
|
74
74
|
MachineAccess,
|
|
75
75
|
MachineIdle,
|
|
76
76
|
MachineNetworking,
|
|
77
|
+
MachineOs,
|
|
77
78
|
MachinePackage,
|
|
79
|
+
MachineRdp,
|
|
78
80
|
MachineSpecApply,
|
|
79
81
|
MachineSpecChange,
|
|
80
82
|
MachineSpecUpdate,
|
|
@@ -97,6 +99,8 @@ from .models import (
|
|
|
97
99
|
OrgMachineLimit,
|
|
98
100
|
OrgMember,
|
|
99
101
|
OrgMembers,
|
|
102
|
+
OrgRdpDefault,
|
|
103
|
+
OrgRdpDefaultResult,
|
|
100
104
|
OrgRef,
|
|
101
105
|
OrgRole,
|
|
102
106
|
OrgUsage,
|
|
@@ -104,6 +108,7 @@ from .models import (
|
|
|
104
108
|
Proxy,
|
|
105
109
|
ProxyEntry,
|
|
106
110
|
ProxyPortMode,
|
|
111
|
+
RdpPassword,
|
|
107
112
|
Region,
|
|
108
113
|
RegionalList,
|
|
109
114
|
RegionCount,
|
|
@@ -196,7 +201,9 @@ __all__ = [
|
|
|
196
201
|
"MachineAccess",
|
|
197
202
|
"MachineIdle",
|
|
198
203
|
"MachineNetworking",
|
|
204
|
+
"MachineOs",
|
|
199
205
|
"MachinePackage",
|
|
206
|
+
"MachineRdp",
|
|
200
207
|
"MachineSpecApply",
|
|
201
208
|
"MachineSpecChange",
|
|
202
209
|
"MachineSpecUpdate",
|
|
@@ -220,6 +227,8 @@ __all__ = [
|
|
|
220
227
|
"OrgMachineLimit",
|
|
221
228
|
"OrgMember",
|
|
222
229
|
"OrgMembers",
|
|
230
|
+
"OrgRdpDefault",
|
|
231
|
+
"OrgRdpDefaultResult",
|
|
223
232
|
"OrgRef",
|
|
224
233
|
"OrgRole",
|
|
225
234
|
"OrgUsage",
|
|
@@ -227,6 +236,7 @@ __all__ = [
|
|
|
227
236
|
"Proxy",
|
|
228
237
|
"ProxyEntry",
|
|
229
238
|
"ProxyPortMode",
|
|
239
|
+
"RdpPassword",
|
|
230
240
|
"Region",
|
|
231
241
|
"RegionalList",
|
|
232
242
|
"RegionCount",
|