Skip to content

Dell EMC Unity package that provides API bindings for Go

License

Notifications You must be signed in to change notification settings

equelin/gounity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Dell EMC Unity package that provides API bindings for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages