insight.proto 5.4 KB

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