hp3par

package
v3.0.0-rc67 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package hp3par holds what the drivers of an HPE 3PAR array have in common: how a command line is built for the array, and how it is run.

The array driver and the disk driver reach the same arrays, and there is one way of reaching them. The shapes here are the ones the disk driver has been run with against real hardware on recent firmware, which is why they are here rather than in each driver.

Index

Constants

View Source
const (
	// MethodSSH runs the command on the array, over ssh.
	MethodSSH = "ssh"

	// MethodCLI runs the command through the 3par cli installed here.
	MethodCLI = "cli"
)

Variables

View Source
var ErrBuildCommand = errors.New("build command")

ErrBuildCommand is raised when the configuration does not say enough to reach the array.

Functions

func Clean

func Clean(s string) string

Clean removes the carriage returns and the trailing blank lines of what the array printed.

func ParseCSV

func ParseCSV(s string, cols []string) []map[string]string

ParseCSV reads what the array printed as one map per line, named by the columns that were asked for.

A line holding fewer values than there are columns is read as far as it goes, and a line holding one value is dropped: the cli prints lines the columns do not describe.

Types

type Config

type Config struct {
	// Method is ssh or cli.
	Method string

	// Manager is the array, by name or address.
	Manager string

	// Username is who to log in as, over ssh.
	Username string

	// KeyFile is the ssh private key to log in with.
	KeyFile string

	// CLI is the 3par cli binary, for the cli method.
	CLI string

	// PWFile is the password file the cli authenticates with.
	PWFile string
}

Config is how one array is reached.

The paths are resolved: a key or a password file named in the configuration as a reference to a datastore is materialised by the caller, which knows what the reference is relative to.

func (Config) Command

func (t Config) Command(cmd string) ([]string, error)

Command returns the command line reaching the array, the program first.

func (Config) Run

func (t Config) Run(ctx context.Context, log *plog.Logger, cmd string) (string, error)

Run runs one command on the array and returns what it printed.

Jump to

Keyboard shortcuts

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