Skip to content

Commit a29dc81

Browse files
Google APIscopybara-github
authored andcommitted
feat: Recommendation Priority / Insight Severity
feat: Recommendation xor_group_id feat: Recommendation security projection feat: Configurable recommenders Incorporate above new features, as well as update .bazel files. PiperOrigin-RevId: 424106499
1 parent 0c05a49 commit a29dc81

7 files changed

Lines changed: 474 additions & 34 deletions

File tree

google/cloud/recommender/v1/BUILD.bazel

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file was automatically generated by BuildFileGenerator
2-
# https://github.com/googleapis/gapic-generator/tree/master/rules_gapic/bazel
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
33

44
# Most of the manual changes to this file will be overwritten.
55
# It's **only** allowed to change the following rule attribute values:
@@ -71,12 +71,15 @@ java_grpc_library(
7171
java_gapic_library(
7272
name = "recommender_java_gapic",
7373
srcs = [":recommender_proto_with_info"],
74+
gapic_yaml = None,
7475
grpc_service_config = "recommender_grpc_service_config.json",
76+
service_yaml = "recommender_v1.yaml",
7577
test_deps = [
7678
":recommender_java_grpc",
7779
],
7880
deps = [
7981
":recommender_java_proto",
82+
"//google/api:api_java_proto",
8083
],
8184
)
8285

@@ -126,6 +129,7 @@ go_gapic_library(
126129
srcs = [":recommender_proto_with_info"],
127130
grpc_service_config = "recommender_grpc_service_config.json",
128131
importpath = "cloud.google.com/go/recommender/apiv1;recommender",
132+
metadata = True,
129133
service_yaml = "recommender_v1.yaml",
130134
deps = [
131135
":recommender_go_proto",
@@ -145,6 +149,7 @@ go_gapic_assembly_pkg(
145149
name = "gapi-cloud-recommender-v1-go",
146150
deps = [
147151
":recommender_go_gapic",
152+
":recommender_go_gapic_srcjar-metadata.srcjar",
148153
":recommender_go_gapic_srcjar-test.srcjar",
149154
":recommender_go_proto",
150155
],
@@ -165,6 +170,7 @@ py_gapic_library(
165170
grpc_service_config = "recommender_grpc_service_config.json",
166171
)
167172

173+
# Open Source Packages
168174
py_gapic_assembly_pkg(
169175
name = "recommender-v1-py",
170176
deps = [
@@ -198,6 +204,7 @@ php_gapic_library(
198204
name = "recommender_php_gapic",
199205
srcs = [":recommender_proto_with_info"],
200206
grpc_service_config = "recommender_grpc_service_config.json",
207+
service_yaml = "recommender_v1.yaml",
201208
deps = [
202209
":recommender_php_grpc",
203210
":recommender_php_proto",
@@ -268,11 +275,11 @@ ruby_cloud_gapic_library(
268275
name = "recommender_ruby_gapic",
269276
srcs = [":recommender_proto_with_info"],
270277
extra_protoc_parameters = [
271-
"ruby-cloud-gem-name=google-cloud-recommender-v1",
272-
"ruby-cloud-env-prefix=RECOMMENDER",
273-
"ruby-cloud-product-url=https://cloud.google.com/recommender",
274278
"ruby-cloud-api-id=recommender.googleapis.com",
275279
"ruby-cloud-api-shortname=recommender",
280+
"ruby-cloud-env-prefix=RECOMMENDER",
281+
"ruby-cloud-gem-name=google-cloud-recommender-v1",
282+
"ruby-cloud-product-url=https://cloud.google.com/recommender",
276283
],
277284
grpc_service_config = "recommender_grpc_service_config.json",
278285
ruby_cloud_description = "Recommender is a service on Google Cloud that provides usage recommendations for Cloud products and services.",

google/cloud/recommender/v1beta1/BUILD.bazel

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file was automatically generated by BuildFileGenerator
2-
# https://github.com/googleapis/gapic-generator/tree/master/rules_gapic/bazel
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
33

44
# Most of the manual changes to this file will be overwritten.
55
# It's **only** allowed to change the following rule attribute values:
@@ -22,7 +22,9 @@ proto_library(
2222
name = "recommender_proto",
2323
srcs = [
2424
"insight.proto",
25+
"insight_type_config.proto",
2526
"recommendation.proto",
27+
"recommender_config.proto",
2628
"recommender_service.proto",
2729
],
2830
deps = [
@@ -32,6 +34,7 @@ proto_library(
3234
"//google/api:resource_proto",
3335
"//google/type:money_proto",
3436
"@com_google_protobuf//:duration_proto",
37+
"@com_google_protobuf//:field_mask_proto",
3538
"@com_google_protobuf//:struct_proto",
3639
"@com_google_protobuf//:timestamp_proto",
3740
],
@@ -71,12 +74,15 @@ java_grpc_library(
7174
java_gapic_library(
7275
name = "recommender_java_gapic",
7376
srcs = [":recommender_proto_with_info"],
77+
gapic_yaml = "recommender_gapic.yaml",
7478
grpc_service_config = "recommender_grpc_service_config.json",
79+
service_yaml = "recommender_v1beta1.yaml",
7580
test_deps = [
7681
":recommender_java_grpc",
7782
],
7883
deps = [
7984
":recommender_java_proto",
85+
"//google/api:api_java_proto",
8086
],
8187
)
8288

@@ -126,6 +132,7 @@ go_gapic_library(
126132
srcs = [":recommender_proto_with_info"],
127133
grpc_service_config = "recommender_grpc_service_config.json",
128134
importpath = "cloud.google.com/go/recommender/apiv1beta1;recommender",
135+
metadata = True,
129136
service_yaml = "recommender_v1beta1.yaml",
130137
deps = [
131138
":recommender_go_proto",
@@ -145,6 +152,7 @@ go_gapic_assembly_pkg(
145152
name = "gapi-cloud-recommender-v1beta1-go",
146153
deps = [
147154
":recommender_go_gapic",
155+
":recommender_go_gapic_srcjar-metadata.srcjar",
148156
":recommender_go_gapic_srcjar-test.srcjar",
149157
":recommender_go_proto",
150158
],
@@ -165,6 +173,7 @@ py_gapic_library(
165173
grpc_service_config = "recommender_grpc_service_config.json",
166174
)
167175

176+
# Open Source Packages
168177
py_gapic_assembly_pkg(
169178
name = "recommender-v1beta1-py",
170179
deps = [
@@ -198,6 +207,7 @@ php_gapic_library(
198207
name = "recommender_php_gapic",
199208
srcs = [":recommender_proto_with_info"],
200209
grpc_service_config = "recommender_grpc_service_config.json",
210+
service_yaml = "recommender_v1beta1.yaml",
201211
deps = [
202212
":recommender_php_grpc",
203213
":recommender_php_proto",
@@ -225,6 +235,7 @@ load(
225235

226236
nodejs_gapic_library(
227237
name = "recommender_nodejs_gapic",
238+
package_name = "@google-cloud/recommender",
228239
src = ":recommender_proto_with_info",
229240
extra_protoc_parameters = ["metadata"],
230241
grpc_service_config = "recommender_grpc_service_config.json",
@@ -246,8 +257,8 @@ nodejs_gapic_assembly_pkg(
246257
##############################################################################
247258
load(
248259
"@com_google_googleapis_imports//:imports.bzl",
249-
"ruby_gapic_assembly_pkg",
250260
"ruby_cloud_gapic_library",
261+
"ruby_gapic_assembly_pkg",
251262
"ruby_grpc_library",
252263
"ruby_proto_library",
253264
)
@@ -265,7 +276,7 @@ ruby_grpc_library(
265276

266277
ruby_cloud_gapic_library(
267278
name = "recommender_ruby_gapic",
268-
srcs = [":recommender_proto_with_info",],
279+
srcs = [":recommender_proto_with_info"],
269280
extra_protoc_parameters = ["ruby-cloud-gem-name=google-cloud-recommender-v1beta1"],
270281
grpc_service_config = "recommender_grpc_service_config.json",
271282
deps = [
@@ -330,4 +341,20 @@ csharp_gapic_assembly_pkg(
330341
##############################################################################
331342
# C++
332343
##############################################################################
333-
# Put your C++ rules here
344+
load(
345+
"@com_google_googleapis_imports//:imports.bzl",
346+
"cc_grpc_library",
347+
"cc_proto_library",
348+
)
349+
350+
cc_proto_library(
351+
name = "recommender_cc_proto",
352+
deps = [":recommender_proto"],
353+
)
354+
355+
cc_grpc_library(
356+
name = "recommender_cc_grpc",
357+
srcs = [":recommender_proto"],
358+
grpc_only = True,
359+
deps = [":recommender_cc_proto"],
360+
)

google/cloud/recommender/v1beta1/insight.proto

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -41,17 +41,10 @@ message Insight {
4141
type: "recommender.googleapis.com/Insight"
4242
pattern: "projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}"
4343
pattern: "billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}"
44-
pattern: "folders/{folder}/locations/{location}/insightTypes/{insight_type}"
45-
pattern: "organizations/{organization}/locations/{location}/insightTypes/{insight_type}"
44+
pattern: "folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}"
45+
pattern: "organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}"
4646
};
4747

48-
// Reference to an associated recommendation.
49-
message RecommendationReference {
50-
// Recommendation resource name, e.g.
51-
// projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID]
52-
string recommendation = 1;
53-
}
54-
5548
// Insight category.
5649
enum Category {
5750
// Unspecified category.
@@ -70,6 +63,31 @@ message Insight {
7063
MANAGEABILITY = 4;
7164
}
7265

66+
// Insight severity levels.
67+
enum Severity {
68+
// Insight has unspecified severity.
69+
SEVERITY_UNSPECIFIED = 0;
70+
71+
// Insight has low severity.
72+
LOW = 1;
73+
74+
// Insight has medium severity.
75+
MEDIUM = 2;
76+
77+
// Insight has high severity.
78+
HIGH = 3;
79+
80+
// Insight has critical severity.
81+
CRITICAL = 4;
82+
}
83+
84+
// Reference to an associated recommendation.
85+
message RecommendationReference {
86+
// Recommendation resource name, e.g.
87+
// `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID]`
88+
string recommendation = 1;
89+
}
90+
7391
// Name of the insight.
7492
string name = 1;
7593

@@ -101,6 +119,9 @@ message Insight {
101119
// Category being targeted by the insight.
102120
Category category = 7;
103121

122+
// Insight's severity.
123+
Severity severity = 15;
124+
104125
// Fingerprint of the Insight. Provides optimistic locking when updating
105126
// states.
106127
string etag = 11;
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// Copyright 2022 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.recommender.v1beta1;
18+
19+
import "google/api/field_behavior.proto";
20+
import "google/api/resource.proto";
21+
import "google/protobuf/struct.proto";
22+
import "google/protobuf/timestamp.proto";
23+
24+
option csharp_namespace = "Google.Cloud.Recommender.V1Beta1";
25+
option go_package = "google.golang.org/genproto/googleapis/cloud/recommender/v1beta1;recommender";
26+
option java_multiple_files = true;
27+
option java_outer_classname = "InsightTypeConfigProto";
28+
option java_package = "com.google.cloud.recommender.v1beta1";
29+
option objc_class_prefix = "CREC";
30+
31+
// Configuration for an InsightType.
32+
message InsightTypeConfig {
33+
option (google.api.resource) = {
34+
type: "recommender.googleapis.com/InsightTypeConfig"
35+
pattern: "projects/{project}/locations/{location}/insightTypes/{insight_type}/config"
36+
pattern: "organizations/{organization}/locations/{location}/insightTypes/{insight_type}/config"
37+
};
38+
39+
// Name of insight type config.
40+
// Eg,
41+
// projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config
42+
string name = 1;
43+
44+
// InsightTypeGenerationConfig which configures the generation of
45+
// insights for this insight type.
46+
InsightTypeGenerationConfig insight_type_generation_config = 2;
47+
48+
// Fingerprint of the InsightTypeConfig. Provides optimistic locking when
49+
// updating.
50+
string etag = 3;
51+
52+
// Last time when the config was updated.
53+
google.protobuf.Timestamp update_time = 4;
54+
55+
// Output only. Immutable. The revision ID of the config.
56+
// A new revision is committed whenever the config is changed in any way.
57+
// The format is an 8-character hexadecimal string.
58+
string revision_id = 5 [
59+
(google.api.field_behavior) = IMMUTABLE,
60+
(google.api.field_behavior) = OUTPUT_ONLY
61+
];
62+
63+
// Allows clients to store small amounts of arbitrary data. Annotations must
64+
// follow the Kubernetes syntax.
65+
// The total size of all keys and values combined is limited to 256k.
66+
// Key can have 2 segments: prefix (optional) and name (required),
67+
// separated by a slash (/).
68+
// Prefix must be a DNS subdomain.
69+
// Name must be 63 characters or less, begin and end with alphanumerics,
70+
// with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
71+
map<string, string> annotations = 6;
72+
73+
// A user-settable field to provide a human-readable name to be used in user
74+
// interfaces.
75+
string display_name = 7;
76+
}
77+
78+
// A configuration to customize the generation of insights.
79+
// Eg, customizing the lookback period considered when generating a
80+
// insight.
81+
message InsightTypeGenerationConfig {
82+
// Parameters for this InsightTypeGenerationConfig. These configs can be used
83+
// by or are applied to all subtypes.
84+
google.protobuf.Struct params = 1;
85+
}

0 commit comments

Comments
 (0)