Skip to content

Commit d0cdaf8

Browse files
Google APIscopybara-github
authored andcommitted
feat: add support for Quota Rule apis
Clients can now use quota rules for limiting the maximum usage on a volume by individual users or groups. They now also have an option for setting the default user and default group quota rule. Introducing CreateQuotaRule, UpdateQuotaRule, DeleteQuotaRule, GetQuotaRule and ListQuotaRules apis. feat: add ipAddress field to MountOption PiperOrigin-RevId: 721387965
1 parent 78733bf commit d0cdaf8

8 files changed

Lines changed: 309 additions & 0 deletions

File tree

google/cloud/netapp/v1/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ proto_library(
3131
"cloud_netapp_service.proto",
3232
"common.proto",
3333
"kms.proto",
34+
"quota_rule.proto",
3435
"replication.proto",
3536
"snapshot.proto",
3637
"storage_pool.proto",
@@ -352,6 +353,7 @@ load(
352353

353354
csharp_proto_library(
354355
name = "netapp_csharp_proto",
356+
extra_opts = [],
355357
deps = [":netapp_proto"],
356358
)
357359

google/cloud/netapp/v1/backup.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ message Backup {
124124
// Output only. Total size of all backups in a chain in bytes = baseline
125125
// backup size + sum(incremental backup size)
126126
int64 chain_storage_bytes = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
127+
128+
// Output only. Reserved for future use
129+
bool satisfies_pzs = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
130+
131+
// Output only. Reserved for future use
132+
bool satisfies_pzi = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
127133
}
128134

129135
// ListBackupsRequest lists backups.

google/cloud/netapp/v1/cloud_netapp_service.proto

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import "google/cloud/netapp/v1/backup.proto";
2525
import "google/cloud/netapp/v1/backup_policy.proto";
2626
import "google/cloud/netapp/v1/backup_vault.proto";
2727
import "google/cloud/netapp/v1/kms.proto";
28+
import "google/cloud/netapp/v1/quota_rule.proto";
2829
import "google/cloud/netapp/v1/replication.proto";
2930
import "google/cloud/netapp/v1/snapshot.proto";
3031
import "google/cloud/netapp/v1/storage_pool.proto";
@@ -702,6 +703,63 @@ service NetApp {
702703
metadata_type: "OperationMetadata"
703704
};
704705
}
706+
707+
// Returns list of all quota rules in a location.
708+
rpc ListQuotaRules(ListQuotaRulesRequest) returns (ListQuotaRulesResponse) {
709+
option (google.api.http) = {
710+
get: "/v1/{parent=projects/*/locations/*/volumes/*}/quotaRules"
711+
};
712+
option (google.api.method_signature) = "parent";
713+
}
714+
715+
// Returns details of the specified quota rule.
716+
rpc GetQuotaRule(GetQuotaRuleRequest) returns (QuotaRule) {
717+
option (google.api.http) = {
718+
get: "/v1/{name=projects/*/locations/*/volumes/*/quotaRules/*}"
719+
};
720+
option (google.api.method_signature) = "name";
721+
}
722+
723+
// Creates a new quota rule.
724+
rpc CreateQuotaRule(CreateQuotaRuleRequest)
725+
returns (google.longrunning.Operation) {
726+
option (google.api.http) = {
727+
post: "/v1/{parent=projects/*/locations/*/volumes/*}/quotaRules"
728+
body: "quota_rule"
729+
};
730+
option (google.api.method_signature) = "parent,quota_rule,quota_rule_id";
731+
option (google.longrunning.operation_info) = {
732+
response_type: "QuotaRule"
733+
metadata_type: "OperationMetadata"
734+
};
735+
}
736+
737+
// Updates a quota rule.
738+
rpc UpdateQuotaRule(UpdateQuotaRuleRequest)
739+
returns (google.longrunning.Operation) {
740+
option (google.api.http) = {
741+
patch: "/v1/{quota_rule.name=projects/*/locations/*/volumes/*/quotaRules/*}"
742+
body: "quota_rule"
743+
};
744+
option (google.api.method_signature) = "quota_rule,update_mask";
745+
option (google.longrunning.operation_info) = {
746+
response_type: "QuotaRule"
747+
metadata_type: "OperationMetadata"
748+
};
749+
}
750+
751+
// Deletes a quota rule.
752+
rpc DeleteQuotaRule(DeleteQuotaRuleRequest)
753+
returns (google.longrunning.Operation) {
754+
option (google.api.http) = {
755+
delete: "/v1/{name=projects/*/locations/*/volumes/*/quotaRules/*}"
756+
};
757+
option (google.api.method_signature) = "name";
758+
option (google.longrunning.operation_info) = {
759+
response_type: "google.protobuf.Empty"
760+
metadata_type: "OperationMetadata"
761+
};
762+
}
705763
}
706764

707765
// Represents the metadata of the long-running operation.

google/cloud/netapp/v1/common.proto

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ enum ServiceLevel {
4444
FLEX = 4;
4545
}
4646

