google-cloud-batch-v1 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/batch/v1/batch_pb.rb +1 -0
  4. data/lib/google/cloud/batch/v1/batch_service/client.rb +24 -42
  5. data/lib/google/cloud/batch/v1/batch_service/operations.rb +12 -14
  6. data/lib/google/cloud/batch/v1/batch_service/rest/client.rb +810 -0
  7. data/lib/google/cloud/batch/v1/batch_service/rest/operations.rb +793 -0
  8. data/lib/google/cloud/batch/v1/batch_service/rest/service_stub.rb +403 -0
  9. data/lib/google/cloud/batch/v1/batch_service/rest.rb +56 -0
  10. data/lib/google/cloud/batch/v1/batch_service.rb +6 -0
  11. data/lib/google/cloud/batch/v1/bindings_override.rb +102 -0
  12. data/lib/google/cloud/batch/v1/job_pb.rb +3 -0
  13. data/lib/google/cloud/batch/v1/rest.rb +38 -0
  14. data/lib/google/cloud/batch/v1/task_pb.rb +1 -0
  15. data/lib/google/cloud/batch/v1/version.rb +1 -1
  16. data/lib/google/cloud/batch/v1.rb +5 -0
  17. data/lib/google/iam/v1/bindings_override.rb +100 -0
  18. data/lib/google/iam/v1/iam_policy/client.rb +639 -0
  19. data/lib/google/iam/v1/iam_policy/credentials.rb +42 -0
  20. data/lib/google/iam/v1/iam_policy/rest/client.rb +558 -0
  21. data/lib/google/iam/v1/iam_policy/rest/service_stub.rb +226 -0
  22. data/lib/google/iam/v1/iam_policy/rest.rb +75 -0
  23. data/lib/google/iam/v1/iam_policy.rb +77 -0
  24. data/lib/google/iam/v1/rest.rb +36 -0
  25. data/lib/google/iam/v1.rb +43 -0
  26. data/lib/google-cloud-batch-v1.rb +1 -0
  27. data/proto_docs/google/cloud/batch/v1/batch.rb +15 -14
  28. data/proto_docs/google/cloud/batch/v1/job.rb +34 -5
  29. data/proto_docs/google/cloud/batch/v1/task.rb +27 -7
  30. data/proto_docs/google/iam/v1/iam_policy.rb +87 -0
  31. data/proto_docs/google/iam/v1/options.rb +50 -0
  32. data/proto_docs/google/iam/v1/policy.rb +418 -0
  33. metadata +33 -21
