service.proto 11 KB

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