feature.proto 7.5 KB

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