rpm

package
v0.0.0-...-9372558 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package rpm wraps xmlrpc communications to rpm service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetPowerState

func SetPowerState(ctx context.Context, req *RPMPowerRequest) error

SetPowerState talks to RPM service via xmltpc to set power state based on a RPMPowerRequest.

func SetPowerStateHTTP

func SetPowerStateHTTP(ctx context.Context, req *RPMPowerRequest) error

SetPowerStateHTTP talks to RPM directly over HTTPS to set power state based on RPMPowerRequest.

Types

type PowerState

type PowerState string

PowerState indicates a state we want to set for a outlet on powerunit.

const (
	// Map to ON state on powerunit.
	PowerStateOn PowerState = "ON"
	// Map to OFF state on powerunit.
	PowerStateOff PowerState = "OFF"
	// CYCLE state will tell RPM server to set a outlet to OFF state and then ON (with necessary interval).
	PowerStateCycle PowerState = "CYCLE"
)

type RPMPowerRequest

type RPMPowerRequest struct {
	// Hostname of the DUT.
	Hostname string
	// Hostname of the RPM power unit, e.g. "chromeos6-row13_14-rack15-rpm2".
	PowerUnitHostname string
	// Name to locate a specific outlet from a RPM power unit, e.g. ".A7".
	PowerunitOutlet string
	// Hostname of hydra if the power unit is connected via a hydra.
	HydraHostname string
	// The expecting new state to set power to.
	State PowerState
	// RPMType is the RPM model/protocol for the device
	Type RPMType
}

RPMPowerRequest holds data required from rpm service to perform a state change.

type RPMType

type RPMType string

RPMType is the RPM model/protocol for the device

const (
	// Sentry Switched CDU RPM
	RPMTypeSentry RPMType = "SENTRY"
	// IPPower 9850 RPM
	RPMTypeIP9850 RPMType = "IP9850"
	// CPI
	RPMTypeCPI RPMType = "CPI"
)

Jump to

Keyboard shortcuts

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