google-cloud-notebooks-v1 0.6.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,6 +34,9 @@ module Google
34
34
  # API v1 service for Cloud AI Platform Notebooks.
35
35
  #
36
36
  class Client
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "notebooks.$UNIVERSE_DOMAIN$"
39
+
37
40
  include Paths
38
41
 
39
42
  # @private
@@ -163,6 +166,15 @@ module Google
163
166
  @config
164
167
  end
165
168
 
169
+ ##
170
+ # The effective universe domain
171
+ #
172
+ # @return [String]
173
+ #
174
+ def universe_domain
175
+ @notebook_service_stub.universe_domain
176
+ end
177
+
166
178
  ##
167
179
  # Create a new NotebookService REST client object.
168
180
  #
@@ -190,8 +202,9 @@ module Google
190
202
  credentials = @config.credentials
191
203
  # Use self-signed JWT if the endpoint is unchanged from default,
192
204
  # but only if the default endpoint does not have a region prefix.
193
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
194
- !@config.endpoint.split(".").first.include?("-")
205
+ enable_self_signed_jwt = @config.endpoint.nil? ||
206
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
207
+ !@config.endpoint.split(".").first.include?("-"))
195
208
  credentials ||= Credentials.default scope: @config.scope,
196
209
  enable_self_signed_jwt: enable_self_signed_jwt
197
210
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -205,12 +218,14 @@ module Google
205
218
  config.credentials = credentials
206
219
  config.quota_project = @quota_project_id
207
220
  config.endpoint = @config.endpoint
221
+ config.universe_domain = @config.universe_domain
208
222
  end
209
223
 
210
224
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
211
225
  config.credentials = credentials
212
226
  config.quota_project = @quota_project_id
213
227
  config.endpoint = @config.endpoint
228
+ config.universe_domain = @config.universe_domain
214
229
  config.bindings_override = @config.bindings_override
215
230
  end
216
231
 
@@ -218,10 +233,16 @@ module Google
218
233
  config.credentials = credentials
219
234
  config.quota_project = @quota_project_id
220
235
  config.endpoint = @config.endpoint
236
+ config.universe_domain = @config.universe_domain
221
237
  config.bindings_override = @config.bindings_override
222
238
  end
223
239
 
224
- @notebook_service_stub = ::Google::Cloud::Notebooks::V1::NotebookService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
240
+ @notebook_service_stub = ::Google::Cloud::Notebooks::V1::NotebookService::Rest::ServiceStub.new(
241
+ endpoint: @config.endpoint,
242
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
243
+ universe_domain: @config.universe_domain,
244
+ credentials: credentials
245
+ )
225
246
  end
226
247
 
227
248
  ##
@@ -280,6 +301,26 @@ module Google
280
301
  # @return [::Google::Cloud::Notebooks::V1::ListInstancesResponse]
281
302
  #
282
303
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
304
+ #
305
+ # @example Basic example
306
+ # require "google/cloud/notebooks/v1"
307
+ #
308
+ # # Create a client object. The client can be reused for multiple calls.
309
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
310
+ #
311
+ # # Create a request. To set request fields, pass in keyword arguments.
312
+ # request = Google::Cloud::Notebooks::V1::ListInstancesRequest.new
313
+ #
314
+ # # Call the list_instances method.
315
+ # result = client.list_instances request
316
+ #
317
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
318
+ # # over elements, and API calls will be issued to fetch pages as needed.
319
+ # result.each do |item|
320
+ # # Each element is of type ::Google::Cloud::Notebooks::V1::Instance.
321
+ # p item
322
+ # end
323
+ #
283
324
  def list_instances request, options = nil
284
325
  raise ::ArgumentError, "request must be provided" if request.nil?
285
326
 
@@ -343,6 +384,22 @@ module Google
343
384
  # @return [::Google::Cloud::Notebooks::V1::Instance]
344
385
  #
345
386
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
387
+ #
388
+ # @example Basic example
389
+ # require "google/cloud/notebooks/v1"
390
+ #
391
+ # # Create a client object. The client can be reused for multiple calls.
392
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
393
+ #
394
+ # # Create a request. To set request fields, pass in keyword arguments.
395
+ # request = Google::Cloud::Notebooks::V1::GetInstanceRequest.new
396
+ #
397
+ # # Call the get_instance method.
398
+ # result = client.get_instance request
399
+ #
400
+ # # The returned object is of type Google::Cloud::Notebooks::V1::Instance.
401
+ # p result
402
+ #
346
403
  def get_instance request, options = nil
347
404
  raise ::ArgumentError, "request must be provided" if request.nil?
348
405
 
@@ -410,6 +467,29 @@ module Google
410
467
  # @return [::Gapic::Operation]
411
468
  #
412
469
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
470
+ #
471
+ # @example Basic example
472
+ # require "google/cloud/notebooks/v1"
473
+ #
474
+ # # Create a client object. The client can be reused for multiple calls.
475
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
476
+ #
477
+ # # Create a request. To set request fields, pass in keyword arguments.
478
+ # request = Google::Cloud::Notebooks::V1::CreateInstanceRequest.new
479
+ #
480
+ # # Call the create_instance method.
481
+ # result = client.create_instance request
482
+ #
483
+ # # The returned object is of type Gapic::Operation. You can use it to
484
+ # # check the status of an operation, cancel it, or wait for results.
485
+ # # Here is how to wait for a response.
486
+ # result.wait_until_done! timeout: 60
487
+ # if result.response?
488
+ # p result.response
489
+ # else
490
+ # puts "No response received."
491
+ # end
492
+ #
413
493
  def create_instance request, options = nil
