go1.9.2 and above. You can install the latest version from:
go get github.com/HewlettPackard/hpe-onesphere-goimport (
"fmt"
"github.com/HewlettPackard/hpe-onesphere-go"
)osClient, err := onesphere.Connect("https://onesphere-host-url", "username", "password")fmt.Println("Status:", osClient.GetStatus())example output
{"service":"OK","database":""}osClient.Disconnect()see sample/main.go
go get the OneSphere project
go get github.com/HewlettPackard/hpe-onesphere-goYou must set the OneSphere host url, user, and password flags.
Replace these values:
ONESPHERE_HOST_URLYOUR_ONESPHERE_USERNAMEYOUR_ONESPHERE_PASSWORD
go run $GOPATH/src/github.com/HewlettPackard/hpe-onesphere-go/sample/main.go \
-host=https://ONESPHERE_HOST_URL \
-user=YOUR_ONESPHERE_USERNAME \
-password=YOUR_ONESPHERE_PASSWORDalternatively use environment variables
host=https://ONESPHERE_HOST_URL \
user=YOUR_ONESPHERE_USERNAME \
password=YOUR_ONESPHERE_PASSWORD \
go run $GOPATH/src/github.com/HewlettPackard/hpe-onesphere-go/sample/main.gohttp requests are not mocked, a valid OneSphere account is required to pass tests
go get the OneSphere project
go get github.com/HewlettPackard/hpe-onesphere-gogo test github.com/HewlettPackard/hpe-onesphere-go \
-host=https://ONESPHERE_HOST_URL \
-user=YOUR_ONESPHERE_USERNAME \
-password=YOUR_ONESPHERE_PASSWORDor use environment variables
host=https://ONESPHERE_HOST_URL \
user=YOUR_ONESPHERE_USERNAME \
password=YOUR_ONESPHERE_PASSWORD \
go test github.com/HewlettPackard/hpe-onesphere-goAll the APIs return data in JSON format the same as those returned from HPE OneSphere composable APIs.
Some APIs are not yet implemented.