Skip to content

Commit bf12acd

Browse files
Google APIscopybara-github
authored andcommitted
feat: add client library BUILD rules, API proto option, v1alpha service config file and service YAML file
PiperOrigin-RevId: 456598021
1 parent 19bd392 commit bf12acd

5 files changed

Lines changed: 327 additions & 24 deletions

File tree

google/cloud/batch/v1alpha/BUILD.bazel

Lines changed: 200 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# 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.
211

312
# This is an API workspace, having public visibility by default makes perfect sense.
413
package(default_visibility = ["//visibility:public"])
@@ -7,6 +16,7 @@ package(default_visibility = ["//visibility:public"])
716
# Common
817
##############################################################################
918
load("@rules_proto//proto:defs.bzl", "proto_library")
19+
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
1020

1121
proto_library(
1222
name = "batch_proto",
@@ -27,11 +37,22 @@ proto_library(
2737
],
2838
)
2939

40+
proto_library_with_info(
41+
name = "batch_proto_with_info",
42+
deps = [
43+
":batch_proto",
44+
"//google/cloud:common_resources_proto",
45+
],
46+
)
47+
3048
##############################################################################
3149
# Java
3250
##############################################################################
3351
load(
3452
"@com_google_googleapis_imports//:imports.bzl",
53+
"java_gapic_assembly_gradle_pkg",
54+
"java_gapic_library",
55+
"java_gapic_test",
3556
"java_grpc_library",
3657
"java_proto_library",
3758
)
@@ -47,12 +68,50 @@ java_grpc_library(
4768
deps = [":batch_java_proto"],
4869
)
4970

71+
java_gapic_library(
72+
name = "batch_java_gapic",
73+
srcs = [":batch_proto_with_info"],
74+
gapic_yaml = None,
75+
grpc_service_config = "batch_grpc_service_config.json",
76+
service_yaml = None,
77+
test_deps = [
78+
":batch_java_grpc",
79+
],
80+
deps = [
81+
":batch_java_proto",
82+
"//google/api:api_java_proto",
83+
],
84+
)
85+
86+
java_gapic_test(
87+
name = "batch_java_gapic_test_suite",
88+
test_classes = [
89+
"com.google.cloud.batch.v1alpha.BatchServiceClientTest",
90+
],
91+
runtime_deps = [":batch_java_gapic_test"],
92+
)
93+
94+
# Open Source Packages
95+
java_gapic_assembly_gradle_pkg(
96+
name = "google-cloud-batch-v1alpha-java",
97+
deps = [
98+
":batch_java_gapic",
99+
":batch_java_grpc",
100+
":batch_java_proto",
101+
":batch_proto",
102+
],
103+
include_samples = True,
104+
)
105+
50106
##############################################################################
51107
# Go
52108
##############################################################################
53109
load(
54110
"@com_google_googleapis_imports//:imports.bzl",
111+
"go_gapic_assembly_pkg",
112+
"go_gapic_library",
55113
"go_proto_library",
114+
"go_test",
56115
)
57116

58117
go_proto_library(
@@ -66,46 +125,71 @@ go_proto_library(
66125
],
67126
)
68127

128+
go_gapic_library(
129+
name = "batch_go_gapic",
130+
srcs = [":batch_proto_with_info"],
131+
grpc_service_config = "batch_grpc_service_config.json",
132+
importpath = "cloud.google.com/go/batch/apiv1alpha;batch",
133+
service_yaml = None,
134+
metadata = True,
135+
deps = [
136+
":batch_go_proto",
137+
"//google/longrunning:longrunning_go_proto",
138+
"@com_google_cloud_go//longrunning/autogen:go_default_library",
139+
"@com_google_cloud_go//longrunning:go_default_library",
140+
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
141+
],
142+
)
143+
144+
go_test(
145+
name = "batch_go_gapic_test",
146+
srcs = [":batch_go_gapic_srcjar_test"],
147+
embed = [":batch_go_gapic"],
148+
importpath = "cloud.google.com/go/batch/apiv1alpha",
149+
)
150+
151+
# Open Source Packages
152+
go_gapic_assembly_pkg(
153+
name = "gapi-cloud-batch-v1alpha-go",
154+
deps = [
155+
":batch_go_gapic",
156+
":batch_go_gapic_srcjar-test.srcjar",
157+
":batch_go_gapic_srcjar-metadata.srcjar",
158+
":batch_go_proto",
159+
],
160+
)
161+
69162
##############################################################################
70163
# Python
71164
##############################################################################
72165
load(
73166
"@com_google_googleapis_imports//:imports.bzl",
74-
"moved_proto_library",
75-
"py_grpc_library",
76-
"py_proto_library",
167+
"py_gapic_assembly_pkg",
168+
"py_gapic_library",
77169
)
78170

