From 00bf0dcdf9038b1e94a8b6dc7fe35ff3d011da04 Mon Sep 17 00:00:00 2001 From: Venkata Subbarao Chunduri Date: Tue, 11 Feb 2020 15:34:07 +0100 Subject: [PATCH 1/3] Formatting: golang uses tabs for indentation with gofmt tool https://golang.org/doc/effective_go.html#formatting Fixing all the spaces with default formatting --- types.go | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/types.go b/types.go index f7f7ab0..3f52950 100644 --- a/types.go +++ b/types.go @@ -1,25 +1,25 @@ package quobyte type retryPolicy struct { - RetryPolicy string `json:"retry,omitempty"` + RetryPolicy string `json:"retry,omitempty"` } // CreateVolumeRequest represents a CreateVolumeRequest type CreateVolumeRequest struct { - Name string `json:"name,omitempty"` - RootUserID string `json:"root_user_id,omitempty"` - RootGroupID string `json:"root_group_id,omitempty"` - ReplicaDeviceIDS []uint64 `json:"replica_device_ids,string,omitempty"` - ConfigurationName string `json:"configuration_name,omitempty"` - AccessMode uint32 `json:"access_mode,uint32,omitempty"` - TenantID string `json:"tenant_id,omitempty"` - retryPolicy + Name string `json:"name,omitempty"` + RootUserID string `json:"root_user_id,omitempty"` + RootGroupID string `json:"root_group_id,omitempty"` + ReplicaDeviceIDS []uint64 `json:"replica_device_ids,string,omitempty"` + ConfigurationName string `json:"configuration_name,omitempty"` + AccessMode uint32 `json:"access_mode,uint32,omitempty"` + TenantID string `json:"tenant_id,omitempty"` + retryPolicy } type resolveVolumeNameRequest struct { - VolumeName string `json:"volume_name,omitempty"` - TenantDomain string `json:"tenant_domain,omitempty"` - retryPolicy + VolumeName string `json:"volume_name,omitempty"` + TenantDomain string `json:"tenant_domain,omitempty"` + retryPolicy } type resolveTenantNameRequest struct { @@ -35,8 +35,8 @@ type volumeUUID struct { } type getClientListRequest struct { - TenantDomain string `json:"tenant_domain,omitempty"` - retryPolicy + TenantDomain string `json:"tenant_domain,omitempty"` + retryPolicy } type GetClientListResponse struct { @@ -67,13 +67,13 @@ type quota struct { } type setQuotaRequest struct { - Quotas []*quota `json:"quotas,omitempty"` - retryPolicy + Quotas []*quota `json:"quotas,omitempty"` + retryPolicy } type getTenantRequest struct { - TenantIDs []string `json:"tenant_id,omitempty"` - retryPolicy + TenantIDs []string `json:"tenant_id,omitempty"` + retryPolicy } type GetTenantResponse struct { @@ -94,8 +94,8 @@ type TenantDomainConfigurationVolumeAccess struct { } type setTenantRequest struct { - Tenants *TenantDomainConfiguration `json:"tenant,omitempty"` - retryPolicy + Tenants *TenantDomainConfiguration `json:"tenant,omitempty"` + retryPolicy } type setTenantResponse struct { From ec1c92e77c83ee6b75c0dbd5e18db7df6fade925 Mon Sep 17 00:00:00 2001 From: Venkata Subbarao Chunduri Date: Tue, 11 Feb 2020 15:42:05 +0100 Subject: [PATCH 2/3] Add volume labels to volume create request --- types.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types.go b/types.go index 3f52950..d15a71b 100644 --- a/types.go +++ b/types.go @@ -11,11 +11,17 @@ type CreateVolumeRequest struct { RootGroupID string `json:"root_group_id,omitempty"` ReplicaDeviceIDS []uint64 `json:"replica_device_ids,string,omitempty"` ConfigurationName string `json:"configuration_name,omitempty"` + Labels []Label `json:"label,omitempty"` AccessMode uint32 `json:"access_mode,uint32,omitempty"` TenantID string `json:"tenant_id,omitempty"` retryPolicy } +type Label struct { + Name string `json:"name,string,omitempty"` + Value string `json:"value,string,omitempty"` +} + type resolveVolumeNameRequest struct { VolumeName string `json:"volume_name,omitempty"` TenantDomain string `json:"tenant_domain,omitempty"` From d6bcd7d0aa333ee12a11744d876cbb8587f6b6f3 Mon Sep 17 00:00:00 2001 From: Venkata Subbarao Chunduri Date: Tue, 11 Feb 2020 16:06:25 +0100 Subject: [PATCH 3/3] Add labels to example --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 642468a..1b7451f 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ func main() { RootUserID: "root", RootGroupID: "root", ConfigurationName: "BASE", + Labels: []quobyte_api.Label{ + {Name: "label1", Value: "value1"}, + {Name: "label2", Value: "value2"}, + }, } volumeUUID, err := client.CreateVolume(req)