mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Update Quobyte API repo
This commit is contained in:
parent
6a88a03d59
commit
7ce5478c0c
2
Godeps/Godeps.json
generated
2
Godeps/Godeps.json
generated
@ -2218,7 +2218,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/quobyte/api",
|
"ImportPath": "github.com/quobyte/api",
|
||||||
"Rev": "bf713b5a4333f44504fa1ce63690de45cfed6413"
|
"Rev": "cb10db90715b14d4784465d2fa3b915dfacc0628"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/rackspace/gophercloud",
|
"ImportPath": "github.com/rackspace/gophercloud",
|
||||||
|
31
vendor/github.com/quobyte/api/BUILD
generated
vendored
31
vendor/github.com/quobyte/api/BUILD
generated
vendored
@ -1,31 +0,0 @@
|
|||||||
package(default_visibility = ["//visibility:public"])
|
|
||||||
|
|
||||||
licenses(["notice"])
|
|
||||||
|
|
||||||
load(
|
|
||||||
"@io_bazel_rules_go//go:def.bzl",
|
|
||||||
"go_library",
|
|
||||||
)
|
|
||||||
|
|
||||||
go_library(
|
|
||||||
name = "go_default_library",
|
|
||||||
srcs = [
|
|
||||||
"quobyte.go",
|
|
||||||
"rpc_client.go",
|
|
||||||
"types.go",
|
|
||||||
],
|
|
||||||
tags = ["automanaged"],
|
|
||||||
)
|
|
||||||
|
|
||||||
filegroup(
|
|
||||||
name = "package-srcs",
|
|
||||||
srcs = glob(["**"]),
|
|
||||||
tags = ["automanaged"],
|
|
||||||
visibility = ["//visibility:private"],
|
|
||||||
)
|
|
||||||
|
|
||||||
filegroup(
|
|
||||||
name = "all-srcs",
|
|
||||||
srcs = [":package-srcs"],
|
|
||||||
tags = ["automanaged"],
|
|
||||||
)
|
|
8
vendor/github.com/quobyte/api/README.md
generated
vendored
8
vendor/github.com/quobyte/api/README.md
generated
vendored
@ -22,14 +22,14 @@ func main() {
|
|||||||
Name: "MyVolume",
|
Name: "MyVolume",
|
||||||
RootUserID: "root",
|
RootUserID: "root",
|
||||||
RootGroupID: "root",
|
RootGroupID: "root",
|
||||||
ConfigurationName: "base",
|
ConfigurationName: "BASE",
|
||||||
}
|
}
|
||||||
|
|
||||||
volume_uuid, err := client.CreateVolume(req)
|
volumeUUID, err := client.CreateVolume(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Error:", err)
|
log.Fatalf("Error:", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("%s", volume_uuid)
|
log.Printf("%s", volumeUUID)
|
||||||
}
|
}
|
||||||
```
|
```
|
27
vendor/github.com/quobyte/api/quobyte.go
generated
vendored
27
vendor/github.com/quobyte/api/quobyte.go
generated
vendored
@ -1,7 +1,9 @@
|
|||||||
// Package quobyte represents a golang API for the Quobyte Storage System
|
// Package quobyte represents a golang API for the Quobyte Storage System
|
||||||
package quobyte
|
package quobyte
|
||||||
|
|
||||||
import "net/http"
|
import (
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
type QuobyteClient struct {
|
type QuobyteClient struct {
|
||||||
client *http.Client
|
client *http.Client
|
||||||
@ -77,3 +79,26 @@ func (client *QuobyteClient) GetClientList(tenant string) (GetClientListResponse
|
|||||||
|
|
||||||
return response, nil
|
return response, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (client *QuobyteClient) SetVolumeQuota(volumeUUID string, quotaSize uint64) error {
|
||||||
|
request := &setQuotaRequest{
|
||||||
|
Quotas: []*quota{
|
||||||
|
"a{
|
||||||
|
Consumer: []*consumingEntity{
|
||||||
|
&consumingEntity{
|
||||||
|
Type: "VOLUME",
|
||||||
|
Identifier: volumeUUID,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Limits: []*resource{
|
||||||
|
&resource{
|
||||||
|
Type: "LOGICAL_DISK_SPACE",
|
||||||
|
Value: quotaSize,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return client.sendRequest("setQuota", request, nil)
|
||||||
|
}
|
||||||
|
22
vendor/github.com/quobyte/api/types.go
generated
vendored
22
vendor/github.com/quobyte/api/types.go
generated
vendored
@ -32,3 +32,25 @@ type Client struct {
|
|||||||
MountedUserName string `json:"mount_user_name,omitempty"`
|
MountedUserName string `json:"mount_user_name,omitempty"`
|
||||||
MountedVolumeUUID string `json:"mounted_volume_uuid,omitempty"`
|
MountedVolumeUUID string `json:"mounted_volume_uuid,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type consumingEntity struct {
|
||||||
|
Type string `json:"type,omitempty"`
|
||||||
|
Identifier string `json:"identifier,omitempty"`
|
||||||
|
TenantID string `json:"tenant_id,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type resource struct {
|
||||||
|
Type string `json:"type,omitempty"`
|
||||||
|
Value uint64 `json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type quota struct {
|
||||||
|
ID string `json:"id,omitempty"`
|
||||||
|
Consumer []*consumingEntity `json:"consumer,omitempty"`
|
||||||
|
Limits []*resource `json:"limits,omitempty"`
|
||||||
|
Currentusage []*resource `json:"current_usage,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type setQuotaRequest struct {
|
||||||
|
Quotas []*quota `json:"quotas,omitempty"`
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user