boxd 0.2.13.dev750__tar.gz → 0.2.13.dev755__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.2.13.dev750/src/boxd.egg-info → boxd-0.2.13.dev755}/PKG-INFO +24 -7
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/README.md +23 -6
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/pyproject.toml +1 -1
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/__init__.py +4 -4
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_generated/api_pb2.py +140 -140
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_generated/api_pb2_grpc.py +14 -14
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_mappers.py +7 -5
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/models.py +13 -6
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/machines.py +12 -2
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/orgs.py +28 -28
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755/src/boxd.egg-info}/PKG-INFO +24 -7
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_namespaces.py +11 -9
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/LICENSE +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/setup.cfg +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_client.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_credentials.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_generated/__init__.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_requests.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_streaming.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_transport.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_urls.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_version_check.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/errors.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/__init__.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/account.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/credentials.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/disks.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/domains.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/snapshots.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/teams.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/vars.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd.egg-info/SOURCES.txt +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd.egg-info/dependency_links.txt +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd.egg-info/requires.txt +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd.egg-info/top_level.txt +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_credentials.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_mappers.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_requests.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_streaming.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_transport.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_urls.py +0 -0
- {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_version_check.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: boxd
|
|
3
|
-
Version: 0.2.13.
|
|
3
|
+
Version: 0.2.13.dev755
|
|
4
4
|
Summary: Python SDK for the boxd cloud VM platform
|
|
5
5
|
Author: Azin
|
|
6
6
|
License-Expression: MIT
|
|
@@ -766,10 +766,11 @@ and admins only; an API key issued for the org works too.
|
|
|
766
766
|
from datetime import datetime, timezone
|
|
767
767
|
|
|
768
768
|
# One machine over its whole life, or pass since=/until= (datetime or unix
|
|
769
|
-
# seconds). A deleted machine is found by its id.
|
|
769
|
+
# seconds). A deleted machine is found by its id or name (org= says where to look).
|
|
770
770
|
u = boxd.machines.usage("my-machine")
|
|
771
771
|
u.seconds.running, u.seconds.standby, u.seconds.hibernated, u.seconds.stopped
|
|
772
772
|
u.cost_micro / 1e6 # estimated cost, in u.currency ("eur" | "usd")
|
|
773
|
+
u.complete # True once all its usage is metered (see below)
|
|
773
774
|
u.period.start, u.period.end
|
|
774
775
|
u.vcpu_hours, u.ram_gib_hours, u.disk_gib_hours # what the cost is priced on
|
|
775
776
|
u.rates # ...at these rates, per unit-hour
|
|
@@ -780,19 +781,35 @@ r.total_cost_micro, r.currency
|
|
|
780
781
|
for m in r.machines:
|
|
781
782
|
print(m.name, m.status, m.cost_micro / 1e6)
|
|
782
783
|
|
|
783
|
-
#
|
|
784
|
-
for e in boxd.orgs.
|
|
784
|
+
# Billing activity: what was actually charged, newest first.
|
|
785
|
+
for e in boxd.orgs.billing_activity(since=datetime(2026, 9, 1, tzinfo=timezone.utc)):
|
|
785
786
|
print(e.created_at, e.kind, e.amount_micro / 1e6) # charges are negative
|
|
786
787
|
```
|
|
787
788
|
|
|
789
|
+
To record what a machine cost after deleting it, wait for `complete`:
|
|
790
|
+
metering lags by up to ~25 minutes, so the figure read right after `delete()`
|
|
791
|
+
is still growing.
|
|
792
|
+
|
|
793
|
+
```python
|
|
794
|
+
boxd.machines.delete(machine_id)
|
|
795
|
+
# ...a little later, or from a periodic job:
|
|
796
|
+
u = boxd.machines.usage(machine_id)
|
|
797
|
+
if u.complete:
|
|
798
|
+
save(machine_id, u.cost_micro, u.currency) # otherwise try again later
|
|
799
|
+
```
|
|
800
|
+
|
|
801
|
+
`orgs.usage()` carries the same flag on every machine, so one periodic call can
|
|
802
|
+
settle all of them. A machine that still exists is never complete in a window
|
|
803
|
+
that runs to now.
|
|
804
|
+
|
|
788
805
|
Money is in micro-units (1e-6) of the org's currency. Usage is metered in
|
|
789
806
|
15-minute buckets and priced at the org's current rates, so it is an estimate
|
|
790
|
-
that tracks
|
|
807
|
+
that tracks billing activity closely; billing activity is what was charged (one
|
|
791
808
|
`usage_charge` per 15 minutes for the whole org, plus top-ups and grants).
|
|
792
809
|
Machines deleted since still show up, with status `"deleted"`. A window spans
|
|
793
|
-
at most 366 days. `orgs.
|
|
810
|
+
at most 366 days. `orgs.billing_activity_page()` returns one page with its
|
|
794
811
|
`next_page_token` when you want to page by hand. The async client has the
|
|
795
|
-
same methods (`async for e in boxd.orgs.
|
|
812
|
+
same methods (`async for e in boxd.orgs.billing_activity(): ...`).
|
|
796
813
|
|
|
797
814
|
## Errors
|
|
798
815
|
|
|
@@ -734,10 +734,11 @@ and admins only; an API key issued for the org works too.
|
|
|
734
734
|
from datetime import datetime, timezone
|
|
735
735
|
|
|
736
736
|
# One machine over its whole life, or pass since=/until= (datetime or unix
|
|
737
|
-
# seconds). A deleted machine is found by its id.
|
|
737
|
+
# seconds). A deleted machine is found by its id or name (org= says where to look).
|
|
738
738
|
u = boxd.machines.usage("my-machine")
|
|
739
739
|
u.seconds.running, u.seconds.standby, u.seconds.hibernated, u.seconds.stopped
|
|
740
740
|
u.cost_micro / 1e6 # estimated cost, in u.currency ("eur" | "usd")
|
|
741
|
+
u.complete # True once all its usage is metered (see below)
|
|
741
742
|
u.period.start, u.period.end
|
|
742
743
|
u.vcpu_hours, u.ram_gib_hours, u.disk_gib_hours # what the cost is priced on
|
|
743
744
|
u.rates # ...at these rates, per unit-hour
|
|
@@ -748,19 +749,35 @@ r.total_cost_micro, r.currency
|
|
|
748
749
|
for m in r.machines:
|
|
749
750
|
print(m.name, m.status, m.cost_micro / 1e6)
|
|
750
751
|
|
|
751
|
-
#
|
|
752
|
-
for e in boxd.orgs.
|
|
752
|
+
# Billing activity: what was actually charged, newest first.
|
|
753
|
+
for e in boxd.orgs.billing_activity(since=datetime(2026, 9, 1, tzinfo=timezone.utc)):
|
|
753
754
|
print(e.created_at, e.kind, e.amount_micro / 1e6) # charges are negative
|
|
754
755
|
```
|
|
755
756
|
|
|
757
|
+
To record what a machine cost after deleting it, wait for `complete`:
|
|
758
|
+
metering lags by up to ~25 minutes, so the figure read right after `delete()`
|
|
759
|
+
is still growing.
|
|
760
|
+
|
|
761
|
+
```python
|
|
762
|
+
boxd.machines.delete(machine_id)
|
|
763
|
+
# ...a little later, or from a periodic job:
|
|
764
|
+
u = boxd.machines.usage(machine_id)
|
|
765
|
+
if u.complete:
|
|
766
|
+
save(machine_id, u.cost_micro, u.currency) # otherwise try again later
|
|
767
|
+
```
|
|
768
|
+
|
|
769
|
+
`orgs.usage()` carries the same flag on every machine, so one periodic call can
|
|
770
|
+
settle all of them. A machine that still exists is never complete in a window
|
|
771
|
+
that runs to now.
|
|
772
|
+
|
|
756
773
|
Money is in micro-units (1e-6) of the org's currency. Usage is metered in
|
|
757
774
|
15-minute buckets and priced at the org's current rates, so it is an estimate
|
|
758
|
-
that tracks
|
|
775
|
+
that tracks billing activity closely; billing activity is what was charged (one
|
|
759
776
|
`usage_charge` per 15 minutes for the whole org, plus top-ups and grants).
|
|
760
777
|
Machines deleted since still show up, with status `"deleted"`. A window spans
|
|
761
|
-
at most 366 days. `orgs.
|
|
778
|
+
at most 366 days. `orgs.billing_activity_page()` returns one page with its
|
|
762
779
|
`next_page_token` when you want to page by hand. The async client has the
|
|
763
|
-
same methods (`async for e in boxd.orgs.
|
|
780
|
+
same methods (`async for e in boxd.orgs.billing_activity(): ...`).
|
|
764
781
|
|
|
765
782
|
## Errors
|
|
766
783
|
|
|
@@ -53,8 +53,8 @@ from .models import (
|
|
|
53
53
|
EnvVar,
|
|
54
54
|
ExecResult,
|
|
55
55
|
ExposedPort,
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
BillingActivityEntry,
|
|
57
|
+
BillingActivityPage,
|
|
58
58
|
Machine,
|
|
59
59
|
MachineAccess,
|
|
60
60
|
MachineIdle,
|
|
@@ -130,8 +130,8 @@ __all__ = [
|
|
|
130
130
|
"EnvVar",
|
|
131
131
|
"ExecResult",
|
|
132
132
|
"ExposedPort",
|
|
133
|
-
"
|
|
134
|
-
"
|
|
133
|
+
"BillingActivityEntry",
|
|
134
|
+
"BillingActivityPage",
|
|
135
135
|
"Machine",
|
|
136
136
|
"MachineAccess",
|
|
137
137
|
"MachineIdle",
|