@@ -0,0 +1,226 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/iam/v1/iam_policy_pb"
20
+
21
+ module Google
22
+ module Iam
23
+ module V1
24
+ module IAMPolicy
25
+ module Rest
26
+ ##
27
+ # REST service stub for the IAMPolicy service.
28
+ # Service stub contains baseline method implementations
29
+ # including transcoding, making the REST call, and deserialing the response.
30
+ #
31
+ class ServiceStub
32
+ def initialize endpoint:, credentials:
33
+ # These require statements are intentionally placed here to initialize
34
+ # the REST modules only when it's required.
35
+ require "gapic/rest"
36
+
37
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ numeric_enums: true,
39
+ raise_faraday_errors: false
40
+ end
41
+
42
+ ##
43
+ # Baseline implementation for the set_iam_policy REST call
44
+ #
45
+ # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest]
46
+ # A request object representing the call parameters. Required.
47
+ # @param options [::Gapic::CallOptions]
48
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
49
+ #
50
+ # @yield [result, operation] Access the result along with the TransportOperation object
51
+ # @yieldparam result [::Google::Iam::V1::Policy]
52
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
53
+ #
54
+ # @return [::Google::Iam::V1::Policy]
55
+ # A result object deserialized from the server's reply
56
+ def set_iam_policy request_pb, options = nil
57
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
58
+
59
+ verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb
60
+ query_string_params = if query_string_params.any?
61
+ query_string_params.to_h { |p| p.split("=", 2) }
62
+ else
63
+ {}
64
+ end
65
+
66
+ response = @client_stub.make_http_request(
67
+ verb,
68
+ uri: uri,
69
+ body: body || "",
70
+ params: query_string_params,
71
+ options: options
72
+ )
73
+ operation = ::Gapic::Rest::TransportOperation.new response
74
+ result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
75
+
76
+ yield result, operation if block_given?
77
+ result
78
+ end
79
+
80
+ ##
81
+ # Baseline implementation for the get_iam_policy REST call
82
+ #
83
+ # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest]
84
+ # A request object representing the call parameters. Required.
85
+ # @param options [::Gapic::CallOptions]
86
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
87
+ #
88
+ # @yield [result, operation] Access the result along with the TransportOperation object
89
+ # @yieldparam result [::Google::Iam::V1::Policy]
90
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
91
+ #
92
+ # @return [::Google::Iam::V1::Policy]
93
+ # A result object deserialized from the server's reply
94
+ def get_iam_policy request_pb, options = nil
95
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
96
+
97
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb
98
+ query_string_params = if query_string_params.any?
99
+ query_string_params.to_h { |p| p.split("=", 2) }
100
+ else
101
+ {}
102
+ end
103
+
104
+ response = @client_stub.make_http_request(
105
+ verb,
106
+ uri: uri,
107
+ body: body || "",
108
+ params: query_string_params,
109
+ options: options
110
+ )
111
+ operation = ::Gapic::Rest::TransportOperation.new response
112
+ result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
113
+
114
+ yield result, operation if block_given?
115
+ result
116
+ end
117
+
118
+ ##
119
+ # Baseline implementation for the test_iam_permissions REST call
120
+ #
121
+ # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest]
122
+ # A request object representing the call parameters. Required.
123
+ # @param options [::Gapic::CallOptions]
124
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
125
+ #
126
+ # @yield [result, operation] Access the result along with the TransportOperation object
127
+ # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
128
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
129
+ #
130
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
131
+ # A result object deserialized from the server's reply
132
+ def test_iam_permissions request_pb, options = nil
133
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
134
+
135
+ verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb
136
+ query_string_params = if query_string_params.any?
137
+ query_string_params.to_h { |p| p.split("=", 2) }
138
+ else
139
+ {}
140
+ end
141
+
142
+ response = @client_stub.make_http_request(
143
+ verb,
144
+ uri: uri,
145
+ body: body || "",
146
+ params: query_string_params,
147
+ options: options
148
+ )
149
+ operation = ::Gapic::Rest::TransportOperation.new response
150
+ result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
151
+
152
+ yield result, operation if block_given?
153
+ result
154
+ end
155
+
156
+ ##
157
+ # @private
158
+ #
159
+ # GRPC transcoding helper method for the set_iam_policy REST call
160
+ #
161
+ # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest]
162
+ # A request object representing the call parameters. Required.
163
+ # @return [Array(String, [String, nil], Hash{String => String})]
164
+ # Uri, Body, Query string parameters
165
+ def self.transcode_set_iam_policy_request request_pb
166
+ transcoder = Gapic::Rest::GrpcTranscoder.new
167
+ .with_bindings(
168
+ uri_method: :post,
169
+ uri_template: "/v1/{resource}:setIamPolicy",
170
+ body: "*",
171
+ matches: [
172
+ ["resource", %r{^.*$}, true]
173
+ ]
174
+ )
175
+ transcoder.transcode request_pb
176
+ end
177
+
178
+ ##
179
+ # @private
180
+ #
181
+ # GRPC transcoding helper method for the get_iam_policy REST call
182
+ #
183
+ # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest]
184
+ # A request object representing the call parameters. Required.
185
+ # @return [Array(String, [String, nil], Hash{String => String})]
186
+ # Uri, Body, Query string parameters
187
+ def self.transcode_get_iam_policy_request request_pb
188
+ transcoder = Gapic::Rest::GrpcTranscoder.new
189
+ .with_bindings(
190
+ uri_method: :post,
191
+ uri_template: "/v1/{resource}:getIamPolicy",
192
+ body: "*",
193
+ matches: [
194
+ ["resource", %r{^.*$}, true]
195
+ ]
196
+ )
197
+ transcoder.transcode request_pb
198
+ end
199
+
200
+ ##
201
+ # @private
202
+ #
203
+ # GRPC transcoding helper method for the test_iam_permissions REST call
204
+ #
205
+ # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest]
206
+ # A request object representing the call parameters. Required.
207
+ # @return [Array(String, [String, nil], Hash{String => String})]
208
+ # Uri, Body, Query string parameters
209
+ def self.transcode_test_iam_permissions_request request_pb
210
+ transcoder = Gapic::Rest::GrpcTranscoder.new
211
+ .with_bindings(
212
+ uri_method: :post,
213
+ uri_template: "/v1/{resource}:testIamPermissions",
214
+ body: "*",
215
+ matches: [
216
+ ["resource", %r{^.*$}, true]
217
+ ]
218
+ )
219
+ transcoder.transcode request_pb
220
+ end
221
+ end
222
+ end
223
+ end
224
+ end
225
+ end
226
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/batch/v1/version"
24
+ require "google/iam/v1/bindings_override"
25
+
26
+ require "google/iam/v1/iam_policy/credentials"
27
+ require "google/iam/v1/iam_policy/rest/client"
28
+
29
+ module Google
30
+ module Iam
31
+ module V1
32
+ ##
33
+ # API Overview
34
+ #
35
+ #
36
+ # Manages Identity and Access Management (IAM) policies.
37
+ #
38
+ # Any implementation of an API that offers access control features
39
+ # implements the google.iam.v1.IAMPolicy interface.
40
+ #
41
+ # ## Data model
42
+ #
43
+ # Access control is applied when a principal (user or service account), takes
44
+ # some action on a resource exposed by a service. Resources, identified by
45
+ # URI-like names, are the unit of access control specification. Service
46
+ # implementations can choose the granularity of access control and the
47
+ # supported permissions for their resources.
48
+ # For example one database service may allow access control to be
49
+ # specified only at the Table level, whereas another might allow access control
50
+ # to also be specified at the Column level.
51
+ #
52
+ # ## Policy Structure
53
+ #
54
+ # See google.iam.v1.Policy
55
+ #
56
+ # This is intentionally not a CRUD style API because access control policies
57
+ # are created and deleted implicitly with the resources to which they are
58
+ # attached.
59
+ #
60
+ # To load this service and instantiate a REST client:
61
+ #
62
+ # require "google/iam/v1/iam_policy/rest"
63
+ # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new
64
+ #
65
+ module IAMPolicy
66
+ # Client for the REST transport
67
+ module Rest
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+
74
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
75
+ require "google/iam/v1/iam_policy/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/batch/v1/version"
24
+
25
+ require "google/iam/v1/iam_policy/credentials"
26
+ require "google/iam/v1/iam_policy/client"
27
+ require "google/iam/v1/iam_policy/rest"
28
+
29
+ module Google
30
+ module Iam
31
+ module V1
32
+ ##
33
+ # API Overview
34
+ #
35
+ #
36
+ # Manages Identity and Access Management (IAM) policies.
37
+ #
38
+ # Any implementation of an API that offers access control features
39
+ # implements the google.iam.v1.IAMPolicy interface.
40
+ #
41
+ # ## Data model
42
+ #
43
+ # Access control is applied when a principal (user or service account), takes
44
+ # some action on a resource exposed by a service. Resources, identified by
45
+ # URI-like names, are the unit of access control specification. Service
46
+ # implementations can choose the granularity of access control and the
47
+ # supported permissions for their resources.
48
+ # For example one database service may allow access control to be
49
+ # specified only at the Table level, whereas another might allow access control
50
+ # to also be specified at the Column level.
51
+ #
52
+ # ## Policy Structure
53
+ #
54
+ # See google.iam.v1.Policy
55
+ #
56
+ # This is intentionally not a CRUD style API because access control policies
57
+ # are created and deleted implicitly with the resources to which they are
58
+ # attached.
59
+ #
60
+ # @example Load this service and instantiate a gRPC client
61
+ #
62
+ # require "google/iam/v1/iam_policy"
63
+ # client = ::Google::Iam::V1::IAMPolicy::Client.new
64
+ #
65
+ # @example Load this service and instantiate a REST client
66
+ #
67
+ # require "google/iam/v1/iam_policy/rest"
68
+ # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new
69
+ #
70
+ module IAMPolicy
71
+ end
72
+ end
73
+ end
74
+ end
75
+
76
+ helper_path = ::File.join __dir__, "iam_policy", "helpers.rb"
77
+ require "google/iam/v1/iam_policy/helpers" if ::File.file? helper_path
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/iam/v1/iam_policy/rest"
20
+ require "google/iam/v1/bindings_override"
21
+ require "google/cloud/batch/v1/version"
22
+
23
+ module Google
24
+ module Iam
25
+ ##
26
+ # To load just the REST part of this package, including all its services, and instantiate a REST client:
27
+ #
28
+ # @example
29
+ #
30
+ # require "google/iam/v1/rest"
31
+ # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new
32
+ #
33
+ module V1
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/iam/v1/iam_policy"
20
+ require "google/cloud/batch/v1/version"
21
+
22
+ module Google
23
+ module Iam
24
+ ##
25
+ # API client module.
26
+ #
27
+ # @example Load this package, including all its services, and instantiate a gRPC client
28
+ #
29
+ # require "google/iam/v1"
30
+ # client = ::Google::Iam::V1::IAMPolicy::Client.new
31
+ #
32
+ # @example Load this package, including all its services, and instantiate a REST client
33
+ #
34
+ # require "google/iam/v1"
35
+ # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new
36
+ #
37
+ module V1
38
+ end
39
+ end
40
+ end
41
+
42
+ helper_path = ::File.join __dir__, "v1", "_helpers.rb"
43
+ require "google/iam/v1/_helpers" if ::File.file? helper_path
@@ -19,3 +19,4 @@
19
19
  # This gem does not autoload during Bundler.require. To load this gem,