414
494
  raise ::ArgumentError, "request must be provided" if request.nil?
415
495
 
@@ -482,6 +562,29 @@ module Google
482
562
  # @return [::Gapic::Operation]
483
563
  #
484
564
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
565
+ #
566
+ # @example Basic example
567
+ # require "google/cloud/notebooks/v1"
568
+ #
569
+ # # Create a client object. The client can be reused for multiple calls.
570
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
571
+ #
572
+ # # Create a request. To set request fields, pass in keyword arguments.
573
+ # request = Google::Cloud::Notebooks::V1::RegisterInstanceRequest.new
574
+ #
575
+ # # Call the register_instance method.
576
+ # result = client.register_instance request
577
+ #
578
+ # # The returned object is of type Gapic::Operation. You can use it to
579
+ # # check the status of an operation, cancel it, or wait for results.
580
+ # # Here is how to wait for a response.
581
+ # result.wait_until_done! timeout: 60
582
+ # if result.response?
583
+ # p result.response
584
+ # else
585
+ # puts "No response received."
586
+ # end
587
+ #
485
588
  def register_instance request, options = nil
486
589
  raise ::ArgumentError, "request must be provided" if request.nil?
487
590
 
@@ -553,6 +656,29 @@ module Google
553
656
  # @return [::Gapic::Operation]
554
657
  #
555
658
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
659
+ #
660
+ # @example Basic example
661
+ # require "google/cloud/notebooks/v1"
662
+ #
663
+ # # Create a client object. The client can be reused for multiple calls.
664
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
665
+ #
666
+ # # Create a request. To set request fields, pass in keyword arguments.
667
+ # request = Google::Cloud::Notebooks::V1::SetInstanceAcceleratorRequest.new
668
+ #
669
+ # # Call the set_instance_accelerator method.
670
+ # result = client.set_instance_accelerator request
671
+ #
672
+ # # The returned object is of type Gapic::Operation. You can use it to
673
+ # # check the status of an operation, cancel it, or wait for results.
674
+ # # Here is how to wait for a response.
675
+ # result.wait_until_done! timeout: 60
676
+ # if result.response?
677
+ # p result.response
678
+ # else
679
+ # puts "No response received."
680
+ # end
681
+ #
556
682
  def set_instance_accelerator request, options = nil
557
683
  raise ::ArgumentError, "request must be provided" if request.nil?
558
684
 
@@ -620,6 +746,29 @@ module Google
620
746
  # @return [::Gapic::Operation]
621
747
  #
622
748
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
749
+ #
750
+ # @example Basic example
751
+ # require "google/cloud/notebooks/v1"
752
+ #
753
+ # # Create a client object. The client can be reused for multiple calls.
754
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
755
+ #
756
+ # # Create a request. To set request fields, pass in keyword arguments.
757
+ # request = Google::Cloud::Notebooks::V1::SetInstanceMachineTypeRequest.new
758
+ #
759
+ # # Call the set_instance_machine_type method.
760
+ # result = client.set_instance_machine_type request
761
+ #
762
+ # # The returned object is of type Gapic::Operation. You can use it to
763
+ # # check the status of an operation, cancel it, or wait for results.
764
+ # # Here is how to wait for a response.
765
+ # result.wait_until_done! timeout: 60
766
+ # if result.response?
767
+ # p result.response
768
+ # else
769
+ # puts "No response received."
770
+ # end
771
+ #
623
772
  def set_instance_machine_type request, options = nil
624
773
  raise ::ArgumentError, "request must be provided" if request.nil?
625
774
 
@@ -686,6 +835,29 @@ module Google
686
835
  # @return [::Gapic::Operation]
687
836
  #
688
837
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
838
+ #
839
+ # @example Basic example
840
+ # require "google/cloud/notebooks/v1"
841
+ #
842
+ # # Create a client object. The client can be reused for multiple calls.
843
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
844
+ #
845
+ # # Create a request. To set request fields, pass in keyword arguments.
846
+ # request = Google::Cloud::Notebooks::V1::UpdateInstanceConfigRequest.new
847
+ #
848
+ # # Call the update_instance_config method.
849
+ # result = client.update_instance_config request
850
+ #
851
+ # # The returned object is of type Gapic::Operation. You can use it to
852
+ # # check the status of an operation, cancel it, or wait for results.
853
+ # # Here is how to wait for a response.
854
+ # result.wait_until_done! timeout: 60
855
+ # if result.response?
856
+ # p result.response
857
+ # else
858
+ # puts "No response received."
859
+ # end
860
+ #
689
861
  def update_instance_config request, options = nil
690
862
  raise ::ArgumentError, "request must be provided" if request.nil?
691
863
 
@@ -752,6 +924,29 @@ module Google
752
924
  # @return [::Gapic::Operation]
753
925
  #
