google-cloud-tpu-v1 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9dd28927088103b60cc1f2d85c96ca70021921b8058c454ea0f3e88d007089b8
4
- data.tar.gz: 2d657b3bbcf30b0cedc91f006e9c1fe515859ca94e2a63677166a094c0cbc5a7
3
+ metadata.gz: 8c8232af5b1a160a36529135d147e7d067fc2d9517e43b39e593dd79d3414d73
4
+ data.tar.gz: dfaf0935f245ccfab6b9246fdb44d82152a52699df5a5f5aad3fc63c80dd3914
5
5
  SHA512:
6
- metadata.gz: f2313bcb05cf16483c339be0874a273ab260e98c6f5bed761a358aadef389b3874b9a5611492a45c9b562da719ba93e576f78af929694ea6747da5496db9a67b
7
- data.tar.gz: 2ae8d8519bc98ef5086433d9f03c5a743ab9e2e4851c1dca992b3850c6dfa53ab4550af3052ba8192ca181a8f72ac98280e297d1c99326a7b7302d185faed3a7
6
+ metadata.gz: cbe6e4bd86aab8e541e1345a8a05dd42e05a72d2fdb0ecf33d21eab440308f079c8cdcceb19645b7b3b4b8ec41adaec745a51e8f8e8e94f275fbacdd76bd0a6b
7
+ data.tar.gz: 0ca39f38ba7ac5e6049bbac5dcf6dae3185d4c2fdceaf15629bf50e292551ea289044ad7406346d728d20911c04ab8fd17802d921bbac05dc05b292d6a8aaeca
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title=Cloud TPU V1 API
2
+ --title="Cloud TPU V1 API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
data/AUTHENTICATION.md CHANGED
@@ -120,15 +120,6 @@ To configure your system for this, simply:
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
121
121
  *should* only be used during development.
122
122
 