20
20
  # issue explicit require statements for the packages desired, e.g.:
21
21
  # require "google/cloud/batch/v1"
22
+ # require "google/iam/v1"
@@ -42,13 +42,13 @@ module Google
42
42
  # Required. The Job to create.
43
43
  # @!attribute [rw] request_id
44
44
  # @return [::String]
45
- # Optional. An optional request ID to identify requests. Specify a unique request ID
46
- # so that if you must retry your request, the server will know to ignore
47
- # the request if it has already been completed. The server will guarantee
48
- # that for at least 60 minutes since the first request.
45
+ # Optional. An optional request ID to identify requests. Specify a unique
46
+ # request ID so that if you must retry your request, the server will know to
47
+ # ignore the request if it has already been completed. The server will
48
+ # guarantee that for at least 60 minutes since the first request.
49
49
  #
50
- # For example, consider a situation where you make an initial request and t
51
- # he request times out. If you make the request again with the same request
50
+ # For example, consider a situation where you make an initial request and
51
+ # the request times out. If you make the request again with the same request
52
52
  # ID, the server can check if original operation with the same request ID
53
53
  # was received, and if so, will ignore the second request. This prevents
54
54
  # clients from accidentally creating duplicate commitments.
@@ -78,13 +78,13 @@ module Google
78
78
  # Optional. Reason for this deletion.
