Skip to content

Commit

Permalink
Merge pull request #224 from cfergeau/rest-doc
Browse files Browse the repository at this point in the history
doc: Document the 'state' value in `GET /vm/status`
  • Loading branch information
openshift-merge-bot[bot] authored Nov 27, 2024
2 parents 856b372 + f822a57 commit e90a8e1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions doc/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,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 @@ -461,8 +461,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 @@ -473,7 +474,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 @@ -483,7 +484,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

0 comments on commit e90a8e1

Please sign in to comment.