123
- [gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
124
- [dev-console]: https://console.cloud.google.com/project
125
-
126
- [enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
127
-
128
- [create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
129
- [create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
130
- [reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
131
-
132
123
  ## Creating a Service Account
133
124
 
134
125
  Google Cloud requires **Service Account Credentials** to
@@ -139,31 +130,22 @@ If you are not running this client within
139
130
  [Google Cloud Platform environments](#google-cloud-platform-environments), you
140
131
  need a Google Developers service account.
141
132
 
142
- 1. Visit the [Google Developers Console][dev-console].
133
+ 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
143
134
  2. Create a new project or click on an existing project.
144
- 3. Activate the slide-out navigation tray and select **API Manager**. From
135
+ 3. Activate the menu in the upper left and select **APIs & Services**. From
145
136
  here, you will enable the APIs that your application requires.
146
137
 
147
- ![Enable the APIs that your application requires][enable-apis]
148
-
149
138
  *Note: You may need to enable billing in order to use these services.*
150
139
 
151
140
  4. Select **Credentials** from the side navigation.
152
141
 
153
- You should see a screen like one of the following.
154
-
155
- ![Create a new service account][create-new-service-account]
156
-
157
- ![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
158
-
159
- Find the "Add credentials" drop down and select "Service account" to be
160
- guided through downloading a new JSON key file.
142
+ Find the "Create credentials" drop down near the top of the page, and select
143
+ "Service account" to be guided through downloading a new JSON key file.
161
144
 
162
145
  If you want to re-use an existing service account, you can easily generate a
163
- new key file. Just select the account you wish to re-use, and click "Generate
164
- new JSON key":
165
-
166
- ![Re-use an existing service account][reuse-service-account]
146
+ new key file. Just select the account you wish to re-use, click the pencil
147
+ tool on the right side to edit the service account, select the **Keys** tab,
148
+ and then select **Add Key**.
167
149
 
168
150
  The key file you download will be used by this library to authenticate API
169
151
  requests and should be stored in a secure location.
data/README.md CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Cloud::Tpu::V1::ListNodesRequest.new # (request fields as ke
37
37
  response = client.list_nodes request
38
38
  ```
39
39
 
40
- View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-tpu-v1/latest)
40
+ View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-tpu-v1/latest)
41
41
  for class and method documentation.
42
42
 
43
43
  See also the [Product Documentation](https://cloud.google.com/tpu/)
@@ -69,16 +69,21 @@ module GRPC
69
69
  end
70
70
  ```
71
71
 
72
+
73
+ ## Google Cloud Samples
74
+
75
+ To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
76
+
72
77
  ## Supported Ruby Versions
73
78
 
74
- This library is supported on Ruby 2.5+.
79
+ This library is supported on Ruby 2.6+.
75
80
 
76
81
  Google provides official support for Ruby versions that are actively supported
77
82
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
78
- in security maintenance, and not end of life. Currently, this means Ruby 2.5
79
- and later. Older versions of Ruby _may_ still work, but are unsupported and not
80
- recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
81
- about the Ruby support schedule.
83
+ in security maintenance, and not end of life. Older versions of Ruby _may_
84
+ still work, but are unsupported and not recommended. See
85
+ https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
86
+ support schedule.
82
87
 
83
88
  ## Which client should I use?
84
89
 
@@ -9,6 +9,7 @@ require 'google/api/field_behavior_pb'
9
9
  require 'google/api/resource_pb'
10
10
  require 'google/longrunning/operations_pb'
11
11
  require 'google/protobuf/timestamp_pb'
12
+
12
13
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
14
  add_file("google/cloud/tpu/v1/cloud_tpu.proto", :syntax => :proto3) do
14
15
  add_message "google.cloud.tpu.v1.SchedulingConfig" do
@@ -29,7 +29,7 @@ module Google
29
29
  # TPU API v1
30
30
  class Service
31
31
 
32
- include GRPC::GenericService
32
+ include ::GRPC::GenericService
33
33
 
34
34
  self.marshal_class_method = :encode
35
35
  self.unmarshal_class_method = :decode
@@ -139,6 +139,7 @@ module Google
139
139
 
140
140
  @operations_client = Operations.new do |config|
141
141
  config.credentials = credentials
142
+ config.quota_project = @quota_project_id
142
143
  config.endpoint = @config.endpoint
143
144
  end
144
145
 
@@ -193,6 +194,27 @@ module Google
193
194
  #
194
195
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
195
196
  #
197
+ # @example Basic example
198
+ # require "google/cloud/tpu/v1"
199
+ #
200
+ # # Create a client object. The client can be reused for multiple calls.
201
+ # client = Google::Cloud::Tpu::V1::Tpu::Client.new
202
+ #
203
+ # # Create a request. To set request fields, pass in keyword arguments.
204
+ # request = Google::Cloud::Tpu::V1::ListNodesRequest.new
205
+ #
206
+ # # Call the list_nodes method.
207
+ # result = client.list_nodes request
208
+ #
209
+ # # The returned object is of type Gapic::PagedEnumerable. You can
210
+ # # iterate over all elements by calling #each, and the enumerable
211
+ # # will lazily make API calls to fetch subsequent pages. Other
212
+ # # methods are also available for managing paging directly.
213
+ # result.each do |response|
214
+ # # Each element is of type ::Google::Cloud::Tpu::V1::Node.
215
+ # p response
216
+ # end
217
+ #
196
218
  def list_nodes request, options = nil
197
219
  raise ::ArgumentError, "request must be provided" if request.nil?
198
220
 
@@ -210,9 +232,11 @@ module Google
210
232
  gapic_version: ::Google::Cloud::Tpu::V1::VERSION
211
233
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
212
234
 
213
- header_params = {
214
- "parent" => request.parent
215
- }
235
+ header_params = {}
236
+ if request.parent
237
+ header_params["parent"] = request.parent
238
+ end
239
+
216
240
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
217
241
  metadata[:"x-goog-request-params"] ||= request_params_header
218
242
 
@@ -262,6 +286,21 @@ module Google
262
286
  #
263
287
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
264
288
  #
289
+ # @example Basic example
290
+ # require "google/cloud/tpu/v1"
291
+ #
292
+ # # Create a client object. The client can be reused for multiple calls.
293
+ # client = Google::Cloud::Tpu::V1::Tpu::Client.new
294
+ #
295
+ # # Create a request. To set request fields, pass in keyword arguments.
296
+ # request = Google::Cloud::Tpu::V1::GetNodeRequest.new
297
+ #
298
+ # # Call the get_node method.
299
+ # result = client.get_node request
300
+ #
301
+ # # The returned object is of type Google::Cloud::Tpu::V1::Node.
302
+ # p result
303
+ #
265
304
  def get_node request, options = nil
266
305
  raise ::ArgumentError, "request must be provided" if request.nil?
267
306
 
@@ -279,9 +318,11 @@ module Google
279
318
  gapic_version: ::Google::Cloud::Tpu::V1::VERSION
280
319
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
281
320
 
282
- header_params = {
283
- "name" => request.name
284
- }
321
+ header_params = {}
322
+ if request.name
323
+ header_params["name"] = request.name
324
+ end
325
+
285
326
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
286
327
  metadata[:"x-goog-request-params"] ||= request_params_header
287
328
 
@@ -334,6 +375,28 @@ module Google
334
375
  #
335
376
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
336
377
  #
378
+ # @example Basic example
379
+ # require "google/cloud/tpu/v1"
380
+ #
381
+ # # Create a client object. The client can be reused for multiple calls.
382
+ # client = Google::Cloud::Tpu::V1::Tpu::Client.new
383
+ #
384
+ # # Create a request. To set request fields, pass in keyword arguments.
385
+ # request = Google::Cloud::Tpu::V1::CreateNodeRequest.new
386
+ #
387
+ # # Call the create_node method.
388
+ # result = client.create_node request
389
+ #
390
+ # # The returned object is of type Gapic::Operation. You can use this
391
+ # # object to check the status of an operation, cancel it, or wait
392
+ # # for results. Here is how to block until completion:
393
+ # result.wait_until_done! timeout: 60
394
+ # if result.response?
395
+ # p result.response
396
+ # else
397
+ # puts "Error!"
398
+ # end
399
+ #
337
400
  def create_node request, options = nil
338
401
  raise ::ArgumentError, "request must be provided" if request.nil?
339
402
 
@@ -351,9 +414,11 @@ module Google
351
414
  gapic_version: ::Google::Cloud::Tpu::V1::VERSION
352
415
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
353
416
 
354
- header_params = {
355
- "parent" => request.parent
356
- }
417
+ header_params = {}
418
+ if request.parent
419
+ header_params["parent"] = request.parent
420
+ end
421
+
357
422
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
358
423
  metadata[:"x-goog-request-params"] ||= request_params_header
359
424
 
@@ -403,6 +468,28 @@ module Google
403
468
  #
404
469
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
405
470
  #
471
+ # @example Basic example
472
+ # require "google/cloud/tpu/v1"
473
+ #
474
+ # # Create a client object. The client can be reused for multiple calls.
475
+ # client = Google::Cloud::Tpu::V1::Tpu::Client.new
476
+ #
477
+ # # Create a request. To set request fields, pass in keyword arguments.
478
+ # request = Google::Cloud::Tpu::V1::DeleteNodeRequest.new
479
+ #
480
+ # # Call the delete_node method.
481
+ # result = client.delete_node request
482
+ #
483
+ # # The returned object is of type Gapic::Operation. You can use this
484
+ # # object to check the status of an operation, cancel it, or wait
485
+ # # for results. Here is how to block until completion:
486
+ # result.wait_until_done! timeout: 60
487
+ # if result.response?
488
+ # p result.response
489
+ # else
490
+ # puts "Error!"
491
+ # end
492
+ #
406
493
  def delete_node request, options = nil
407
494
  raise ::ArgumentError, "request must be provided" if request.nil?
408
495
 
@@ -420,9 +507,11 @@ module Google
420
507
  gapic_version: ::Google::Cloud::Tpu::V1::VERSION
421
508
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
422
509
 
423
- header_params = {
424
- "name" => request.name
425
- }
510
+ header_params = {}
511
+ if request.name
512
+ header_params["name"] = request.name
513
+ end
514
+
426
515
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
427
516
  metadata[:"x-goog-request-params"] ||= request_params_header
428
517
 
@@ -474,6 +563,28 @@ module Google
474
563
  #
475
564
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
476
565
  #
566
+ # @example Basic example
567
+ # require "google/cloud/tpu/v1"
568
+ #
569
+ # # Create a client object. The client can be reused for multiple calls.
570
+ # client = Google::Cloud::Tpu::V1::Tpu::Client.new
571
+ #
572
+ # # Create a request. To set request fields, pass in keyword arguments.
573
+ # request = Google::Cloud::Tpu::V1::ReimageNodeRequest.new
574
+ #
575
+ # # Call the reimage_node method.
576
+ # result = client.reimage_node request
577
+ #
578
+ # # The returned object is of type Gapic::Operation. You can use this
579
+ # # object to check the status of an operation, cancel it, or wait
580
+ # # for results. Here is how to block until completion:
581
+ # result.wait_until_done! timeout: 60
582
+ # if result.response?
583
+ # p result.response
584
+ # else
585
+ # puts "Error!"
586
+ # end
587
+ #
477
588
  def reimage_node request, options = nil
478
589
  raise ::ArgumentError, "request must be provided" if request.nil?
479
590
 
@@ -491,9 +602,11 @@ module Google
491
602
  gapic_version: ::Google::Cloud::Tpu::V1::VERSION
492
603
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
493
604
 
494
- header_params = {
495
- "name" => request.name
496
- }
605
+ header_params = {}
606
+ if request.name
607
+ header_params["name"] = request.name
608
+ end
609
+
497
610
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
498
611
  metadata[:"x-goog-request-params"] ||= request_params_header
499
612
 
@@ -543,6 +656,28 @@ module Google
543
656
  #
544
657
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
545
658
  #
659
+ # @example Basic example
660
+ # require "google/cloud/tpu/v1"
661
+ #
662
+ # # Create a client object. The client can be reused for multiple calls.
663
+ # client = Google::Cloud::Tpu::V1::Tpu::Client.new
664
+ #
665
+ # # Create a request. To set request fields, pass in keyword arguments.
666
+ # request = Google::Cloud::Tpu::V1::StopNodeRequest.new
667
+ #
668
+ # # Call the stop_node method.
669
+ # result = client.stop_node request
670
+ #
671
+ # # The returned object is of type Gapic::Operation. You can use this
672
+ # # object to check the status of an operation, cancel it, or wait
673
+ # # for results. Here is how to block until completion:
674
+ # result.wait_until_done! timeout: 60
675
+ # if result.response?
676
+ # p result.response
677
+ # else
678
+ # puts "Error!"
679
+ # end
680
+ #
546
681
  def stop_node request, options = nil
547
682
  raise ::ArgumentError, "request must be provided" if request.nil?
548
683
 
@@ -560,9 +695,11 @@ module Google
560
695
  gapic_version: ::Google::Cloud::Tpu::V1::VERSION
561
696
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
562
697
 
563
- header_params = {
564
- "name" => request.name
565
- }
698
+ header_params = {}
699
+ if request.name
700
+ header_params["name"] = request.name
701
+ end
702
+
566
703
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
567
704
  metadata[:"x-goog-request-params"] ||= request_params_header
568
705
 
@@ -612,6 +749,28 @@ module Google
612
749
  #
613
750
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
614
751
  #
752
+ # @example Basic example
753
+ # require "google/cloud/tpu/v1"
754
+ #
755
+ # # Create a client object. The client can be reused for multiple calls.
756
+ # client = Google::Cloud::Tpu::V1::Tpu::Client.new
757
+ #
758
+ # # Create a request. To set request fields, pass in keyword arguments.
759
+ # request = Google::Cloud::Tpu::V1::StartNodeRequest.new
760
+ #
761
+ # # Call the start_node method.
762
+ # result = client.start_node request
763
+ #
764
+ # # The returned object is of type Gapic::Operation. You can use this
765
+ # # object to check the status of an operation, cancel it, or wait
766
+ # # for results. Here is how to block until completion:
767
+ # result.wait_until_done! timeout: 60
768
+ # if result.response?
769
+ # p result.response
770
+ # else
771
+ # puts "Error!"
772
+ # end
773
+ #
615
774
  def start_node request, options = nil
616
775
  raise ::ArgumentError, "request must be provided" if request.nil?
617
776
 
@@ -629,9 +788,11 @@ module Google
629
788
  gapic_version: ::Google::Cloud::Tpu::V1::VERSION
630
789
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
631
790
 
632
- header_params = {
633
- "name" => request.name
634
- }
791
+ header_params = {}
792
+ if request.name
793
+ header_params["name"] = request.name
794
+ end
795
+
635
796
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
636
797
  metadata[:"x-goog-request-params"] ||= request_params_header
637
798
 
@@ -689,6 +850,27 @@ module Google
689
850
  #
690
851
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
691
852
  #
853
+ # @example Basic example
854
+ # require "google/cloud/tpu/v1"
855
+ #
856
+ # # Create a client object. The client can be reused for multiple calls.
857
+ # client = Google::Cloud::Tpu::V1::Tpu::Client.new
858
+ #
859
+ # # Create a request. To set request fields, pass in keyword arguments.
860
+ # request = Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest.new
861
+ #
862
+ # # Call the list_tensor_flow_versions method.
863
+ # result = client.list_tensor_flow_versions request
864
+ #
865
+ # # The returned object is of type Gapic::PagedEnumerable. You can
866
+ # # iterate over all elements by calling #each, and the enumerable
867
+ # # will lazily make API calls to fetch subsequent pages. Other
868
+ # # methods are also available for managing paging directly.
869
+ # result.each do |response|
870
+ # # Each element is of type ::Google::Cloud::Tpu::V1::TensorFlowVersion.
871
+ # p response
872
+ # end
873
+ #
692
874
  def list_tensor_flow_versions request, options = nil
693
875
  raise ::ArgumentError, "request must be provided" if request.nil?
694
876
 
@@ -706,9 +888,11 @@ module Google
706
888
  gapic_version: ::Google::Cloud::Tpu::V1::VERSION
707
889
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
708
890
 
709
- header_params = {
710
- "parent" => request.parent
711
- }
891
+ header_params = {}
892
+ if request.parent
893
+ header_params["parent"] = request.parent
894
+ end
895
+
712
896
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
713
897
  metadata[:"x-goog-request-params"] ||= request_params_header
714
898
 
@@ -758,6 +942,21 @@ module Google
758
942
  #
759
943
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
760
944
  #
945
+ # @example Basic example
946
+ # require "google/cloud/tpu/v1"
947
+ #
948
+ # # Create a client object. The client can be reused for multiple calls.
949
+ # client = Google::Cloud::Tpu::V1::Tpu::Client.new
950
+ #
951
+ # # Create a request. To set request fields, pass in keyword arguments.
952
+ # request = Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest.new
953
+ #
954
+ # # Call the get_tensor_flow_version method.
955
+ # result = client.get_tensor_flow_version request
956
+ #
957
+ # # The returned object is of type Google::Cloud::Tpu::V1::TensorFlowVersion.
958
+ # p result
959
+ #
761
960
  def get_tensor_flow_version request, options = nil
762
961
  raise ::ArgumentError, "request must be provided" if request.nil?
763
962
 
@@ -775,9 +974,11 @@ module Google
775
974
  gapic_version: ::Google::Cloud::Tpu::V1::VERSION
776
975
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
777
976
 
778
- header_params = {
779
- "name" => request.name
780
- }
977
+ header_params = {}
978
+ if request.name
979
+ header_params["name"] = request.name
980
+ end
981
+
781
982
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
782
983
  metadata[:"x-goog-request-params"] ||= request_params_header
783
984
 
@@ -834,6 +1035,27 @@ module Google
834
1035
  #
835
1036
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
836
1037
  #
1038
+ # @example Basic example
1039
+ # require "google/cloud/tpu/v1"
1040
+ #
1041
+ # # Create a client object. The client can be reused for multiple calls.
1042
+ # client = Google::Cloud::Tpu::V1::Tpu::Client.new
1043
+ #
1044
+ # # Create a request. To set request fields, pass in keyword arguments.
1045
+ # request = Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest.new
1046
+ #
1047
+ # # Call the list_accelerator_types method.
1048
+ # result = client.list_accelerator_types request
1049
+ #
1050
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1051
+ # # iterate over all elements by calling #each, and the enumerable
1052
+ # # will lazily make API calls to fetch subsequent pages. Other
1053
+ # # methods are also available for managing paging directly.
1054
+ # result.each do |response|
1055
+ # # Each element is of type ::Google::Cloud::Tpu::V1::AcceleratorType.
1056
+ # p response
1057
+ # end
1058
+ #
837
1059
  def list_accelerator_types request, options = nil
838
1060
  raise ::ArgumentError, "request must be provided" if request.nil?
839
1061
 
@@ -851,9 +1073,11 @@ module Google
851
1073
  gapic_version: ::Google::Cloud::Tpu::V1::VERSION
852
1074
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
853
1075
 
854
- header_params = {
855
- "parent" => request.parent
856
- }
1076
+ header_params = {}
1077
+ if request.parent
1078
+ header_params["parent"] = request.parent
1079
+ end
1080
+
857
1081
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
858
1082
  metadata[:"x-goog-request-params"] ||= request_params_header
859
1083
 
@@ -903,6 +1127,21 @@ module Google
903
1127
  #
904
1128
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
905
1129
  #
1130
+ # @example Basic example
1131
+ # require "google/cloud/tpu/v1"
1132
+ #
1133
+ # # Create a client object. The client can be reused for multiple calls.
1134
+ # client = Google::Cloud::Tpu::V1::Tpu::Client.new
1135
+ #
1136
+ # # Create a request. To set request fields, pass in keyword arguments.
1137
+ # request = Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest.new
1138
+ #
1139
+ # # Call the get_accelerator_type method.
1140
+ # result = client.get_accelerator_type request
1141
+ #
1142
+ # # The returned object is of type Google::Cloud::Tpu::V1::AcceleratorType.
1143
+ # p result
1144
+ #
906
1145
  def get_accelerator_type request, options = nil
907
1146
  raise ::ArgumentError, "request must be provided" if request.nil?
908
1147
 
@@ -920,9 +1159,11 @@ module Google
920
1159
  gapic_version: ::Google::Cloud::Tpu::V1::VERSION
921
1160
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
922
1161
 
923
- header_params = {
924
- "name" => request.name
925
- }
1162
+ header_params = {}
1163
+ if request.name
1164
+ header_params["name"] = request.name
1165
+ end
1166
+
926
1167
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
927
1168
  metadata[:"x-goog-request-params"] ||= request_params_header
928
1169
 
@@ -95,6 +95,9 @@ module Google
95
95
  channel_args: @config.channel_args,
96
96
  interceptors: @config.interceptors
97
97
  )
98
+
99
+ # Used by an LRO wrapper for some methods of this service
100
+ @operations_client = self
98
101
  end
99
102
 
100
103
  # Service calls
@@ -143,6 +146,27 @@ module Google
143
146
  #
144
147
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
145
148
  #
149
+ # @example Basic example
150
+ # require "google/longrunning"
151
+ #
152
+ # # Create a client object. The client can be reused for multiple calls.
153
+ # client = Google::Longrunning::Operations::Client.new
154
+ #
155
+ # # Create a request. To set request fields, pass in keyword arguments.
156
+ # request = Google::Longrunning::ListOperationsRequest.new
157
+ #
158
+ # # Call the list_operations method.
159
+ # result = client.list_operations request
160
+ #
161
+ # # The returned object is of type Gapic::PagedEnumerable. You can
162
+ # # iterate over all elements by calling #each, and the enumerable
163
+ # # will lazily make API calls to fetch subsequent pages. Other
164
+ # # methods are also available for managing paging directly.
165
+ # result.each do |response|
166
+ # # Each element is of type ::Google::Longrunning::Operation.
167
+ # p response
168
+ # end
169
+ #
146
170
  def list_operations request, options = nil
147
171
  raise ::ArgumentError, "request must be provided" if request.nil?
148
172
 
@@ -160,9 +184,11 @@ module Google
160
184
  gapic_version: ::Google::Cloud::Tpu::V1::VERSION
161
185
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
162
186
 
163
- header_params = {
164
- "name" => request.name
165
- }
187
+ header_params = {}
188
+ if request.name
189
+ header_params["name"] = request.name
190
+ end
191
+
166
192
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
167
193
  metadata[:"x-goog-request-params"] ||= request_params_header
168
194
 
@@ -215,6 +241,28 @@ module Google
215
241
  #
216
242
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
217
243
  #
244
+ # @example Basic example
245
+ # require "google/longrunning"
246
+ #
247
+ # # Create a client object. The client can be reused for multiple calls.
248
+ # client = Google::Longrunning::Operations::Client.new
249
+ #
250
+ # # Create a request. To set request fields, pass in keyword arguments.
251
+ # request = Google::Longrunning::GetOperationRequest.new
252
+ #
253
+ # # Call the get_operation method.
254
+ # result = client.get_operation request
255
+ #
256
+ # # The returned object is of type Gapic::Operation. You can use this
257
+ # # object to check the status of an operation, cancel it, or wait
258
+ # # for results. Here is how to block until completion:
259
+ # result.wait_until_done! timeout: 60
260
+ # if result.response?
261
+ # p result.response
262
+ # else
263
+ # puts "Error!"
264
+ # end
265
+ #
218
266
  def get_operation request, options = nil
219
267
  raise ::ArgumentError, "request must be provided" if request.nil?
220
268
 
@@ -232,9 +280,11 @@ module Google
232
280
  gapic_version: ::Google::Cloud::Tpu::V1::VERSION
233
281
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
234
282
 
235
- header_params = {
236
- "name" => request.name
237
- }
283
+ header_params = {}
284
+ if request.name
285
+ header_params["name"] = request.name
286
+ end
287
+
238
288
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
239
289
  metadata[:"x-goog-request-params"] ||= request_params_header
240
290
 
@@ -287,6 +337,21 @@ module Google
287
337
  #
288
338
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
289
339
  #
340
+ # @example Basic example
341
+ # require "google/longrunning"
342
+ #
343
+ # # Create a client object. The client can be reused for multiple calls.
344
+ # client = Google::Longrunning::Operations::Client.new
345
+ #
346
+ # # Create a request. To set request fields, pass in keyword arguments.
347
+ # request = Google::Longrunning::DeleteOperationRequest.new
348
+ #
349
+ # # Call the delete_operation method.
350
+ # result = client.delete_operation request
351
+ #
352
+ # # The returned object is of type Google::Protobuf::Empty.
353
+ # p result
354
+ #
290
355
  def delete_operation request, options = nil
291
356
  raise ::ArgumentError, "request must be provided" if request.nil?
292
357
 
@@ -304,9 +369,11 @@ module Google
304
369
  gapic_version: ::Google::Cloud::Tpu::V1::VERSION
305
370
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
306
371
 
307
- header_params = {
308
- "name" => request.name
309
- }
372
+ header_params = {}
373
+ if request.name
374
+ header_params["name"] = request.name
375
+ end
376
+
310
377
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
311
378
  metadata[:"x-goog-request-params"] ||= request_params_header
312
379
 
@@ -364,6 +431,21 @@ module Google
364
431
  #
365
432
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
366
433
  #
434
+ # @example Basic example
435
+ # require "google/longrunning"
436
+ #
437
+ # # Create a client object. The client can be reused for multiple calls.
438
+ # client = Google::Longrunning::Operations::Client.new
439
+ #
440
+ # # Create a request. To set request fields, pass in keyword arguments.
441
+ # request = Google::Longrunning::CancelOperationRequest.new
442
+ #
443
+ # # Call the cancel_operation method.
444
+ # result = client.cancel_operation request
445
+ #
446
+ # # The returned object is of type Google::Protobuf::Empty.
447
+ # p result
448
+ #
367
449
  def cancel_operation request, options = nil
368
450
  raise ::ArgumentError, "request must be provided" if request.nil?
369
451
 
@@ -381,9 +463,11 @@ module Google
381
463
  gapic_version: ::Google::Cloud::Tpu::V1::VERSION
382
464
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
383
465
 
384
- header_params = {
385
- "name" => request.name
386
- }
466
+ header_params = {}
467
+ if request.name
468
+ header_params["name"] = request.name
469
+ end
470
+
387
471
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
388
472
  metadata[:"x-goog-request-params"] ||= request_params_header
389
473
 
@@ -444,6 +528,28 @@ module Google
444
528
  #
445
529
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
446
530
  #
531
+ # @example Basic example
532
+ # require "google/longrunning"
533
+ #
534
+ # # Create a client object. The client can be reused for multiple calls.
535
+ # client = Google::Longrunning::Operations::Client.new
536
+ #
537
+ # # Create a request. To set request fields, pass in keyword arguments.
538
+ # request = Google::Longrunning::WaitOperationRequest.new
539
+ #
540
+ # # Call the wait_operation method.
541
+ # result = client.wait_operation request
542
+ #
543
+ # # The returned object is of type Gapic::Operation. You can use this
544
+ # # object to check the status of an operation, cancel it, or wait
545
+ # # for results. Here is how to block until completion:
546
+ # result.wait_until_done! timeout: 60
547
+ # if result.response?
548
+ # p result.response
549
+ # else
550
+ # puts "Error!"
551
+ # end
552
+ #
447
553
  def wait_operation request, options = nil
448
554
  raise ::ArgumentError, "request must be provided" if request.nil?
449
555
 
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Tpu
23
23
  module V1
24
- VERSION = "0.1.2"
24
+ VERSION = "0.2.0"
25
25
  end
26
26
  end
27
27
  end
@@ -25,6 +25,8 @@ module Google
25
25
  ##
26
26
  # To load this package, including all its services, and instantiate a client:
27
27
  #
28
+ # @example
29
+ #
28
30
  # require "google/cloud/tpu/v1"
29
31
  # client = ::Google::Cloud::Tpu::V1::Tpu::Client.new
30
32
  #
@@ -33,11 +33,7 @@ module Google
33
33
  # // For Kubernetes resources, the format is {api group}/{kind}.
34
34
  # option (google.api.resource) = {
35
35
  # type: "pubsub.googleapis.com/Topic"
36
- # name_descriptor: {
37
- # pattern: "projects/{project}/topics/{topic}"
38
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
39
- # parent_name_extractor: "projects/{project}"
40
- # }
36
+ # pattern: "projects/{project}/topics/{topic}"
41
37
  # };
42
38
  # }
43
39
  #
@@ -45,10 +41,7 @@ module Google
45
41
  #
46
42
  # resources:
47
43
  # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/{project}/topics/{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/{project}"
44
+ # pattern: "projects/{project}/topics/{topic}"
52
45
  #
53
46
  # Sometimes, resources have multiple patterns, typically because they can
54
47
  # live under multiple parents.
@@ -58,26 +51,10 @@ module Google
58
51
  # message LogEntry {
59
52
  # option (google.api.resource) = {
60
53
  # type: "logging.googleapis.com/LogEntry"
61
- # name_descriptor: {
62
- # pattern: "projects/{project}/logs/{log}"
63
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
64
- # parent_name_extractor: "projects/{project}"
65
- # }
66
- # name_descriptor: {
67
- # pattern: "folders/{folder}/logs/{log}"
68
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
69
- # parent_name_extractor: "folders/{folder}"
70
- # }
71
- # name_descriptor: {
72
- # pattern: "organizations/{organization}/logs/{log}"
73
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
74
- # parent_name_extractor: "organizations/{organization}"
75
- # }
76
- # name_descriptor: {
77
- # pattern: "billingAccounts/{billing_account}/logs/{log}"
78
- # parent_type: "billing.googleapis.com/BillingAccount"
79
- # parent_name_extractor: "billingAccounts/{billing_account}"
80
- # }
54
+ # pattern: "projects/{project}/logs/{log}"
55
+ # pattern: "folders/{folder}/logs/{log}"
56
+ # pattern: "organizations/{organization}/logs/{log}"
57
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
81
58
  # };
82
59
  # }
83
60
  #
@@ -85,48 +62,10 @@ module Google
85
62
  #
86
63
  # resources:
87
64
  # - type: 'logging.googleapis.com/LogEntry'
88
- # name_descriptor:
89
- # - pattern: "projects/{project}/logs/{log}"
90
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
91
- # parent_name_extractor: "projects/{project}"
92
- # - pattern: "folders/{folder}/logs/{log}"
93
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
94
- # parent_name_extractor: "folders/{folder}"
95
- # - pattern: "organizations/{organization}/logs/{log}"
96
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
97
- # parent_name_extractor: "organizations/{organization}"
98
- # - pattern: "billingAccounts/{billing_account}/logs/{log}"
99
- # parent_type: "billing.googleapis.com/BillingAccount"
100
- # parent_name_extractor: "billingAccounts/{billing_account}"
101
- #
102
- # For flexible resources, the resource name doesn't contain parent names, but
103
- # the resource itself has parents for policy evaluation.
104
- #
105
- # Example:
106
- #
107
- # message Shelf {
108
- # option (google.api.resource) = {
109
- # type: "library.googleapis.com/Shelf"
110
- # name_descriptor: {
111
- # pattern: "shelves/{shelf}"
112
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
113
- # }
114
- # name_descriptor: {
115
- # pattern: "shelves/{shelf}"
116
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
117
- # }
118
- # };
119
- # }
120
- #
121
- # The ResourceDescriptor Yaml config will look like:
122
- #
123
- # resources:
124
- # - type: 'library.googleapis.com/Shelf'
125
- # name_descriptor:
126
- # - pattern: "shelves/{shelf}"
127
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
128
- # - pattern: "shelves/{shelf}"
129
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
65
+ # pattern: "projects/{project}/logs/{log}"
66
+ # pattern: "folders/{folder}/logs/{log}"
67
+ # pattern: "organizations/{organization}/logs/{log}"
68
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
130
69
  # @!attribute [rw] type
131
70
  # @return [::String]
132
71
  # The resource type. It must be in the format of
@@ -44,7 +44,7 @@ module Google
44
44
  # foo = any.unpack(Foo.class);
45
45
  # }
46
46
  #
47
- # Example 3: Pack and unpack a message in Python.
47
+ # Example 3: Pack and unpack a message in Python.
48
48
  #
49
49
  # foo = Foo(...)
50
50
  # any = Any()
@@ -54,7 +54,7 @@ module Google
54
54
  # any.Unpack(foo)
55
55
  # ...
56
56
  #
57
- # Example 4: Pack and unpack a message in Go
57
+ # Example 4: Pack and unpack a message in Go
58
58
  #
59
59
  # foo := &pb.Foo{...}
60
60
  # any, err := anypb.New(foo)
@@ -75,7 +75,7 @@ module Google
75
75
  #
76
76
  #
77
77
  # JSON
78
- # ====
78
+ #
79
79
  # The JSON representation of an `Any` value uses the regular
80
80
  # representation of the deserialized, embedded message, with an
81
81
  # additional field `@type` which contains the type URL. Example:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-tpu-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-11 00:00:00.000000000 Z
11
+ date: 2022-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.7'
19
+ version: '0.10'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.7'
29
+ version: '0.10'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -50,28 +50,28 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 1.25.1
53
+ version: 1.26.1
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 1.25.1
60
+ version: 1.26.1
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: minitest
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '5.14'
67
+ version: '5.16'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '5.14'
74
+ version: '5.16'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: minitest-focus
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -106,14 +106,14 @@ dependencies:
106
106
  requirements:
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: '12.0'
109
+ version: '13.0'
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
- version: '12.0'
116
+ version: '13.0'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: redcarpet
119
119
  requirement: !ruby/object:Gem::Requirement
@@ -203,14 +203,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
203
203
  requirements:
204
204
  - - ">="
205
205
  - !ruby/object:Gem::Version
206
- version: '2.5'
206
+ version: '2.6'
207
207
  required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  requirements:
209
209
  - - ">="
210
210
  - !ruby/object:Gem::Version
211
211
  version: '0'
212
212
  requirements: []
213
- rubygems_version: 3.2.17
213
+ rubygems_version: 3.3.14
214
214
  signing_key:
215
215
  specification_version: 4
216
216
  summary: API Client library for the Cloud TPU V1 API