servicemesh.proto 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. // Copyright 2021 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.gkehub.servicemesh.v1alpha;
  16. import "google/api/field_behavior.proto";
  17. import "google/protobuf/struct.proto";
  18. import "google/api/annotations.proto";
  19. option csharp_namespace = "Google.Cloud.GkeHub.ServiceMesh.V1Alpha";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/gkehub/servicemesh/v1alpha;servicemesh";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "ServiceMeshProto";
  23. option java_package = "com.google.cloud.gkehub.servicemesh.v1alpha";
  24. option php_namespace = "Google\\Cloud\\GkeHub\\ServiceMesh\\V1alpha";
  25. option ruby_package = "Google::Cloud::GkeHub::ServiceMesh::V1alpha";
  26. // **Service Mesh**: State for the whole Hub, as analyzed by the Service Mesh
  27. // Hub Controller.
  28. message FeatureState {
  29. // Output only. Results of running Service Mesh analyzers.
  30. repeated AnalysisMessage analysis_messages = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  31. }
  32. // **Service Mesh**: State for a single Membership, as analyzed by the Service
  33. // Mesh Hub Controller.
  34. message MembershipState {
  35. // Output only. Results of running Service Mesh analyzers.
  36. repeated AnalysisMessage analysis_messages = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  37. }
  38. // AnalysisMessageBase describes some common information that is
  39. // needed for all messages.
  40. message AnalysisMessageBase {
  41. // A unique identifier for the type of message. Display_name is intended to be
  42. // human-readable, code is intended to be machine readable. There should be a
  43. // one-to-one mapping between display_name and code. (i.e. do not re-use
  44. // display_names or codes between message types.)
  45. // See istio.analysis.v1alpha1.AnalysisMessageBase.Type
  46. message Type {
  47. // A human-readable name for the message type. e.g. "InternalError",
  48. // "PodMissingProxy". This should be the same for all messages of the same
  49. // type. (This corresponds to the `name` field in open-source Istio.)
  50. string display_name = 1;
  51. // A 7 character code matching `^IST[0-9]{4}$` or `^ASM[0-9]{4}$`, intended
  52. // to uniquely identify the message type. (e.g. "IST0001" is mapped to the
  53. // "InternalError" message type.)
  54. string code = 2;
  55. }
  56. // The values here are chosen so that more severe messages get sorted higher,
  57. // as well as leaving space in between to add more later
  58. // See istio.analysis.v1alpha1.AnalysisMessageBase.Level
  59. enum Level {
  60. // Illegal. Same istio.analysis.v1alpha1.AnalysisMessageBase.Level.UNKNOWN.
  61. LEVEL_UNSPECIFIED = 0;
  62. // ERROR represents a misconfiguration that must be fixed.
  63. ERROR = 3;
  64. // WARNING represents a misconfiguration that should be fixed.
  65. WARNING = 8;
  66. // INFO represents an informational finding.
  67. INFO = 12;
  68. }
  69. // Represents the specific type of a message.
  70. Type type = 1;
  71. // Represents how severe a message is.
  72. Level level = 2;
  73. // A url pointing to the Service Mesh or Istio documentation for this specific
  74. // error type.
  75. string documentation_url = 3;
  76. }
  77. // AnalysisMessage is a single message produced by an analyzer, and
  78. // it used to communicate to the end user about the state of their Service
  79. // Mesh configuration.
  80. message AnalysisMessage {
  81. // Details common to all types of Istio and ServiceMesh analysis messages.
  82. AnalysisMessageBase message_base = 1;
  83. // A human readable description of what the error means. It is suitable for
  84. // non-internationalize display purposes.
  85. string description = 2;
  86. // A list of strings specifying the resource identifiers that were the cause
  87. // of message generation.
  88. // A "path" here may be:
  89. // * MEMBERSHIP_ID if the cause is a specific member cluster
  90. // * MEMBERSHIP_ID/(NAMESPACE\/)?RESOURCETYPE/NAME if the cause is a resource
  91. // in a cluster
  92. repeated string resource_paths = 3;
  93. // A UI can combine these args with a template (based on message_base.type)
  94. // to produce an internationalized message.
  95. google.protobuf.Struct args = 4;
  96. }