754
926
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
927
+ #
928
+ # @example Basic example
929
+ # require "google/cloud/notebooks/v1"
930
+ #
931
+ # # Create a client object. The client can be reused for multiple calls.
932
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
933
+ #
934
+ # # Create a request. To set request fields, pass in keyword arguments.
935
+ # request = Google::Cloud::Notebooks::V1::UpdateShieldedInstanceConfigRequest.new
936
+ #
937
+ # # Call the update_shielded_instance_config method.
938
+ # result = client.update_shielded_instance_config request
939
+ #
940
+ # # The returned object is of type Gapic::Operation. You can use it to
941
+ # # check the status of an operation, cancel it, or wait for results.
942
+ # # Here is how to wait for a response.
943
+ # result.wait_until_done! timeout: 60
944
+ # if result.response?
945
+ # p result.response
946
+ # else
947
+ # puts "No response received."
948
+ # end
949
+ #
755
950
  def update_shielded_instance_config request, options = nil
756
951
  raise ::ArgumentError, "request must be provided" if request.nil?
757
952
 
@@ -819,6 +1014,29 @@ module Google
819
1014
  # @return [::Gapic::Operation]
820
1015
  #
821
1016
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1017
+ #
1018
+ # @example Basic example
1019
+ # require "google/cloud/notebooks/v1"
1020
+ #
1021
+ # # Create a client object. The client can be reused for multiple calls.
1022
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
1023
+ #
1024
+ # # Create a request. To set request fields, pass in keyword arguments.
1025
+ # request = Google::Cloud::Notebooks::V1::SetInstanceLabelsRequest.new
1026
+ #
1027
+ # # Call the set_instance_labels method.
1028
+ # result = client.set_instance_labels request
1029
+ #
1030
+ # # The returned object is of type Gapic::Operation. You can use it to
1031
+ # # check the status of an operation, cancel it, or wait for results.
1032
+ # # Here is how to wait for a response.
1033
+ # result.wait_until_done! timeout: 60
1034
+ # if result.response?
1035
+ # p result.response
1036
+ # else
1037
+ # puts "No response received."
1038
+ # end
1039
+ #
822
1040
  def set_instance_labels request, options = nil
823
1041
  raise ::ArgumentError, "request must be provided" if request.nil?
824
1042
 
@@ -885,6 +1103,22 @@ module Google
885
1103
  # @return [::Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsResponse]
886
1104
  #
887
1105
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1106
+ #
1107
+ # @example Basic example
1108
+ # require "google/cloud/notebooks/v1"
1109
+ #
1110
+ # # Create a client object. The client can be reused for multiple calls.
1111
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
1112
+ #
1113
+ # # Create a request. To set request fields, pass in keyword arguments.
1114
+ # request = Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsRequest.new
1115
+ #
1116
+ # # Call the update_instance_metadata_items method.
1117
+ # result = client.update_instance_metadata_items request
1118
+ #
1119
+ # # The returned object is of type Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsResponse.
1120
+ # p result
1121
+ #
888
1122
  def update_instance_metadata_items request, options = nil
889
1123
  raise ::ArgumentError, "request must be provided" if request.nil?
890
1124
 
@@ -948,6 +1182,29 @@ module Google
948
1182
  # @return [::Gapic::Operation]
949
1183
  #
950
1184
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1185
+ #
1186
+ # @example Basic example
1187
+ # require "google/cloud/notebooks/v1"
1188
+ #
1189
+ # # Create a client object. The client can be reused for multiple calls.
1190
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
1191
+ #
1192
+ # # Create a request. To set request fields, pass in keyword arguments.
1193
+ # request = Google::Cloud::Notebooks::V1::DeleteInstanceRequest.new
1194
+ #
1195
+ # # Call the delete_instance method.
1196
+ # result = client.delete_instance request
1197
+ #
1198
+ # # The returned object is of type Gapic::Operation. You can use it to
1199
+ # # check the status of an operation, cancel it, or wait for results.
1200
+ # # Here is how to wait for a response.
1201
+ # result.wait_until_done! timeout: 60
1202
+ # if result.response?
1203
+ # p result.response
1204
+ # else
1205
+ # puts "No response received."
1206
+ # end
1207
+ #
951
1208
  def delete_instance request, options = nil
952
1209
  raise ::ArgumentError, "request must be provided" if request.nil?
953
1210
 
@@ -1012,6 +1269,29 @@ module Google
1012
1269
  # @return [::Gapic::Operation]
1013
1270
  #
1014
1271
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1272
+ #
1273
+ # @example Basic example
1274
+ # require "google/cloud/notebooks/v1"
1275
+ #
1276
+ # # Create a client object. The client can be reused for multiple calls.
1277
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
1278
+ #
1279
+ # # Create a request. To set request fields, pass in keyword arguments.
1280
+ # request = Google::Cloud::Notebooks::V1::StartInstanceRequest.new
1281
+ #
1282
+ # # Call the start_instance method.
1283
+ # result = client.start_instance request
1284
+ #
1285
+ # # The returned object is of type Gapic::Operation. You can use it to
1286
+ # # check the status of an operation, cancel it, or wait for results.
1287
+ # # Here is how to wait for a response.
1288
+ # result.wait_until_done! timeout: 60
1289
+ # if result.response?
1290
+ # p result.response
1291
+ # else
1292
+ # puts "No response received."
1293
+ # end
1294
+ #
1015
1295
  def start_instance request, options = nil
1016
1296
  raise ::ArgumentError, "request must be provided" if request.nil?
1017
1297
 
@@ -1076,6 +1356,29 @@ module Google
1076
1356
  # @return [::Gapic::Operation]
1077
1357
  #
