https://github.com/equelin/gounity
Dell EMC Unity package that provides API bindings for Go
https://github.com/equelin/gounity
Last synced: 11 months ago
JSON representation
Dell EMC Unity package that provides API bindings for Go
- Host: GitHub
- URL: https://github.com/equelin/gounity
- Owner: equelin
- License: mit
- Created: 2017-10-16T13:29:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-30T17:18:13.000Z (about 8 years ago)
- Last Synced: 2024-06-20T19:19:31.712Z (almost 2 years ago)
- Language: Go
- Size: 12.7 KB
- Stars: 7
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gounity
Dell EMC Unity package that provides API bindings for Go.
# Examples
## Initialize a new Unity session
```Golang
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
```Golang
err = session.GetDNSServer()
if err != nil {
log.Fatal(err)
}
```
## Create a realtime metric's query
```Golang
// 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.