79
79
  # @!attribute [rw] request_id
80
80
  # @return [::String]
81
- # Optional. An optional request ID to identify requests. Specify a unique request ID
82
- # so that if you must retry your request, the server will know to ignore
83
- # the request if it has already been completed. The server will guarantee
84
- # that for at least 60 minutes after the first request.
81
+ # Optional. An optional request ID to identify requests. Specify a unique
82
+ # request ID so that if you must retry your request, the server will know to
83
+ # ignore the request if it has already been completed. The server will
84
+ # guarantee that for at least 60 minutes after the first request.
85
85
  #
86
- # For example, consider a situation where you make an initial request and t
87
- # he request times out. If you make the request again with the same request
86
+ # For example, consider a situation where you make an initial request and
87
+ # the request times out. If you make the request again with the same request
88
88
  # ID, the server can check if original operation with the same request ID
89
89
  # was received, and if so, will ignore the second request. This prevents
90
90
  # clients from accidentally creating duplicate commitments.
@@ -195,8 +195,9 @@ module Google
195
195
  # @return [::Boolean]
196
196
  # Output only. Identifies whether the user has requested cancellation
197
197
  # of the operation. Operations that have successfully been cancelled
198
- # have [Operation.error][] value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
199
- # corresponding to `Code.CANCELLED`.
198
+ # have [Operation.error][] value with a
199
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to
200
+ # `Code.CANCELLED`.
200
201
  # @!attribute [r] api_version