1078
1358
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1359
+ #
1360
+ # @example Basic example
1361
+ # require "google/cloud/notebooks/v1"
1362
+ #
1363
+ # # Create a client object. The client can be reused for multiple calls.
1364
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
1365
+ #
1366
+ # # Create a request. To set request fields, pass in keyword arguments.
1367
+ # request = Google::Cloud::Notebooks::V1::StopInstanceRequest.new
1368
+ #
1369
+ # # Call the stop_instance method.
1370
+ # result = client.stop_instance request
1371
+ #
1372
+ # # The returned object is of type Gapic::Operation. You can use it to
1373
+ # # check the status of an operation, cancel it, or wait for results.
1374
+ # # Here is how to wait for a response.
1375
+ # result.wait_until_done! timeout: 60
1376
+ # if result.response?
1377
+ # p result.response
1378
+ # else
1379
+ # puts "No response received."
1380
+ # end
1381
+ #
1079
1382
  def stop_instance request, options = nil
1080
1383
  raise ::ArgumentError, "request must be provided" if request.nil?
1081
1384
 
@@ -1140,6 +1443,29 @@ module Google
1140
1443
  # @return [::Gapic::Operation]
1141
1444
  #
1142
1445
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1446
+ #
1447
+ # @example Basic example
1448
+ # require "google/cloud/notebooks/v1"
1449
+ #
1450
+ # # Create a client object. The client can be reused for multiple calls.
1451
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
1452
+ #
1453
+ # # Create a request. To set request fields, pass in keyword arguments.
1454
+ # request = Google::Cloud::Notebooks::V1::ResetInstanceRequest.new
1455
+ #
1456
+ # # Call the reset_instance method.
1457
+ # result = client.reset_instance request
1458
+ #
1459
+ # # The returned object is of type Gapic::Operation. You can use it to
1460
+ # # check the status of an operation, cancel it, or wait for results.
1461
+ # # Here is how to wait for a response.
1462
+ # result.wait_until_done! timeout: 60
1463
+ # if result.response?
1464
+ # p result.response
1465
+ # else
1466
+ # puts "No response received."
1467
+ # end
1468
+ #
1143
1469
  def reset_instance request, options = nil
1144
1470
  raise ::ArgumentError, "request must be provided" if request.nil?
1145
1471
 
@@ -1213,6 +1539,29 @@ module Google
1213
1539
  # @return [::Gapic::Operation]
1214
1540
  #
1215
1541
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1542
+ #
1543
+ # @example Basic example
1544
+ # require "google/cloud/notebooks/v1"
1545
+ #
1546
+ # # Create a client object. The client can be reused for multiple calls.
1547
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
1548
+ #
1549
+ # # Create a request. To set request fields, pass in keyword arguments.
1550
+ # request = Google::Cloud::Notebooks::V1::ReportInstanceInfoRequest.new
1551
+ #
1552
+ # # Call the report_instance_info method.
1553
+ # result = client.report_instance_info request
1554
+ #
1555
+ # # The returned object is of type Gapic::Operation. You can use it to
1556
+ # # check the status of an operation, cancel it, or wait for results.
1557
+ # # Here is how to wait for a response.
1558
+ # result.wait_until_done! timeout: 60
1559
+ # if result.response?
1560
+ # p result.response
1561
+ # else
1562
+ # puts "No response received."
1563
+ # end
1564
+ #
1216
1565
  def report_instance_info request, options = nil
1217
1566
  raise ::ArgumentError, "request must be provided" if request.nil?
1218
1567
 
@@ -1280,6 +1629,22 @@ module Google
1280
1629
  # @return [::Google::Cloud::Notebooks::V1::IsInstanceUpgradeableResponse]
1281
1630
  #
1282
1631
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1632
+ #
1633
+ # @example Basic example
1634
+ # require "google/cloud/notebooks/v1"
1635
+ #
1636
+ # # Create a client object. The client can be reused for multiple calls.
1637
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
1638
+ #
1639
+ # # Create a request. To set request fields, pass in keyword arguments.
1640
+ # request = Google::Cloud::Notebooks::V1::IsInstanceUpgradeableRequest.new
1641
+ #
1642
+ # # Call the is_instance_upgradeable method.
1643
+ # result = client.is_instance_upgradeable request
1644
+ #
1645
+ # # The returned object is of type Google::Cloud::Notebooks::V1::IsInstanceUpgradeableResponse.
1646
+ # p result
1647
+ #
1283
1648
  def is_instance_upgradeable request, options = nil
1284
1649
  raise ::ArgumentError, "request must be provided" if request.nil?
1285
1650
 
@@ -1343,6 +1708,22 @@ module Google
1343
1708
  # @return [::Google::Cloud::Notebooks::V1::GetInstanceHealthResponse]
1344
1709
  #
1345
1710
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1711
+ #
1712
+ # @example Basic example
1713
+ # require "google/cloud/notebooks/v1"
1714
+ #
1715
+ # # Create a client object. The client can be reused for multiple calls.
1716
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
1717
+ #
1718
+ # # Create a request. To set request fields, pass in keyword arguments.
1719
+ # request = Google::Cloud::Notebooks::V1::GetInstanceHealthRequest.new
1720
+ #
1721
+ # # Call the get_instance_health method.
1722
+ # result = client.get_instance_health request
1723
+ #
1724
+ # # The returned object is of type Google::Cloud::Notebooks::V1::GetInstanceHealthResponse.
1725
+ # p result
1726
+ #
1346
1727
  def get_instance_health request, options = nil
1347
1728
  raise ::ArgumentError, "request must be provided" if request.nil?
1348
1729
 
@@ -1409,6 +1790,29 @@ module Google
1409
1790
  # @return [::Gapic::Operation]
