insight.proto 5.1 KB

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