mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-20 22:21:13 +02:00
Fixes #2515 This implements simple HTTP API which should cover same methods as IPMI methods in Sidero. Examples: ``` $ curl http://172.20.0.1:34791/status {"PoweredOn":false} ``` ``` $ curl -X POST http://172.20.0.1:34791/poweroff ``` API listens on bridge address, each VM has unique port which can be found in cluster state as `apiport: NNNN`. Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
20 lines
499 B
Go
20 lines
499 B
Go
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
package vm
|
|
|
|
// Controller interface should be implemented by the VM to be controlled via the API.
|
|
type Controller interface {
|
|
PowerOn() error
|
|
PowerOff() error
|
|
Reboot() error
|
|
PXEBootOnce() error
|
|
Status() Status
|
|
}
|
|
|
|
// Status describes current VM status.
|
|
type Status struct {
|
|
PoweredOn bool
|
|
}
|