insight.proto 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. // Copyright 2020 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}"
  40. pattern: "organizations/{organization}/locations/{location}/insightTypes/{insight_type}"
  41. };
  42. // Reference to an associated recommendation.
  43. message RecommendationReference {
  44. // Recommendation resource name, e.g.
  45. // projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID]
  46. string recommendation = 1;
  47. }
  48. // Insight category.
  49. enum Category {
  50. // Unspecified category.
  51. CATEGORY_UNSPECIFIED = 0;
  52. // The insight is related to cost.
  53. COST = 1;
  54. // The insight is related to security.
  55. SECURITY = 2;
  56. // The insight is related to performance.
  57. PERFORMANCE = 3;
  58. // This insight is related to manageability.
  59. MANAGEABILITY = 4;
  60. }
  61. // Name of the insight.
  62. string name = 1;
  63. // Free-form human readable summary in English. The maximum length is 500
  64. // characters.
  65. string description = 2;
  66. // Fully qualified resource names that this insight is targeting.
  67. repeated string target_resources = 9;
  68. // Insight subtype. Insight content schema will be stable for a given subtype.
  69. string insight_subtype = 10;
  70. // A struct of custom fields to explain the insight.
  71. // Example: "grantedPermissionsCount": "1000"
  72. google.protobuf.Struct content = 3;
  73. // Timestamp of the latest data used to generate the insight.
  74. google.protobuf.Timestamp last_refresh_time = 4;
  75. // Observation period that led to the insight. The source data used to
  76. // generate the insight ends at last_refresh_time and begins at
  77. // (last_refresh_time - observation_period).
  78. google.protobuf.Duration observation_period = 5;
  79. // Information state and metadata.
  80. InsightStateInfo state_info = 6;
  81. // Category being targeted by the insight.
  82. Category category = 7;
  83. // Fingerprint of the Insight. Provides optimistic locking when updating
  84. // states.
  85. string etag = 11;
  86. // Recommendations derived from this insight.
  87. repeated RecommendationReference associated_recommendations = 8;
  88. }
  89. // Information related to insight state.
  90. message InsightStateInfo {
  91. // Represents insight state.
  92. enum State {
  93. // Unspecified state.
  94. STATE_UNSPECIFIED = 0;
  95. // Insight is active. Content for ACTIVE insights can be updated by Google.
  96. // ACTIVE insights can be marked DISMISSED OR ACCEPTED.
  97. ACTIVE = 1;
  98. // Some action has been taken based on this insight. Insights become
  99. // accepted when a recommendation derived from the insight has been marked
  100. // CLAIMED, SUCCEEDED, or FAILED. ACTIVE insights can also be marked
  101. // ACCEPTED explicitly. Content for ACCEPTED insights is immutable. ACCEPTED
  102. // insights can only be marked ACCEPTED (which may update state metadata).
  103. ACCEPTED = 2;
  104. // Insight is dismissed. Content for DISMISSED insights can be updated by
  105. // Google. DISMISSED insights can be marked as ACTIVE.
  106. DISMISSED = 3;
  107. }
  108. // Insight state.
  109. State state = 1;
  110. // A map of metadata for the state, provided by user or automations systems.
  111. map<string, string> state_metadata = 2;
  112. }