1410
1791
  #
1411
1792
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1793
+ #
1794
+ # @example Basic example
1795
+ # require "google/cloud/notebooks/v1"
1796
+ #
1797
+ # # Create a client object. The client can be reused for multiple calls.
1798
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
1799
+ #
1800
+ # # Create a request. To set request fields, pass in keyword arguments.
1801
+ # request = Google::Cloud::Notebooks::V1::UpgradeInstanceRequest.new
1802
+ #
1803
+ # # Call the upgrade_instance method.
1804
+ # result = client.upgrade_instance request
1805
+ #
1806
+ # # The returned object is of type Gapic::Operation. You can use it to
1807
+ # # check the status of an operation, cancel it, or wait for results.
1808
+ # # Here is how to wait for a response.
1809
+ # result.wait_until_done! timeout: 60
1810
+ # if result.response?
1811
+ # p result.response
1812
+ # else
1813
+ # puts "No response received."
1814
+ # end
1815
+ #
1412
1816
  def upgrade_instance request, options = nil
1413
1817
  raise ::ArgumentError, "request must be provided" if request.nil?
1414
1818
 
@@ -1476,6 +1880,29 @@ module Google
1476
1880
  # @return [::Gapic::Operation]
1477
1881
  #
1478
1882
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1883
+ #
1884
+ # @example Basic example
1885
+ # require "google/cloud/notebooks/v1"
1886
+ #
1887
+ # # Create a client object. The client can be reused for multiple calls.
1888
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
1889
+ #
1890
+ # # Create a request. To set request fields, pass in keyword arguments.
1891
+ # request = Google::Cloud::Notebooks::V1::RollbackInstanceRequest.new
1892
+ #
1893
+ # # Call the rollback_instance method.
1894
+ # result = client.rollback_instance request
1895
+ #
1896
+ # # The returned object is of type Gapic::Operation. You can use it to
1897
+ # # check the status of an operation, cancel it, or wait for results.
1898
+ # # Here is how to wait for a response.
1899
+ # result.wait_until_done! timeout: 60
1900
+ # if result.response?
1901
+ # p result.response
1902
+ # else
1903
+ # puts "No response received."
1904
+ # end
1905
+ #
1479
1906
  def rollback_instance request, options = nil
1480
1907
  raise ::ArgumentError, "request must be provided" if request.nil?
1481
1908
 
@@ -1542,6 +1969,29 @@ module Google
1542
1969
  # @return [::Gapic::Operation]
1543
1970
  #
1544
1971
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1972
+ #
1973
+ # @example Basic example
1974
+ # require "google/cloud/notebooks/v1"
1975
+ #
1976
+ # # Create a client object. The client can be reused for multiple calls.
1977
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
1978
+ #
1979
+ # # Create a request. To set request fields, pass in keyword arguments.
1980
+ # request = Google::Cloud::Notebooks::V1::DiagnoseInstanceRequest.new
1981
+ #
1982
+ # # Call the diagnose_instance method.
1983
+ # result = client.diagnose_instance request
1984
+ #
1985
+ # # The returned object is of type Gapic::Operation. You can use it to
1986
+ # # check the status of an operation, cancel it, or wait for results.
1987
+ # # Here is how to wait for a response.
1988
+ # result.wait_until_done! timeout: 60
1989
+ # if result.response?
1990
+ # p result.response
1991
+ # else
1992
+ # puts "No response received."
1993
+ # end
1994
+ #
1545
1995
  def diagnose_instance request, options = nil
1546
1996
  raise ::ArgumentError, "request must be provided" if request.nil?
1547
1997
 
@@ -1613,6 +2063,29 @@ module Google
1613
2063
  # @return [::Gapic::Operation]
1614
2064
  #
1615
2065
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2066
+ #
2067
+ # @example Basic example
2068
+ # require "google/cloud/notebooks/v1"
2069
+ #
2070
+ # # Create a client object. The client can be reused for multiple calls.
2071
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
2072
+ #
2073
+ # # Create a request. To set request fields, pass in keyword arguments.
2074
+ # request = Google::Cloud::Notebooks::V1::UpgradeInstanceInternalRequest.new
2075
+ #
2076
+ # # Call the upgrade_instance_internal method.
2077
+ # result = client.upgrade_instance_internal request
2078
+ #
2079
+ # # The returned object is of type Gapic::Operation. You can use it to
2080
+ # # check the status of an operation, cancel it, or wait for results.
2081
+ # # Here is how to wait for a response.
2082
+ # result.wait_until_done! timeout: 60
2083
+ # if result.response?
2084
+ # p result.response
2085
+ # else
2086
+ # puts "No response received."
2087
+ # end
2088
+ #
1616
2089
  def upgrade_instance_internal request, options = nil
1617
2090
  raise ::ArgumentError, "request must be provided" if request.nil?
1618
2091
 
@@ -1681,6 +2154,26 @@ module Google
1681
2154
  # @return [::Google::Cloud::Notebooks::V1::ListEnvironmentsResponse]
1682
2155
  #
