Documentation
¶
Overview ¶
Package servers holds the SDK-backed server subcommands added for PD-6075: power actions, rescue mode and lock/unlock access. Each command talks to the API through lsh.NewClient() and renders through the shared renderer so -o json/yaml and --query work everywhere.
Index ¶
- func NewExitRescueModeCmd() *cobra.Command
- func NewLockCmd() *cobra.Command
- func NewPowerOffCmd() *cobra.Command
- func NewPowerOnCmd() *cobra.Command
- func NewRebootCmd() *cobra.Command
- func NewRescueModeCmd() *cobra.Command
- func NewUnlockCmd() *cobra.Command
- type ServerActionModel
- type SimpleServerModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewExitRescueModeCmd ¶
NewExitRescueModeCmd builds `lsh servers exit-rescue-mode <id>`.
func NewPowerOffCmd ¶
NewPowerOffCmd builds `lsh servers power-off <server_id>`.
func NewPowerOnCmd ¶
NewPowerOnCmd builds `lsh servers power-on <server_id>`.
func NewRebootCmd ¶
NewRebootCmd builds `lsh servers reboot <server_id>`.
func NewRescueModeCmd ¶
NewRescueModeCmd builds `lsh servers rescue-mode <id>`.
func NewUnlockCmd ¶
NewUnlockCmd builds `lsh servers unlock <id>`.
Types ¶
type ServerActionModel ¶
type ServerActionModel struct {
ServerID string
Action string
Data *components.ServerActionData
}
ServerActionModel renders the response of a server power action.
func (*ServerActionModel) GetData ¶
func (m *ServerActionModel) GetData() []renderer.ResponseData
func (*ServerActionModel) TableRow ¶
func (m *ServerActionModel) TableRow() table.Row
type SimpleServerModel ¶
SimpleServerModel renders a one-line outcome for state changes (lock/unlock, rescue mode) that return no body of their own.
func (*SimpleServerModel) GetData ¶
func (m *SimpleServerModel) GetData() []renderer.ResponseData
func (*SimpleServerModel) TableRow ¶
func (m *SimpleServerModel) TableRow() table.Row