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