1683
2156
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2157
+ #
2158
+ # @example Basic example
2159
+ # require "google/cloud/notebooks/v1"
2160
+ #
2161
+ # # Create a client object. The client can be reused for multiple calls.
2162
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
2163
+ #
2164
+ # # Create a request. To set request fields, pass in keyword arguments.
2165
+ # request = Google::Cloud::Notebooks::V1::ListEnvironmentsRequest.new
2166
+ #
2167
+ # # Call the list_environments method.
2168
+ # result = client.list_environments request
2169
+ #
2170
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2171
+ # # over elements, and API calls will be issued to fetch pages as needed.
2172
+ # result.each do |item|
2173
+ # # Each element is of type ::Google::Cloud::Notebooks::V1::Environment.
2174
+ # p item
2175
+ # end
2176
+ #
1684
2177
  def list_environments request, options = nil
1685
2178
  raise ::ArgumentError, "request must be provided" if request.nil?
1686
2179
 
@@ -1744,6 +2237,22 @@ module Google
1744
2237
  # @return [::Google::Cloud::Notebooks::V1::Environment]
1745
2238
  #
1746
2239
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2240
+ #
2241
+ # @example Basic example
2242
+ # require "google/cloud/notebooks/v1"
2243
+ #
2244
+ # # Create a client object. The client can be reused for multiple calls.
2245
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
2246
+ #
2247
+ # # Create a request. To set request fields, pass in keyword arguments.
2248
+ # request = Google::Cloud::Notebooks::V1::GetEnvironmentRequest.new
2249
+ #
2250
+ # # Call the get_environment method.
2251
+ # result = client.get_environment request
2252
+ #
2253
+ # # The returned object is of type Google::Cloud::Notebooks::V1::Environment.
2254
+ # p result
2255
+ #
1747
2256
  def get_environment request, options = nil
1748
2257
  raise ::ArgumentError, "request must be provided" if request.nil?
1749
2258
 
@@ -1813,6 +2322,29 @@ module Google
1813
2322
  # @return [::Gapic::Operation]
1814
2323
  #
1815
2324
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2325
+ #
2326
+ # @example Basic example
2327
+ # require "google/cloud/notebooks/v1"
2328
+ #
2329
+ # # Create a client object. The client can be reused for multiple calls.
2330
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
2331
+ #
2332
+ # # Create a request. To set request fields, pass in keyword arguments.
2333
+ # request = Google::Cloud::Notebooks::V1::CreateEnvironmentRequest.new
2334
+ #
2335
+ # # Call the create_environment method.
2336
+ # result = client.create_environment request
2337
+ #
2338
+ # # The returned object is of type Gapic::Operation. You can use it to
2339
+ # # check the status of an operation, cancel it, or wait for results.
2340
+ # # Here is how to wait for a response.
2341
+ # result.wait_until_done! timeout: 60
2342
+ # if result.response?
2343
+ # p result.response
2344
+ # else
2345
+ # puts "No response received."
2346
+ # end
2347
+ #
1816
2348
  def create_environment request, options = nil
1817
2349
  raise ::ArgumentError, "request must be provided" if request.nil?
1818
2350
 
@@ -1877,6 +2409,29 @@ module Google
1877
2409
  # @return [::Gapic::Operation]
1878
2410
  #
1879
2411
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2412
+ #
2413
+ # @example Basic example
2414
+ # require "google/cloud/notebooks/v1"
2415
+ #
2416
+ # # Create a client object. The client can be reused for multiple calls.
2417
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
2418
+ #
2419
+ # # Create a request. To set request fields, pass in keyword arguments.
2420
+ # request = Google::Cloud::Notebooks::V1::DeleteEnvironmentRequest.new
2421
+ #
2422
+ # # Call the delete_environment method.
2423
+ # result = client.delete_environment request
2424
+ #
2425
+ # # The returned object is of type Gapic::Operation. You can use it to
2426
+ # # check the status of an operation, cancel it, or wait for results.
2427
+ # # Here is how to wait for a response.
2428
+ # result.wait_until_done! timeout: 60
2429
+ # if result.response?
2430
+ # p result.response
2431
+ # else
2432
+ # puts "No response received."
2433
+ # end
2434
+ #
1880
2435
  def delete_environment request, options = nil
1881
2436
  raise ::ArgumentError, "request must be provided" if request.nil?
1882
2437
 
@@ -1950,6 +2505,26 @@ module Google
1950
2505
  # @return [::Google::Cloud::Notebooks::V1::ListSchedulesResponse]
1951
2506
  #
1952
2507
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2508
+ #
2509
+ # @example Basic example
2510
+ # require "google/cloud/notebooks/v1"
2511
+ #
2512
+ # # Create a client object. The client can be reused for multiple calls.
2513
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
2514
+ #
2515
+ # # Create a request. To set request fields, pass in keyword arguments.
2516
+ # request = Google::Cloud::Notebooks::V1::ListSchedulesRequest.new
2517
+ #
2518
+ # # Call the list_schedules method.
2519
+ # result = client.list_schedules request
2520
+ #
2521
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2522
+ # # over elements, and API calls will be issued to fetch pages as needed.
2523
+ # result.each do |item|
2524
+ # # Each element is of type ::Google::Cloud::Notebooks::V1::Schedule.
2525
+ # p item
2526
+ # end
2527
+ #
1953
2528
  def list_schedules request, options = nil
1954
2529
  raise ::ArgumentError, "request must be provided" if request.nil?
1955
2530
 
@@ -2013,6 +2588,22 @@ module Google
2013
2588
  # @return [::Google::Cloud::Notebooks::V1::Schedule]
2014
2589
  #
