google-apis-tpu_v1alpha1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 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
+
15
+ module Google
16
+ module Apis
17
+ module TpuV1alpha1
18
+ # Version of the google-apis-tpu_v1alpha1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20201014"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,327 @@
1
+ # Copyright 2020 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
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module TpuV1alpha1
24
+
25
+ class AcceleratorType
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class Empty
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class ListAcceleratorTypesResponse
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class ListLocationsResponse
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class ListNodesResponse
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class ListOperationsResponse
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class ListTensorFlowVersionsResponse
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class Location
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class NetworkEndpoint
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class Node
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class Operation
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class OperationMetadata
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class ReimageNodeRequest
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class SchedulingConfig
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class StartNodeRequest
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class Status
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class StopNodeRequest
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class Symptom
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class TensorFlowVersion
134
+ class Representation < Google::Apis::Core::JsonRepresentation; end
135
+
136
+ include Google::Apis::Core::JsonObjectSupport
137
+ end
138
+
139
+ class AcceleratorType
140
+ # @private
141
+ class Representation < Google::Apis::Core::JsonRepresentation
142
+ property :name, as: 'name'
143
+ property :type, as: 'type'
144
+ end
145
+ end
146
+
147
+ class Empty
148
+ # @private
149
+ class Representation < Google::Apis::Core::JsonRepresentation
150
+ end
151
+ end
152
+
153
+ class ListAcceleratorTypesResponse
154
+ # @private
155
+ class Representation < Google::Apis::Core::JsonRepresentation
156
+ collection :accelerator_types, as: 'acceleratorTypes', class: Google::Apis::TpuV1alpha1::AcceleratorType, decorator: Google::Apis::TpuV1alpha1::AcceleratorType::Representation
157
+
158
+ property :next_page_token, as: 'nextPageToken'
159
+ collection :unreachable, as: 'unreachable'
160
+ end
161
+ end
162
+
163
+ class ListLocationsResponse
164
+ # @private
165
+ class Representation < Google::Apis::Core::JsonRepresentation
166
+ collection :locations, as: 'locations', class: Google::Apis::TpuV1alpha1::Location, decorator: Google::Apis::TpuV1alpha1::Location::Representation
167
+
168
+ property :next_page_token, as: 'nextPageToken'
169
+ end
170
+ end
171
+
172
+ class ListNodesResponse
173
+ # @private
174
+ class Representation < Google::Apis::Core::JsonRepresentation
175
+ property :next_page_token, as: 'nextPageToken'
176
+ collection :nodes, as: 'nodes', class: Google::Apis::TpuV1alpha1::Node, decorator: Google::Apis::TpuV1alpha1::Node::Representation
177
+
178
+ collection :unreachable, as: 'unreachable'
179
+ end
180
+ end
181
+
182
+ class ListOperationsResponse
183
+ # @private
184
+ class Representation < Google::Apis::Core::JsonRepresentation
185
+ property :next_page_token, as: 'nextPageToken'
186
+ collection :operations, as: 'operations', class: Google::Apis::TpuV1alpha1::Operation, decorator: Google::Apis::TpuV1alpha1::Operation::Representation
187
+
188
+ end
189
+ end
190
+
191
+ class ListTensorFlowVersionsResponse
192
+ # @private
193
+ class Representation < Google::Apis::Core::JsonRepresentation
194
+ property :next_page_token, as: 'nextPageToken'
195
+ collection :tensorflow_versions, as: 'tensorflowVersions', class: Google::Apis::TpuV1alpha1::TensorFlowVersion, decorator: Google::Apis::TpuV1alpha1::TensorFlowVersion::Representation
196
+
197
+ collection :unreachable, as: 'unreachable'
198
+ end
199
+ end
200
+
201
+ class Location
202
+ # @private
203
+ class Representation < Google::Apis::Core::JsonRepresentation
204
+ property :display_name, as: 'displayName'
205
+ hash :labels, as: 'labels'
206
+ property :location_id, as: 'locationId'
207
+ hash :metadata, as: 'metadata'
208
+ property :name, as: 'name'
209
+ end
210
+ end
211
+
212
+ class NetworkEndpoint
213
+ # @private
214
+ class Representation < Google::Apis::Core::JsonRepresentation
215
+ property :ip_address, as: 'ipAddress'
216
+ property :port, as: 'port'
217
+ end
218
+ end
219
+
220
+ class Node
221
+ # @private
222
+ class Representation < Google::Apis::Core::JsonRepresentation
223
+ property :accelerator_type, as: 'acceleratorType'
224
+ property :cidr_block, as: 'cidrBlock'
225
+ property :create_time, as: 'createTime'
226
+ property :description, as: 'description'
227
+ property :health, as: 'health'
228
+ property :health_description, as: 'healthDescription'
229
+ property :ip_address, as: 'ipAddress'
230
+ hash :labels, as: 'labels'
231
+ property :name, as: 'name'
232
+ property :network, as: 'network'
233
+ collection :network_endpoints, as: 'networkEndpoints', class: Google::Apis::TpuV1alpha1::NetworkEndpoint, decorator: Google::Apis::TpuV1alpha1::NetworkEndpoint::Representation
234
+
235
+ property :port, as: 'port'
236
+ property :scheduling_config, as: 'schedulingConfig', class: Google::Apis::TpuV1alpha1::SchedulingConfig, decorator: Google::Apis::TpuV1alpha1::SchedulingConfig::Representation
237
+
238
+ property :service_account, as: 'serviceAccount'
239
+ property :state, as: 'state'
240
+ collection :symptoms, as: 'symptoms', class: Google::Apis::TpuV1alpha1::Symptom, decorator: Google::Apis::TpuV1alpha1::Symptom::Representation
241
+
242
+ property :tensorflow_version, as: 'tensorflowVersion'
243
+ property :use_service_networking, as: 'useServiceNetworking'
244
+ end
245
+ end
246
+
247
+ class Operation
248
+ # @private
249
+ class Representation < Google::Apis::Core::JsonRepresentation
250
+ property :done, as: 'done'
251
+ property :error, as: 'error', class: Google::Apis::TpuV1alpha1::Status, decorator: Google::Apis::TpuV1alpha1::Status::Representation
252
+
253
+ hash :metadata, as: 'metadata'
254
+ property :name, as: 'name'
255
+ hash :response, as: 'response'
256
+ end
257
+ end
258
+
259
+ class OperationMetadata
260
+ # @private
261
+ class Representation < Google::Apis::Core::JsonRepresentation
262
+ property :api_version, as: 'apiVersion'
263
+ property :cancel_requested, as: 'cancelRequested'
264
+ property :create_time, as: 'createTime'
265
+ property :end_time, as: 'endTime'
266
+ property :status_detail, as: 'statusDetail'
267
+ property :target, as: 'target'
268
+ property :verb, as: 'verb'
269
+ end
270
+ end
271
+
272
+ class ReimageNodeRequest
273
+ # @private
274
+ class Representation < Google::Apis::Core::JsonRepresentation
275
+ property :tensorflow_version, as: 'tensorflowVersion'
276
+ end
277
+ end
278
+
279
+ class SchedulingConfig
280
+ # @private
281
+ class Representation < Google::Apis::Core::JsonRepresentation
282
+ property :preemptible, as: 'preemptible'
283
+ property :reserved, as: 'reserved'
284
+ end
285
+ end
286
+
287
+ class StartNodeRequest
288
+ # @private
289
+ class Representation < Google::Apis::Core::JsonRepresentation
290
+ end
291
+ end
292
+
293
+ class Status
294
+ # @private
295
+ class Representation < Google::Apis::Core::JsonRepresentation
296
+ property :code, as: 'code'
297
+ collection :details, as: 'details'
298
+ property :message, as: 'message'
299
+ end
300
+ end
301
+
302
+ class StopNodeRequest
303
+ # @private
304
+ class Representation < Google::Apis::Core::JsonRepresentation
305
+ end
306
+ end
307
+
308
+ class Symptom
309
+ # @private
310
+ class Representation < Google::Apis::Core::JsonRepresentation
311
+ property :create_time, as: 'createTime'
312
+ property :details, as: 'details'
313
+ property :symptom_type, as: 'symptomType'
314
+ property :worker_id, as: 'workerId'
315
+ end
316
+ end
317
+
318
+ class TensorFlowVersion
319
+ # @private
320
+ class Representation < Google::Apis::Core::JsonRepresentation
321
+ property :name, as: 'name'
322
+ property :version, as: 'version'
323
+ end
324
+ end
325
+ end
326
+ end
327
+ end
@@ -0,0 +1,652 @@
1
+ # Copyright 2020 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
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module TpuV1alpha1
23
+ # Cloud TPU API
24
+ #
25
+ # TPU API provides customers with access to Google TPU technology.
26
+ #
27
+ # @example
28
+ # require 'google/apis/tpu_v1alpha1'
29
+ #
30
+ # Tpu = Google::Apis::TpuV1alpha1 # Alias the module
31
+ # service = Tpu::TPUService.new
32
+ #
33
+ # @see https://cloud.google.com/tpu/
34
+ class TPUService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://tpu.googleapis.com/', '',
47
+ client_name: 'google-apis-tpu_v1alpha1',
48
+ client_version: Google::Apis::TpuV1alpha1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Gets information about a location.
53
+ # @param [String] name
54
+ # Resource name for the location.
55
+ # @param [String] fields
56
+ # Selector specifying which fields to include in a partial response.
57
+ # @param [String] quota_user
58
+ # Available to use for quota purposes for server-side applications. Can be any
59
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
60
+ # @param [Google::Apis::RequestOptions] options
61
+ # Request-specific options
62
+ #
63
+ # @yield [result, err] Result & error if block supplied
64
+ # @yieldparam result [Google::Apis::TpuV1alpha1::Location] parsed result object
65
+ # @yieldparam err [StandardError] error object if request failed
66
+ #
67
+ # @return [Google::Apis::TpuV1alpha1::Location]
68
+ #
69
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
70
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
71
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
72
+ def get_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
73
+ command = make_simple_command(:get, 'v1alpha1/{+name}', options)
74
+ command.response_representation = Google::Apis::TpuV1alpha1::Location::Representation
75
+ command.response_class = Google::Apis::TpuV1alpha1::Location
76
+ command.params['name'] = name unless name.nil?
77
+ command.query['fields'] = fields unless fields.nil?
78
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
79
+ execute_or_queue_command(command, &block)
80
+ end
81
+
82
+ # Lists information about the supported locations for this service.
83
+ # @param [String] name
84
+ # The resource that owns the locations collection, if applicable.
85
+ # @param [String] filter
86
+ # The standard list filter.
87
+ # @param [Fixnum] page_size
88
+ # The standard list page size.
89
+ # @param [String] page_token
90
+ # The standard list page token.
91
+ # @param [String] fields
92
+ # Selector specifying which fields to include in a partial response.
93
+ # @param [String] quota_user
94
+ # Available to use for quota purposes for server-side applications. Can be any
95
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
96
+ # @param [Google::Apis::RequestOptions] options
97
+ # Request-specific options
98
+ #
99
+ # @yield [result, err] Result & error if block supplied
100
+ # @yieldparam result [Google::Apis::TpuV1alpha1::ListLocationsResponse] parsed result object
101
+ # @yieldparam err [StandardError] error object if request failed
102
+ #
103
+ # @return [Google::Apis::TpuV1alpha1::ListLocationsResponse]
104
+ #
105
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
106
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
107
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
108
+ def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
109
+ command = make_simple_command(:get, 'v1alpha1/{+name}/locations', options)
110
+ command.response_representation = Google::Apis::TpuV1alpha1::ListLocationsResponse::Representation
111
+ command.response_class = Google::Apis::TpuV1alpha1::ListLocationsResponse
112
+ command.params['name'] = name unless name.nil?
113
+ command.query['filter'] = filter unless filter.nil?
114
+ command.query['pageSize'] = page_size unless page_size.nil?
115
+ command.query['pageToken'] = page_token unless page_token.nil?
116
+ command.query['fields'] = fields unless fields.nil?
117
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
118
+ execute_or_queue_command(command, &block)
119
+ end
120
+
121
+ # Gets AcceleratorType.
122
+ # @param [String] name
123
+ # Required. The resource name.
124
+ # @param [String] fields
125
+ # Selector specifying which fields to include in a partial response.
126
+ # @param [String] quota_user
127
+ # Available to use for quota purposes for server-side applications. Can be any
128
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
129
+ # @param [Google::Apis::RequestOptions] options
130
+ # Request-specific options
131
+ #
132
+ # @yield [result, err] Result & error if block supplied
133
+ # @yieldparam result [Google::Apis::TpuV1alpha1::AcceleratorType] parsed result object
134
+ # @yieldparam err [StandardError] error object if request failed
135
+ #
136
+ # @return [Google::Apis::TpuV1alpha1::AcceleratorType]
137
+ #
138
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
139
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
140
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
141
+ def get_project_location_accelerator_type(name, fields: nil, quota_user: nil, options: nil, &block)
142
+ command = make_simple_command(:get, 'v1alpha1/{+name}', options)
143
+ command.response_representation = Google::Apis::TpuV1alpha1::AcceleratorType::Representation
144
+ command.response_class = Google::Apis::TpuV1alpha1::AcceleratorType
145
+ command.params['name'] = name unless name.nil?
146
+ command.query['fields'] = fields unless fields.nil?
147
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
148
+ execute_or_queue_command(command, &block)
149
+ end
150
+
151
+ # Lists accelerator types supported by this API.
152
+ # @param [String] parent
153
+ # Required. The parent resource name.
154
+ # @param [String] filter
155
+ # List filter.
156
+ # @param [String] order_by
157
+ # Sort results.
158
+ # @param [Fixnum] page_size
159
+ # The maximum number of items to return.
160
+ # @param [String] page_token
161
+ # The next_page_token value returned from a previous List request, if any.
162
+ # @param [String] fields
163
+ # Selector specifying which fields to include in a partial response.
164
+ # @param [String] quota_user
165
+ # Available to use for quota purposes for server-side applications. Can be any
166
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
167
+ # @param [Google::Apis::RequestOptions] options
168
+ # Request-specific options
169
+ #
170
+ # @yield [result, err] Result & error if block supplied
171
+ # @yieldparam result [Google::Apis::TpuV1alpha1::ListAcceleratorTypesResponse] parsed result object
172
+ # @yieldparam err [StandardError] error object if request failed
173
+ #
174
+ # @return [Google::Apis::TpuV1alpha1::ListAcceleratorTypesResponse]
175
+ #
176
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
177
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
178
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
179
+ def list_project_location_accelerator_types(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
180
+ command = make_simple_command(:get, 'v1alpha1/{+parent}/acceleratorTypes', options)
181
+ command.response_representation = Google::Apis::TpuV1alpha1::ListAcceleratorTypesResponse::Representation
182
+ command.response_class = Google::Apis::TpuV1alpha1::ListAcceleratorTypesResponse
183
+ command.params['parent'] = parent unless parent.nil?
184
+ command.query['filter'] = filter unless filter.nil?
185
+ command.query['orderBy'] = order_by unless order_by.nil?
186
+ command.query['pageSize'] = page_size unless page_size.nil?
187
+ command.query['pageToken'] = page_token unless page_token.nil?
188
+ command.query['fields'] = fields unless fields.nil?
189
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
190
+ execute_or_queue_command(command, &block)
191
+ end
192
+
193
+ # Creates a node.
194
+ # @param [String] parent
195
+ # Required. The parent resource name.
196
+ # @param [Google::Apis::TpuV1alpha1::Node] node_object
197
+ # @param [String] node_id
198
+ # The unqualified resource name.
199
+ # @param [String] fields
200
+ # Selector specifying which fields to include in a partial response.
201
+ # @param [String] quota_user
202
+ # Available to use for quota purposes for server-side applications. Can be any
203
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
204
+ # @param [Google::Apis::RequestOptions] options
205
+ # Request-specific options
206
+ #
207
+ # @yield [result, err] Result & error if block supplied
208
+ # @yieldparam result [Google::Apis::TpuV1alpha1::Operation] parsed result object
209
+ # @yieldparam err [StandardError] error object if request failed
210
+ #
211
+ # @return [Google::Apis::TpuV1alpha1::Operation]
212
+ #
213
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
214
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
215
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
216
+ def create_project_location_node(parent, node_object = nil, node_id: nil, fields: nil, quota_user: nil, options: nil, &block)
217
+ command = make_simple_command(:post, 'v1alpha1/{+parent}/nodes', options)
218
+ command.request_representation = Google::Apis::TpuV1alpha1::Node::Representation
219
+ command.request_object = node_object
220
+ command.response_representation = Google::Apis::TpuV1alpha1::Operation::Representation
221
+ command.response_class = Google::Apis::TpuV1alpha1::Operation
222
+ command.params['parent'] = parent unless parent.nil?
223
+ command.query['nodeId'] = node_id unless node_id.nil?
224
+ command.query['fields'] = fields unless fields.nil?
225
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
226
+ execute_or_queue_command(command, &block)
227
+ end
228
+
229
+ # Deletes a node.
230
+ # @param [String] name
231
+ # Required. The resource name.
232
+ # @param [String] fields
233
+ # Selector specifying which fields to include in a partial response.
234
+ # @param [String] quota_user
235
+ # Available to use for quota purposes for server-side applications. Can be any
236
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
237
+ # @param [Google::Apis::RequestOptions] options
238
+ # Request-specific options
239
+ #
240
+ # @yield [result, err] Result & error if block supplied
241
+ # @yieldparam result [Google::Apis::TpuV1alpha1::Operation] parsed result object
242
+ # @yieldparam err [StandardError] error object if request failed
243
+ #
244
+ # @return [Google::Apis::TpuV1alpha1::Operation]
245
+ #
246
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
247
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
248
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
249
+ def delete_project_location_node(name, fields: nil, quota_user: nil, options: nil, &block)
250
+ command = make_simple_command(:delete, 'v1alpha1/{+name}', options)
251
+ command.response_representation = Google::Apis::TpuV1alpha1::Operation::Representation
252
+ command.response_class = Google::Apis::TpuV1alpha1::Operation
253
+ command.params['name'] = name unless name.nil?
254
+ command.query['fields'] = fields unless fields.nil?
255
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
256
+ execute_or_queue_command(command, &block)
257
+ end
258
+
259
+ # Gets the details of a node.
260
+ # @param [String] name
261
+ # Required. The resource name.
262
+ # @param [String] fields
263
+ # Selector specifying which fields to include in a partial response.
264
+ # @param [String] quota_user
265
+ # Available to use for quota purposes for server-side applications. Can be any
266
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
267
+ # @param [Google::Apis::RequestOptions] options
268
+ # Request-specific options
269
+ #
270
+ # @yield [result, err] Result & error if block supplied
271
+ # @yieldparam result [Google::Apis::TpuV1alpha1::Node] parsed result object
272
+ # @yieldparam err [StandardError] error object if request failed
273
+ #
274
+ # @return [Google::Apis::TpuV1alpha1::Node]
275
+ #
276
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
277
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
278
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
279
+ def get_project_location_node(name, fields: nil, quota_user: nil, options: nil, &block)
280
+ command = make_simple_command(:get, 'v1alpha1/{+name}', options)
281
+ command.response_representation = Google::Apis::TpuV1alpha1::Node::Representation
282
+ command.response_class = Google::Apis::TpuV1alpha1::Node
283
+ command.params['name'] = name unless name.nil?
284
+ command.query['fields'] = fields unless fields.nil?
285
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
286
+ execute_or_queue_command(command, &block)
287
+ end
288
+
289
+ # Lists nodes.
290
+ # @param [String] parent
291
+ # Required. The parent resource name.
292
+ # @param [Fixnum] page_size
293
+ # The maximum number of items to return.
294
+ # @param [String] page_token
295
+ # The next_page_token value returned from a previous List request, if any.
296
+ # @param [String] fields
297
+ # Selector specifying which fields to include in a partial response.
298
+ # @param [String] quota_user
299
+ # Available to use for quota purposes for server-side applications. Can be any
300
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
301
+ # @param [Google::Apis::RequestOptions] options
302
+ # Request-specific options
303
+ #
304
+ # @yield [result, err] Result & error if block supplied
305
+ # @yieldparam result [Google::Apis::TpuV1alpha1::ListNodesResponse] parsed result object
306
+ # @yieldparam err [StandardError] error object if request failed
307
+ #
308
+ # @return [Google::Apis::TpuV1alpha1::ListNodesResponse]
309
+ #
310
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
311
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
312
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
313
+ def list_project_location_nodes(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
314
+ command = make_simple_command(:get, 'v1alpha1/{+parent}/nodes', options)
315
+ command.response_representation = Google::Apis::TpuV1alpha1::ListNodesResponse::Representation
316
+ command.response_class = Google::Apis::TpuV1alpha1::ListNodesResponse
317
+ command.params['parent'] = parent unless parent.nil?
318
+ command.query['pageSize'] = page_size unless page_size.nil?
319
+ command.query['pageToken'] = page_token unless page_token.nil?
320
+ command.query['fields'] = fields unless fields.nil?
321
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
322
+ execute_or_queue_command(command, &block)
323
+ end
324
+
325
+ # Reimages a node's OS.
326
+ # @param [String] name
327
+ # The resource name.
328
+ # @param [Google::Apis::TpuV1alpha1::ReimageNodeRequest] reimage_node_request_object
329
+ # @param [String] fields
330
+ # Selector specifying which fields to include in a partial response.
331
+ # @param [String] quota_user
332
+ # Available to use for quota purposes for server-side applications. Can be any
333
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
334
+ # @param [Google::Apis::RequestOptions] options
335
+ # Request-specific options
336
+ #
337
+ # @yield [result, err] Result & error if block supplied
338
+ # @yieldparam result [Google::Apis::TpuV1alpha1::Operation] parsed result object
339
+ # @yieldparam err [StandardError] error object if request failed
340
+ #
341
+ # @return [Google::Apis::TpuV1alpha1::Operation]
342
+ #
343
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
344
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
345
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
346
+ def reimage_project_location_node(name, reimage_node_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
347
+ command = make_simple_command(:post, 'v1alpha1/{+name}:reimage', options)
348
+ command.request_representation = Google::Apis::TpuV1alpha1::ReimageNodeRequest::Representation
349
+ command.request_object = reimage_node_request_object
350
+ command.response_representation = Google::Apis::TpuV1alpha1::Operation::Representation
351
+ command.response_class = Google::Apis::TpuV1alpha1::Operation
352
+ command.params['name'] = name unless name.nil?
353
+ command.query['fields'] = fields unless fields.nil?
354
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
355
+ execute_or_queue_command(command, &block)
356
+ end
357
+
358
+ # Starts a node.
359
+ # @param [String] name
360
+ # The resource name.
361
+ # @param [Google::Apis::TpuV1alpha1::StartNodeRequest] start_node_request_object
362
+ # @param [String] fields
363
+ # Selector specifying which fields to include in a partial response.
364
+ # @param [String] quota_user
365
+ # Available to use for quota purposes for server-side applications. Can be any
366
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
367
+ # @param [Google::Apis::RequestOptions] options
368
+ # Request-specific options
369
+ #
370
+ # @yield [result, err] Result & error if block supplied
371
+ # @yieldparam result [Google::Apis::TpuV1alpha1::Operation] parsed result object
372
+ # @yieldparam err [StandardError] error object if request failed
373
+ #
374
+ # @return [Google::Apis::TpuV1alpha1::Operation]
375
+ #
376
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
377
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
378
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
379
+ def start_node(name, start_node_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
380
+ command = make_simple_command(:post, 'v1alpha1/{+name}:start', options)
381
+ command.request_representation = Google::Apis::TpuV1alpha1::StartNodeRequest::Representation
382
+ command.request_object = start_node_request_object
383
+ command.response_representation = Google::Apis::TpuV1alpha1::Operation::Representation
384
+ command.response_class = Google::Apis::TpuV1alpha1::Operation
385
+ command.params['name'] = name unless name.nil?
386
+ command.query['fields'] = fields unless fields.nil?
387
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
388
+ execute_or_queue_command(command, &block)
389
+ end
390
+
391
+ # Stops a node.
392
+ # @param [String] name
393
+ # The resource name.
394
+ # @param [Google::Apis::TpuV1alpha1::StopNodeRequest] stop_node_request_object
395
+ # @param [String] fields
396
+ # Selector specifying which fields to include in a partial response.
397
+ # @param [String] quota_user
398
+ # Available to use for quota purposes for server-side applications. Can be any
399
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
400
+ # @param [Google::Apis::RequestOptions] options
401
+ # Request-specific options
402
+ #
403
+ # @yield [result, err] Result & error if block supplied
404
+ # @yieldparam result [Google::Apis::TpuV1alpha1::Operation] parsed result object
405
+ # @yieldparam err [StandardError] error object if request failed
406
+ #
407
+ # @return [Google::Apis::TpuV1alpha1::Operation]
408
+ #
409
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
410
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
411
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
412
+ def stop_node(name, stop_node_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
413
+ command = make_simple_command(:post, 'v1alpha1/{+name}:stop', options)
414
+ command.request_representation = Google::Apis::TpuV1alpha1::StopNodeRequest::Representation
415
+ command.request_object = stop_node_request_object
416
+ command.response_representation = Google::Apis::TpuV1alpha1::Operation::Representation
417
+ command.response_class = Google::Apis::TpuV1alpha1::Operation
418
+ command.params['name'] = name unless name.nil?
419
+ command.query['fields'] = fields unless fields.nil?
420
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
421
+ execute_or_queue_command(command, &block)
422
+ end
423
+
424
+ # Starts asynchronous cancellation on a long-running operation. The server makes
425
+ # a best effort to cancel the operation, but success is not guaranteed. If the
426
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
427
+ # Clients can use Operations.GetOperation or other methods to check whether the
428
+ # cancellation succeeded or whether the operation completed despite cancellation.
429
+ # On successful cancellation, the operation is not deleted; instead, it becomes
430
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
431
+ # corresponding to `Code.CANCELLED`.
432
+ # @param [String] name
433
+ # The name of the operation resource to be cancelled.
434
+ # @param [String] fields
435
+ # Selector specifying which fields to include in a partial response.
436
+ # @param [String] quota_user
437
+ # Available to use for quota purposes for server-side applications. Can be any
438
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
439
+ # @param [Google::Apis::RequestOptions] options
440
+ # Request-specific options
441
+ #
442
+ # @yield [result, err] Result & error if block supplied
443
+ # @yieldparam result [Google::Apis::TpuV1alpha1::Empty] parsed result object
444
+ # @yieldparam err [StandardError] error object if request failed
445
+ #
446
+ # @return [Google::Apis::TpuV1alpha1::Empty]
447
+ #
448
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
449
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
450
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
451
+ def cancel_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
452
+ command = make_simple_command(:post, 'v1alpha1/{+name}:cancel', options)
453
+ command.response_representation = Google::Apis::TpuV1alpha1::Empty::Representation
454
+ command.response_class = Google::Apis::TpuV1alpha1::Empty
455
+ command.params['name'] = name unless name.nil?
456
+ command.query['fields'] = fields unless fields.nil?
457
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
458
+ execute_or_queue_command(command, &block)
459
+ end
460
+
461
+ # Deletes a long-running operation. This method indicates that the client is no
462
+ # longer interested in the operation result. It does not cancel the operation.
463
+ # If the server doesn't support this method, it returns `google.rpc.Code.
464
+ # UNIMPLEMENTED`.
465
+ # @param [String] name
466
+ # The name of the operation resource to be deleted.
467
+ # @param [String] fields
468
+ # Selector specifying which fields to include in a partial response.
469
+ # @param [String] quota_user
470
+ # Available to use for quota purposes for server-side applications. Can be any
471
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
472
+ # @param [Google::Apis::RequestOptions] options
473
+ # Request-specific options
474
+ #
475
+ # @yield [result, err] Result & error if block supplied
476
+ # @yieldparam result [Google::Apis::TpuV1alpha1::Empty] parsed result object
477
+ # @yieldparam err [StandardError] error object if request failed
478
+ #
479
+ # @return [Google::Apis::TpuV1alpha1::Empty]
480
+ #
481
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
482
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
483
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
484
+ def delete_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
485
+ command = make_simple_command(:delete, 'v1alpha1/{+name}', options)
486
+ command.response_representation = Google::Apis::TpuV1alpha1::Empty::Representation
487
+ command.response_class = Google::Apis::TpuV1alpha1::Empty
488
+ command.params['name'] = name unless name.nil?
489
+ command.query['fields'] = fields unless fields.nil?
490
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
491
+ execute_or_queue_command(command, &block)
492
+ end
493
+
494
+ # Gets the latest state of a long-running operation. Clients can use this method
495
+ # to poll the operation result at intervals as recommended by the API service.
496
+ # @param [String] name
497
+ # The name of the operation resource.
498
+ # @param [String] fields
499
+ # Selector specifying which fields to include in a partial response.
500
+ # @param [String] quota_user
501
+ # Available to use for quota purposes for server-side applications. Can be any
502
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
503
+ # @param [Google::Apis::RequestOptions] options
504
+ # Request-specific options
505
+ #
506
+ # @yield [result, err] Result & error if block supplied
507
+ # @yieldparam result [Google::Apis::TpuV1alpha1::Operation] parsed result object
508
+ # @yieldparam err [StandardError] error object if request failed
509
+ #
510
+ # @return [Google::Apis::TpuV1alpha1::Operation]
511
+ #
512
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
513
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
514
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
515
+ def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
516
+ command = make_simple_command(:get, 'v1alpha1/{+name}', options)
517
+ command.response_representation = Google::Apis::TpuV1alpha1::Operation::Representation
518
+ command.response_class = Google::Apis::TpuV1alpha1::Operation
519
+ command.params['name'] = name unless name.nil?
520
+ command.query['fields'] = fields unless fields.nil?
521
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
522
+ execute_or_queue_command(command, &block)
523
+ end
524
+
525
+ # Lists operations that match the specified filter in the request. If the server
526
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
527
+ # binding allows API services to override the binding to use different resource
528
+ # name schemes, such as `users/*/operations`. To override the binding, API
529
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
530
+ # service configuration. For backwards compatibility, the default name includes
531
+ # the operations collection id, however overriding users must ensure the name
532
+ # binding is the parent resource, without the operations collection id.
533
+ # @param [String] name
534
+ # The name of the operation's parent resource.
535
+ # @param [String] filter
536
+ # The standard list filter.
537
+ # @param [Fixnum] page_size
538
+ # The standard list page size.
539
+ # @param [String] page_token
540
+ # The standard list page token.
541
+ # @param [String] fields
542
+ # Selector specifying which fields to include in a partial response.
543
+ # @param [String] quota_user
544
+ # Available to use for quota purposes for server-side applications. Can be any
545
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
546
+ # @param [Google::Apis::RequestOptions] options
547
+ # Request-specific options
548
+ #
549
+ # @yield [result, err] Result & error if block supplied
550
+ # @yieldparam result [Google::Apis::TpuV1alpha1::ListOperationsResponse] parsed result object
551
+ # @yieldparam err [StandardError] error object if request failed
552
+ #
553
+ # @return [Google::Apis::TpuV1alpha1::ListOperationsResponse]
554
+ #
555
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
556
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
557
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
558
+ def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
559
+ command = make_simple_command(:get, 'v1alpha1/{+name}/operations', options)
560
+ command.response_representation = Google::Apis::TpuV1alpha1::ListOperationsResponse::Representation
561
+ command.response_class = Google::Apis::TpuV1alpha1::ListOperationsResponse
562
+ command.params['name'] = name unless name.nil?
563
+ command.query['filter'] = filter unless filter.nil?
564
+ command.query['pageSize'] = page_size unless page_size.nil?
565
+ command.query['pageToken'] = page_token unless page_token.nil?
566
+ command.query['fields'] = fields unless fields.nil?
567
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
568
+ execute_or_queue_command(command, &block)
569
+ end
570
+
571
+ # Gets TensorFlow Version.
572
+ # @param [String] name
573
+ # Required. The resource name.
574
+ # @param [String] fields
575
+ # Selector specifying which fields to include in a partial response.
576
+ # @param [String] quota_user
577
+ # Available to use for quota purposes for server-side applications. Can be any
578
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
579
+ # @param [Google::Apis::RequestOptions] options
580
+ # Request-specific options
581
+ #
582
+ # @yield [result, err] Result & error if block supplied
583
+ # @yieldparam result [Google::Apis::TpuV1alpha1::TensorFlowVersion] parsed result object
584
+ # @yieldparam err [StandardError] error object if request failed
585
+ #
586
+ # @return [Google::Apis::TpuV1alpha1::TensorFlowVersion]
587
+ #
588
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
589
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
590
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
591
+ def get_project_location_tensorflow_version(name, fields: nil, quota_user: nil, options: nil, &block)
592
+ command = make_simple_command(:get, 'v1alpha1/{+name}', options)
593
+ command.response_representation = Google::Apis::TpuV1alpha1::TensorFlowVersion::Representation
594
+ command.response_class = Google::Apis::TpuV1alpha1::TensorFlowVersion
595
+ command.params['name'] = name unless name.nil?
596
+ command.query['fields'] = fields unless fields.nil?
597
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
598
+ execute_or_queue_command(command, &block)
599
+ end
600
+
601
+ # Lists TensorFlow versions supported by this API.
602
+ # @param [String] parent
603
+ # Required. The parent resource name.
604
+ # @param [String] filter
605
+ # List filter.
606
+ # @param [String] order_by
607
+ # Sort results.
608
+ # @param [Fixnum] page_size
609
+ # The maximum number of items to return.
610
+ # @param [String] page_token
611
+ # The next_page_token value returned from a previous List request, if any.
612
+ # @param [String] fields
613
+ # Selector specifying which fields to include in a partial response.
614
+ # @param [String] quota_user
615
+ # Available to use for quota purposes for server-side applications. Can be any
616
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
617
+ # @param [Google::Apis::RequestOptions] options
618
+ # Request-specific options
619
+ #
620
+ # @yield [result, err] Result & error if block supplied
621
+ # @yieldparam result [Google::Apis::TpuV1alpha1::ListTensorFlowVersionsResponse] parsed result object
622
+ # @yieldparam err [StandardError] error object if request failed
623
+ #
624
+ # @return [Google::Apis::TpuV1alpha1::ListTensorFlowVersionsResponse]
625
+ #
626
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
627
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
628
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
629
+ def list_project_location_tensorflow_versions(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
630
+ command = make_simple_command(:get, 'v1alpha1/{+parent}/tensorflowVersions', options)
631
+ command.response_representation = Google::Apis::TpuV1alpha1::ListTensorFlowVersionsResponse::Representation
632
+ command.response_class = Google::Apis::TpuV1alpha1::ListTensorFlowVersionsResponse
633
+ command.params['parent'] = parent unless parent.nil?
634
+ command.query['filter'] = filter unless filter.nil?
635
+ command.query['orderBy'] = order_by unless order_by.nil?
636
+ command.query['pageSize'] = page_size unless page_size.nil?
637
+ command.query['pageToken'] = page_token unless page_token.nil?
638
+ command.query['fields'] = fields unless fields.nil?
639
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
640
+ execute_or_queue_command(command, &block)
641
+ end
642
+
643
+ protected
644
+
645
+ def apply_command_defaults(command)
646
+ command.query['key'] = key unless key.nil?
647
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
648
+ end
649
+ end
650
+ end
651
+ end
652
+ end