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