feature.proto 7.7 KB

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