xref: /aosp_15_r20/external/googleapis/google/api/cloudquotas/v1/resources.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 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
15syntax = "proto3";
16
17package google.api.cloudquotas.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/protobuf/timestamp.proto";
22import "google/protobuf/wrappers.proto";
23
24option csharp_namespace = "Google.Cloud.CloudQuotas.V1";
25option go_package = "cloud.google.com/go/cloudquotas/apiv1/cloudquotaspb;cloudquotaspb";
26option java_multiple_files = true;
27option java_outer_classname = "ResourcesProto";
28option java_package = "com.google.api.cloudquotas.v1";
29option php_namespace = "Google\\Cloud\\CloudQuotas\\V1";
30option ruby_package = "Google::Cloud::CloudQuotas::V1";
31
32// Enumerations of quota safety checks.
33enum QuotaSafetyCheck {
34  // Unspecified quota safety check.
35  QUOTA_SAFETY_CHECK_UNSPECIFIED = 0;
36
37  // Validates that a quota mutation would not cause the consumer's effective
38  // limit to be lower than the consumer's quota usage.
39  QUOTA_DECREASE_BELOW_USAGE = 1;
40
41  // Validates that a quota mutation would not cause the consumer's effective
42  // limit to decrease by more than 10 percent.
43  QUOTA_DECREASE_PERCENTAGE_TOO_HIGH = 2;
44}
45
46// QuotaInfo represents information about a particular quota for a given
47// project, folder or organization.
48message QuotaInfo {
49  option (google.api.resource) = {
50    type: "cloudquotas.googleapis.com/QuotaInfo"
51    pattern: "projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}"
52    pattern: "folders/{folder}/locations/{location}/services/{service}/quotaInfos/{quota_info}"
53    pattern: "organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info}"
54  };
55
56  // The enumeration of the types of a cloud resource container.
57  enum ContainerType {
58    // Unspecified container type.
59    CONTAINER_TYPE_UNSPECIFIED = 0;
60
61    // consumer project
62    PROJECT = 1;
63
64    // folder
65    FOLDER = 2;
66
67    // organization
68    ORGANIZATION = 3;
69  }
70
71  // Resource name of this QuotaInfo.
72  // The ID component following "locations/" must be "global".
73  // Example:
74  // `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
75  string name = 1;
76
77  // The id of the quota, which is unquie within the service.
78  // Example: `CpusPerProjectPerRegion`
79  string quota_id = 2;
80
81  // The metric of the quota. It specifies the resources consumption the quota
82  // is defined for.
83  // Example: `compute.googleapis.com/cpus`
84  string metric = 3;
85
86  // The name of the service in which the quota is defined.
87  // Example: `compute.googleapis.com`
88  string service = 4;
89
90  // Whether this is a precise quota. A precise quota is tracked with absolute
91  // precision. In contrast, an imprecise quota is not tracked with precision.
92  bool is_precise = 5;
93
94  // The reset time interval for the quota. Refresh interval applies to rate
95  // quota only.
96  // Example: "minute" for per minute, "day" for per day, or "10 seconds" for
97  // every 10 seconds.
98  string refresh_interval = 6;
99
100  // The container type of the QuotaInfo.
101  ContainerType container_type = 7;
102
103  // The dimensions the quota is defined on.
104  repeated string dimensions = 8;
105
106  // The display name of the quota metric
107  string metric_display_name = 9;
108
109  // The display name of the quota.
110  string quota_display_name = 10;
111
112  // The unit in which the metric value is reported, e.g., "MByte".
113  string metric_unit = 11;
114
115  // Whether it is eligible to request a higher quota value for this quota.
116  QuotaIncreaseEligibility quota_increase_eligibility = 12;
117
118  // Whether the quota value is fixed or adjustable
119  bool is_fixed = 13;
120
121  // The collection of dimensions info ordered by their dimensions from more
122  // specific ones to less specific ones.
123  repeated DimensionsInfo dimensions_infos = 14;
124
125  // Whether the quota is a concurrent quota. Concurrent quotas are enforced
126  // on the total number of concurrent operations in flight at any given time.
127  bool is_concurrent = 15;
128
129  // URI to the page where users can request more quota for the cloud
130  // service—for example,
131  // https://console.cloud.google.com/iam-admin/quotas.
132  string service_request_quota_uri = 17;
133}
134
135// Eligibility information regarding requesting increase adjustment of a quota.
136message QuotaIncreaseEligibility {
137  // The enumeration of reasons when it is ineligible to request increase
138  // adjustment.
139  enum IneligibilityReason {
140    // Default value when is_eligible is true.
141    INELIGIBILITY_REASON_UNSPECIFIED = 0;
142
143    // The container is not linked with a valid billing account.
144    NO_VALID_BILLING_ACCOUNT = 1;
145
146    // Other reasons.
147    OTHER = 2;
148  }
149
150  // Whether a higher quota value can be requested for the quota.
151  bool is_eligible = 1;
152
153  // The reason of why it is ineligible to request increased value of the quota.
154  // If the is_eligible field is true, it defaults to
155  // INELIGIBILITY_REASON_UNSPECIFIED.
156  IneligibilityReason ineligibility_reason = 2;
157}
158
159// QuotaPreference represents the preferred quota configuration specified for
160// a project, folder or organization. There is only one QuotaPreference
161// resource for a quota value targeting a unique set of dimensions.
162message QuotaPreference {
163  option (google.api.resource) = {
164    type: "cloudquotas.googleapis.com/QuotaPreference"
165    pattern: "projects/{project}/locations/{location}/quotaPreferences/{quota_preference}"
166    pattern: "folders/{folder}/locations/{location}/quotaPreferences/{quota_preference}"
167    pattern: "organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference}"
168  };
169
170  // Required except in the CREATE requests.
171  // The resource name of the quota preference.
172  // The ID component following "locations/" must be "global".
173  // Example:
174  // `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
175  string name = 1;
176
177  // Immutable. The dimensions that this quota preference applies to. The key of
178  // the map entry is the name of a dimension, such as "region", "zone",
179  // "network_id", and the value of the map entry is the dimension value.
180  //
181  // If a dimension is missing from the map of dimensions, the quota preference
182  // applies to all the dimension values except for those that have other quota
183  // preferences configured for the specific value.
184  //
185  // NOTE: QuotaPreferences can only be applied across all values of "user" and
186  // "resource" dimension. Do not set values for "user" or "resource" in the
187  // dimension map.
188  //
189  // Example: {"provider", "Foo Inc"} where "provider" is a service specific
190  // dimension.
191  map<string, string> dimensions = 2 [(google.api.field_behavior) = IMMUTABLE];
192
193  // Required. Preferred quota configuration.
194  QuotaConfig quota_config = 3 [(google.api.field_behavior) = REQUIRED];
195
196  // Optional. The current etag of the quota preference. If an etag is provided
197  // on update and does not match the current server's etag of the quota
198  // preference, the request will be blocked and an ABORTED error will be
199  // returned. See https://google.aip.dev/134#etags for more details on etags.
200  string etag = 4 [(google.api.field_behavior) = OPTIONAL];
201
202  // Output only. Create time stamp
203  google.protobuf.Timestamp create_time = 5
204      [(google.api.field_behavior) = OUTPUT_ONLY];
205
206  // Output only. Update time stamp
207  google.protobuf.Timestamp update_time = 6
208      [(google.api.field_behavior) = OUTPUT_ONLY];
209
210  // Required. The name of the service to which the quota preference is applied.
211  string service = 7 [(google.api.field_behavior) = REQUIRED];
212
213  // Required. The id of the quota to which the quota preference is applied. A
214  // quota name is unique in the service. Example: `CpusPerProjectPerRegion`
215  string quota_id = 8 [(google.api.field_behavior) = REQUIRED];
216
217  // Output only. Is the quota preference pending Google Cloud approval and
218  // fulfillment.
219  bool reconciling = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
220
221  // The reason / justification for this quota preference.
222  string justification = 11;
223
224  // Input only. An email address that can be used to contact the the user, in
225  // case Google Cloud needs more information to make a decision before
226  // additional quota can be granted.
227  //
228  // When requesting a quota increase, the email address is required.
229  // When requesting a quota decrease, the email address is optional.
230  // For example, the email address is optional when the
231  // `QuotaConfig.preferred_value` is smaller than the
232  // `QuotaDetails.reset_value`.
233  string contact_email = 12 [(google.api.field_behavior) = INPUT_ONLY];
234}
235
236// The preferred quota configuration.
237message QuotaConfig {
238  // The enumeration of the origins of quota preference requests.
239  enum Origin {
240    // The unspecified value.
241    ORIGIN_UNSPECIFIED = 0;
242
243    // Created through Cloud Console.
244    CLOUD_CONSOLE = 1;
245
246    // Generated by automatic quota adjustment.
247    AUTO_ADJUSTER = 2;
248  }
249
250  // Required. The preferred value. Must be greater than or equal to -1. If set
251  // to -1, it means the value is "unlimited".
252  int64 preferred_value = 1 [(google.api.field_behavior) = REQUIRED];
253
254  // Output only. Optional details about the state of this quota preference.
255  string state_detail = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
256
257  // Output only. Granted quota value.
258  google.protobuf.Int64Value granted_value = 3
259      [(google.api.field_behavior) = OUTPUT_ONLY];
260
261  // Output only. The trace id that the Google Cloud uses to provision the
262  // requested quota. This trace id may be used by the client to contact Cloud
263  // support to track the state of a quota preference request. The trace id is
264  // only produced for increase requests and is unique for each request. The
265  // quota decrease requests do not have a trace id.
266  string trace_id = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
267
268  // Optional. The annotations map for clients to store small amounts of
269  // arbitrary data. Do not put PII or other sensitive information here. See
270  // https://google.aip.dev/128#annotations
271  map<string, string> annotations = 5 [(google.api.field_behavior) = OPTIONAL];
272
273  // Output only. The origin of the quota preference request.
274  Origin request_origin = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
275}
276
277// The detailed quota information such as effective quota value for a
278// combination of dimensions.
279message DimensionsInfo {
280  // The map of dimensions for this dimensions info. The key of a map entry
281  // is "region", "zone" or the name of a service specific dimension, and the
282  // value of a map entry is the value of the dimension.  If a dimension does
283  // not appear in the map of dimensions, the dimensions info applies to all
284  // the dimension values except for those that have another DimenisonInfo
285  // instance configured for the specific value.
286  // Example: {"provider" : "Foo Inc"} where "provider" is a service specific
287  // dimension of a quota.
288  map<string, string> dimensions = 1;
289
290  // Quota details for the specified dimensions.
291  QuotaDetails details = 2;
292
293  // The applicable regions or zones of this dimensions info. The field will be
294  // set to ['global'] for quotas that are not per region or per zone.
295  // Otherwise, it will be set to the list of locations this dimension info is
296  // applicable to.
297  repeated string applicable_locations = 3;
298}
299
300// The quota details for a map of dimensions.
301message QuotaDetails {
302  // The value currently in effect and being enforced.
303  int64 value = 1;
304
305  // Rollout information of this quota.
306  // This field is present only if the effective limit will change due to the
307  // ongoing rollout of the service config.
308  RolloutInfo rollout_info = 3;
309}
310
311// [Output only] Rollout information of a quota.
312message RolloutInfo {
313  // Whether there is an ongoing rollout for a quota or not.
314  bool ongoing_rollout = 1;
315}
316