Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Document the 'state' value in GET /vm/status #224

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions doc/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ None

To interact with the RESTful API, append a valid scheme to your base command: `--restful-uri tcp://localhost:8081`.

### Get VM state
### Get the virtual machine's state

Obtain the state of the virtual machine that is being run by vfkit.

Expand All @@ -439,8 +439,9 @@ Response:
`{ "state": string, "canStart": bool, "canPause": bool, "canResume": bool, "canStop": bool, "canHardStop": bool }`

`canHardStop` is only supported on macOS 12 and newer, false will always be returned on older versions.
`state` is one of `VirtualMachineStateRunning`, `VirtualMachineStateStopped`, `VirtualMachineStatePaused`, `VirtualMachineStateError`, `VirtualMachineStateStarting`, `VirtualMachineStatePausing`, `VirtualMachineStateResuming`, `VirtualMachineStateStopping`, `VirtualMachineStateSaving`, or `VirtualMachineStateRestoring`.

### Change VM State
### Change the virtual machine's state

Change the state of the virtual machine. Valid state values are:
* HardStop
Expand All @@ -451,7 +452,7 @@ Change the state of the virtual machine. Valid state values are:
```HTTP
POST /vm/state { "state": "new value"}
```
Response: HTTP 200
Response: `HTTP 200`

### Inspect VM

Expand All @@ -461,7 +462,7 @@ Get description of the virtual machine
GET /vm/inspect
```

Response: { "cpus": uint, "memory": uint64, "devices": []config.VirtIODevice }
Response: `{ "cpus": uint, "memory": uint64, "devices": []config.VirtIODevice }`

## Enabling a Graphical User Interface

Expand Down