47+
// Flex Storage Pool performance.
48+
enum FlexPerformance {
49+
// Unspecified flex performance.
50+
FLEX_PERFORMANCE_UNSPECIFIED = 0;
51+
52+
// Flex Storage Pool with default performance.
53+
FLEX_PERFORMANCE_DEFAULT = 1;
54+
55+
// Flex Storage Pool with custom performance.
56+
FLEX_PERFORMANCE_CUSTOM = 2;
57+
}
58+
4759
// The volume encryption key source.
4860
enum EncryptionType {
4961
// The source of the encryption key is not specified.
@@ -71,4 +83,8 @@ message LocationMetadata {
7183
// Output only. Supported service levels in a location.
7284
repeated ServiceLevel supported_service_levels = 1
7385
[(google.api.field_behavior) = OUTPUT_ONLY];
86+
87+
// Output only. Supported flex performance in a location.
88+
repeated FlexPerformance supported_flex_performance = 2
89+
[(google.api.field_behavior) = OUTPUT_ONLY];
7490
}
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
// Copyright 2024 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.cloud.netapp.v1;
18+
19+
import "google/api/field_behavior.proto";
20+
import "google/api/resource.proto";
21+
import "google/protobuf/field_mask.proto";
22+
import "google/protobuf/timestamp.proto";
23+
24+
option csharp_namespace = "Google.Cloud.NetApp.V1";
25+
option go_package = "cloud.google.com/go/netapp/apiv1/netapppb;netapppb";
26+
option java_multiple_files = true;
27+
option java_outer_classname = "QuotaRuleProto";
28+
option java_package = "com.google.cloud.netapp.v1";
29+
option php_namespace = "Google\\Cloud\\NetApp\\V1";
30+
option ruby_package = "Google::Cloud::NetApp::V1";
31+
32+
// ListQuotaRulesRequest for listing quota rules.
33+
message ListQuotaRulesRequest {
34+
// Required. Parent value for ListQuotaRulesRequest
35+
string parent = 1 [
36+
(google.api.field_behavior) = REQUIRED,
37+
(google.api.resource_reference) = {
38+
child_type: "netapp.googleapis.com/QuotaRule"
39+
}
40+
];
41+
42+
// Optional. Requested page size. Server may return fewer items than
43+
// requested. If unspecified, the server will pick an appropriate default.
44+
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
45+
46+
// Optional. A token identifying a page of results the server should return.
47+
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
48+
49+
// Optional. Filtering results
50+
string filter = 4 [(google.api.field_behavior) = OPTIONAL];
51+
52+
// Optional. Hint for how to order the results
53+
string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
54+
}
55+
56+
// ListQuotaRulesResponse is the response to a ListQuotaRulesRequest.
57+
message ListQuotaRulesResponse {
58+
// List of quota rules
59+
repeated QuotaRule quota_rules = 1;
60+
61+
// A token identifying a page of results the server should return.
62+
string next_page_token = 2;
63+
64+
// Locations that could not be reached.
65+
repeated string unreachable = 3;
66+
}
67+
68+
// GetQuotaRuleRequest for getting a quota rule.
69+
message GetQuotaRuleRequest {
70+
// Required. Name of the quota rule
71+
string name = 1 [
72+
(google.api.field_behavior) = REQUIRED,
73+
(google.api.resource_reference) = {
74+
type: "netapp.googleapis.com/QuotaRule"
75+
}
76+
];
77+
}
78+
79+
// CreateQuotaRuleRequest for creating a quota rule.
80+
message CreateQuotaRuleRequest {
81+
// Required. Parent value for CreateQuotaRuleRequest
82+
string parent = 1 [
83+
(google.api.field_behavior) = REQUIRED,
84+
(google.api.resource_reference) = {
85+
child_type: "netapp.googleapis.com/QuotaRule"
86+
}
87+
];
88+
89+
// Required. Fields of the to be created quota rule.
90+
QuotaRule quota_rule = 2 [(google.api.field_behavior) = REQUIRED];
91+
92+
// Required. ID of the quota rule to create. Must be unique within the parent
93+
// resource. Must contain only letters, numbers, underscore and hyphen, with
94+
// the first character a letter or underscore, the last a letter or underscore
95+
// or a number, and a 63 character maximum.
96+
string quota_rule_id = 3 [(google.api.field_behavior) = REQUIRED];
97+
}
98+
99+
// UpdateQuotaRuleRequest for updating a quota rule.
100+
message UpdateQuotaRuleRequest {
101+
// Optional. Field mask is used to specify the fields to be overwritten in the
102+
// Quota Rule resource by the update.
103+
// The fields specified in the update_mask are relative to the resource, not
104+
// the full request. A field will be overwritten if it is in the mask. If the
105+
// user does not provide a mask then all fields will be overwritten.
106+
google.protobuf.FieldMask update_mask = 1
107+
[(google.api.field_behavior) = OPTIONAL];
108+
109+
// Required. The quota rule being updated
110+
QuotaRule quota_rule = 2 [(google.api.field_behavior) = REQUIRED];
111+
}
112+
113+
// DeleteQuotaRuleRequest for deleting a single quota rule.
114+
message DeleteQuotaRuleRequest {
115+
// Required. Name of the quota rule.
116+
string name = 1 [
117+
(google.api.field_behavior) = REQUIRED,
118+
(google.api.resource_reference) = {
119+
type: "netapp.googleapis.com/QuotaRule"
120+
}
121+
];
122+
}
123+
124+
// QuotaRule specifies the maximum disk space a user or group can use within a
125+
// volume. They can be used for creating default and individual quota rules.
126+
message QuotaRule {
127+
option (google.api.resource) = {
128+
type: "netapp.googleapis.com/QuotaRule"
129+
pattern: "projects/{project}/locations/{location}/volumes/{volume}/quotaRules/{quota_rule}"
130+
plural: "quotaRules"
131+
singular: "quotaRule"
132+
};
133+
134+
// Types of Quota Rule
135+
enum Type {
136+
// Unspecified type for quota rule
137+
TYPE_UNSPECIFIED = 0;
138+
139+
// Individual user quota rule
140+
INDIVIDUAL_USER_QUOTA = 1;
141+
142+
// Individual group quota rule
143+
INDIVIDUAL_GROUP_QUOTA = 2;
144+
145+
// Default user quota rule
146+
DEFAULT_USER_QUOTA = 3;
147+
148+
// Default group quota rule
149+
DEFAULT_GROUP_QUOTA = 4;
150+
}
151+
152+
// Quota Rule states
153+
enum State {
154+
// Unspecified state for quota rule
155+
STATE_UNSPECIFIED = 0;
156+
157+
// Quota rule is creating
158+
CREATING = 1;
159+
160+
// Quota rule is updating
161+
UPDATING = 2;
162+
163+
// Quota rule is deleting
164+
DELETING = 3;
165+
166+
// Quota rule is ready
167+
READY = 4;
168+
169+
// Quota rule is in error state.
170+
ERROR = 5;
171+
}
172+
173+
// Identifier. The resource name of the quota rule.
174+
// Format:
175+
// `projects/{project_number}/locations/{location_id}/volumes/volumes/{volume_id}/quotaRules/{quota_rule_id}`.
176+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
177+
178+
// Optional. The quota rule applies to the specified user or group, identified
179+
// by a Unix UID/GID, Windows SID, or null for default.
180+
string target = 2 [(google.api.field_behavior) = OPTIONAL];
181+
182+
// Required. The type of quota rule.
183+
Type type = 3 [(google.api.field_behavior) = REQUIRED];
184+
185+
// Required. The maximum allowed disk space in MiB.
186+
int32 disk_limit_mib = 4 [(google.api.field_behavior) = REQUIRED];
187+
188+
// Output only. State of the quota rule
189+
State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
190+
191+
// Output only. State details of the quota rule
192+
string state_details = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
193+
194+
// Output only. Create time of the quota rule
195+
google.protobuf.Timestamp create_time = 8
196+
[(google.api.field_behavior) = OUTPUT_ONLY];
197+
198+
// Optional. Description of the quota rule
199+
string description = 9 [(google.api.field_behavior) = OPTIONAL];
200+
201+
// Optional. Labels of the quota rule
202+
map<string, string> labels = 10 [(google.api.field_behavior) = OPTIONAL];
203+
}

google/cloud/netapp/v1/replication.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,18 @@ message HybridPeeringDetails {
256256

257257
// Optional. Temporary passphrase generated to accept cluster peering command.
258258
string passphrase = 4 [(google.api.field_behavior) = OPTIONAL];
259+
260+
// Optional. Name of the user's local source volume to be peered with the
261+
// destination volume.
262+
string peer_volume_name = 5 [(google.api.field_behavior) = OPTIONAL];
263+
264+
// Optional. Name of the user's local source cluster to be peered with the
265+
// destination cluster.
266+
string peer_cluster_name = 6 [(google.api.field_behavior) = OPTIONAL];
267+
268+
// Optional. Name of the user's local source vserver svm to be peered with the
269+
// destination vserver svm.
270+
string peer_svm_name = 7 [(google.api.field_behavior) = OPTIONAL];
259271
}
260272

261273
// ListReplications lists replications.

google/cloud/netapp/v1/storage_pool.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,12 @@ message StoragePool {
253253

254254
// Optional. Specifies the active zone for regional storagePool.
255255
string zone = 21 [(google.api.field_behavior) = OPTIONAL];
256+
257+
// Output only. Reserved for future use
258+
bool satisfies_pzs = 23 [(google.api.field_behavior) = OUTPUT_ONLY];
259+
260+
// Output only. Reserved for future use
261+
bool satisfies_pzi = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
256262
}
257263

258264
// ValidateDirectoryServiceRequest validates the directory service policy

google/cloud/netapp/v1/volume.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,12 @@ message MountOption {
568568

569569
// Instructions for mounting
570570
string instructions = 4;
571+
572+
// Output only. IP Address.
573+
string ip_address = 5 [
574+
(google.api.field_info).format = IPV4,
575+
(google.api.field_behavior) = OUTPUT_ONLY
576+
];
571577
}
572578

573579
// The RestoreParameters if volume is created from a snapshot or backup.

0 commit comments

Comments
 (0)