1- // Copyright 2019 Google LLC.
1+ // Copyright 2020 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.
1111// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212// See the License for the specific language governing permissions and
1313// limitations under the License.
14- //
1514
1615syntax = "proto3" ;
1716
@@ -21,6 +20,7 @@ import "google/api/annotations.proto";
2120import "google/api/client.proto" ;
2221import "google/api/field_behavior.proto" ;
2322import "google/api/resource.proto" ;
23+ import "google/cloud/recommender/v1/insight.proto" ;
2424import "google/cloud/recommender/v1/recommendation.proto" ;
2525
2626option csharp_namespace = "Google.Cloud.Recommender.V1" ;
@@ -30,14 +30,46 @@ option java_outer_classname = "RecommenderProto";
3030option java_package = "com.google.cloud.recommender.v1" ;
3131option objc_class_prefix = "CREC" ;
3232
33- // Provides recommendations for cloud customers for various categories like
34- // performance optimization, cost savings, reliability, feature discovery, etc.
35- // These recommendations are generated automatically based on analysis of user
36- // resources, configuration and monitoring metrics.
33+ // Provides insights and recommendations for cloud customers for various
34+ // categories like performance optimization, cost savings, reliability, feature
35+ // discovery, etc. Insights and recommendations are generated automatically
36+ // based on analysis of user resources, configuration and monitoring metrics.
3737service Recommender {
3838 option (google.api.default_host ) = "recommender.googleapis.com" ;
3939 option (google.api.oauth_scopes ) = "https://www.googleapis.com/auth/cloud-platform" ;
4040
41+ // Lists insights for a Cloud project. Requires the recommender.*.list IAM
42+ // permission for the specified insight type.
43+ rpc ListInsights (ListInsightsRequest ) returns (ListInsightsResponse ) {
44+ option (google.api.http ) = {
45+ get : "/v1/{parent=projects/*/locations/*/insightTypes/*}/insights"
46+ };
47+ option (google.api.method_signature ) = "parent" ;
48+ }
49+
50+ // Gets the requested insight. Requires the recommender.*.get IAM permission
51+ // for the specified insight type.
52+ rpc GetInsight (GetInsightRequest ) returns (Insight ) {
53+ option (google.api.http ) = {
54+ get : "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}"
55+ };
56+ option (google.api.method_signature ) = "name" ;
57+ }
58+
59+ // Marks the Insight State as Accepted. Users can use this method to
60+ // indicate to the Recommender API that they have applied some action based
61+ // on the insight. This stops the insight content from being updated.
62+ //
63+ // MarkInsightAccepted can be applied to insights in ACTIVE state. Requires
64+ // the recommender.*.update IAM permission for the specified insight.
65+ rpc MarkInsightAccepted (MarkInsightAcceptedRequest ) returns (Insight ) {
66+ option (google.api.http ) = {
67+ post : "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted"
68+ body : "*"
69+ };
70+ option (google.api.method_signature ) = "name,state_metadata,etag" ;
71+ }
72+
4173 // Lists recommendations for a Cloud project. Requires the recommender.*.list
4274 // IAM permission for the specified recommender.
4375 rpc ListRecommendations (ListRecommendationsRequest ) returns (ListRecommendationsResponse ) {
@@ -57,10 +89,10 @@ service Recommender {
5789 option (google.api.method_signature ) = "name" ;
5890 }
5991
60- // Mark the Recommendation State as Claimed. Users can use this method to
92+ // Marks the Recommendation State as Claimed. Users can use this method to
6193 // indicate to the Recommender API that they are starting to apply the
6294 // recommendation themselves. This stops the recommendation content from being
63- // updated.
95+ // updated. Associated insights are frozen and placed in the ACCEPTED state.
6496 //
6597 // MarkRecommendationClaimed can be applied to recommendations in CLAIMED,
6698 // SUCCEEDED, FAILED, or ACTIVE state.
@@ -75,10 +107,11 @@ service Recommender {
75107 option (google.api.method_signature ) = "name,state_metadata,etag" ;
76108 }
77109
78- // Mark the Recommendation State as Succeeded. Users can use this method to
110+ // Marks the Recommendation State as Succeeded. Users can use this method to
79111 // indicate to the Recommender API that they have applied the recommendation
80112 // themselves, and the operation was successful. This stops the recommendation
81- // content from being updated.
113+ // content from being updated. Associated insights are frozen and placed in
114+ // the ACCEPTED state.
82115 //
83116 // MarkRecommendationSucceeded can be applied to recommendations in ACTIVE,
84117 // CLAIMED, SUCCEEDED, or FAILED state.
@@ -93,10 +126,11 @@ service Recommender {
93126 option (google.api.method_signature ) = "name,state_metadata,etag" ;
94127 }
95128
96- // Mark the Recommendation State as Failed. Users can use this method to
129+ // Marks the Recommendation State as Failed. Users can use this method to
97130 // indicate to the Recommender API that they have applied the recommendation
98131 // themselves, and the operation failed. This stops the recommendation content
99- // from being updated.
132+ // from being updated. Associated insights are frozen and placed in the
133+ // ACCEPTED state.
100134 //
101135 // MarkRecommendationFailed can be applied to recommendations in ACTIVE,
102136 // CLAIMED, SUCCEEDED, or FAILED state.
@@ -112,6 +146,79 @@ service Recommender {
112146 }
113147}
114148
149+ // Request for the `ListInsights` method.
150+ message ListInsightsRequest {
151+ // Required. The container resource on which to execute the request.
152+ // Acceptable formats:
153+ //
154+ // 1.
155+ // "projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]",
156+ //
157+ // LOCATION here refers to GCP Locations:
158+ // https://cloud.google.com/about/locations/
159+ string parent = 1 [
160+ (google.api.field_behavior ) = REQUIRED ,
161+ (google.api.resource_reference ) = {
162+ type : "recommender.googleapis.com/InsightType"
163+ }
164+ ];
165+
166+ // Optional. The maximum number of results to return from this request. Non-positive
167+ // values are ignored. If not specified, the server will determine the number
168+ // of results to return.
169+ int32 page_size = 2 [(google.api.field_behavior ) = OPTIONAL ];
170+
171+ // Optional. If present, retrieves the next batch of results from the preceding call to
172+ // this method. `page_token` must be the value of `next_page_token` from the
173+ // previous response. The values of other method parameters must be identical
174+ // to those in the previous call.
175+ string page_token = 3 [(google.api.field_behavior ) = OPTIONAL ];
176+
177+ // Optional. Filter expression to restrict the insights returned. Supported
178+ // filter fields: state
179+ // Eg: `state:"DISMISSED" or state:"ACTIVE"
180+ string filter = 4 [(google.api.field_behavior ) = OPTIONAL ];
181+ }
182+
183+ // Response to the `ListInsights` method.
184+ message ListInsightsResponse {
185+ // The set of insights for the `parent` resource.
186+ repeated Insight insights = 1 ;
187+
188+ // A token that can be used to request the next page of results. This field is
189+ // empty if there are no additional results.
190+ string next_page_token = 2 ;
191+ }
192+
193+ // Request to the `GetInsight` method.
194+ message GetInsightRequest {
195+ // Required. Name of the insight.
196+ string name = 1 [
197+ (google.api.field_behavior ) = REQUIRED ,
198+ (google.api.resource_reference ) = {
199+ type : "recommender.googleapis.com/Insight"
200+ }
201+ ];
202+ }
203+
204+ // Request for the `MarkInsightAccepted` method.
205+ message MarkInsightAcceptedRequest {
206+ // Required. Name of the insight.
207+ string name = 1 [
208+ (google.api.field_behavior ) = REQUIRED ,
209+ (google.api.resource_reference ) = {
210+ type : "recommender.googleapis.com/Insight"
211+ }
212+ ];
213+
214+ // Optional. State properties user wish to include with this state. Full replace of the
215+ // current state_metadata.
216+ map <string , string > state_metadata = 2 [(google.api.field_behavior ) = OPTIONAL ];
217+
218+ // Required. Fingerprint of the Insight. Provides optimistic locking.
219+ string etag = 3 [(google.api.field_behavior ) = REQUIRED ];
220+ }
221+
115222// Request for the `ListRecommendations` method.
116223message ListRecommendationsRequest {
117224 // Required. The container resource on which to execute the request.
0 commit comments