feature.proto 8.2 KB

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