insight.proto 5.4 KB

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