79-
moved_proto_library(
80-
name = "batch_moved_proto",
171+
py_gapic_library(
172+
name = "batch_py_gapic",
81173
srcs = [":batch_proto"],
82-
deps = [
83-
"//google/api:annotations_proto",
84-
"//google/api:client_proto",
85-
"//google/api:field_behavior_proto",
86-
"//google/api:resource_proto",
87-
"//google/longrunning:operations_proto",
88-
"@com_google_protobuf//:duration_proto",
89-
"@com_google_protobuf//:timestamp_proto",
90-
],
91-
)
92-
93-
py_proto_library(
94-
name = "batch_py_proto",
95-
deps = [":batch_moved_proto"],
174+
grpc_service_config = "batch_grpc_service_config.json",
175+
service_yaml = None,
96176
)
97177

98-
py_grpc_library(
99-
name = "batch_py_grpc",
100-
srcs = [":batch_moved_proto"],
101-
deps = [":batch_py_proto"],
178+
# Open Source Packages
179+
py_gapic_assembly_pkg(
180+
name = "batch-v1alpha-py",
181+
deps = [
182+
":batch_py_gapic",
183+
],
102184
)
103185

104186
##############################################################################
105187
# PHP
106188
##############################################################################
107189
load(
108190
"@com_google_googleapis_imports//:imports.bzl",
191+
"php_gapic_assembly_pkg",
192+
"php_gapic_library",
109193
"php_grpc_library",
110194
"php_proto_library",
111195
)
@@ -121,6 +205,27 @@ php_grpc_library(
121205
deps = [":batch_php_proto"],
122206
)
123207

208+
php_gapic_library(
209+
name = "batch_php_gapic",
210+
srcs = [":batch_proto_with_info"],
211+
grpc_service_config = "batch_grpc_service_config.json",
212+
service_yaml = None,
213+
deps = [
214+
":batch_php_grpc",
215+
":batch_php_proto",
216+
],
217+
)
218+
219+
# Open Source Packages
220+
php_gapic_assembly_pkg(
221+
name = "google-cloud-batch-v1alpha-php",
222+
deps = [
223+
":batch_php_gapic",
224+
":batch_php_grpc",
225+
":batch_php_proto",
226+
],
227+
)
228+
124229
##############################################################################
125230
# Node.js
126231
##############################################################################
@@ -130,12 +235,32 @@ load(
130235
"nodejs_gapic_library",
131236
)
132237

238+
nodejs_gapic_library(
239+
name = "batch_nodejs_gapic",
240+
package_name = "@google-cloud/batch",
241+
src = ":batch_proto_with_info",
242+
extra_protoc_parameters = ["metadata"],
243+
grpc_service_config = "batch_grpc_service_config.json",
244+
package = "google.cloud.batch.v1alpha",
245+
service_yaml = None,
246+
deps = [],
247+
)
248+
249+
nodejs_gapic_assembly_pkg(
250+
name = "batch-v1alpha-nodejs",
251+
deps = [
252+
":batch_nodejs_gapic",
253+
":batch_proto",
254+
],
255+
)
133256

134257
##############################################################################
135258
# Ruby
136259
##############################################################################
137260
load(
138261
"@com_google_googleapis_imports//:imports.bzl",
262+
"ruby_gapic_assembly_pkg",
263+
"ruby_cloud_gapic_library",
139264
"ruby_grpc_library",
140265
"ruby_proto_library",
141266
)
@@ -151,11 +276,41 @@ ruby_grpc_library(
151276
deps = [":batch_ruby_proto"],
152277
)
153278

279+
ruby_cloud_gapic_library(
280+
name = "batch_ruby_gapic",
281+
srcs = [":batch_proto_with_info"],
282+
extra_protoc_parameters = [
283+
"ruby-cloud-api-id=batch.googleapis.com",
284+
"ruby-cloud-api-shortname=batch",
285+
"ruby-cloud-gem-name=google-cloud-batch-v1alpha",
286+
],
287+
grpc_service_config = "batch_grpc_service_config.json",
288+
service_yaml = "batch_v1alpha.yaml",
289+
ruby_cloud_description = "Google Cloud Batch is a fully managed service used by scientists, VFX artists, developers to easily and efficiently run batch workloads on Google Cloud. This service manages provisioning of resources to satisfy the requirements of the batch jobs for a variety of workloads including ML, HPC, VFX rendering, transcoding, genomics and others.",
290+
ruby_cloud_title = "Batch V1alpha",
291+
deps = [
292+
":batch_ruby_grpc",
293+
":batch_ruby_proto",
294+
],
295+
)
296+
297+
# Open Source Packages
298+
ruby_gapic_assembly_pkg(
299+
name = "google-cloud-batch-v1alpha-ruby",
300+
deps = [
301+
":batch_ruby_gapic",
302+
":batch_ruby_grpc",
303+
":batch_ruby_proto",
304+
],
305+
)
306+
154307
##############################################################################
155308
# C#
156309
##############################################################################
157310
load(
158311
"@com_google_googleapis_imports//:imports.bzl",
312+
"csharp_gapic_assembly_pkg",
313+
"csharp_gapic_library",
159314
"csharp_grpc_library",
160315
"csharp_proto_library",
161316
)
@@ -171,6 +326,28 @@ csharp_grpc_library(
171326
deps = [":batch_csharp_proto"],
172327
)
173328

329+
csharp_gapic_library(
330+
name = "batch_csharp_gapic",
331+
srcs = [":batch_proto_with_info"],
332+
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
333+
grpc_service_config = "batch_grpc_service_config.json",
334+
service_yaml = None,
335+
deps = [
336+
":batch_csharp_grpc",
337+
":batch_csharp_proto",
338+
],
339+
)
340+
341+
# Open Source Packages
342+
csharp_gapic_assembly_pkg(
343+
name = "google-cloud-batch-v1alpha-csharp",
344+
deps = [
345+
":batch_csharp_gapic",
346+
":batch_csharp_grpc",
347+
":batch_csharp_proto",
348+
],
349+
)
350+
174351
##############################################################################
175352
# C++
176353
##############################################################################

google/cloud/batch/v1alpha/batch.proto

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,26 @@ service BatchService {
4343

4444
// Create a Job.
4545
rpc CreateJob(CreateJobRequest) returns (Job) {
46+
option (google.api.http) = {
47+
post: "/v1alpha/{parent=projects/*/locations/*}/jobs"
48+
body: "job"
49+
};
4650
option (google.api.method_signature) = "parent,job,job_id";
4751
}
4852

4953
// Get a Job specified by its resource name.
5054
rpc GetJob(GetJobRequest) returns (Job) {
55+
option (google.api.http) = {
56+
get: "/v1alpha/{name=projects/*/locations/*/jobs/*}"
57+
};
5158
option (google.api.method_signature) = "name";
5259
}
5360

5461
// Delete a Job.
5562
rpc DeleteJob(DeleteJobRequest) returns (google.longrunning.Operation) {
63+
option (google.api.http) = {
64+
delete: "/v1alpha/{name=projects/*/locations/*/jobs/*}"
65+
};
5666
option (google.api.method_signature) = "name";
5767
option (google.longrunning.operation_info) = {
5868
response_type: "google.protobuf.Empty"
@@ -62,16 +72,25 @@ service BatchService {
6272

6373
// List all Jobs for a project within a region.
6474
rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) {
75+
option (google.api.http) = {
76+
get: "/v1alpha/{parent=projects/*/locations/*}/jobs"
77+
};
6578
option (google.api.method_signature) = "parent";
6679
}
6780

6881
// Return a single Task.
6982
rpc GetTask(GetTaskRequest) returns (Task) {
83+
option (google.api.http) = {
84+
get: "/v1alpha/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}"
85+
};
7086
option (google.api.method_signature) = "name";
7187
}
7288

7389
// List Tasks associated with a job.
7490
rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) {
91+
option (google.api.http) = {
92+
get: "/v1alpha/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks"
93+
};
7594
option (google.api.method_signature) = "parent";
7695
}
7796
}

0 commit comments

Comments
 (0)