
This update picks up https://github.com/quobyte/api/pull/19 which adds the needed `SetTransport` option. With this update, we can add the IP deny list into quobyte operations.
40 lines
868 B
Markdown
40 lines
868 B
Markdown
# Quobyte API Clients
|
|
|
|
Get the quobyte api client
|
|
|
|
```bash
|
|
go get github.com/quobyte/api
|
|
```
|
|
|
|
## Usage
|
|
|
|
```go
|
|
package main
|
|
|
|
import (
|
|
"log"
|
|
quobyte_api "github.com/quobyte/api"
|
|
)
|
|
|
|
func main() {
|
|
client := quobyte_api.NewQuobyteClient("http://apiserver:7860", "user", "password")
|
|
client.SetAPIRetryPolicy(quobyte_api.RetryInfinitely) // Default quobyte_api.RetryInteractive
|
|
req := &quobyte_api.CreateVolumeRequest{
|
|
Name: "MyVolume",
|
|
RootUserID: "root",
|
|
RootGroupID: "root",
|
|
ConfigurationName: "BASE",
|
|
Labels: []quobyte_api.Label{
|
|
{Name: "label1", Value: "value1"},
|
|
{Name: "label2", Value: "value2"},
|
|
},
|
|
}
|
|
|
|
volumeUUID, err := client.CreateVolume(req)
|
|
if err != nil {
|
|
log.Fatalf("Error:", err)
|
|
}
|
|
|
|
log.Printf("%s", volumeUUID)
|
|
}
|
|
``` |