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.v1beta; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/cloud/gkehub/v1beta/feature.proto"; 23import "google/longrunning/operations.proto"; 24import "google/protobuf/field_mask.proto"; 25import "google/protobuf/timestamp.proto"; 26 27option csharp_namespace = "Google.Cloud.GkeHub.V1Beta"; 28option go_package = "cloud.google.com/go/gkehub/apiv1beta/gkehubpb;gkehubpb"; 29option java_multiple_files = true; 30option java_outer_classname = "ServiceProto"; 31option java_package = "com.google.cloud.gkehub.v1beta"; 32option php_namespace = "Google\\Cloud\\GkeHub\\V1beta"; 33option ruby_package = "Google::Cloud::GkeHub::V1beta"; 34 35// The GKE Hub service handles the registration of many Kubernetes clusters to 36// Google Cloud, and the management of multi-cluster features over those 37// clusters. 38// 39// The GKE Hub service operates on the following resources: 40// 41// * [Membership][google.cloud.gkehub.v1beta.Membership] 42// * [Feature][google.cloud.gkehub.v1beta.Feature] 43// 44// GKE Hub is currently only available in the global region. 45// 46// **Membership management may be non-trivial:** it is recommended to use one 47// of the Google-provided client libraries or tools where possible when working 48// with Membership resources. 49service GkeHub { 50 option (google.api.default_host) = "gkehub.googleapis.com"; 51 option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; 52 53 // Lists Features in a given project and location. 54 rpc ListFeatures(ListFeaturesRequest) returns (ListFeaturesResponse) { 55 option (google.api.http) = { 56 get: "/v1beta/{parent=projects/*/locations/*}/features" 57 }; 58 option (google.api.method_signature) = "parent"; 59 } 60 61 // Gets details of a single Feature. 62 rpc GetFeature(GetFeatureRequest) returns (Feature) { 63 option (google.api.http) = { 64 get: "/v1beta/{name=projects/*/locations/*/features/*}" 65 }; 66 option (google.api.method_signature) = "name"; 67 } 68 69 // Adds a new Feature. 70 rpc CreateFeature(CreateFeatureRequest) returns (google.longrunning.Operation) { 71 option (google.api.http) = { 72 post: "/v1beta/{parent=projects/*/locations/*}/features" 73 body: "resource" 74 }; 75 option (google.api.method_signature) = "parent,resource,feature_id"; 76 option (google.longrunning.operation_info) = { 77 response_type: "Feature" 78 metadata_type: "OperationMetadata" 79 }; 80 } 81 82 // Removes a Feature. 83 rpc DeleteFeature(DeleteFeatureRequest) returns (google.longrunning.Operation) { 84 option (google.api.http) = { 85 delete: "/v1beta/{name=projects/*/locations/*/features/*}" 86 }; 87 option (google.api.method_signature) = "name"; 88 option (google.longrunning.operation_info) = { 89 response_type: "google.protobuf.Empty" 90 metadata_type: "OperationMetadata" 91 }; 92 } 93 94 // Updates an existing Feature. 95 rpc UpdateFeature(UpdateFeatureRequest) returns (google.longrunning.Operation) { 96 option (google.api.http) = { 97 patch: "/v1beta/{name=projects/*/locations/*/features/*}" 98 body: "resource" 99 }; 100 option (google.api.method_signature) = "name,resource,update_mask"; 101 option (google.longrunning.operation_info) = { 102 response_type: "Feature" 103 metadata_type: "OperationMetadata" 104 }; 105 } 106} 107 108// Request message for `GkeHub.ListFeatures` method. 109message ListFeaturesRequest { 110 // The parent (project and location) where the Features will be listed. 111 // Specified in the format `projects/*/locations/*`. 112 string parent = 1; 113 114 // When requesting a 'page' of resources, `page_size` specifies number of 115 // resources to return. If unspecified or set to 0, all resources will 116 // be returned. 117 int32 page_size = 2; 118 119 // Token returned by previous call to `ListFeatures` which 120 // specifies the position in the list from where to continue listing the 121 // resources. 122 string page_token = 3; 123 124 // Lists Features that match the filter expression, following the syntax 125 // outlined in https://google.aip.dev/160. 126 // 127 // Examples: 128 // 129 // - Feature with the name "servicemesh" in project "foo-proj": 130 // 131 // name = "projects/foo-proj/locations/global/features/servicemesh" 132 // 133 // - Features that have a label called `foo`: 134 // 135 // labels.foo:* 136 // 137 // - Features that have a label called `foo` whose value is `bar`: 138 // 139 // labels.foo = bar 140 string filter = 4; 141 142 // One or more fields to compare and use to sort the output. 143 // See https://google.aip.dev/132#ordering. 144 string order_by = 5; 145} 146 147// Response message for the `GkeHub.ListFeatures` method. 148message ListFeaturesResponse { 149 // The list of matching Features 150 repeated Feature resources = 1; 151 152 // A token to request the next page of resources from the 153 // `ListFeatures` method. The value of an empty string means 154 // that there are no more resources to return. 155 string next_page_token = 2; 156} 157 158// Request message for `GkeHub.GetFeature` method. 159message GetFeatureRequest { 160 // The Feature resource name in the format 161 // `projects/*/locations/*/features/*` 162 string name = 1; 163} 164 165// Request message for the `GkeHub.CreateFeature` method. 166message CreateFeatureRequest { 167 // The parent (project and location) where the Feature will be created. 168 // Specified in the format `projects/*/locations/*`. 169 string parent = 1; 170 171 // The ID of the feature to create. 172 string feature_id = 2; 173 174 // The Feature resource to create. 175 Feature resource = 3; 176 177 // Optional. A request ID to identify requests. Specify a unique request ID 178 // so that if you must retry your request, the server will know to ignore 179 // the request if it has already been completed. The server will guarantee 180 // that for at least 60 minutes after the first request. 181 // 182 // For example, consider a situation where you make an initial request and 183 // the request times out. If you make the request again with the same request 184 // ID, the server can check if original operation with the same request ID 185 // was received, and if so, will ignore the second request. This prevents 186 // clients from accidentally creating duplicate commitments. 187 // 188 // The request ID must be a valid UUID with the exception that zero UUID is 189 // not supported (00000000-0000-0000-0000-000000000000). 190 string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; 191} 192 193// Request message for `GkeHub.DeleteFeature` method. 194message DeleteFeatureRequest { 195 // The Feature resource name in the format 196 // `projects/*/locations/*/features/*`. 197 string name = 1; 198 199 // If set to true, the delete will ignore any outstanding resources for 200 // this Feature (that is, `FeatureState.has_resources` is set to true). These 201 // resources will NOT be cleaned up or modified in any way. 202 bool force = 2; 203 204 // Optional. A request ID to identify requests. Specify a unique request ID 205 // so that if you must retry your request, the server will know to ignore 206 // the request if it has already been completed. The server will guarantee 207 // that for at least 60 minutes after the first request. 208 // 209 // For example, consider a situation where you make an initial request and 210 // the request times out. If you make the request again with the same request 211 // ID, the server can check if original operation with the same request ID 212 // was received, and if so, will ignore the second request. This prevents 213 // clients from accidentally creating duplicate commitments. 214 // 215 // The request ID must be a valid UUID with the exception that zero UUID is 216 // not supported (00000000-0000-0000-0000-000000000000). 217 string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; 218} 219 220// Request message for `GkeHub.UpdateFeature` method. 221message UpdateFeatureRequest { 222 // The Feature resource name in the format 223 // `projects/*/locations/*/features/*`. 224 string name = 1; 225 226 // Mask of fields to update. 227 google.protobuf.FieldMask update_mask = 2; 228 229 // Only fields specified in update_mask are updated. 230 // If you specify a field in the update_mask but don't specify its value here 231 // that field will be deleted. 232 // If you are updating a map field, set the value of a key to null or empty 233 // string to delete the key from the map. It's not possible to update a key's 234 // value to the empty string. 235 // If you specify the update_mask to be a special path "*", fully replaces all 236 // user-modifiable fields to match `resource`. 237 Feature resource = 3; 238 239 // Optional. A request ID to identify requests. Specify a unique request ID 240 // so that if you must retry your request, the server will know to ignore 241 // the request if it has already been completed. The server will guarantee 242 // that for at least 60 minutes after the first request. 243 // 244 // For example, consider a situation where you make an initial request and 245 // the request times out. If you make the request again with the same request 246 // ID, the server can check if original operation with the same request ID 247 // was received, and if so, will ignore the second request. This prevents 248 // clients from accidentally creating duplicate commitments. 249 // 250 // The request ID must be a valid UUID with the exception that zero UUID is 251 // not supported (00000000-0000-0000-0000-000000000000). 252 string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; 253} 254 255// Represents the metadata of the long-running operation. 256message OperationMetadata { 257 // Output only. The time the operation was created. 258 google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 259 260 // Output only. The time the operation finished running. 261 google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 262 263 // Output only. Server-defined resource path for the target of the operation. 264 string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 265 266 // Output only. Name of the verb executed by the operation. 267 string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; 268 269 // Output only. Human-readable status of the operation, if any. 270 string status_detail = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; 271 272 // Output only. Identifies whether the user has requested cancellation 273 // of the operation. Operations that have successfully been cancelled 274 // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, 275 // corresponding to `Code.CANCELLED`. 276 bool cancel_requested = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 277 278 // Output only. API version used to start the operation. 279 string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; 280} 281