Update Quobyte API repo

This commit is contained in:
Johannes Scheuermann
2017-06-29 12:15:22 +02:00
parent 6a88a03d59
commit 7ce5478c0c
5 changed files with 53 additions and 37 deletions

View File

@@ -1,7 +1,9 @@
// Package quobyte represents a golang API for the Quobyte Storage System
package quobyte
import "net/http"
import (
"net/http"
)
type QuobyteClient struct {
client *http.Client
@@ -77,3 +79,26 @@ func (client *QuobyteClient) GetClientList(tenant string) (GetClientListResponse
return response, nil
}
func (client *QuobyteClient) SetVolumeQuota(volumeUUID string, quotaSize uint64) error {
request := &setQuotaRequest{
Quotas: []*quota{
&quota{
Consumer: []*consumingEntity{
&consumingEntity{
Type: "VOLUME",
Identifier: volumeUUID,
},
},
Limits: []*resource{
&resource{
Type: "LOGICAL_DISK_SPACE",
Value: quotaSize,
},
},
},
},
}
return client.sendRequest("setQuota", request, nil)
}