201
202
  # @return [::String]
202
203
  # Output only. API version used to start the operation.
@@ -32,7 +32,8 @@ module Google
32
32
  # @!attribute [rw] priority
33
33
  # @return [::Integer]
34
34
  # Priority of the Job.
35
- # The valid value range is [0, 100).
35
+ # The valid value range is [0, 100). Default value is 0.
36
+ # Higher value indicates higher priority.
36
37
  # A job with higher priority value is more likely to run earlier if all other
37
38
  # requirements are satisfied.
38
39
  # @!attribute [rw] task_groups
@@ -137,6 +138,9 @@ module Google
137
138
  # @!attribute [rw] task_pack
138
139
  # @return [::Integer]
139
140
  # The max number of tasks can be assigned to this instance type.
141
+ # @!attribute [rw] boot_disk
142
+ # @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
143
+ # The VM boot disk.
140
144
  class InstanceStatus
141
145
  include ::Google::Protobuf::MessageExts
142
146
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -301,19 +305,36 @@ module Google
301
305
  # @!attribute [rw] image
302
306
  # @return [::String]
303
307
  # Name of a public or custom image used as the data source.
308
+ # For example, the following are all valid URLs:
309
+ # (1) Specify the image by its family name:
310
+ # projects/\\{project}/global/images/family/\\{image_family}
311
+ # (2) Specify the image version:
312
+ # projects/\\{project}/global/images/\\{image_version}
313
+ # You can also use Batch customized image in short names.
314
+ # The following image values are supported for a boot disk:
315
+ # "batch-debian": use Batch Debian images.
316
+ # "batch-centos": use Batch CentOS images.
317
+ # "batch-cos": use Batch Container-Optimized images.
304
318
  # @!attribute [rw] snapshot
305
319
  # @return [::String]
306
320
  # Name of a snapshot used as the data source.
307
321
  # @!attribute [rw] type
308
322
  # @return [::String]
309
- # Disk type as shown in `gcloud compute disk-types list`
310
- # For example, "pd-ssd", "pd-standard", "pd-balanced", "local-ssd".
323
+ # Disk type as shown in `gcloud compute disk-types list`.
324
+ # For example, local SSD uses type "local-ssd".
325
+ # Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
326
+ # or "pd-standard".
311
327
  # @!attribute [rw] size_gb
312
328
  # @return [::Integer]
313
329
  # Disk size in GB.
314
- # This field is ignored if `data_source` is `disk` or `image`.
315
- # If `type` is `local-ssd`, size_gb should be a multiple of 375GB,
330
+ # For persistent disk, this field is ignored if `data_source` is `image` or
331
+ # `snapshot`.
332
+ # For local SSD, size_gb should be a multiple of 375GB,
316
333
  # otherwise, the final size will be the next greater multiple of 375 GB.
334
+ # For boot disk, Batch will calculate the boot disk size based on source
335
+ # image and task requirements if you do not speicify the size.
336
+ # If both this field and the boot_disk_mib field in task spec's
337
+ # compute_resource are defined, Batch will only honor this field.
317
338
  # @!attribute [rw] disk_interface
318
339
  # @return [::String]
319
340
  # Local SSDs are available through both "SCSI" and "NVMe" interfaces.
@@ -375,6 +396,10 @@ module Google
375
396
  # @!attribute [rw] accelerators
376
397
  # @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
377
398
  # The accelerators attached to each VM instance.
399
+ # @!attribute [rw] boot_disk
400
+ # @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
401
+ # Book disk to be created and attached to each VM by this InstancePolicy.
402
+ # Boot disk will be deleted when the VM is deleted.
378
403
  # @!attribute [rw] disks
379
404
  # @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
