Skip to content

Commit 818eab1

Browse files
Google APIscopybara-github
authored andcommitted
feat: Added support for hierarchical enrollment in Quota Adjuster consumer API
docs: Added 2 new fields in `.google.api.cloudquotas.v1beta.QuotaAdjusterSettings` docs: Added inherited and inherited_from in `.google.api.cloudquotas.v1beta.QuotaAdjusterSettings` docs: Added support for folder and organization level enrollment PiperOrigin-RevId: 768053907
1 parent 4c2be91 commit 818eab1

2 files changed

Lines changed: 61 additions & 30 deletions

File tree

google/api/cloudquotas/v1beta/quota_adjuster_settings.proto

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ service QuotaAdjusterSettingsManager {
4848
option (google.api.http) = {
4949
patch: "/v1beta/{quota_adjuster_settings.name=projects/*/locations/*/quotaAdjusterSettings}"
5050
body: "quota_adjuster_settings"
51+
additional_bindings {
52+
patch: "/v1beta/{quota_adjuster_settings.name=folders/*/locations/*/quotaAdjusterSettings}"
53+
body: "quota_adjuster_settings"
54+
}
55+
additional_bindings {
56+
patch: "/v1beta/{quota_adjuster_settings.name=organizations/*/locations/*/quotaAdjusterSettings}"
57+
body: "quota_adjuster_settings"
58+
}
5159
};
5260
option (google.api.method_signature) =
5361
"quota_adjuster_settings,update_mask";
@@ -58,6 +66,12 @@ service QuotaAdjusterSettingsManager {
5866
returns (QuotaAdjusterSettings) {
5967
option (google.api.http) = {
6068
get: "/v1beta/{name=projects/*/locations/*/quotaAdjusterSettings}"
69+
additional_bindings {
70+
get: "/v1beta/{name=folders/*/locations/*/quotaAdjusterSettings}"
71+
}
72+
additional_bindings {
73+
get: "/v1beta/{name=organizations/*/locations/*/quotaAdjusterSettings}"
74+
}
6175
};
6276
option (google.api.method_signature) = "name";
6377
}
@@ -97,6 +111,8 @@ message QuotaAdjusterSettings {
97111
option (google.api.resource) = {
98112
type: "cloudquotas.googleapis.com/QuotaAdjusterSettings"
99113
pattern: "projects/{project}/locations/{location}/quotaAdjusterSettings"
114+
pattern: "organizations/{organization}/locations/{location}/quotaAdjusterSettings"
115+
pattern: "folders/{folder}/locations/{location}/quotaAdjusterSettings"
100116
plural: "quotaAdjusterSettings"
101117
singular: "quotaAdjusterSettings"
102118
style: DECLARATIVE_FRIENDLY
@@ -114,13 +130,14 @@ message QuotaAdjusterSettings {
114130
DISABLED = 3;
115131
}
116132

117-
// Identifier. Name of the configuration, in the following format:
118-
// `projects/PROJECT_NUMBER/locations/global/quotaAdjusterSettings`.
119-
// Replace PROJECT_NUMBER with the project number for your project.
133+
// Identifier. Name of the config would be of the format:
134+
// projects/PROJECT_NUMBER/locations/global/quotaAdjusterSettings
135+
// folders/FOLDER_NUMBER/locations/global/quotaAdjusterSettings
136+
// organizations/ORGANIZATION_NUMBER/locations/global/quotaAdjusterSettings
120137
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
121138

122-
// Required. The configured value of the enablement at the given resource.
123-
Enablement enablement = 2 [(google.api.field_behavior) = REQUIRED];
139+
// Optional. The configured value of the enablement at the given resource.
140+
Enablement enablement = 2 [(google.api.field_behavior) = OPTIONAL];
124141

125142
// Output only. The timestamp when the QuotaAdjusterSettings resource was last
126143
// updated.
@@ -132,4 +149,16 @@ message QuotaAdjusterSettings {
132149
// QuotaAdjusterSettings, the request is blocked and returns an ABORTED error.
133150
// See https://google.aip.dev/134#etags for more details on ETags.
134151
string etag = 6 [(google.api.field_behavior) = OPTIONAL];
152+
153+
// Optional. Indicates whether the setting is inherited or explicitly
154+
// specified.
155+
bool inherited = 7 [(google.api.field_behavior) = OPTIONAL];
156+
157+
// Output only. The resource container from which the setting is inherited.
158+
// This refers to the nearest ancestor with enablement set (either ENABLED or
159+
// DISABLED). The value can be an organizations/{organization_id},
160+
// folders/{folder_id}, or can be 'default' if no ancestor exists with
161+
// enablement set. The value will be empty when enablement is directly set on
162+
// this container.
163+
string inherited_from = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
135164
}

google/api/cloudquotas/v1beta/resources.proto

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,21 @@ message QuotaInfo {
7070

7171
// Resource name of this QuotaInfo.
7272
// The ID component following "locations/" must be "global".
73-
// Example:
73+
// For example,
7474
// `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
7575
string name = 1;
7676

7777
// The id of the quota, which is unquie within the service.
78-
// Example: `CpusPerProjectPerRegion`
78+
// For example, `CpusPerProjectPerRegion`
7979
string quota_id = 2;
8080

8181
// The metric of the quota. It specifies the resources consumption the quota
8282
// is defined for.
83-
// Example: `compute.googleapis.com/cpus`
83+
// For example, `compute.googleapis.com/cpus`
8484
string metric = 3;
8585

8686
// The name of the service in which the quota is defined.
87-
// Example: `compute.googleapis.com`
87+
// For example, `compute.googleapis.com`
8888
string service = 4;
8989

9090
// Whether this is a precise quota. A precise quota is tracked with absolute
@@ -93,8 +93,8 @@ message QuotaInfo {
9393

9494
// The reset time interval for the quota. Refresh interval applies to rate
9595
// quota only.
96-
// Example: "minute" for per minute, "day" for per day, or "10 seconds" for
97-
// every 10 seconds.
96+
// For example, "minute" for per minute, "day" for per day, or "10 seconds"
97+
// for every 10 seconds.
9898
string refresh_interval = 6;
9999

100100
// The container type of the QuotaInfo.
@@ -175,25 +175,26 @@ message QuotaPreference {
175175

176176
// Required except in the CREATE requests.
177177
// The resource name of the quota preference.
178-
// The ID component following "locations/" must be "global".
179-
// Example:
178+
// The path that follows `/locations` must be `/global`.
179+
// For example:
180180
// `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
181181
string name = 1;
182182

183183
// Immutable. The dimensions that this quota preference applies to. The key of
184-
// the map entry is the name of a dimension, such as "region", "zone",
185-
// "network_id", and the value of the map entry is the dimension value.
184+
// the map entry is the name of a dimension, such as `region`, `zone`,
185+
// `network_id`, and the value of the map entry is the dimension value.
186186
//
187187
// If a dimension is missing from the map of dimensions, the quota preference
188188
// applies to all the dimension values except for those that have other quota
189189
// preferences configured for the specific value.
190190
//
191-
// NOTE: QuotaPreferences can only be applied across all values of "user" and
192-
// "resource" dimension. Do not set values for "user" or "resource" in the
191+
// Note: QuotaPreferences can only be applied across all values of `user` and
192+
// `resource` dimension. Do not set values for `user` or `resource` in the
193193
// dimension map.
194194
//
195-
// Example: {"provider", "Foo Inc"} where "provider" is a service specific
196-
// dimension.
195+
// For example: `{"provider" : "Example Organization"}` where `provider` is a
196+
// service-specific quota dimension and `Example Organization` is the provider
197+
// name.
197198
map<string, string> dimensions = 2 [(google.api.field_behavior) = IMMUTABLE];
198199

199200
// Required. Preferred quota configuration.
@@ -217,7 +218,7 @@ message QuotaPreference {
217218
string service = 7 [(google.api.field_behavior) = REQUIRED];
218219

219220
// Required. The id of the quota to which the quota preference is applied. A
220-
// quota name is unique in the service. Example: `CpusPerProjectPerRegion`
221+
// quota name is unique in the service. For example, `CpusPerProjectPerRegion`
221222
string quota_id = 8 [(google.api.field_behavior) = REQUIRED];
222223

223224
// Output only. Is the quota preference pending Google Cloud approval and
@@ -227,9 +228,9 @@ message QuotaPreference {
227228
// The reason / justification for this quota preference.
228229
string justification = 11;
229230

230-
// Input only. An email address that can be used to contact the the user, in
231-
// case Google Cloud needs more information to make a decision before
232-
// additional quota can be granted.
231+
// Input only. An email address that can be used to contact the user, in case
232+
// Google Cloud needs more information to make a decision before additional
233+
// quota can be granted.
233234
//
234235
// When requesting a quota increase, the email address is required.
235236
// When requesting a quota decrease, the email address is optional.
@@ -283,20 +284,21 @@ message QuotaConfig {
283284
// The detailed quota information such as effective quota value for a
284285
// combination of dimensions.
285286
message DimensionsInfo {
286-
// The map of dimensions for this dimensions info. The key of a map entry
287-
// is "region", "zone" or the name of a service specific dimension, and the
288-
// value of a map entry is the value of the dimension. If a dimension does
287+
// The map of dimensions in key-value pairs. The key of a map entry
288+
// is "region", "zone", or the name of a service-specific dimension, and the
289+
// value of a map entry is the value of the dimension. If a dimension does
289290
// not appear in the map of dimensions, the dimensions info applies to all
290-
// the dimension values except for those that have another DimenisonInfo
291+
// the dimension values except for those that have another DimensionInfo
291292
// instance configured for the specific value.
292-
// Example: {"provider" : "Foo Inc"} where "provider" is a service specific
293-
// dimension of a quota.
293+
// For example: `{"provider" : "Example Organization"}` where `provider` is a
294+
// service-specific quota dimension and `Example Organization` is the provider
295+
// name.
294296
map<string, string> dimensions = 1;
295297

296298
// Quota details for the specified dimensions.
297299
QuotaDetails details = 2;
298300

299-
// The applicable regions or zones of this dimensions info. The field will be
301+
// The applicable regions or zones of this dimension. The field is
300302
// set to ['global'] for quotas that are not per region or per zone.
301303
// Otherwise, it will be set to the list of locations this dimension info is
302304
// applicable to.

0 commit comments

Comments
 (0)