servicemesh.proto 4.4 KB

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