You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`CreateVm`| Boot a microVM from an image; returns its `vm_id`. |`INVALID_ARGUMENT` (bad/missing image or enum), `RESOURCE_EXHAUSTED` (no capacity), `UNAVAILABLE` (host lost mid-create) |
26
-
|`StopVm`| Tear down a running microVM. |`NOT_FOUND` (unknown id), `UNAVAILABLE` (host down) |
27
-
|`GetVm`| Which node a microVM runs on. |`NOT_FOUND`|
28
-
|`ListVms`| Every microVM known to the cluster. | -- |
22
+
```python
23
+
```
24
+
25
+
### Listing VMs
26
+
27
+
You can list running virtual machines with:
28
+
29
+
```python
30
+
```
31
+
32
+
33
+
### Getting VM Info
34
+
35
+
You can query the current status of any VM with:
36
+
37
+
```python
38
+
```
39
+
40
+
### Stopping a VM
41
+
42
+
You can stop a running VM with:
43
+
44
+
```python
45
+
```
29
46
30
-
A machine is addressed by its **`vm_id`** -- a URL-safe base64 string the server
31
-
mints at creation. The server is stateless and identical on every node;
32
-
placement and routing are cluster-wide, so any node can serve any request.
33
47
34
48
## Configuring the server
35
49
@@ -88,6 +102,70 @@ Generate a client stub from `proto/hyper/grpc/v0/hyper.proto` with your
88
102
language's gRPC tooling (`protoc`, `buf`, etc.) and call the `Hyper` service.
89
103
The `.proto` ships in the published package as well as the repo.
90
104
105
+
### From Python (grpcio)
106
+
107
+
Generate the bindings with `grpcio-tools`:
108
+
109
+
```sh
110
+
pip install grpcio grpcio-tools
111
+
python -m grpc_tools.protoc -I proto \
112
+
--python_out=. --grpc_python_out=. --pyi_out=. \
113
+
proto/hyper/grpc/v0/hyper.proto
114
+
```
115
+
116
+
That writes `hyper/grpc/v0/hyper_pb2.py`, `hyper_pb2_grpc.py`, and the
117
+
`hyper_pb2.pyi` type stubs. Then drive the cluster:
118
+
119
+
```python
120
+
import grpc
121
+
from google.protobuf import empty_pb2
122
+
from hyper.grpc.v0 import hyper_pb2, hyper_pb2_grpc
0 commit comments