Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7ce5478c
Commit
7ce5478c
authored
Jun 29, 2017
by
Johannes Scheuermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Quobyte API repo
parent
6a88a03d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
37 deletions
+54
-37
Godeps.json
Godeps/Godeps.json
+1
-1
BUILD
vendor/github.com/quobyte/api/BUILD
+0
-31
README.md
vendor/github.com/quobyte/api/README.md
+5
-4
quobyte.go
vendor/github.com/quobyte/api/quobyte.go
+26
-1
types.go
vendor/github.com/quobyte/api/types.go
+22
-0
No files found.
Godeps/Godeps.json
View file @
7ce5478c
...
...
@@ -2218,7 +2218,7 @@
},
{
"ImportPath"
:
"github.com/quobyte/api"
,
"Rev"
:
"
bf713b5a4333f44504fa1ce63690de45cfed6413
"
"Rev"
:
"
cb10db90715b14d4784465d2fa3b915dfacc0628
"
},
{
"ImportPath"
:
"github.com/rackspace/gophercloud"
,
...
...
vendor/github.com/quobyte/api/BUILD
deleted
100644 → 0
View file @
6a88a03d
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"],
)
vendor/github.com/quobyte/api/README.md
View file @
7ce5478c
...
...
@@ -22,14 +22,14 @@ func main() {
Name
:
"MyVolume"
,
RootUserID
:
"root"
,
RootGroupID
:
"root"
,
ConfigurationName
:
"
base
"
,
ConfigurationName
:
"
BASE
"
,
}
volume
_uuid
,
err
:=
client
.
CreateVolume
(
req
)
volume
UUID
,
err
:=
client
.
CreateVolume
(
req
)
if
err
!=
nil
{
log
.
Fatalf
(
"Error:"
,
err
)
}
log
.
Printf
(
"%s"
,
volume
_uuid
)
log
.
Printf
(
"%s"
,
volume
UUID
)
}
```
```
\ No newline at end of file
vendor/github.com/quobyte/api/quobyte.go
View file @
7ce5478c
// 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
)
}
vendor/github.com/quobyte/api/types.go
View file @
7ce5478c
...
...
@@ -32,3 +32,25 @@ type Client struct {
MountedUserName
string
`json:"mount_user_name,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"`
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment