gounity

package module
v0.0.0-...-f339ef7 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: MIT Imports: 11 Imported by: 0

README

Gounity

Dell EMC Unity package that provides API bindings for Go.

Examples

Initialize a new Unity session

server := "myunity.example.com"
insecure := true
username := "myuser"
password := "mypassword"

session, err := gounity.NewSession(server, insecure, username, password)
if err != nil {
    log.Fatal(err)
}

Get Unity's DNS configuration

err = session.GetDNSServer()
if err != nil {
    log.Fatal(err)
}

Create a realtime metric's query

// metric paths
paths := []string{
    "sp.*.cpu.summary.busyTicks",
    "sp.*.cpu.uptime",
    "sp.*.storage.pool.*.sizeFree",
    "sp.*.storage.pool.*.sizeSubscribed",
    "sp.*.storage.pool.*.sizeTotal",
    "sp.*.storage.pool.*.sizeUsed",
    "sp.*.storage.pool.*.sizeUsedBlocks",
    "sp.*.memory.summary.totalBytes",
    "sp.*.memory.summary.totalUsedBytes",
}

// metric interval in second
var interval uint32
interval = 60

Metric, err := session.NewMetricRealTimeQuery(paths, interval)
if err != nil {
    log.Fatal(err)
}

Author

Erwan Quélin

License

Copyright 2017 Erwan Quelin and the community.

Licensed under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeCredentials

func EncodeCredentials(username string, password string) string

EncodeCredentials purpose is to encode the Username and Password with base64 encoding which is required for UNITY

func URL

func URL(server string, URI string) string

URL purpose is to return the main entry point for the UNITY API

Types

type Session

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

Session struct

func NewSession

func NewSession(server string, insecure bool, username string, password string) (*Session, error)

NewSession purpose is to build a session object and authenticate to the Unity array

func (*Session) CloseSession

func (session *Session) CloseSession() (err error)

CloseSession purpose is to end the session with the Unity array.

func (*Session) DeleteMetricRealTimeQuery

func (session *Session) DeleteMetricRealTimeQuery(queryID int) error

DeleteMetricRealTimeQuery purpose is to delete a real time query.

func (*Session) GetDNSServer

func (session *Session) GetDNSServer() (resp *types.DNSServer, err error)

GetDNSServer purpose is to get the DNS configuration of the Unity array.

func (*Session) GetLUN

func (session *Session) GetLUN() (resp *types.LUN, err error)

GetLUN purpose is to get information about LUNs in the storage system.

func (*Session) GetMetricRealTimeQueryResult

func (session *Session) GetMetricRealTimeQueryResult(queryID int) (resp *types.MetricRealTimeQueryResult, err error)

GetMetricRealTimeQueryResult tototo

func (*Session) GetPool

func (session *Session) GetPool() (resp *types.Pool, err error)

GetPool purpose is to get information about pool in the storage system. .

func (*Session) GetStorageResource

func (session *Session) GetStorageResource() (resp *types.StorageResource, err error)

GetStorageResource purpose is to get information about storage resources in the storage system.

func (*Session) GetbasicSystemInfo

func (session *Session) GetbasicSystemInfo() (resp *types.BasicSystemInfo, err error)

GetbasicSystemInfo Provides access to system model, system name, software version, and API version information.

func (*Session) GetkpiValue

func (session *Session) GetkpiValue(path string) (resp *types.KpiValueResponse, err error)

GetkpiValue Historical values for requested metrics

func (*Session) GetmetricValue

func (session *Session) GetmetricValue(path string) (resp *types.MetricValueResponse, err error)

GetmetricValue Historical values for requested metrics

func (*Session) NewMetricRealTimeQuery

func (session *Session) NewMetricRealTimeQuery(paths []string, interval uint32) (resp *types.MetricRealTimeQueryResponse, err error)

NewMetricRealTimeQuery purpose is to create a real time query.

func (*Session) Request

func (session *Session) Request(method string, URI string, fields string, filter string, engineering bool, body, resp interface{}) error

Request purpose is to send a Rest API request to the Unity array.

Directories

Path Synopsis
types
v1

Jump to

Keyboard shortcuts

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