https://github.com/jacobweinstock/gophish
Redfish client library written in Go
https://github.com/jacobweinstock/gophish
go redfish
Last synced: 16 days ago
JSON representation
Redfish client library written in Go
- Host: GitHub
- URL: https://github.com/jacobweinstock/gophish
- Owner: jacobweinstock
- License: bsd-3-clause
- Created: 2020-12-15T00:45:20.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-15T02:54:08.000Z (over 5 years ago)
- Last Synced: 2025-03-29T05:29:00.319Z (over 1 year ago)
- Topics: go, redfish
- Language: Go
- Homepage:
- Size: 268 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Redfish and Swordfish client library
fork of https://github.com/stmcginnis/gofish
[](http://godoc.org/github.com/jacobweinstock/gophish)
[](https://goreportcard.com/report/github.com/jacobweinstock/gophish)
[](https://github.com/jacobweinstock/gophish/releases)
[](./LICENSE)
## Introduction
gophish is a Golang library for interacting with [DMTF Redfish](https://www.dmtf.org/standards/redfish) and [SNIA Swordfish](https://www.snia.org/forums/smi/swordfish) enabled devices.
For the moment, the goal of this repo is to stay up to date with https://github.com/stmcginnis/gofish.
## Usage
Basic usage:
```go
package main
import (
"fmt"
"github.com/jacobweinstock/gophish"
)
func main() {
config := gophish.ClientConfig{
Endpoint: "https://localhost:5000",
Username: "admin",
Password: "admin",
Insecure: true,
}
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()
c, err := gophish.Connect(ctx, config)
if err != nil {
panic(err)
}
defer c.Logout(ctx)
// Query the chassis data using the session token
chassis, err := c.Service.Systems(ctx)
if err != nil {
panic(err)
}
for _, chass := range chassis {
fmt.Println("Chassis:", chass.PowerState)
}
}
```