feature.proto 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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.v1alpha;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/gkehub/v1alpha/cloudauditlogging/cloudauditlogging.proto";
  19. import "google/cloud/gkehub/v1alpha/configmanagement/configmanagement.proto";
  20. import "google/cloud/gkehub/v1alpha/metering/metering.proto";
  21. import "google/cloud/gkehub/v1alpha/multiclusteringress/multiclusteringress.proto";
  22. import "google/cloud/gkehub/v1alpha/servicemesh/servicemesh.proto";
  23. import "google/protobuf/timestamp.proto";
  24. import "google/api/annotations.proto";
  25. option csharp_namespace = "Google.Cloud.GkeHub.V1Alpha";
  26. option go_package = "google.golang.org/genproto/googleapis/cloud/gkehub/v1alpha;gkehub";
  27. option java_multiple_files = true;
  28. option java_outer_classname = "FeatureProto";
  29. option java_package = "com.google.cloud.gkehub.v1alpha";
  30. option php_namespace = "Google\\Cloud\\GkeHub\\V1alpha";
  31. option ruby_package = "Google::Cloud::GkeHub::V1alpha";
  32. // Feature represents the settings and status of any Hub Feature.
  33. message Feature {
  34. option (google.api.resource) = {
  35. type: "gkehub.googleapis.com/Feature"
  36. pattern: "projects/{project}/locations/{location}/features/{feature}"
  37. };
  38. // Output only. The full, unique name of this Feature resource in the format
  39. // `projects/*/locations/*/features/*`.
  40. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  41. // GCP labels for this Feature.
  42. map<string, string> labels = 2;
  43. // Output only. State of the Feature resource itself.
  44. FeatureResourceState resource_state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  45. // Optional. Hub-wide Feature configuration. If this Feature does not support any
  46. // Hub-wide configuration, this field may be unused.
  47. CommonFeatureSpec spec = 4 [(google.api.field_behavior) = OPTIONAL];
  48. // Optional. Membership-specific configuration for this Feature. If this Feature does
  49. // not support any per-Membership configuration, this field may be unused.
  50. //
  51. // The keys indicate which Membership the configuration is for, in the form:
  52. //
  53. // projects/{p}/locations/{l}/memberships/{m}
  54. //
  55. // Where {p} is the project, {l} is a valid location and {m} is a valid
  56. // Membership in this project at that location. {p} WILL match the Feature's
  57. // project.
  58. //
  59. // {p} will always be returned as the project number, but the project ID is
  60. // also accepted during input. If the same Membership is specified in the map
  61. // twice (using the project ID form, and the project number form), exactly
  62. // ONE of the entries will be saved, with no guarantees as to which. For this
  63. // reason, it is recommended the same format be used for all entries when
  64. // mutating a Feature.
  65. map<string, MembershipFeatureSpec> membership_specs = 5 [(google.api.field_behavior) = OPTIONAL];
  66. // Output only. The Hub-wide Feature state.
  67. CommonFeatureState state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  68. // Output only. Membership-specific Feature status. If this Feature does
  69. // report any per-Membership status, this field may be unused.
  70. //
  71. // The keys indicate which Membership the state is for, in the form:
  72. //
  73. // projects/{p}/locations/{l}/memberships/{m}
  74. //
  75. // Where {p} is the project number, {l} is a valid location and {m} is a valid
  76. // Membership in this project at that location. {p} MUST match the Feature's
  77. // project number.
  78. map<string, MembershipFeatureState> membership_states = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  79. // Output only. When the Feature resource was created.
  80. google.protobuf.Timestamp create_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  81. // Output only. When the Feature resource was last updated.
  82. google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  83. // Output only. When the Feature resource was deleted.
  84. google.protobuf.Timestamp delete_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  85. }
  86. // FeatureResourceState describes the state of a Feature *resource* in the
  87. // GkeHub API. See `FeatureState` for the "running state" of the Feature in the
  88. // Hub and across Memberships.
  89. message FeatureResourceState {
  90. // State describes the lifecycle status of a Feature.
  91. enum State {
  92. // State is unknown or not set.
  93. STATE_UNSPECIFIED = 0;
  94. // The Feature is being enabled, and the Feature resource is being created.
  95. // Once complete, the corresponding Feature will be enabled in this Hub.
  96. ENABLING = 1;
  97. // The Feature is enabled in this Hub, and the Feature resource is fully
  98. // available.
  99. ACTIVE = 2;
  100. // The Feature is being disabled in this Hub, and the Feature resource
  101. // is being deleted.
  102. DISABLING = 3;
  103. // The Feature resource is being updated.
  104. UPDATING = 4;
  105. // The Feature resource is being updated by the Hub Service.
  106. SERVICE_UPDATING = 5;
  107. }
  108. // The current state of the Feature resource in the Hub API.
  109. State state = 1;
  110. }
  111. // FeatureState describes the high-level state of a Feature. It may be used to
  112. // describe a Feature's state at the environ-level, or per-membershop, depending
  113. // on the context.
  114. message FeatureState {
  115. // Code represents a machine-readable, high-level status of the Feature.
  116. enum Code {
  117. // Unknown or not set.
  118. CODE_UNSPECIFIED = 0;
  119. // The Feature is operating normally.
  120. OK = 1;
  121. // The Feature has encountered an issue, and is operating in a degraded
  122. // state. The Feature may need intervention to return to normal operation.
  123. // See the description and any associated Feature-specific details for more
  124. // information.
  125. WARNING = 2;
  126. // The Feature is not operating or is in a severely degraded state.
  127. // The Feature may need intervention to return to normal operation.
  128. // See the description and any associated Feature-specific details for more
  129. // information.
  130. ERROR = 3;
  131. }
  132. // The high-level, machine-readable status of this Feature.
  133. Code code = 1;
  134. // A human-readable description of the current status.
  135. string description = 2;
  136. // The time this status and any related Feature-specific details were updated.
  137. google.protobuf.Timestamp update_time = 3;
  138. }
  139. // CommonFeatureSpec contains Hub-wide configuration information
  140. message CommonFeatureSpec {
  141. oneof feature_spec {
  142. // Multicluster Ingress-specific spec.
  143. google.cloud.gkehub.multiclusteringress.v1alpha.FeatureSpec multiclusteringress = 102;
  144. // Cloud Audit Logging-specific spec.
  145. google.cloud.gkehub.cloudauditlogging.v1alpha.FeatureSpec cloudauditlogging = 108;
  146. }
  147. }
  148. // CommonFeatureState contains Hub-wide Feature status information.
  149. message CommonFeatureState {
  150. oneof feature_state {
  151. // Service Mesh-specific state.
  152. google.cloud.gkehub.servicemesh.v1alpha.FeatureState servicemesh = 100;
  153. }
  154. // Output only. The "running state" of the Feature in this Hub.
  155. FeatureState state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  156. }
  157. // MembershipFeatureSpec contains configuration information for a single
  158. // Membership.
  159. message MembershipFeatureSpec {
  160. oneof feature_spec {
  161. // Config Management-specific spec.
  162. google.cloud.gkehub.configmanagement.v1alpha.MembershipSpec configmanagement = 106;
  163. }
  164. }
  165. // MembershipFeatureState contains Feature status information for a single
  166. // Membership.
  167. message MembershipFeatureState {
  168. oneof feature_state {
  169. // Service Mesh-specific state.
  170. google.cloud.gkehub.servicemesh.v1alpha.MembershipState servicemesh = 100;
  171. // Metering-specific spec.
  172. google.cloud.gkehub.metering.v1alpha.MembershipState metering = 104;
  173. // Config Management-specific state.
  174. google.cloud.gkehub.configmanagement.v1alpha.MembershipState configmanagement = 106;
  175. }
  176. // The high-level state of this Feature for a single membership.
  177. FeatureState state = 1;
  178. }