2015
2590
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2591
+ #
2592
+ # @example Basic example
2593
+ # require "google/cloud/notebooks/v1"
2594
+ #
2595
+ # # Create a client object. The client can be reused for multiple calls.
2596
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
2597
+ #
2598
+ # # Create a request. To set request fields, pass in keyword arguments.
2599
+ # request = Google::Cloud::Notebooks::V1::GetScheduleRequest.new
2600
+ #
2601
+ # # Call the get_schedule method.
2602
+ # result = client.get_schedule request
2603
+ #
2604
+ # # The returned object is of type Google::Cloud::Notebooks::V1::Schedule.
2605
+ # p result
2606
+ #
2016
2607
  def get_schedule request, options = nil
2017
2608
  raise ::ArgumentError, "request must be provided" if request.nil?
2018
2609
 
@@ -2076,6 +2667,29 @@ module Google
2076
2667
  # @return [::Gapic::Operation]
2077
2668
  #
2078
2669
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2670
+ #
2671
+ # @example Basic example
2672
+ # require "google/cloud/notebooks/v1"
2673
+ #
2674
+ # # Create a client object. The client can be reused for multiple calls.
2675
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
2676
+ #
2677
+ # # Create a request. To set request fields, pass in keyword arguments.
2678
+ # request = Google::Cloud::Notebooks::V1::DeleteScheduleRequest.new
2679
+ #
2680
+ # # Call the delete_schedule method.
2681
+ # result = client.delete_schedule request
2682
+ #
2683
+ # # The returned object is of type Gapic::Operation. You can use it to
2684
+ # # check the status of an operation, cancel it, or wait for results.
2685
+ # # Here is how to wait for a response.
2686
+ # result.wait_until_done! timeout: 60
2687
+ # if result.response?
2688
+ # p result.response
2689
+ # else
2690
+ # puts "No response received."
2691
+ # end
2692
+ #
2079
2693
  def delete_schedule request, options = nil
2080
2694
  raise ::ArgumentError, "request must be provided" if request.nil?
2081
2695
 
@@ -2144,6 +2758,29 @@ module Google
2144
2758
  # @return [::Gapic::Operation]
2145
2759
  #
2146
2760
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2761
+ #
2762
+ # @example Basic example
2763
+ # require "google/cloud/notebooks/v1"
2764
+ #
2765
+ # # Create a client object. The client can be reused for multiple calls.
2766
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
2767
+ #
2768
+ # # Create a request. To set request fields, pass in keyword arguments.
2769
+ # request = Google::Cloud::Notebooks::V1::CreateScheduleRequest.new
2770
+ #
2771
+ # # Call the create_schedule method.
2772
+ # result = client.create_schedule request
2773
+ #
2774
+ # # The returned object is of type Gapic::Operation. You can use it to
2775
+ # # check the status of an operation, cancel it, or wait for results.
2776
+ # # Here is how to wait for a response.
2777
+ # result.wait_until_done! timeout: 60
2778
+ # if result.response?
2779
+ # p result.response
2780
+ # else
2781
+ # puts "No response received."
2782
+ # end
2783
+ #
2147
2784
  def create_schedule request, options = nil
2148
2785
  raise ::ArgumentError, "request must be provided" if request.nil?
2149
2786
 
@@ -2208,6 +2845,29 @@ module Google
2208
2845
  # @return [::Gapic::Operation]
2209
2846
  #
2210
2847
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2848
+ #
2849
+ # @example Basic example
2850
+ # require "google/cloud/notebooks/v1"
2851
+ #
2852
+ # # Create a client object. The client can be reused for multiple calls.
2853
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
2854
+ #
2855
+ # # Create a request. To set request fields, pass in keyword arguments.
2856
+ # request = Google::Cloud::Notebooks::V1::TriggerScheduleRequest.new
2857
+ #
2858
+ # # Call the trigger_schedule method.
2859
+ # result = client.trigger_schedule request
2860
+ #
2861
+ # # The returned object is of type Gapic::Operation. You can use it to
2862
+ # # check the status of an operation, cancel it, or wait for results.
2863
+ # # Here is how to wait for a response.
2864
+ # result.wait_until_done! timeout: 60
2865
+ # if result.response?
2866
+ # p result.response
2867
+ # else
2868
+ # puts "No response received."
2869
+ # end
2870
+ #
2211
2871
  def trigger_schedule request, options = nil
2212
2872
  raise ::ArgumentError, "request must be provided" if request.nil?
2213
2873
 
@@ -2283,6 +2943,26 @@ module Google
2283
2943
  # @return [::Google::Cloud::Notebooks::V1::ListExecutionsResponse]
2284
2944
  #
2285
2945
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2946
+ #
2947
+ # @example Basic example
2948
+ # require "google/cloud/notebooks/v1"
2949
+ #
2950
+ # # Create a client object. The client can be reused for multiple calls.
2951
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
2952
+ #
2953
+ # # Create a request. To set request fields, pass in keyword arguments.
2954
+ # request = Google::Cloud::Notebooks::V1::ListExecutionsRequest.new
2955
+ #
2956
+ # # Call the list_executions method.
2957
+ # result = client.list_executions request
2958
+ #
2959
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2960
+ # # over elements, and API calls will be issued to fetch pages as needed.
2961
+ # result.each do |item|
2962
+ # # Each element is of type ::Google::Cloud::Notebooks::V1::Execution.
2963
+ # p item
2964
+ # end
2965
+ #
2286
2966
  def list_executions request, options = nil
2287
2967
  raise ::ArgumentError, "request must be provided" if request.nil?
2288
2968
 
