google-apis-tpu_v2 0.1.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.
- checksums.yaml +7 -0
- data/.yardopts +13 -0
- data/CHANGELOG.md +7 -0
- data/LICENSE.md +202 -0
- data/OVERVIEW.md +96 -0
- data/lib/google/apis/tpu_v2/classes.rb +1021 -0
- data/lib/google/apis/tpu_v2/gem_version.rb +28 -0
- data/lib/google/apis/tpu_v2/representations.rb +504 -0
- data/lib/google/apis/tpu_v2/service.rb +726 -0
- data/lib/google/apis/tpu_v2.rb +36 -0
- data/lib/google-apis-tpu_v2.rb +15 -0
- metadata +82 -0
@@ -0,0 +1,1021 @@
|
|
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 TpuV2
|
24
|
+
|
25
|
+
# A accelerator type that a Node can be configured with.
|
26
|
+
class AcceleratorType
|
27
|
+
include Google::Apis::Core::Hashable
|
28
|
+
|
29
|
+
# The resource name.
|
30
|
+
# Corresponds to the JSON property `name`
|
31
|
+
# @return [String]
|
32
|
+
attr_accessor :name
|
33
|
+
|
34
|
+
# the accelerator type.
|
35
|
+
# Corresponds to the JSON property `type`
|
36
|
+
# @return [String]
|
37
|
+
attr_accessor :type
|
38
|
+
|
39
|
+
def initialize(**args)
|
40
|
+
update!(**args)
|
41
|
+
end
|
42
|
+
|
43
|
+
# Update properties of this object
|
44
|
+
def update!(**args)
|
45
|
+
@name = args[:name] if args.key?(:name)
|
46
|
+
@type = args[:type] if args.key?(:type)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# An access config attached to the TPU worker.
|
51
|
+
class AccessConfig
|
52
|
+
include Google::Apis::Core::Hashable
|
53
|
+
|
54
|
+
# Output only. An external IP address associated with the TPU worker.
|
55
|
+
# Corresponds to the JSON property `externalIp`
|
56
|
+
# @return [String]
|
57
|
+
attr_accessor :external_ip
|
58
|
+
|
59
|
+
def initialize(**args)
|
60
|
+
update!(**args)
|
61
|
+
end
|
62
|
+
|
63
|
+
# Update properties of this object
|
64
|
+
def update!(**args)
|
65
|
+
@external_ip = args[:external_ip] if args.key?(:external_ip)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# A node-attached disk resource. Next ID: 8;
|
70
|
+
class AttachedDisk
|
71
|
+
include Google::Apis::Core::Hashable
|
72
|
+
|
73
|
+
# The mode in which to attach this disk. If not specified, the default is
|
74
|
+
# READ_WRITE mode. Only applicable to data_disks.
|
75
|
+
# Corresponds to the JSON property `mode`
|
76
|
+
# @return [String]
|
77
|
+
attr_accessor :mode
|
78
|
+
|
79
|
+
# Specifies the full path to an existing disk. For example: "projects/my-project/
|
80
|
+
# zones/us-central1-c/disks/my-disk".
|
81
|
+
# Corresponds to the JSON property `sourceDisk`
|
82
|
+
# @return [String]
|
83
|
+
attr_accessor :source_disk
|
84
|
+
|
85
|
+
def initialize(**args)
|
86
|
+
update!(**args)
|
87
|
+
end
|
88
|
+
|
89
|
+
# Update properties of this object
|
90
|
+
def update!(**args)
|
91
|
+
@mode = args[:mode] if args.key?(:mode)
|
92
|
+
@source_disk = args[:source_disk] if args.key?(:source_disk)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
# A generic empty message that you can re-use to avoid defining duplicated empty
|
97
|
+
# messages in your APIs. A typical example is to use it as the request or the
|
98
|
+
# response type of an API method. For instance: service Foo ` rpc Bar(google.
|
99
|
+
# protobuf.Empty) returns (google.protobuf.Empty); `
|
100
|
+
class Empty
|
101
|
+
include Google::Apis::Core::Hashable
|
102
|
+
|
103
|
+
def initialize(**args)
|
104
|
+
update!(**args)
|
105
|
+
end
|
106
|
+
|
107
|
+
# Update properties of this object
|
108
|
+
def update!(**args)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
# Request for GenerateServiceIdentity.
|
113
|
+
class GenerateServiceIdentityRequest
|
114
|
+
include Google::Apis::Core::Hashable
|
115
|
+
|
116
|
+
def initialize(**args)
|
117
|
+
update!(**args)
|
118
|
+
end
|
119
|
+
|
120
|
+
# Update properties of this object
|
121
|
+
def update!(**args)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
# Response for GenerateServiceIdentity.
|
126
|
+
class GenerateServiceIdentityResponse
|
127
|
+
include Google::Apis::Core::Hashable
|
128
|
+
|
129
|
+
# The per-product per-project service identity for Cloud TPU service.
|
130
|
+
# Corresponds to the JSON property `identity`
|
131
|
+
# @return [Google::Apis::TpuV2::ServiceIdentity]
|
132
|
+
attr_accessor :identity
|
133
|
+
|
134
|
+
def initialize(**args)
|
135
|
+
update!(**args)
|
136
|
+
end
|
137
|
+
|
138
|
+
# Update properties of this object
|
139
|
+
def update!(**args)
|
140
|
+
@identity = args[:identity] if args.key?(:identity)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
# Request for GetGuestAttributes.
|
145
|
+
class GetGuestAttributesRequest
|
146
|
+
include Google::Apis::Core::Hashable
|
147
|
+
|
148
|
+
# The guest attributes path to be queried.
|
149
|
+
# Corresponds to the JSON property `queryPath`
|
150
|
+
# @return [String]
|
151
|
+
attr_accessor :query_path
|
152
|
+
|
153
|
+
# The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
|
154
|
+
# returned.
|
155
|
+
# Corresponds to the JSON property `workerIds`
|
156
|
+
# @return [Array<String>]
|
157
|
+
attr_accessor :worker_ids
|
158
|
+
|
159
|
+
def initialize(**args)
|
160
|
+
update!(**args)
|
161
|
+
end
|
162
|
+
|
163
|
+
# Update properties of this object
|
164
|
+
def update!(**args)
|
165
|
+
@query_path = args[:query_path] if args.key?(:query_path)
|
166
|
+
@worker_ids = args[:worker_ids] if args.key?(:worker_ids)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
# Response for GetGuestAttributes.
|
171
|
+
class GetGuestAttributesResponse
|
172
|
+
include Google::Apis::Core::Hashable
|
173
|
+
|
174
|
+
# The guest attributes for the TPU workers.
|
175
|
+
# Corresponds to the JSON property `guestAttributes`
|
176
|
+
# @return [Array<Google::Apis::TpuV2::GuestAttributes>]
|
177
|
+
attr_accessor :guest_attributes
|
178
|
+
|
179
|
+
def initialize(**args)
|
180
|
+
update!(**args)
|
181
|
+
end
|
182
|
+
|
183
|
+
# Update properties of this object
|
184
|
+
def update!(**args)
|
185
|
+
@guest_attributes = args[:guest_attributes] if args.key?(:guest_attributes)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
# A guest attributes.
|
190
|
+
class GuestAttributes
|
191
|
+
include Google::Apis::Core::Hashable
|
192
|
+
|
193
|
+
# The path to be queried. This can be the default namespace ('/') or a nested
|
194
|
+
# namespace ('/\/') or a specified key ('/\/\')
|
195
|
+
# Corresponds to the JSON property `queryPath`
|
196
|
+
# @return [String]
|
197
|
+
attr_accessor :query_path
|
198
|
+
|
199
|
+
# Array of guest attribute namespace/key/value tuples.
|
200
|
+
# Corresponds to the JSON property `queryValue`
|
201
|
+
# @return [Google::Apis::TpuV2::GuestAttributesValue]
|
202
|
+
attr_accessor :query_value
|
203
|
+
|
204
|
+
def initialize(**args)
|
205
|
+
update!(**args)
|
206
|
+
end
|
207
|
+
|
208
|
+
# Update properties of this object
|
209
|
+
def update!(**args)
|
210
|
+
@query_path = args[:query_path] if args.key?(:query_path)
|
211
|
+
@query_value = args[:query_value] if args.key?(:query_value)
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
# A guest attributes namespace/key/value entry.
|
216
|
+
class GuestAttributesEntry
|
217
|
+
include Google::Apis::Core::Hashable
|
218
|
+
|
219
|
+
# Key for the guest attribute entry.
|
220
|
+
# Corresponds to the JSON property `key`
|
221
|
+
# @return [String]
|
222
|
+
attr_accessor :key
|
223
|
+
|
224
|
+
# Namespace for the guest attribute entry.
|
225
|
+
# Corresponds to the JSON property `namespace`
|
226
|
+
# @return [String]
|
227
|
+
attr_accessor :namespace
|
228
|
+
|
229
|
+
# Value for the guest attribute entry.
|
230
|
+
# Corresponds to the JSON property `value`
|
231
|
+
# @return [String]
|
232
|
+
attr_accessor :value
|
233
|
+
|
234
|
+
def initialize(**args)
|
235
|
+
update!(**args)
|
236
|
+
end
|
237
|
+
|
238
|
+
# Update properties of this object
|
239
|
+
def update!(**args)
|
240
|
+
@key = args[:key] if args.key?(:key)
|
241
|
+
@namespace = args[:namespace] if args.key?(:namespace)
|
242
|
+
@value = args[:value] if args.key?(:value)
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
# Array of guest attribute namespace/key/value tuples.
|
247
|
+
class GuestAttributesValue
|
248
|
+
include Google::Apis::Core::Hashable
|
249
|
+
|
250
|
+
# The list of guest attributes entries.
|
251
|
+
# Corresponds to the JSON property `items`
|
252
|
+
# @return [Array<Google::Apis::TpuV2::GuestAttributesEntry>]
|
253
|
+
attr_accessor :items
|
254
|
+
|
255
|
+
def initialize(**args)
|
256
|
+
update!(**args)
|
257
|
+
end
|
258
|
+
|
259
|
+
# Update properties of this object
|
260
|
+
def update!(**args)
|
261
|
+
@items = args[:items] if args.key?(:items)
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
# Response for ListAcceleratorTypes.
|
266
|
+
class ListAcceleratorTypesResponse
|
267
|
+
include Google::Apis::Core::Hashable
|
268
|
+
|
269
|
+
# The listed nodes.
|
270
|
+
# Corresponds to the JSON property `acceleratorTypes`
|
271
|
+
# @return [Array<Google::Apis::TpuV2::AcceleratorType>]
|
272
|
+
attr_accessor :accelerator_types
|
273
|
+
|
274
|
+
# The next page token or empty if none.
|
275
|
+
# Corresponds to the JSON property `nextPageToken`
|
276
|
+
# @return [String]
|
277
|
+
attr_accessor :next_page_token
|
278
|
+
|
279
|
+
# Locations that could not be reached.
|
280
|
+
# Corresponds to the JSON property `unreachable`
|
281
|
+
# @return [Array<String>]
|
282
|
+
attr_accessor :unreachable
|
283
|
+
|
284
|
+
def initialize(**args)
|
285
|
+
update!(**args)
|
286
|
+
end
|
287
|
+
|
288
|
+
# Update properties of this object
|
289
|
+
def update!(**args)
|
290
|
+
@accelerator_types = args[:accelerator_types] if args.key?(:accelerator_types)
|
291
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
292
|
+
@unreachable = args[:unreachable] if args.key?(:unreachable)
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
296
|
+
# The response message for Locations.ListLocations.
|
297
|
+
class ListLocationsResponse
|
298
|
+
include Google::Apis::Core::Hashable
|
299
|
+
|
300
|
+
# A list of locations that matches the specified filter in the request.
|
301
|
+
# Corresponds to the JSON property `locations`
|
302
|
+
# @return [Array<Google::Apis::TpuV2::Location>]
|
303
|
+
attr_accessor :locations
|
304
|
+
|
305
|
+
# The standard List next-page token.
|
306
|
+
# Corresponds to the JSON property `nextPageToken`
|
307
|
+
# @return [String]
|
308
|
+
attr_accessor :next_page_token
|
309
|
+
|
310
|
+
def initialize(**args)
|
311
|
+
update!(**args)
|
312
|
+
end
|
313
|
+
|
314
|
+
# Update properties of this object
|
315
|
+
def update!(**args)
|
316
|
+
@locations = args[:locations] if args.key?(:locations)
|
317
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
# Response for ListNodes.
|
322
|
+
class ListNodesResponse
|
323
|
+
include Google::Apis::Core::Hashable
|
324
|
+
|
325
|
+
# The next page token or empty if none.
|
326
|
+
# Corresponds to the JSON property `nextPageToken`
|
327
|
+
# @return [String]
|
328
|
+
attr_accessor :next_page_token
|
329
|
+
|
330
|
+
# The listed nodes.
|
331
|
+
# Corresponds to the JSON property `nodes`
|
332
|
+
# @return [Array<Google::Apis::TpuV2::Node>]
|
333
|
+
attr_accessor :nodes
|
334
|
+
|
335
|
+
# Locations that could not be reached.
|
336
|
+
# Corresponds to the JSON property `unreachable`
|
337
|
+
# @return [Array<String>]
|
338
|
+
attr_accessor :unreachable
|
339
|
+
|
340
|
+
def initialize(**args)
|
341
|
+
update!(**args)
|
342
|
+
end
|
343
|
+
|
344
|
+
# Update properties of this object
|
345
|
+
def update!(**args)
|
346
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
347
|
+
@nodes = args[:nodes] if args.key?(:nodes)
|
348
|
+
@unreachable = args[:unreachable] if args.key?(:unreachable)
|
349
|
+
end
|
350
|
+
end
|
351
|
+
|
352
|
+
# The response message for Operations.ListOperations.
|
353
|
+
class ListOperationsResponse
|
354
|
+
include Google::Apis::Core::Hashable
|
355
|
+
|
356
|
+
# The standard List next-page token.
|
357
|
+
# Corresponds to the JSON property `nextPageToken`
|
358
|
+
# @return [String]
|
359
|
+
attr_accessor :next_page_token
|
360
|
+
|
361
|
+
# A list of operations that matches the specified filter in the request.
|
362
|
+
# Corresponds to the JSON property `operations`
|
363
|
+
# @return [Array<Google::Apis::TpuV2::Operation>]
|
364
|
+
attr_accessor :operations
|
365
|
+
|
366
|
+
def initialize(**args)
|
367
|
+
update!(**args)
|
368
|
+
end
|
369
|
+
|
370
|
+
# Update properties of this object
|
371
|
+
def update!(**args)
|
372
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
373
|
+
@operations = args[:operations] if args.key?(:operations)
|
374
|
+
end
|
375
|
+
end
|
376
|
+
|
377
|
+
# Response for ListRuntimeVersions.
|
378
|
+
class ListRuntimeVersionsResponse
|
379
|
+
include Google::Apis::Core::Hashable
|
380
|
+
|
381
|
+
# The next page token or empty if none.
|
382
|
+
# Corresponds to the JSON property `nextPageToken`
|
383
|
+
# @return [String]
|
384
|
+
attr_accessor :next_page_token
|
385
|
+
|
386
|
+
# The listed nodes.
|
387
|
+
# Corresponds to the JSON property `runtimeVersions`
|
388
|
+
# @return [Array<Google::Apis::TpuV2::RuntimeVersion>]
|
389
|
+
attr_accessor :runtime_versions
|
390
|
+
|
391
|
+
# Locations that could not be reached.
|
392
|
+
# Corresponds to the JSON property `unreachable`
|
393
|
+
# @return [Array<String>]
|
394
|
+
attr_accessor :unreachable
|
395
|
+
|
396
|
+
def initialize(**args)
|
397
|
+
update!(**args)
|
398
|
+
end
|
399
|
+
|
400
|
+
# Update properties of this object
|
401
|
+
def update!(**args)
|
402
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
403
|
+
@runtime_versions = args[:runtime_versions] if args.key?(:runtime_versions)
|
404
|
+
@unreachable = args[:unreachable] if args.key?(:unreachable)
|
405
|
+
end
|
406
|
+
end
|
407
|
+
|
408
|
+
# A resource that represents Google Cloud Platform location.
|
409
|
+
class Location
|
410
|
+
include Google::Apis::Core::Hashable
|
411
|
+
|
412
|
+
# The friendly name for this location, typically a nearby city name. For example,
|
413
|
+
# "Tokyo".
|
414
|
+
# Corresponds to the JSON property `displayName`
|
415
|
+
# @return [String]
|
416
|
+
attr_accessor :display_name
|
417
|
+
|
418
|
+
# Cross-service attributes for the location. For example `"cloud.googleapis.com/
|
419
|
+
# region": "us-east1"`
|
420
|
+
# Corresponds to the JSON property `labels`
|
421
|
+
# @return [Hash<String,String>]
|
422
|
+
attr_accessor :labels
|
423
|
+
|
424
|
+
# The canonical id for this location. For example: `"us-east1"`.
|
425
|
+
# Corresponds to the JSON property `locationId`
|
426
|
+
# @return [String]
|
427
|
+
attr_accessor :location_id
|
428
|
+
|
429
|
+
# Service-specific metadata. For example the available capacity at the given
|
430
|
+
# location.
|
431
|
+
# Corresponds to the JSON property `metadata`
|
432
|
+
# @return [Hash<String,Object>]
|
433
|
+
attr_accessor :metadata
|
434
|
+
|
435
|
+
# Resource name for the location, which may vary between implementations. For
|
436
|
+
# example: `"projects/example-project/locations/us-east1"`
|
437
|
+
# Corresponds to the JSON property `name`
|
438
|
+
# @return [String]
|
439
|
+
attr_accessor :name
|
440
|
+
|
441
|
+
def initialize(**args)
|
442
|
+
update!(**args)
|
443
|
+
end
|
444
|
+
|
445
|
+
# Update properties of this object
|
446
|
+
def update!(**args)
|
447
|
+
@display_name = args[:display_name] if args.key?(:display_name)
|
448
|
+
@labels = args[:labels] if args.key?(:labels)
|
449
|
+
@location_id = args[:location_id] if args.key?(:location_id)
|
450
|
+
@metadata = args[:metadata] if args.key?(:metadata)
|
451
|
+
@name = args[:name] if args.key?(:name)
|
452
|
+
end
|
453
|
+
end
|
454
|
+
|
455
|
+
# Network related configurations.
|
456
|
+
class NetworkConfig
|
457
|
+
include Google::Apis::Core::Hashable
|
458
|
+
|
459
|
+
# Allows the TPU node to send and receive packets with non-matching destination
|
460
|
+
# or source IPs. This is required if you plan to use the TPU workers to forward
|
461
|
+
# routes.
|
462
|
+
# Corresponds to the JSON property `canIpForward`
|
463
|
+
# @return [Boolean]
|
464
|
+
attr_accessor :can_ip_forward
|
465
|
+
alias_method :can_ip_forward?, :can_ip_forward
|
466
|
+
|
467
|
+
# Indicates that external IP addresses would be associated with the TPU workers.
|
468
|
+
# If set to false, the specified subnetwork or network should have Private
|
469
|
+
# Google Access enabled.
|
470
|
+
# Corresponds to the JSON property `enableExternalIps`
|
471
|
+
# @return [Boolean]
|
472
|
+
attr_accessor :enable_external_ips
|
473
|
+
alias_method :enable_external_ips?, :enable_external_ips
|
474
|
+
|
475
|
+
# The name of the network for the TPU node. It must be a preexisting Google
|
476
|
+
# Compute Engine network. If none is provided, "default" will be used.
|
477
|
+
# Corresponds to the JSON property `network`
|
478
|
+
# @return [String]
|
479
|
+
attr_accessor :network
|
480
|
+
|
481
|
+
# The name of the subnetwork for the TPU node. It must be a preexisting Google
|
482
|
+
# Compute Engine subnetwork. If none is provided, "default" will be used.
|
483
|
+
# Corresponds to the JSON property `subnetwork`
|
484
|
+
# @return [String]
|
485
|
+
attr_accessor :subnetwork
|
486
|
+
|
487
|
+
def initialize(**args)
|
488
|
+
update!(**args)
|
489
|
+
end
|
490
|
+
|
491
|
+
# Update properties of this object
|
492
|
+
def update!(**args)
|
493
|
+
@can_ip_forward = args[:can_ip_forward] if args.key?(:can_ip_forward)
|
494
|
+
@enable_external_ips = args[:enable_external_ips] if args.key?(:enable_external_ips)
|
495
|
+
@network = args[:network] if args.key?(:network)
|
496
|
+
@subnetwork = args[:subnetwork] if args.key?(:subnetwork)
|
497
|
+
end
|
498
|
+
end
|
499
|
+
|
500
|
+
# A network endpoint over which a TPU worker can be reached.
|
501
|
+
class NetworkEndpoint
|
502
|
+
include Google::Apis::Core::Hashable
|
503
|
+
|
504
|
+
# An access config attached to the TPU worker.
|
505
|
+
# Corresponds to the JSON property `accessConfig`
|
506
|
+
# @return [Google::Apis::TpuV2::AccessConfig]
|
507
|
+
attr_accessor :access_config
|
508
|
+
|
509
|
+
# The internal IP address of this network endpoint.
|
510
|
+
# Corresponds to the JSON property `ipAddress`
|
511
|
+
# @return [String]
|
512
|
+
attr_accessor :ip_address
|
513
|
+
|
514
|
+
# The port of this network endpoint.
|
515
|
+
# Corresponds to the JSON property `port`
|
516
|
+
# @return [Fixnum]
|
517
|
+
attr_accessor :port
|
518
|
+
|
519
|
+
def initialize(**args)
|
520
|
+
update!(**args)
|
521
|
+
end
|
522
|
+
|
523
|
+
# Update properties of this object
|
524
|
+
def update!(**args)
|
525
|
+
@access_config = args[:access_config] if args.key?(:access_config)
|
526
|
+
@ip_address = args[:ip_address] if args.key?(:ip_address)
|
527
|
+
@port = args[:port] if args.key?(:port)
|
528
|
+
end
|
529
|
+
end
|
530
|
+
|
531
|
+
# A TPU instance.
|
532
|
+
class Node
|
533
|
+
include Google::Apis::Core::Hashable
|
534
|
+
|
535
|
+
# Required. The type of hardware accelerators associated with this node.
|
536
|
+
# Corresponds to the JSON property `acceleratorType`
|
537
|
+
# @return [String]
|
538
|
+
attr_accessor :accelerator_type
|
539
|
+
|
540
|
+
# Output only. The API version that created this Node.
|
541
|
+
# Corresponds to the JSON property `apiVersion`
|
542
|
+
# @return [String]
|
543
|
+
attr_accessor :api_version
|
544
|
+
|
545
|
+
# The CIDR block that the TPU node will use when selecting an IP address. This
|
546
|
+
# CIDR block must be a /29 block; the Compute Engine networks API forbids a
|
547
|
+
# smaller block, and using a larger block would be wasteful (a node can only
|
548
|
+
# consume one IP address). Errors will occur if the CIDR block has already been
|
549
|
+
# used for a currently existing TPU node, the CIDR block conflicts with any
|
550
|
+
# subnetworks in the user's provided network, or the provided network is peered
|
551
|
+
# with another network that is using that CIDR block.
|
552
|
+
# Corresponds to the JSON property `cidrBlock`
|
553
|
+
# @return [String]
|
554
|
+
attr_accessor :cidr_block
|
555
|
+
|
556
|
+
# Output only. The time when the node was created.
|
557
|
+
# Corresponds to the JSON property `createTime`
|
558
|
+
# @return [String]
|
559
|
+
attr_accessor :create_time
|
560
|
+
|
561
|
+
# The additional data disks for the Node.
|
562
|
+
# Corresponds to the JSON property `dataDisks`
|
563
|
+
# @return [Array<Google::Apis::TpuV2::AttachedDisk>]
|
564
|
+
attr_accessor :data_disks
|
565
|
+
|
566
|
+
# The user-supplied description of the TPU. Maximum of 512 characters.
|
567
|
+
# Corresponds to the JSON property `description`
|
568
|
+
# @return [String]
|
569
|
+
attr_accessor :description
|
570
|
+
|
571
|
+
# The health status of the TPU node.
|
572
|
+
# Corresponds to the JSON property `health`
|
573
|
+
# @return [String]
|
574
|
+
attr_accessor :health
|
575
|
+
|
576
|
+
# Output only. If this field is populated, it contains a description of why the
|
577
|
+
# TPU Node is unhealthy.
|
578
|
+
# Corresponds to the JSON property `healthDescription`
|
579
|
+
# @return [String]
|
580
|
+
attr_accessor :health_description
|
581
|
+
|
582
|
+
# Output only. The unique identifier for the TPU Node.
|
583
|
+
# Corresponds to the JSON property `id`
|
584
|
+
# @return [Fixnum]
|
585
|
+
attr_accessor :id
|
586
|
+
|
587
|
+
# Resource labels to represent user-provided metadata.
|
588
|
+
# Corresponds to the JSON property `labels`
|
589
|
+
# @return [Hash<String,String>]
|
590
|
+
attr_accessor :labels
|
591
|
+
|
592
|
+
# Custom metadata to apply to the TPU Node. Can set startup-script and shutdown-
|
593
|
+
# script
|
594
|
+
# Corresponds to the JSON property `metadata`
|
595
|
+
# @return [Hash<String,String>]
|
596
|
+
attr_accessor :metadata
|
597
|
+
|
598
|
+
# Output only. Immutable. The name of the TPU.
|
599
|
+
# Corresponds to the JSON property `name`
|
600
|
+
# @return [String]
|
601
|
+
attr_accessor :name
|
602
|
+
|
603
|
+
# Network related configurations.
|
604
|
+
# Corresponds to the JSON property `networkConfig`
|
605
|
+
# @return [Google::Apis::TpuV2::NetworkConfig]
|
606
|
+
attr_accessor :network_config
|
607
|
+
|
608
|
+
# Output only. The network endpoints where TPU workers can be accessed and sent
|
609
|
+
# work. It is recommended that runtime clients of the node reach out to the 0th
|
610
|
+
# entry in this map first.
|
611
|
+
# Corresponds to the JSON property `networkEndpoints`
|
612
|
+
# @return [Array<Google::Apis::TpuV2::NetworkEndpoint>]
|
613
|
+
attr_accessor :network_endpoints
|
614
|
+
|
615
|
+
# Required. The runtime version running in the Node.
|
616
|
+
# Corresponds to the JSON property `runtimeVersion`
|
617
|
+
# @return [String]
|
618
|
+
attr_accessor :runtime_version
|
619
|
+
|
620
|
+
# Sets the scheduling options for this node.
|
621
|
+
# Corresponds to the JSON property `schedulingConfig`
|
622
|
+
# @return [Google::Apis::TpuV2::SchedulingConfig]
|
623
|
+
attr_accessor :scheduling_config
|
624
|
+
|
625
|
+
# A service account.
|
626
|
+
# Corresponds to the JSON property `serviceAccount`
|
627
|
+
# @return [Google::Apis::TpuV2::ServiceAccount]
|
628
|
+
attr_accessor :service_account
|
629
|
+
|
630
|
+
# A set of Shielded Instance options.
|
631
|
+
# Corresponds to the JSON property `shieldedInstanceConfig`
|
632
|
+
# @return [Google::Apis::TpuV2::ShieldedInstanceConfig]
|
633
|
+
attr_accessor :shielded_instance_config
|
634
|
+
|
635
|
+
# Output only. The current state for the TPU Node.
|
636
|
+
# Corresponds to the JSON property `state`
|
637
|
+
# @return [String]
|
638
|
+
attr_accessor :state
|
639
|
+
|
640
|
+
# Output only. The Symptoms that have occurred to the TPU Node.
|
641
|
+
# Corresponds to the JSON property `symptoms`
|
642
|
+
# @return [Array<Google::Apis::TpuV2::Symptom>]
|
643
|
+
attr_accessor :symptoms
|
644
|
+
|
645
|
+
# Tags to apply to the TPU Node. Tags are used to identify valid sources or
|
646
|
+
# targets for network firewalls.
|
647
|
+
# Corresponds to the JSON property `tags`
|
648
|
+
# @return [Array<String>]
|
649
|
+
attr_accessor :tags
|
650
|
+
|
651
|
+
def initialize(**args)
|
652
|
+
update!(**args)
|
653
|
+
end
|
654
|
+
|
655
|
+
# Update properties of this object
|
656
|
+
def update!(**args)
|
657
|
+
@accelerator_type = args[:accelerator_type] if args.key?(:accelerator_type)
|
658
|
+
@api_version = args[:api_version] if args.key?(:api_version)
|
659
|
+
@cidr_block = args[:cidr_block] if args.key?(:cidr_block)
|
660
|
+
@create_time = args[:create_time] if args.key?(:create_time)
|
661
|
+
@data_disks = args[:data_disks] if args.key?(:data_disks)
|
662
|
+
@description = args[:description] if args.key?(:description)
|
663
|
+
@health = args[:health] if args.key?(:health)
|
664
|
+
@health_description = args[:health_description] if args.key?(:health_description)
|
665
|
+
@id = args[:id] if args.key?(:id)
|
666
|
+
@labels = args[:labels] if args.key?(:labels)
|
667
|
+
@metadata = args[:metadata] if args.key?(:metadata)
|
668
|
+
@name = args[:name] if args.key?(:name)
|
669
|
+
@network_config = args[:network_config] if args.key?(:network_config)
|
670
|
+
@network_endpoints = args[:network_endpoints] if args.key?(:network_endpoints)
|
671
|
+
@runtime_version = args[:runtime_version] if args.key?(:runtime_version)
|
672
|
+
@scheduling_config = args[:scheduling_config] if args.key?(:scheduling_config)
|
673
|
+
@service_account = args[:service_account] if args.key?(:service_account)
|
674
|
+
@shielded_instance_config = args[:shielded_instance_config] if args.key?(:shielded_instance_config)
|
675
|
+
@state = args[:state] if args.key?(:state)
|
676
|
+
@symptoms = args[:symptoms] if args.key?(:symptoms)
|
677
|
+
@tags = args[:tags] if args.key?(:tags)
|
678
|
+
end
|
679
|
+
end
|
680
|
+
|
681
|
+
# This resource represents a long-running operation that is the result of a
|
682
|
+
# network API call.
|
683
|
+
class Operation
|
684
|
+
include Google::Apis::Core::Hashable
|
685
|
+
|
686
|
+
# If the value is `false`, it means the operation is still in progress. If `true`
|
687
|
+
# , the operation is completed, and either `error` or `response` is available.
|
688
|
+
# Corresponds to the JSON property `done`
|
689
|
+
# @return [Boolean]
|
690
|
+
attr_accessor :done
|
691
|
+
alias_method :done?, :done
|
692
|
+
|
693
|
+
# The `Status` type defines a logical error model that is suitable for different
|
694
|
+
# programming environments, including REST APIs and RPC APIs. It is used by [
|
695
|
+
# gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
|
696
|
+
# data: error code, error message, and error details. You can find out more
|
697
|
+
# about this error model and how to work with it in the [API Design Guide](https:
|
698
|
+
# //cloud.google.com/apis/design/errors).
|
699
|
+
# Corresponds to the JSON property `error`
|
700
|
+
# @return [Google::Apis::TpuV2::Status]
|
701
|
+
attr_accessor :error
|
702
|
+
|
703
|
+
# Service-specific metadata associated with the operation. It typically contains
|
704
|
+
# progress information and common metadata such as create time. Some services
|
705
|
+
# might not provide such metadata. Any method that returns a long-running
|
706
|
+
# operation should document the metadata type, if any.
|
707
|
+
# Corresponds to the JSON property `metadata`
|
708
|
+
# @return [Hash<String,Object>]
|
709
|
+
attr_accessor :metadata
|
710
|
+
|
711
|
+
# The server-assigned name, which is only unique within the same service that
|
712
|
+
# originally returns it. If you use the default HTTP mapping, the `name` should
|
713
|
+
# be a resource name ending with `operations/`unique_id``.
|
714
|
+
# Corresponds to the JSON property `name`
|
715
|
+
# @return [String]
|
716
|
+
attr_accessor :name
|
717
|
+
|
718
|
+
# The normal response of the operation in case of success. If the original
|
719
|
+
# method returns no data on success, such as `Delete`, the response is `google.
|
720
|
+
# protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`,
|
721
|
+
# the response should be the resource. For other methods, the response should
|
722
|
+
# have the type `XxxResponse`, where `Xxx` is the original method name. For
|
723
|
+
# example, if the original method name is `TakeSnapshot()`, the inferred
|
724
|
+
# response type is `TakeSnapshotResponse`.
|
725
|
+
# Corresponds to the JSON property `response`
|
726
|
+
# @return [Hash<String,Object>]
|
727
|
+
attr_accessor :response
|
728
|
+
|
729
|
+
def initialize(**args)
|
730
|
+
update!(**args)
|
731
|
+
end
|
732
|
+
|
733
|
+
# Update properties of this object
|
734
|
+
def update!(**args)
|
735
|
+
@done = args[:done] if args.key?(:done)
|
736
|
+
@error = args[:error] if args.key?(:error)
|
737
|
+
@metadata = args[:metadata] if args.key?(:metadata)
|
738
|
+
@name = args[:name] if args.key?(:name)
|
739
|
+
@response = args[:response] if args.key?(:response)
|
740
|
+
end
|
741
|
+
end
|
742
|
+
|
743
|
+
# Metadata describing an Operation
|
744
|
+
class OperationMetadata
|
745
|
+
include Google::Apis::Core::Hashable
|
746
|
+
|
747
|
+
# API version.
|
748
|
+
# Corresponds to the JSON property `apiVersion`
|
749
|
+
# @return [String]
|
750
|
+
attr_accessor :api_version
|
751
|
+
|
752
|
+
# Specifies if cancellation was requested for the operation.
|
753
|
+
# Corresponds to the JSON property `cancelRequested`
|
754
|
+
# @return [Boolean]
|
755
|
+
attr_accessor :cancel_requested
|
756
|
+
alias_method :cancel_requested?, :cancel_requested
|
757
|
+
|
758
|
+
# The time the operation was created.
|
759
|
+
# Corresponds to the JSON property `createTime`
|
760
|
+
# @return [String]
|
761
|
+
attr_accessor :create_time
|
762
|
+
|
763
|
+
# The time the operation finished running.
|
764
|
+
# Corresponds to the JSON property `endTime`
|
765
|
+
# @return [String]
|
766
|
+
attr_accessor :end_time
|
767
|
+
|
768
|
+
# Human-readable status of the operation, if any.
|
769
|
+
# Corresponds to the JSON property `statusDetail`
|
770
|
+
# @return [String]
|
771
|
+
attr_accessor :status_detail
|
772
|
+
|
773
|
+
# Target of the operation - for example projects/project-1/connectivityTests/
|
774
|
+
# test-1
|
775
|
+
# Corresponds to the JSON property `target`
|
776
|
+
# @return [String]
|
777
|
+
attr_accessor :target
|
778
|
+
|
779
|
+
# Name of the verb executed by the operation.
|
780
|
+
# Corresponds to the JSON property `verb`
|
781
|
+
# @return [String]
|
782
|
+
attr_accessor :verb
|
783
|
+
|
784
|
+
def initialize(**args)
|
785
|
+
update!(**args)
|
786
|
+
end
|
787
|
+
|
788
|
+
# Update properties of this object
|
789
|
+
def update!(**args)
|
790
|
+
@api_version = args[:api_version] if args.key?(:api_version)
|
791
|
+
@cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)
|
792
|
+
@create_time = args[:create_time] if args.key?(:create_time)
|
793
|
+
@end_time = args[:end_time] if args.key?(:end_time)
|
794
|
+
@status_detail = args[:status_detail] if args.key?(:status_detail)
|
795
|
+
@target = args[:target] if args.key?(:target)
|
796
|
+
@verb = args[:verb] if args.key?(:verb)
|
797
|
+
end
|
798
|
+
end
|
799
|
+
|
800
|
+
# A runtime version that a Node can be configured with.
|
801
|
+
class RuntimeVersion
|
802
|
+
include Google::Apis::Core::Hashable
|
803
|
+
|
804
|
+
# The resource name.
|
805
|
+
# Corresponds to the JSON property `name`
|
806
|
+
# @return [String]
|
807
|
+
attr_accessor :name
|
808
|
+
|
809
|
+
# The runtime version.
|
810
|
+
# Corresponds to the JSON property `version`
|
811
|
+
# @return [String]
|
812
|
+
attr_accessor :version
|
813
|
+
|
814
|
+
def initialize(**args)
|
815
|
+
update!(**args)
|
816
|
+
end
|
817
|
+
|
818
|
+
# Update properties of this object
|
819
|
+
def update!(**args)
|
820
|
+
@name = args[:name] if args.key?(:name)
|
821
|
+
@version = args[:version] if args.key?(:version)
|
822
|
+
end
|
823
|
+
end
|
824
|
+
|
825
|
+
# Sets the scheduling options for this node.
|
826
|
+
class SchedulingConfig
|
827
|
+
include Google::Apis::Core::Hashable
|
828
|
+
|
829
|
+
# Defines whether the node is preemptible.
|
830
|
+
# Corresponds to the JSON property `preemptible`
|
831
|
+
# @return [Boolean]
|
832
|
+
attr_accessor :preemptible
|
833
|
+
alias_method :preemptible?, :preemptible
|
834
|
+
|
835
|
+
# Whether the node is created under a reservation.
|
836
|
+
# Corresponds to the JSON property `reserved`
|
837
|
+
# @return [Boolean]
|
838
|
+
attr_accessor :reserved
|
839
|
+
alias_method :reserved?, :reserved
|
840
|
+
|
841
|
+
def initialize(**args)
|
842
|
+
update!(**args)
|
843
|
+
end
|
844
|
+
|
845
|
+
# Update properties of this object
|
846
|
+
def update!(**args)
|
847
|
+
@preemptible = args[:preemptible] if args.key?(:preemptible)
|
848
|
+
@reserved = args[:reserved] if args.key?(:reserved)
|
849
|
+
end
|
850
|
+
end
|
851
|
+
|
852
|
+
# A service account.
|
853
|
+
class ServiceAccount
|
854
|
+
include Google::Apis::Core::Hashable
|
855
|
+
|
856
|
+
# Email address of the service account. If empty, default Compute service
|
857
|
+
# account will be used.
|
858
|
+
# Corresponds to the JSON property `email`
|
859
|
+
# @return [String]
|
860
|
+
attr_accessor :email
|
861
|
+
|
862
|
+
# The list of scopes to be made available for this service account. If empty,
|
863
|
+
# access to all Cloud APIs will be allowed.
|
864
|
+
# Corresponds to the JSON property `scope`
|
865
|
+
# @return [Array<String>]
|
866
|
+
attr_accessor :scope
|
867
|
+
|
868
|
+
def initialize(**args)
|
869
|
+
update!(**args)
|
870
|
+
end
|
871
|
+
|
872
|
+
# Update properties of this object
|
873
|
+
def update!(**args)
|
874
|
+
@email = args[:email] if args.key?(:email)
|
875
|
+
@scope = args[:scope] if args.key?(:scope)
|
876
|
+
end
|
877
|
+
end
|
878
|
+
|
879
|
+
# The per-product per-project service identity for Cloud TPU service.
|
880
|
+
class ServiceIdentity
|
881
|
+
include Google::Apis::Core::Hashable
|
882
|
+
|
883
|
+
# The email address of the service identity.
|
884
|
+
# Corresponds to the JSON property `email`
|
885
|
+
# @return [String]
|
886
|
+
attr_accessor :email
|
887
|
+
|
888
|
+
def initialize(**args)
|
889
|
+
update!(**args)
|
890
|
+
end
|
891
|
+
|
892
|
+
# Update properties of this object
|
893
|
+
def update!(**args)
|
894
|
+
@email = args[:email] if args.key?(:email)
|
895
|
+
end
|
896
|
+
end
|
897
|
+
|
898
|
+
# A set of Shielded Instance options.
|
899
|
+
class ShieldedInstanceConfig
|
900
|
+
include Google::Apis::Core::Hashable
|
901
|
+
|
902
|
+
# Defines whether the instance has Secure Boot enabled.
|
903
|
+
# Corresponds to the JSON property `enableSecureBoot`
|
904
|
+
# @return [Boolean]
|
905
|
+
attr_accessor :enable_secure_boot
|
906
|
+
alias_method :enable_secure_boot?, :enable_secure_boot
|
907
|
+
|
908
|
+
def initialize(**args)
|
909
|
+
update!(**args)
|
910
|
+
end
|
911
|
+
|
912
|
+
# Update properties of this object
|
913
|
+
def update!(**args)
|
914
|
+
@enable_secure_boot = args[:enable_secure_boot] if args.key?(:enable_secure_boot)
|
915
|
+
end
|
916
|
+
end
|
917
|
+
|
918
|
+
# Request for StartNode.
|
919
|
+
class StartNodeRequest
|
920
|
+
include Google::Apis::Core::Hashable
|
921
|
+
|
922
|
+
def initialize(**args)
|
923
|
+
update!(**args)
|
924
|
+
end
|
925
|
+
|
926
|
+
# Update properties of this object
|
927
|
+
def update!(**args)
|
928
|
+
end
|
929
|
+
end
|
930
|
+
|
931
|
+
# The `Status` type defines a logical error model that is suitable for different
|
932
|
+
# programming environments, including REST APIs and RPC APIs. It is used by [
|
933
|
+
# gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
|
934
|
+
# data: error code, error message, and error details. You can find out more
|
935
|
+
# about this error model and how to work with it in the [API Design Guide](https:
|
936
|
+
# //cloud.google.com/apis/design/errors).
|
937
|
+
class Status
|
938
|
+
include Google::Apis::Core::Hashable
|
939
|
+
|
940
|
+
# The status code, which should be an enum value of google.rpc.Code.
|
941
|
+
# Corresponds to the JSON property `code`
|
942
|
+
# @return [Fixnum]
|
943
|
+
attr_accessor :code
|
944
|
+
|
945
|
+
# A list of messages that carry the error details. There is a common set of
|
946
|
+
# message types for APIs to use.
|
947
|
+
# Corresponds to the JSON property `details`
|
948
|
+
# @return [Array<Hash<String,Object>>]
|
949
|
+
attr_accessor :details
|
950
|
+
|
951
|
+
# A developer-facing error message, which should be in English. Any user-facing
|
952
|
+
# error message should be localized and sent in the google.rpc.Status.details
|
953
|
+
# field, or localized by the client.
|
954
|
+
# Corresponds to the JSON property `message`
|
955
|
+
# @return [String]
|
956
|
+
attr_accessor :message
|
957
|
+
|
958
|
+
def initialize(**args)
|
959
|
+
update!(**args)
|
960
|
+
end
|
961
|
+
|
962
|
+
# Update properties of this object
|
963
|
+
def update!(**args)
|
964
|
+
@code = args[:code] if args.key?(:code)
|
965
|
+
@details = args[:details] if args.key?(:details)
|
966
|
+
@message = args[:message] if args.key?(:message)
|
967
|
+
end
|
968
|
+
end
|
969
|
+
|
970
|
+
# Request for StopNode.
|
971
|
+
class StopNodeRequest
|
972
|
+
include Google::Apis::Core::Hashable
|
973
|
+
|
974
|
+
def initialize(**args)
|
975
|
+
update!(**args)
|
976
|
+
end
|
977
|
+
|
978
|
+
# Update properties of this object
|
979
|
+
def update!(**args)
|
980
|
+
end
|
981
|
+
end
|
982
|
+
|
983
|
+
# A Symptom instance.
|
984
|
+
class Symptom
|
985
|
+
include Google::Apis::Core::Hashable
|
986
|
+
|
987
|
+
# Timestamp when the Symptom is created.
|
988
|
+
# Corresponds to the JSON property `createTime`
|
989
|
+
# @return [String]
|
990
|
+
attr_accessor :create_time
|
991
|
+
|
992
|
+
# Detailed information of the current Symptom.
|
993
|
+
# Corresponds to the JSON property `details`
|
994
|
+
# @return [String]
|
995
|
+
attr_accessor :details
|
996
|
+
|
997
|
+
# Type of the Symptom.
|
998
|
+
# Corresponds to the JSON property `symptomType`
|
999
|
+
# @return [String]
|
1000
|
+
attr_accessor :symptom_type
|
1001
|
+
|
1002
|
+
# A string used to uniquely distinguish a worker within a TPU node.
|
1003
|
+
# Corresponds to the JSON property `workerId`
|
1004
|
+
# @return [String]
|
1005
|
+
attr_accessor :worker_id
|
1006
|
+
|
1007
|
+
def initialize(**args)
|
1008
|
+
update!(**args)
|
1009
|
+
end
|
1010
|
+
|
1011
|
+
# Update properties of this object
|
1012
|
+
def update!(**args)
|
1013
|
+
@create_time = args[:create_time] if args.key?(:create_time)
|
1014
|
+
@details = args[:details] if args.key?(:details)
|
1015
|
+
@symptom_type = args[:symptom_type] if args.key?(:symptom_type)
|
1016
|
+
@worker_id = args[:worker_id] if args.key?(:worker_id)
|
1017
|
+
end
|
1018
|
+
end
|
1019
|
+
end
|
1020
|
+
end
|
1021
|
+
end
|