Skip to content

Commit abe82f8

Browse files
Google APIscopybara-github
authored andcommitted
feat: introduce Long-Running Operations (LRO) for KMS
PiperOrigin-RevId: 631049366
1 parent 245c0f5 commit abe82f8

5 files changed

Lines changed: 43 additions & 24 deletions

File tree

google/cloud/kms/v1/BUILD.bazel

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
1-
load("@rules_proto//proto:defs.bzl", "proto_library")
1+
# This file was automatically generated by BuildFileGenerator
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
3+
4+
# Most of the manual changes to this file will be overwritten.
5+
# It's **only** allowed to change the following rule attribute values:
6+
# - names of *_gapic_assembly_* rules
7+
# - certain parameters of *_gapic_library rules, including but not limited to:
8+
# * extra_protoc_parameters
9+
# * extra_protoc_file_parameters
10+
# The complete list of preserved parameters can be found in the source code.
11+
12+
# buildifier: disable=load-on-top
213

314
# This is an API workspace, having public visibility by default makes perfect sense.
415
package(default_visibility = ["//visibility:public"])
516

6-
# Reading the default service config is useful for custom gRPC clients.
7-
exports_files(["cloudkms_grpc_service_config.json"])
8-
917
##############################################################################
1018
# Common
1119
##############################################################################
12-
# buildifier: disable=load-on-top
20+
# buildifier: disable=same-origin-load
1321
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
22+
load("@rules_proto//proto:defs.bzl", "proto_library")
1423

1524
proto_library(
1625
name = "kms_proto",
@@ -24,9 +33,9 @@ proto_library(
2433
"//google/api:client_proto",
2534
"//google/api:field_behavior_proto",
2635
"//google/api:resource_proto",
36+
"//google/longrunning:operations_proto",
2737
"@com_google_protobuf//:duration_proto",
2838
"@com_google_protobuf//:field_mask_proto",
29-
"@com_google_protobuf//:struct_proto",
3039
"@com_google_protobuf//:timestamp_proto",
3140
"@com_google_protobuf//:wrappers_proto",
3241
],
@@ -39,14 +48,12 @@ proto_library_with_info(
3948
"//google/cloud:common_resources_proto",
4049
"//google/cloud/location:location_proto",
4150
"//google/iam/v1:iam_policy_proto",
42-
"//google/iam/v1:policy_proto",
4351
],
4452
)
4553

