common

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSpecFile = "generated-mc-openapi.yaml" // Default OpenAPI specification file
	DefaultProtocol = "https"                     // Default MC API Protocol
)
View Source
const (
	APICallMetric = "exosx_api_appliance_api_call"
	APICallHelp   = "How many API calls have been executed"

	APICallDurationMetric = "exosx_api_appliance_api_call_duration"
	APICallDurationHelp   = "The total duration of API calls"
)
View Source
const (
	InvalidSessionKey                     = 2
	LUNOverlapErrorCode                   = -3177
	SnapshotNotFoundErrorCode             = -10050
	BadInputParam                         = -10058
	InvalidArgumentErrorCode              = -10058
	HostMapDoesNotExistsErrorCode         = -10074
	VolumeNotFoundErrorCode               = -10075
	VolumeHasSnapshot                     = -10183
	SnapshotAlreadyExists                 = -10186
	InitiatorNicknameOrIdentifierNotFound = -10386
	UnmapFailedErrorCode                  = -10509
)

Exos X Storage API Error Codes

Variables

This section is empty.

Functions

func CreationTimeFromString

func CreationTimeFromString(creationTime string) (*timestamp.Timestamp, error)

func GetAddress

func GetAddress(addr string) string

GetAddress: Return ip address, handles the case where addr contains protocol

func GetAddressAndProtocol

func GetAddressAndProtocol(addr string, protocol string) (string, string)

GetAddressAndProtocol: Return ip address and protocol, handling concatenated string

func Login

func Login(ctx context.Context, config *Config) (*client.APIClient, error)

Login: Perform the needed steps to configure a connection and login to the MC

Types

type Collector

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

func NewCollector

func NewCollector() *Collector

func (*Collector) Collect

func (collector *Collector) Collect(ch chan<- prometheus.Metric)

func (*Collector) Describe

func (collector *Collector) Describe(ch chan<- *prometheus.Desc)

func (*Collector) TrackAPICall

func (collector *Collector) TrackAPICall(endpoint string) func(bool)

type Config

type Config struct {
	Verbosity         string `json:"verbosity"`
	ConfigurationFile string `json:"configuration"`
	SpecificationFile string `json:"specification"`
	MCIpAddress       string `json:"mc-ip"`
	MCProtocol        string `json:"mc-protocol"` // User can specify http, https
	MCUsername        string `json:"mc-username"`
	MCPassword        string `json:"mc-password"`
	MCDescription     string `json:"mc-description"`
}

func InitConfig

func InitConfig(args []string) (*Config, error)

Init: initialize the configuration data using command line args, ENV, or a file

type PoolType

type PoolType struct {
	Name         string
	SerialNumber string
	Type         string
}

PoolType: Linear or virtual pool attributes

type PortType

type PortType struct {
	Label      string
	Type       string
	TargetId   string
	IPAddress  string
	Present    string
	Compliance string
}

PortType: Storage system port attributes

type ResponseStatus

type ResponseStatus struct {
	ResponseType        string
	ResponseTypeNumeric int
	Response            string
	ReturnCode          int
	Time                time.Time
}

ResponseStatus: Final representation of the "status" object in every API response

type SnapshotObject

type SnapshotObject struct {
	ObjectName              string               // snapshot
	CreationDateTime        string               //  creation-date-time, created using ptypes.TimestampProto
	CreationDateTimeNumeric int64                // creation-date-time-numeric
	CreationTime            *timestamp.Timestamp // Creation timestamp
	MasterVolumeName        string               // master-volume-name,omitempty
	Name                    string               // name
	StoragePoolName         string               // Disk group used to create the snapshot
	TotalSize               string               // The total size (total-size) formatted using the session settings for base, precision, and units
	TotalSizeNumeric        int64                // The total size (total-size-numeric) formatted using the session settings for base, precision, and units( In numeric form )
	VolumeParent            string               // The name of volume used to create the snapshot
}

SnapshotObject: Schema data for each snapshot object returned from 'show snapshots'

type SystemInfo

type SystemInfo struct {
	IPAddress     string
	Protocol      string
	URL           string
	Controller    string
	Platform      string
	SerialNumber  string
	Status        string
	MCCodeVersion string
	MCBaseVersion string
	Pools         []PoolType
	Ports         []PortType
}

System: Information stored for a single storage array controller

type SystemsData

type SystemsData struct {
	Systems []*SystemInfo
}

SystemsData: Information stored for multiple storage array controllers

type VolumeObject

type VolumeObject struct {
	ObjectName      string // volume
	Blocks          int64  // The size in blocks, blocks
	BlockSize       int64  // Block Size
	Health          string
	SizeNumeric     int64  // size-numeric
	StoragePoolName string // The disk group used to create this volume.
	StorageType     string
	TierAffinity    string // The tier affinity used to create this volume.
	TotalSize       string
	VolumeName      string // User-defined name for the volume, volume-name
	VolumeType      string
	Wwn             string // World Wide Name
}

VolumeObject: Schema data for each volume object returned from 'show volumes'

Jump to

Keyboard shortcuts

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