380
405
  # Non-boot disks to be attached for each VM created by this InstancePolicy.
@@ -532,6 +557,10 @@ module Google
532
557
  # Compute Engine service account for the project will be used. If instance
533
558
  # template is being used, the service account has to be specified in the
534
559
  # instance template and it has to match the email field here.
560
+ # @!attribute [rw] scopes
561
+ # @return [::Array<::String>]
562
+ # List of scopes to be enabled for this service account on the VM, in
563
+ # addition to the cloud-platform API scope that will be added by default.
535
564
  class ServiceAccount
536
565
  include ::Google::Protobuf::MessageExts
537
566
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -49,6 +49,9 @@ module Google
49
49
  # @!attribute [rw] task_execution
50
50
  # @return [::Google::Cloud::Batch::V1::TaskExecution]
51
51
  # Task Execution
52
+ # @!attribute [rw] task_state
53
+ # @return [::Google::Cloud::Batch::V1::TaskStatus::State]
54
+ # Task State
52
55
  class StatusEvent
53
56
  include ::Google::Protobuf::MessageExts
54
57
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -184,9 +187,23 @@ module Google
184
187
  # @!attribute [rw] path
185
188
  # @return [::String]
186
189
  # Script file path on the host VM.
190
+ #
191
+ # To specify an interpreter, please add a `#!<interpreter>`(also known as
192
+ # [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
193
+ # first line of the file.(For example, to execute the script using bash,
194
+ # `#!/bin/bash` should be the first line of the file. To execute the
195
+ # script using`Python3`, `#!/usr/bin/env python3` should be the first
196
+ # line of the file.) Otherwise, the file will by default be excuted by
197
+ # `/bin/sh`.
187
198
  # @!attribute [rw] text
188
199
  # @return [::String]
189
200
  # Shell script text.
201
+ #
202
+ # To specify an interpreter, please add a `#!<interpreter>\n` at the
203
+ # beginning of the text.(For example, to execute the script using bash,
204
+ # `#!/bin/bash\n` should be added. To execute the script using`Python3`,
205
+ # `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
206
+ # by default be excuted by `/bin/sh`.
190
207
  class Script
191
208
  include ::Google::Protobuf::MessageExts
192
209
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -231,13 +248,12 @@ module Google
231
248
  # @!attribute [rw] lifecycle_policies
232
249
  # @return [::Array<::Google::Cloud::Batch::V1::LifecyclePolicy>]
233
250
  # Lifecycle management schema when any task in a task group is failed.
234
- # The valid size of lifecycle policies are [0, 10].
235
- # For each lifecycle policy, when the condition is met,
236
- # the action in that policy will execute.
237
- # If there are multiple policies that the task execution result matches,
238
- # we use the action from the first matched policy. If task execution result
239
- # does not meet with any of the defined lifecycle policy, we consider it as
240
- # the default policy. Default policy means if the exit code is 0, exit task.
251
+ # Currently we only support one lifecycle policy.
252
+ # When the lifecycle policy condition is met,
253
+ # the action in the policy will execute.
254
+ # If task execution result does not meet with the defined lifecycle
255
+ # policy, we consider it as the default policy.
256
+ # Default policy means if the exit code is 0, exit task.
241
257
  # If task ends with non-zero exit code, retry the task with max_retry_count.
242
258
  # @!attribute [rw] environments
243
259
  # @return [::Google::Protobuf::Map{::String => ::String}]
@@ -267,6 +283,10 @@ module Google
267
283
  # @!attribute [rw] action
268
284
  # @return [::Google::Cloud::Batch::V1::LifecyclePolicy::Action]
269
285
  # Action to execute when ActionCondition is true.
286
+ # When RETRY_TASK is specified, we will retry failed tasks
287
+ # if we notice any exit code match and fail tasks if no match is found.
288
+ # Likewise, when FAIL_TASK is specified, we will fail tasks
289
+ # if we notice any exit code match and retry tasks if no match is found.
270
290
  # @!attribute [rw] action_condition
271
291
  # @return [::Google::Cloud::Batch::V1::LifecyclePolicy::ActionCondition]
272
292
  # Conditions that decide why a task failure is dealt with a specific action.