powers

package
v0.0.0-...-d823fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PowerAction

func PowerAction(client *golangsdk.ServiceClient, opts PowerOptsBuilder, option string) (r cloudservers.JobResult)

PowerAction uses a option parameter to control the power state of the ECS instance. The option only supports 'os-start' (power on), 'os-stop' (power off) and 'reboot'.

Types

type PowerOpts

type PowerOpts struct {
	Servers []ServerInfo `json:"servers" required:"true"`
	Type    string       `json:"type,omitempty"`
}

PowerOpts allows batch update of the ECS instances power state through the API. Parameter 'Type' supports two methods of 'SOFT' and 'HARD' to shut down and reboot the machine's power.

func (PowerOpts) ToPowerActionMap

func (opts PowerOpts) ToPowerActionMap(option string) (map[string]interface{}, error)

ToPowerActionMap assembles a request body based on the contents of a PowerOpts and the power option parameter.

type PowerOptsBuilder

type PowerOptsBuilder interface {
	ToPowerActionMap(option string) (map[string]interface{}, error)
}

PowerOptsBuilder allows extensions to add additional parameters to the PowerAction(power on/off and reboot) request.

type ServerInfo

type ServerInfo struct {
	ID string `json:"id" required:"true"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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