@@ -2346,6 +3026,22 @@ module Google
2346
3026
  # @return [::Google::Cloud::Notebooks::V1::Execution]
2347
3027
  #
2348
3028
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
3029
+ #
3030
+ # @example Basic example
3031
+ # require "google/cloud/notebooks/v1"
3032
+ #
3033
+ # # Create a client object. The client can be reused for multiple calls.
3034
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
3035
+ #
3036
+ # # Create a request. To set request fields, pass in keyword arguments.
3037
+ # request = Google::Cloud::Notebooks::V1::GetExecutionRequest.new
3038
+ #
3039
+ # # Call the get_execution method.
3040
+ # result = client.get_execution request
3041
+ #
3042
+ # # The returned object is of type Google::Cloud::Notebooks::V1::Execution.
3043
+ # p result
3044
+ #
2349
3045
  def get_execution request, options = nil
2350
3046
  raise ::ArgumentError, "request must be provided" if request.nil?
2351
3047
 
@@ -2409,6 +3105,29 @@ module Google
2409
3105
  # @return [::Gapic::Operation]
2410
3106
  #
2411
3107
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
3108
+ #
3109
+ # @example Basic example
3110
+ # require "google/cloud/notebooks/v1"
3111
+ #
3112
+ # # Create a client object. The client can be reused for multiple calls.
3113
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
3114
+ #
3115
+ # # Create a request. To set request fields, pass in keyword arguments.
3116
+ # request = Google::Cloud::Notebooks::V1::DeleteExecutionRequest.new
3117
+ #
3118
+ # # Call the delete_execution method.
3119
+ # result = client.delete_execution request
3120
+ #
3121
+ # # The returned object is of type Gapic::Operation. You can use it to
3122
+ # # check the status of an operation, cancel it, or wait for results.
3123
+ # # Here is how to wait for a response.
3124
+ # result.wait_until_done! timeout: 60
3125
+ # if result.response?
3126
+ # p result.response
3127
+ # else
3128
+ # puts "No response received."
3129
+ # end
3130
+ #
2412
3131
  def delete_execution request, options = nil
2413
3132
  raise ::ArgumentError, "request must be provided" if request.nil?
2414
3133
 
@@ -2477,6 +3196,29 @@ module Google
2477
3196
  # @return [::Gapic::Operation]
2478
3197
  #
2479
3198
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
3199
+ #
3200
+ # @example Basic example
3201
+ # require "google/cloud/notebooks/v1"
3202
+ #
3203
+ # # Create a client object. The client can be reused for multiple calls.
3204
+ # client = Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new
3205
+ #
3206
+ # # Create a request. To set request fields, pass in keyword arguments.
3207
+ # request = Google::Cloud::Notebooks::V1::CreateExecutionRequest.new
3208
+ #
3209
+ # # Call the create_execution method.
3210
+ # result = client.create_execution request
3211
+ #
3212
+ # # The returned object is of type Gapic::Operation. You can use it to
3213
+ # # check the status of an operation, cancel it, or wait for results.
3214
+ # # Here is how to wait for a response.
3215
+ # result.wait_until_done! timeout: 60
3216
+ # if result.response?
3217
+ # p result.response
3218
+ # else
3219
+ # puts "No response received."
3220
+ # end
3221
+ #
2480
3222
  def create_execution request, options = nil
2481
3223
  raise ::ArgumentError, "request must be provided" if request.nil?
2482
3224
 
@@ -2543,9 +3285,9 @@ module Google
2543
3285
  # end
2544
3286
  #
2545
3287
  # @!attribute [rw] endpoint
2546
- # The hostname or hostname:port of the service endpoint.
2547
- # Defaults to `"notebooks.googleapis.com"`.
2548
- # @return [::String]
3288
+ # A custom service endpoint, as a hostname or hostname:port. The default is
3289
+ # nil, indicating to use the default endpoint in the current universe domain.
3290
+ # @return [::String,nil]
2549
3291
  # @!attribute [rw] credentials
2550
3292
  # Credentials to send with calls. You may provide any of the following types:
2551
3293
  # * (`String`) The path to a service account key file in JSON format
@@ -2582,13 +3324,20 @@ module Google
2582
3324
  # @!attribute [rw] quota_project
2583
3325
  # A separate project against which to charge quota.
2584
3326
  # @return [::String]
3327
+ # @!attribute [rw] universe_domain
3328
+ # The universe domain within which to make requests. This determines the
3329
+ # default endpoint URL. The default value of nil uses the environment
3330
+ # universe (usually the default "googleapis.com" universe).
3331
+ # @return [::String,nil]
2585
3332
  #
2586
3333
  class Configuration
2587
3334
  extend ::Gapic::Config
2588
3335
 
3336
+ # @private
3337
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
2589
3338
  DEFAULT_ENDPOINT = "notebooks.googleapis.com"
2590
3339
 
2591
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
3340
+ config_attr :endpoint, nil, ::String, nil
2592
3341
  config_attr :credentials, nil do |value|
2593
3342
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2594
3343
  allowed.any? { |klass| klass === value }
@@ -2600,6 +3349,7 @@ module Google
2600
3349
  config_attr :metadata, nil, ::Hash, nil
2601
3350
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2602
3351
  config_attr :quota_project, nil, ::String, nil
3352
+ config_attr :universe_domain, nil, ::String, nil
2603
3353
 
2604
3354
  # @private
2605
3355
  # Overrides for http bindings for the RPCs of this service