feature.proto 7.7 KB

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