shutdown

package
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Path     = "/api/appliance/shutdown"
	Action   = "action"
	Cancel   = "cancel"
	PowerOff = "poweroff"
	Reboot   = "reboot"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Action       string `json:"action"`
	Reason       string `json:"reason"`
	ShutdownTime string `json:"shutdown_time"`
}

Config defines shutdown configuration returned by the Shutdown.get operation

type Manager

type Manager struct {
	*rest.Client
}

Manager provides convenience methods for shutdown Action

func NewManager

func NewManager(client *rest.Client) *Manager

NewManager creates a new Manager

func (*Manager) Cancel

func (m *Manager) Cancel(ctx context.Context) error

Cancel cancels pending shutdown action.

func (*Manager) Get

func (m *Manager) Get(ctx context.Context) (Config, error)

Get returns details about the pending shutdown action.

func (*Manager) PowerOff

func (m *Manager) PowerOff(ctx context.Context, reason string, delay int) error

PowerOff powers off the appliance.

func (*Manager) Reboot

func (m *Manager) Reboot(ctx context.Context, reason string, delay int) error

Reboot reboots the appliance

type Spec

type Spec struct {
	Delay  int    `json:"delay"`
	Reason string `json:"reason"`
}

Spec represents request body class for an operation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL