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 15syntax = "proto3"; 16 17package google.cloud.recommender.v1beta1; 18 19import "google/api/resource.proto"; 20import "google/protobuf/duration.proto"; 21import "google/protobuf/struct.proto"; 22import "google/protobuf/timestamp.proto"; 23 24option csharp_namespace = "Google.Cloud.Recommender.V1Beta1"; 25option go_package = "cloud.google.com/go/recommender/apiv1beta1/recommenderpb;recommenderpb"; 26option java_multiple_files = true; 27option java_package = "com.google.cloud.recommender.v1beta1"; 28option objc_class_prefix = "CREC"; 29 30// An insight along with the information used to derive the insight. The insight 31// may have associated recommendations as well. 32message Insight { 33 option (google.api.resource) = { 34 type: "recommender.googleapis.com/Insight" 35 pattern: "projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}" 36 pattern: "billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}" 37 pattern: "folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}" 38 pattern: "organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}" 39 }; 40 41 // Insight category. 42 enum Category { 43 // Unspecified category. 44 CATEGORY_UNSPECIFIED = 0; 45 46 // The insight is related to cost. 47 COST = 1; 48 49 // The insight is related to security. 50 SECURITY = 2; 51 52 // The insight is related to performance. 53 PERFORMANCE = 3; 54 55 // This insight is related to manageability. 56 MANAGEABILITY = 4; 57 } 58 59 // Insight severity levels. 60 enum Severity { 61 // Insight has unspecified severity. 62 SEVERITY_UNSPECIFIED = 0; 63 64 // Insight has low severity. 65 LOW = 1; 66 67 // Insight has medium severity. 68 MEDIUM = 2; 69 70 // Insight has high severity. 71 HIGH = 3; 72 73 // Insight has critical severity. 74 CRITICAL = 4; 75 } 76 77 // Reference to an associated recommendation. 78 message RecommendationReference { 79 // Recommendation resource name, e.g. 80 // projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] 81 string recommendation = 1; 82 } 83 84 // Name of the insight. 85 string name = 1; 86 87 // Free-form human readable summary in English. The maximum length is 500 88 // characters. 89 string description = 2; 90 91 // Fully qualified resource names that this insight is targeting. 92 repeated string target_resources = 9; 93 94 // Insight subtype. Insight content schema will be stable for a given subtype. 95 string insight_subtype = 10; 96 97 // A struct of custom fields to explain the insight. 98 // Example: "grantedPermissionsCount": "1000" 99 google.protobuf.Struct content = 3; 100 101 // Timestamp of the latest data used to generate the insight. 102 google.protobuf.Timestamp last_refresh_time = 4; 103 104 // Observation period that led to the insight. The source data used to 105 // generate the insight ends at last_refresh_time and begins at 106 // (last_refresh_time - observation_period). 107 google.protobuf.Duration observation_period = 5; 108 109 // Information state and metadata. 110 InsightStateInfo state_info = 6; 111 112 // Category being targeted by the insight. 113 Category category = 7; 114 115 // Insight's severity. 116 Severity severity = 15; 117 118 // Fingerprint of the Insight. Provides optimistic locking when updating 119 // states. 120 string etag = 11; 121 122 // Recommendations derived from this insight. 123 repeated RecommendationReference associated_recommendations = 8; 124} 125 126// Information related to insight state. 127message InsightStateInfo { 128 // Represents insight state. 129 enum State { 130 // Unspecified state. 131 STATE_UNSPECIFIED = 0; 132 133 // Insight is active. Content for ACTIVE insights can be updated by Google. 134 // ACTIVE insights can be marked DISMISSED OR ACCEPTED. 135 ACTIVE = 1; 136 137 // Some action has been taken based on this insight. Insights become 138 // accepted when a recommendation derived from the insight has been marked 139 // CLAIMED, SUCCEEDED, or FAILED. ACTIVE insights can also be marked 140 // ACCEPTED explicitly. Content for ACCEPTED insights is immutable. ACCEPTED 141 // insights can only be marked ACCEPTED (which may update state metadata). 142 ACCEPTED = 2; 143 144 // Insight is dismissed. Content for DISMISSED insights can be updated by 145 // Google. DISMISSED insights can be marked as ACTIVE. 146 DISMISSED = 3; 147 } 148 149 // Insight state. 150 State state = 1; 151 152 // A map of metadata for the state, provided by user or automations systems. 153 map<string, string> state_metadata = 2; 154} 155 156// The type of insight. 157message InsightType { 158 option (google.api.resource) = { 159 type: "recommender.googleapis.com/InsightType" 160 pattern: "projects/{project}/locations/{location}/insightTypes/{insight_type}" 161 pattern: "billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}" 162 pattern: "folders/{folder}/locations/{location}/insightTypes/{insight_type}" 163 pattern: "organizations/{organization}/locations/{location}/insightTypes/{insight_type}" 164 pattern: "insightTypes/{insight_type}" 165 }; 166 167 // The insight_type’s name in format insightTypes/{insight_type} 168 // eg: insightTypes/google.iam.policy.Insight 169 string name = 1; 170} 171