power

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CIM_PowerManagementService string = "CIM_PowerManagementService"
	RequestPowerStateChange    string = "RequestPowerStateChange"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body struct {
	XMLName                         xml.Name            `xml:"Body"`
	RequestPowerStateChangeResponse PowerActionResponse `xml:"RequestPowerStateChange_OUTPUT"`
	GetResponse                     PowerManagementService
	EnumerateResponse               common.EnumerateResponse
	PullResponse                    PullResponse
}

Response Types

type ManagementService

type ManagementService struct {
	// contains filtered or unexported fields
}

func NewPowerManagementServiceWithClient

func NewPowerManagementServiceWithClient(wsmanMessageCreator *message.WSManMessageCreator, client client.WSMan) ManagementService

NewPowerManagementService returns a new instance of the PowerManagementService struct.

func (ManagementService) Enumerate

func (managementService ManagementService) Enumerate() (response Response, err error)

// Enumerate returns an enumeration context which is used in a subsequent Pull call

func (ManagementService) Get

func (managementService ManagementService) Get() (response Response, err error)

Get retrieves the representation of the instance

func (ManagementService) Pull

func (managementService ManagementService) Pull(enumerationContext string) (response Response, err error)

Pull returns the instances of this class. An enumeration context provided by the Enumerate call is used as input.

func (ManagementService) RequestPowerStateChange

func (managementService ManagementService) RequestPowerStateChange(powerState PowerState) (response Response, err error)

RequestPowerStateChange defines the desired power state of the managed element, and when the element should be put into that state.

type PowerActionResponse

type PowerActionResponse struct {
	ReturnValue int `xml:"ReturnValue"`
}

Response Types

type PowerManagementService

type PowerManagementService struct {
	XMLName                 xml.Name              `xml:"CIM_PowerManagementService"`
	CreationClassName       string                `xml:"CreationClassName,omitempty"`
	ElementName             string                `xml:"ElementName,omitempty"`
	EnabledState            models.EnabledState   `xml:"EnabledState,omitempty"`
	Name                    string                `xml:"Name,omitempty"`
	RequestedState          models.RequestedState `xml:"RequestedState,omitempty"`
	SystemCreationClassName string                `xml:"SystemCreationClassName,omitempty"`
	SystemName              string                `xml:"SystemName,omitempty"`
}

Response Types

type PowerState

type PowerState int
const (
	// Power On
	PowerOn PowerState = 2 // Verified Hardware Power On

	// Sleep - Light
	SleepLight PowerState = 3 // ?

	// Sleep - Deep
	SleepDeep PowerState = 4 // ?

	// Power Cycle (Off Soft)
	PowerCycleOffSoft PowerState = 6 // ?

	// Power Off - Hard
	PowerOffHard PowerState = 8 // Verfied Hardware Power Off

	// Hibernate
	Hibernate PowerState = 7 // ?

	// Power Off - Soft
	PowerOffSoft PowerState = 9 // ?

	// Power Cycle (Off Hard)
	PowerCycleOffHard PowerState = 5 // Verified Hardware Power Cycle (off then on)

	// Master Bus Reset
	MasterBusReset PowerState = 10 // Verified Hardware Reboot

	// Diagnostic Interrupt (NMI)
	DiagnosticInterruptNMI PowerState = 11 // ?

	// Power Off - Soft Graceful
	PowerOffSoftGraceful PowerState = 12 // ?

	// Power Off - Hard Graceful
	PowerOffHardGraceful PowerState = 13 // ?

	// Master Bus Reset Graceful
	MasterBusResetGraceful PowerState = 14 // ?

	// Power Cycle (Off - Soft Graceful)
	PowerCycleOffSoftGraceful PowerState = 15 // ?

	// Power Cycle (Off - Hard Graceful)
	PowerCycleOffHardGraceful PowerState = 16 // ?
)

type PullResponse

type PullResponse struct {
	XMLName                     xml.Name                 `xml:"PullResponse"`
	PowerManagementServiceItems []PowerManagementService `xml:"Items>CIM_PowerManagementService"`
}

Response Types

type Response

type Response struct {
	*client.Message
	XMLName xml.Name       `xml:"Envelope"`
	Header  message.Header `xml:"Header"`
	Body    Body           `xml:"Body"`
}

Response Types

func (*Response) JSON

func (r *Response) JSON() string

JSON marshals the type into JSON format

func (*Response) YAML

func (r *Response) YAML() string

YAML marshals the type into YAML format

Jump to

Keyboard shortcuts

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