service.proto 11 KB

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