4654
##############################################################################
4755
# Java
4856
##############################################################################
49-
# buildifier: disable=load-on-top
5057
# buildifier: disable=same-origin-load
5158
load(
5259
"@com_google_googleapis_imports//:imports.bzl",
@@ -71,6 +78,7 @@ java_grpc_library(
7178
java_gapic_library(
7279
name = "kms_java_gapic",
7380
srcs = [":kms_proto_with_info"],
81+
gapic_yaml = None,
7482
grpc_service_config = "cloudkms_grpc_service_config.json",
7583
rest_numeric_enums = True,
7684
service_yaml = "cloudkms_v1.yaml",
@@ -82,6 +90,7 @@ java_gapic_library(
8290
transport = "grpc+rest",
8391
deps = [
8492
":kms_java_proto",
93+
"//google/api:api_java_proto",
8594
"//google/cloud/location:location_java_proto",
8695
"//google/iam/v1:iam_java_proto",
8796
],
@@ -90,6 +99,8 @@ java_gapic_library(
9099
java_gapic_test(
91100
name = "kms_java_gapic_test_suite",
92101
test_classes = [
102+
"com.google.cloud.kms.v1.EkmServiceClientHttpJsonTest",
103+
"com.google.cloud.kms.v1.EkmServiceClientTest",
93104
"com.google.cloud.kms.v1.KeyManagementServiceClientHttpJsonTest",
94105
"com.google.cloud.kms.v1.KeyManagementServiceClientTest",
95106
],
@@ -112,7 +123,6 @@ java_gapic_assembly_gradle_pkg(
112123
##############################################################################
113124
# Go
114125
##############################################################################
115-
# buildifier: disable=load-on-top
116126
# buildifier: disable=same-origin-load
117127
load(
118128
"@com_google_googleapis_imports//:imports.bzl",
@@ -128,7 +138,7 @@ go_proto_library(
128138
protos = [":kms_proto"],
129139
deps = [
130140
"//google/api:annotations_go_proto",
131-
"//google/iam/v1:iam_go_proto",
141+
"//google/longrunning:longrunning_go_proto",
132142
],
133143
)
134144

@@ -146,6 +156,9 @@ go_gapic_library(
146156
":kms_go_proto",
147157
"//google/cloud/location:location_go_proto",
148158
"//google/iam/v1:iam_go_proto",
159+
"//google/longrunning:longrunning_go_proto",
160+
"@com_google_cloud_go_longrunning//:go_default_library",
161+
"@com_google_cloud_go_longrunning//autogen:go_default_library",
149162
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
150163
],
151164
)
@@ -155,6 +168,7 @@ go_gapic_assembly_pkg(
155168
name = "gapi-cloud-kms-v1-go",
156169
deps = [
157170
":kms_go_gapic",
171+
":kms_go_gapic_srcjar-metadata.srcjar",
158172
":kms_go_gapic_srcjar-snippets.srcjar",
159173
":kms_go_gapic_srcjar-test.srcjar",
160174
":kms_go_proto",
@@ -164,7 +178,6 @@ go_gapic_assembly_pkg(
164178
##############################################################################
165179
# Python
166180
##############################################################################
167-
# buildifier: disable=load-on-top
168181
# buildifier: disable=same-origin-load
169182
load(
170183
"@com_google_googleapis_imports//:imports.bzl",
@@ -190,7 +203,6 @@ py_gapic_library(
190203
transport = "grpc+rest",
191204
deps = [
192205
"//google/iam/v1:iam_policy_py_proto",
193-
"//google/iam/v1:policy_py_proto",
194206
],
195207
)
196208

@@ -204,6 +216,7 @@ py_test(
204216
deps = [":kms_py_gapic"],
205217
)
206218

219+
# Open Source Packages
207220
py_gapic_assembly_pkg(
208221
name = "kms-v1-py",
209222
deps = [
@@ -214,7 +227,6 @@ py_gapic_assembly_pkg(
214227
##############################################################################
215228
# PHP
216229
##############################################################################
217-
# buildifier: disable=load-on-top
218230
# buildifier: disable=same-origin-load
219231
load(
220232
"@com_google_googleapis_imports//:imports.bzl",
@@ -231,11 +243,14 @@ php_proto_library(
231243
php_gapic_library(
232244
name = "kms_php_gapic",
233245
srcs = [":kms_proto_with_info"],
246+
grpc_service_config = "cloudkms_grpc_service_config.json",
234247
migration_mode = "MIGRATING",
235248
rest_numeric_enums = True,
236249
service_yaml = "cloudkms_v1.yaml",
237250
transport = "grpc+rest",
238-
deps = [":kms_php_proto"],
251+
deps = [
252+
":kms_php_proto",
253+
],
239254
)
240255

241256
# Open Source Packages
@@ -250,7 +265,6 @@ php_gapic_assembly_pkg(
250265
##############################################################################
251266
# Node.js
252267
##############################################################################
253-
# buildifier: disable=load-on-top
254268
# buildifier: disable=same-origin-load
255269
load(
256270
"@com_google_googleapis_imports//:imports.bzl",
@@ -282,7 +296,6 @@ nodejs_gapic_assembly_pkg(
282296
##############################################################################
283297
# Ruby
284298
##############################################################################
285-
# buildifier: disable=load-on-top
286299
# buildifier: disable=same-origin-load
287300
load(
288301
"@com_google_googleapis_imports//:imports.bzl",
@@ -307,11 +320,11 @@ ruby_cloud_gapic_library(
307320
name = "kms_ruby_gapic",
308321
srcs = [":kms_proto_with_info"],
309322
extra_protoc_parameters = [
310-
"ruby-cloud-gem-name=google-cloud-kms-v1",
311-
"ruby-cloud-env-prefix=KMS",
312-
"ruby-cloud-product-url=https://cloud.google.com/kms",
313323
"ruby-cloud-api-id=cloudkms.googleapis.com",
314324
"ruby-cloud-api-shortname=cloudkms",
325+
"ruby-cloud-env-prefix=KMS",
326+
"ruby-cloud-gem-name=google-cloud-kms-v1",
327+
"ruby-cloud-product-url=https://cloud.google.com/kms",
315328
],
316329
grpc_service_config = "cloudkms_grpc_service_config.json",
317330
rest_numeric_enums = True,
@@ -338,7 +351,6 @@ ruby_gapic_assembly_pkg(
338351
##############################################################################
339352
# C#
340353
##############################################################################
341-
# buildifier: disable=load-on-top
342354
# buildifier: disable=same-origin-load
343355
load(
344356
"@com_google_googleapis_imports//:imports.bzl",
@@ -350,6 +362,7 @@ load(
350362

351363
csharp_proto_library(
352364
name = "kms_csharp_proto",
365+
extra_opts = [],
353366
deps = [":kms_proto"],
354367
)
355368

@@ -386,7 +399,6 @@ csharp_gapic_assembly_pkg(
386399
##############################################################################
387400
# C++
388401
##############################################################################
389-
# buildifier: disable=load-on-top
390402
# buildifier: disable=same-origin-load
391403
load(
392404
"@com_google_googleapis_imports//:imports.bzl",

google/cloud/kms/v1/cloudkms_v1.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ http:
8484
body: '*'
8585
- post: '/v1/{resource=projects/*/locations/*/ekmConnections/*}:testIamPermissions'
8686
body: '*'
87+
- selector: google.longrunning.Operations.GetOperation
88+
get: '/v1/{name=projects/*/locations/*/operations/*}'
8789

8890
authentication:
8991
rules:
@@ -112,3 +114,8 @@ authentication:
112114
canonical_scopes: |-
113115
https://www.googleapis.com/auth/cloud-platform,
114116
https://www.googleapis.com/auth/cloudkms
117+
- selector: google.longrunning.Operations.GetOperation
118+
oauth:
119+
canonical_scopes: |-
120+
https://www.googleapis.com/auth/cloud-platform,
121+
https://www.googleapis.com/auth/cloudkms

google/cloud/kms/v1/ekm_service.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 Google LLC
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

google/cloud/kms/v1/resources.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 Google LLC
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

google/cloud/kms/v1/service.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 Google LLC
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)