google-cloud-vm_migration-v1 0.3.0 → 0.5.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.
@@ -18,6 +18,8 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/vmmigration/v1/vmmigration_pb"
21
+ require "google/cloud/location"
22
+ require "google/iam/v1"
21
23
 
22
24
  module Google
23
25
  module Cloud
@@ -147,6 +149,18 @@ module Google
147
149
  config.endpoint = @config.endpoint
148
150
  end
149
151
 
152
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
153
+ config.credentials = credentials
154
+ config.quota_project = @quota_project_id
155
+ config.endpoint = @config.endpoint
156
+ end
157
+
158
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
159
+ config.credentials = credentials
160
+ config.quota_project = @quota_project_id
161
+ config.endpoint = @config.endpoint
162
+ end
163
+
150
164
  @vm_migration_stub = ::Gapic::ServiceStub.new(
151
165
  ::Google::Cloud::VMMigration::V1::VmMigration::Stub,
152
166
  credentials: credentials,
@@ -163,6 +177,20 @@ module Google
163
177
  #
164
178
  attr_reader :operations_client
165
179
 
180
+ ##
181
+ # Get the associated client for mix-in of the Locations.
182
+ #
183
+ # @return [Google::Cloud::Location::Locations::Client]
184
+ #
185
+ attr_reader :location_client
186
+
187
+ ##
188
+ # Get the associated client for mix-in of the IAMPolicy.
189
+ #
190
+ # @return [Google::Iam::V1::IAMPolicy::Client]
191
+ #
192
+ attr_reader :iam_policy_client
193
+
166
194
  # Service calls
167
195
 
168
196
  ##
@@ -221,13 +249,11 @@ module Google
221
249
  # # Call the list_sources method.
222
250
  # result = client.list_sources request
223
251
  #
224
- # # The returned object is of type Gapic::PagedEnumerable. You can
225
- # # iterate over all elements by calling #each, and the enumerable
226
- # # will lazily make API calls to fetch subsequent pages. Other
227
- # # methods are also available for managing paging directly.
228
- # result.each do |response|
252
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
253
+ # # over elements, and API calls will be issued to fetch pages as needed.
254
+ # result.each do |item|
229
255
  # # Each element is of type ::Google::Cloud::VMMigration::V1::Source.
230
- # p response
256
+ # p item
231
257
  # end
232
258
  #
233
259
  def list_sources request, options = nil
@@ -416,14 +442,14 @@ module Google
416
442
  # # Call the create_source method.
417
443
  # result = client.create_source request
418
444
  #
419
- # # The returned object is of type Gapic::Operation. You can use this
420
- # # object to check the status of an operation, cancel it, or wait
421
- # # for results. Here is how to block until completion:
445
+ # # The returned object is of type Gapic::Operation. You can use it to
446
+ # # check the status of an operation, cancel it, or wait for results.
447
+ # # Here is how to wait for a response.
422
448
  # result.wait_until_done! timeout: 60
423
449
  # if result.response?
424
450
  # p result.response
425
451
  # else
426
- # puts "Error!"
452
+ # puts "No response received."
427
453
  # end
428
454
  #
429
455
  def create_source request, options = nil
@@ -529,14 +555,14 @@ module Google
529
555
  # # Call the update_source method.
530
556
  # result = client.update_source request
531
557
  #
532
- # # The returned object is of type Gapic::Operation. You can use this
533
- # # object to check the status of an operation, cancel it, or wait
534
- # # for results. Here is how to block until completion:
558
+ # # The returned object is of type Gapic::Operation. You can use it to
559
+ # # check the status of an operation, cancel it, or wait for results.
560
+ # # Here is how to wait for a response.
535
561
  # result.wait_until_done! timeout: 60
536
562
  # if result.response?
537
563
  # p result.response
538
564
  # else
539
- # puts "Error!"
565
+ # puts "No response received."
540
566
  # end
541
567
  #
542
568
  def update_source request, options = nil
@@ -636,14 +662,14 @@ module Google
636
662
  # # Call the delete_source method.
637
663
  # result = client.delete_source request
638
664
  #
639
- # # The returned object is of type Gapic::Operation. You can use this
640
- # # object to check the status of an operation, cancel it, or wait
641
- # # for results. Here is how to block until completion:
665
+ # # The returned object is of type Gapic::Operation. You can use it to
666
+ # # check the status of an operation, cancel it, or wait for results.
667
+ # # Here is how to wait for a response.
642
668
  # result.wait_until_done! timeout: 60
643
669
  # if result.response?
644
670
  # p result.response
645
671
  # else
646
- # puts "Error!"
672
+ # puts "No response received."
647
673
  # end
648
674
  #
649
675
  def delete_source request, options = nil
@@ -839,13 +865,11 @@ module Google
839
865
  # # Call the list_utilization_reports method.
840
866
  # result = client.list_utilization_reports request
841
867
  #
842
- # # The returned object is of type Gapic::PagedEnumerable. You can
843
- # # iterate over all elements by calling #each, and the enumerable
844
- # # will lazily make API calls to fetch subsequent pages. Other
845
- # # methods are also available for managing paging directly.
846
- # result.each do |response|
868
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
869
+ # # over elements, and API calls will be issued to fetch pages as needed.
870
+ # result.each do |item|
847
871
  # # Each element is of type ::Google::Cloud::VMMigration::V1::UtilizationReport.
848
- # p response
872
+ # p item
849
873
  # end
850
874
  #
851
875
  def list_utilization_reports request, options = nil
@@ -1042,14 +1066,14 @@ module Google
1042
1066
  # # Call the create_utilization_report method.
1043
1067
  # result = client.create_utilization_report request
1044
1068
  #
1045
- # # The returned object is of type Gapic::Operation. You can use this
1046
- # # object to check the status of an operation, cancel it, or wait
1047
- # # for results. Here is how to block until completion:
1069
+ # # The returned object is of type Gapic::Operation. You can use it to
1070
+ # # check the status of an operation, cancel it, or wait for results.
1071
+ # # Here is how to wait for a response.
1048
1072
  # result.wait_until_done! timeout: 60
1049
1073
  # if result.response?
1050
1074
  # p result.response
1051
1075
  # else
1052
- # puts "Error!"
1076
+ # puts "No response received."
1053
1077
  # end
1054
1078
  #
1055
1079
  def create_utilization_report request, options = nil
@@ -1149,14 +1173,14 @@ module Google
1149
1173
  # # Call the delete_utilization_report method.
1150
1174
  # result = client.delete_utilization_report request
1151
1175
  #
1152
- # # The returned object is of type Gapic::Operation. You can use this
1153
- # # object to check the status of an operation, cancel it, or wait
1154
- # # for results. Here is how to block until completion:
1176
+ # # The returned object is of type Gapic::Operation. You can use it to
1177
+ # # check the status of an operation, cancel it, or wait for results.
1178
+ # # Here is how to wait for a response.
1155
1179
  # result.wait_until_done! timeout: 60
1156
1180
  # if result.response?
1157
1181
  # p result.response
1158
1182
  # else
1159
- # puts "Error!"
1183
+ # puts "No response received."
1160
1184
  # end
1161
1185
  #
1162
1186
  def delete_utilization_report request, options = nil
@@ -1258,13 +1282,11 @@ module Google
1258
1282
  # # Call the list_datacenter_connectors method.
1259
1283
  # result = client.list_datacenter_connectors request
1260
1284
  #
1261
- # # The returned object is of type Gapic::PagedEnumerable. You can
1262
- # # iterate over all elements by calling #each, and the enumerable
1263
- # # will lazily make API calls to fetch subsequent pages. Other
1264
- # # methods are also available for managing paging directly.
1265
- # result.each do |response|
1285
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1286
+ # # over elements, and API calls will be issued to fetch pages as needed.
1287
+ # result.each do |item|
1266
1288
  # # Each element is of type ::Google::Cloud::VMMigration::V1::DatacenterConnector.
1267
- # p response
1289
+ # p item
1268
1290
  # end
1269
1291
  #
1270
1292
  def list_datacenter_connectors request, options = nil
@@ -1456,14 +1478,14 @@ module Google
1456
1478
  # # Call the create_datacenter_connector method.
1457
1479
  # result = client.create_datacenter_connector request
1458
1480
  #
1459
- # # The returned object is of type Gapic::Operation. You can use this
1460
- # # object to check the status of an operation, cancel it, or wait
1461
- # # for results. Here is how to block until completion:
1481
+ # # The returned object is of type Gapic::Operation. You can use it to
1482
+ # # check the status of an operation, cancel it, or wait for results.
1483
+ # # Here is how to wait for a response.
1462
1484
  # result.wait_until_done! timeout: 60
1463
1485
  # if result.response?
1464
1486
  # p result.response
1465
1487
  # else
1466
- # puts "Error!"
1488
+ # puts "No response received."
1467
1489
  # end
1468
1490
  #
1469
1491
  def create_datacenter_connector request, options = nil
@@ -1563,14 +1585,14 @@ module Google
1563
1585
  # # Call the delete_datacenter_connector method.
1564
1586
  # result = client.delete_datacenter_connector request
1565
1587
  #
1566
- # # The returned object is of type Gapic::Operation. You can use this
1567
- # # object to check the status of an operation, cancel it, or wait
1568
- # # for results. Here is how to block until completion:
1588
+ # # The returned object is of type Gapic::Operation. You can use it to
1589
+ # # check the status of an operation, cancel it, or wait for results.
1590
+ # # Here is how to wait for a response.
1569
1591
  # result.wait_until_done! timeout: 60
1570
1592
  # if result.response?
1571
1593
  # p result.response
1572
1594
  # else
1573
- # puts "Error!"
1595
+ # puts "No response received."
1574
1596
  # end
1575
1597
  #
1576
1598
  def delete_datacenter_connector request, options = nil
@@ -1671,14 +1693,14 @@ module Google
1671
1693
  # # Call the upgrade_appliance method.
1672
1694
  # result = client.upgrade_appliance request
1673
1695
  #
1674
- # # The returned object is of type Gapic::Operation. You can use this
1675
- # # object to check the status of an operation, cancel it, or wait
1676
- # # for results. Here is how to block until completion:
1696
+ # # The returned object is of type Gapic::Operation. You can use it to
1697
+ # # check the status of an operation, cancel it, or wait for results.
1698
+ # # Here is how to wait for a response.
1677
1699
  # result.wait_until_done! timeout: 60
1678
1700
  # if result.response?
1679
1701
  # p result.response
1680
1702
  # else
1681
- # puts "Error!"
1703
+ # puts "No response received."
1682
1704
  # end
1683
1705
  #
1684
1706
  def upgrade_appliance request, options = nil
@@ -1782,14 +1804,14 @@ module Google
1782
1804
  # # Call the create_migrating_vm method.
1783
1805
  # result = client.create_migrating_vm request
1784
1806
  #
1785
- # # The returned object is of type Gapic::Operation. You can use this
1786
- # # object to check the status of an operation, cancel it, or wait
1787
- # # for results. Here is how to block until completion:
1807
+ # # The returned object is of type Gapic::Operation. You can use it to
1808
+ # # check the status of an operation, cancel it, or wait for results.
1809
+ # # Here is how to wait for a response.
1788
1810
  # result.wait_until_done! timeout: 60
1789
1811
  # if result.response?
1790
1812
  # p result.response
1791
1813
  # else
1792
- # puts "Error!"
1814
+ # puts "No response received."
1793
1815
  # end
1794
1816
  #
1795
1817
  def create_migrating_vm request, options = nil
@@ -1892,13 +1914,11 @@ module Google
1892
1914
  # # Call the list_migrating_vms method.
1893
1915
  # result = client.list_migrating_vms request
1894
1916
  #
1895
- # # The returned object is of type Gapic::PagedEnumerable. You can
1896
- # # iterate over all elements by calling #each, and the enumerable
1897
- # # will lazily make API calls to fetch subsequent pages. Other
1898
- # # methods are also available for managing paging directly.
1899
- # result.each do |response|
1917
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1918
+ # # over elements, and API calls will be issued to fetch pages as needed.
1919
+ # result.each do |item|
1900
1920
  # # Each element is of type ::Google::Cloud::VMMigration::V1::MigratingVm.
1901
- # p response
1921
+ # p item
1902
1922
  # end
1903
1923
  #
1904
1924
  def list_migrating_vms request, options = nil
@@ -2091,14 +2111,14 @@ module Google
2091
2111
  # # Call the update_migrating_vm method.
2092
2112
  # result = client.update_migrating_vm request
2093
2113
  #
2094
- # # The returned object is of type Gapic::Operation. You can use this
2095
- # # object to check the status of an operation, cancel it, or wait
2096
- # # for results. Here is how to block until completion:
2114
+ # # The returned object is of type Gapic::Operation. You can use it to
2115
+ # # check the status of an operation, cancel it, or wait for results.
2116
+ # # Here is how to wait for a response.
2097
2117
  # result.wait_until_done! timeout: 60
2098
2118
  # if result.response?
2099
2119
  # p result.response
2100
2120
  # else
2101
- # puts "Error!"
2121
+ # puts "No response received."
2102
2122
  # end
2103
2123
  #
2104
2124
  def update_migrating_vm request, options = nil
@@ -2184,14 +2204,14 @@ module Google
2184
2204
  # # Call the delete_migrating_vm method.
2185
2205
  # result = client.delete_migrating_vm request
2186
2206
  #
2187
- # # The returned object is of type Gapic::Operation. You can use this
2188
- # # object to check the status of an operation, cancel it, or wait
2189
- # # for results. Here is how to block until completion:
2207
+ # # The returned object is of type Gapic::Operation. You can use it to
2208
+ # # check the status of an operation, cancel it, or wait for results.
2209
+ # # Here is how to wait for a response.
2190
2210
  # result.wait_until_done! timeout: 60
2191
2211
  # if result.response?
2192
2212
  # p result.response
2193
2213
  # else
2194
- # puts "Error!"
2214
+ # puts "No response received."
2195
2215
  # end
2196
2216
  #
2197
2217
  def delete_migrating_vm request, options = nil
@@ -2278,14 +2298,14 @@ module Google
2278
2298
  # # Call the start_migration method.
2279
2299
  # result = client.start_migration request
2280
2300
  #
2281
- # # The returned object is of type Gapic::Operation. You can use this
2282
- # # object to check the status of an operation, cancel it, or wait
2283
- # # for results. Here is how to block until completion:
2301
+ # # The returned object is of type Gapic::Operation. You can use it to
2302
+ # # check the status of an operation, cancel it, or wait for results.
2303
+ # # Here is how to wait for a response.
2284
2304
  # result.wait_until_done! timeout: 60
2285
2305
  # if result.response?
2286
2306
  # p result.response
2287
2307
  # else
2288
- # puts "Error!"
2308
+ # puts "No response received."
2289
2309
  # end
2290
2310
  #
2291
2311
  def start_migration request, options = nil
@@ -2374,14 +2394,14 @@ module Google
2374
2394
  # # Call the resume_migration method.
2375
2395
  # result = client.resume_migration request
2376
2396
  #
2377
- # # The returned object is of type Gapic::Operation. You can use this
2378
- # # object to check the status of an operation, cancel it, or wait
2379
- # # for results. Here is how to block until completion:
2397
+ # # The returned object is of type Gapic::Operation. You can use it to
2398
+ # # check the status of an operation, cancel it, or wait for results.
2399
+ # # Here is how to wait for a response.
2380
2400
  # result.wait_until_done! timeout: 60
2381
2401
  # if result.response?
2382
2402
  # p result.response
2383
2403
  # else
2384
- # puts "Error!"
2404
+ # puts "No response received."
2385
2405
  # end
2386
2406
  #
2387
2407
  def resume_migration request, options = nil
@@ -2469,14 +2489,14 @@ module Google
2469
2489
  # # Call the pause_migration method.
2470
2490
  # result = client.pause_migration request
2471
2491
  #
2472
- # # The returned object is of type Gapic::Operation. You can use this
2473
- # # object to check the status of an operation, cancel it, or wait
2474
- # # for results. Here is how to block until completion:
2492
+ # # The returned object is of type Gapic::Operation. You can use it to
2493
+ # # check the status of an operation, cancel it, or wait for results.
2494
+ # # Here is how to wait for a response.
2475
2495
  # result.wait_until_done! timeout: 60
2476
2496
  # if result.response?
2477
2497
  # p result.response
2478
2498
  # else
2479
- # puts "Error!"
2499
+ # puts "No response received."
2480
2500
  # end
2481
2501
  #
2482
2502
  def pause_migration request, options = nil
@@ -2563,14 +2583,14 @@ module Google
2563
2583
  # # Call the finalize_migration method.
2564
2584
  # result = client.finalize_migration request
2565
2585
  #
2566
- # # The returned object is of type Gapic::Operation. You can use this
2567
- # # object to check the status of an operation, cancel it, or wait
2568
- # # for results. Here is how to block until completion:
2586
+ # # The returned object is of type Gapic::Operation. You can use it to
2587
+ # # check the status of an operation, cancel it, or wait for results.
2588
+ # # Here is how to wait for a response.
2569
2589
  # result.wait_until_done! timeout: 60
2570
2590
  # if result.response?
2571
2591
  # p result.response
2572
2592
  # else
2573
- # puts "Error!"
2593
+ # puts "No response received."
2574
2594
  # end
2575
2595
  #
2576
2596
  def finalize_migration request, options = nil
@@ -2674,14 +2694,14 @@ module Google
2674
2694
  # # Call the create_clone_job method.
2675
2695
  # result = client.create_clone_job request
2676
2696
  #
2677
- # # The returned object is of type Gapic::Operation. You can use this
2678
- # # object to check the status of an operation, cancel it, or wait
2679
- # # for results. Here is how to block until completion:
2697
+ # # The returned object is of type Gapic::Operation. You can use it to
2698
+ # # check the status of an operation, cancel it, or wait for results.
2699
+ # # Here is how to wait for a response.
2680
2700
  # result.wait_until_done! timeout: 60
2681
2701
  # if result.response?
2682
2702
  # p result.response
2683
2703
  # else
2684
- # puts "Error!"
2704
+ # puts "No response received."
2685
2705
  # end
2686
2706
  #
2687
2707
  def create_clone_job request, options = nil
@@ -2767,14 +2787,14 @@ module Google
2767
2787
  # # Call the cancel_clone_job method.
2768
2788
  # result = client.cancel_clone_job request
2769
2789
  #
2770
- # # The returned object is of type Gapic::Operation. You can use this
2771
- # # object to check the status of an operation, cancel it, or wait
2772
- # # for results. Here is how to block until completion:
2790
+ # # The returned object is of type Gapic::Operation. You can use it to
2791
+ # # check the status of an operation, cancel it, or wait for results.
2792
+ # # Here is how to wait for a response.
2773
2793
  # result.wait_until_done! timeout: 60
2774
2794
  # if result.response?
2775
2795
  # p result.response
2776
2796
  # else
2777
- # puts "Error!"
2797
+ # puts "No response received."
2778
2798
  # end
2779
2799
  #
2780
2800
  def cancel_clone_job request, options = nil
@@ -2875,13 +2895,11 @@ module Google
2875
2895
  # # Call the list_clone_jobs method.
2876
2896
  # result = client.list_clone_jobs request
2877
2897
  #
2878
- # # The returned object is of type Gapic::PagedEnumerable. You can
2879
- # # iterate over all elements by calling #each, and the enumerable
2880
- # # will lazily make API calls to fetch subsequent pages. Other
2881
- # # methods are also available for managing paging directly.
2882
- # result.each do |response|
2898
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2899
+ # # over elements, and API calls will be issued to fetch pages as needed.
2900
+ # result.each do |item|
2883
2901
  # # Each element is of type ::Google::Cloud::VMMigration::V1::CloneJob.
2884
- # p response
2902
+ # p item
2885
2903
  # end
2886
2904
  #
2887
2905
  def list_clone_jobs request, options = nil
@@ -3072,14 +3090,14 @@ module Google
3072
3090
  # # Call the create_cutover_job method.
3073
3091
  # result = client.create_cutover_job request
3074
3092
  #
3075
- # # The returned object is of type Gapic::Operation. You can use this
3076
- # # object to check the status of an operation, cancel it, or wait
3077
- # # for results. Here is how to block until completion:
3093
+ # # The returned object is of type Gapic::Operation. You can use it to
3094
+ # # check the status of an operation, cancel it, or wait for results.
3095
+ # # Here is how to wait for a response.
3078
3096
  # result.wait_until_done! timeout: 60
3079
3097
  # if result.response?
3080
3098
  # p result.response
3081
3099
  # else
3082
- # puts "Error!"
3100
+ # puts "No response received."
3083
3101
  # end
3084
3102
  #
3085
3103
  def create_cutover_job request, options = nil
@@ -3165,14 +3183,14 @@ module Google
3165
3183
  # # Call the cancel_cutover_job method.
3166
3184
  # result = client.cancel_cutover_job request
3167
3185
  #
3168
- # # The returned object is of type Gapic::Operation. You can use this
3169
- # # object to check the status of an operation, cancel it, or wait
3170
- # # for results. Here is how to block until completion:
3186
+ # # The returned object is of type Gapic::Operation. You can use it to
3187
+ # # check the status of an operation, cancel it, or wait for results.
3188
+ # # Here is how to wait for a response.
3171
3189
  # result.wait_until_done! timeout: 60
3172
3190
  # if result.response?
3173
3191
  # p result.response
3174
3192
  # else
3175
- # puts "Error!"
3193
+ # puts "No response received."
3176
3194
  # end
3177
3195
  #
3178
3196
  def cancel_cutover_job request, options = nil
@@ -3273,13 +3291,11 @@ module Google
3273
3291
  # # Call the list_cutover_jobs method.
3274
3292
  # result = client.list_cutover_jobs request
3275
3293
  #
3276
- # # The returned object is of type Gapic::PagedEnumerable. You can
3277
- # # iterate over all elements by calling #each, and the enumerable
3278
- # # will lazily make API calls to fetch subsequent pages. Other
3279
- # # methods are also available for managing paging directly.
3280
- # result.each do |response|
3294
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
3295
+ # # over elements, and API calls will be issued to fetch pages as needed.
3296
+ # result.each do |item|
3281
3297
  # # Each element is of type ::Google::Cloud::VMMigration::V1::CutoverJob.
3282
- # p response
3298
+ # p item
3283
3299
  # end
3284
3300
  #
3285
3301
  def list_cutover_jobs request, options = nil
@@ -3465,13 +3481,11 @@ module Google
3465
3481
  # # Call the list_groups method.
3466
3482
  # result = client.list_groups request
3467
3483
  #
3468
- # # The returned object is of type Gapic::PagedEnumerable. You can
3469
- # # iterate over all elements by calling #each, and the enumerable
3470
- # # will lazily make API calls to fetch subsequent pages. Other
3471
- # # methods are also available for managing paging directly.
3472
- # result.each do |response|
3484
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
3485
+ # # over elements, and API calls will be issued to fetch pages as needed.
3486
+ # result.each do |item|
3473
3487
  # # Each element is of type ::Google::Cloud::VMMigration::V1::Group.
3474
- # p response
3488
+ # p item
3475
3489
  # end
3476
3490
  #
3477
3491
  def list_groups request, options = nil
@@ -3660,14 +3674,14 @@ module Google
3660
3674
  # # Call the create_group method.
3661
3675
  # result = client.create_group request
3662
3676
  #
3663
- # # The returned object is of type Gapic::Operation. You can use this
3664
- # # object to check the status of an operation, cancel it, or wait
3665
- # # for results. Here is how to block until completion:
3677
+ # # The returned object is of type Gapic::Operation. You can use it to
3678
+ # # check the status of an operation, cancel it, or wait for results.
3679
+ # # Here is how to wait for a response.
3666
3680
  # result.wait_until_done! timeout: 60
3667
3681
  # if result.response?
3668
3682
  # p result.response
3669
3683
  # else
3670
- # puts "Error!"
3684
+ # puts "No response received."
3671
3685
  # end
3672
3686
  #
3673
3687
  def create_group request, options = nil
@@ -3773,14 +3787,14 @@ module Google
3773
3787
  # # Call the update_group method.
3774
3788
  # result = client.update_group request
3775
3789
  #
3776
- # # The returned object is of type Gapic::Operation. You can use this
3777
- # # object to check the status of an operation, cancel it, or wait
3778
- # # for results. Here is how to block until completion:
3790
+ # # The returned object is of type Gapic::Operation. You can use it to
3791
+ # # check the status of an operation, cancel it, or wait for results.
3792
+ # # Here is how to wait for a response.
3779
3793
  # result.wait_until_done! timeout: 60
3780
3794
  # if result.response?
3781
3795
  # p result.response
3782
3796
  # else
3783
- # puts "Error!"
3797
+ # puts "No response received."
3784
3798
  # end
3785
3799
  #
3786
3800
  def update_group request, options = nil
@@ -3880,14 +3894,14 @@ module Google
3880
3894
  # # Call the delete_group method.
3881
3895
  # result = client.delete_group request
3882
3896
  #
3883
- # # The returned object is of type Gapic::Operation. You can use this
3884
- # # object to check the status of an operation, cancel it, or wait
3885
- # # for results. Here is how to block until completion:
3897
+ # # The returned object is of type Gapic::Operation. You can use it to
3898
+ # # check the status of an operation, cancel it, or wait for results.
3899
+ # # Here is how to wait for a response.
3886
3900
  # result.wait_until_done! timeout: 60
3887
3901
  # if result.response?
3888
3902
  # p result.response
3889
3903
  # else
3890
- # puts "Error!"
3904
+ # puts "No response received."
3891
3905
  # end
3892
3906
  #
3893
3907
  def delete_group request, options = nil
@@ -3975,14 +3989,14 @@ module Google
3975
3989
  # # Call the add_group_migration method.
3976
3990
  # result = client.add_group_migration request
3977
3991
  #
3978
- # # The returned object is of type Gapic::Operation. You can use this
3979
- # # object to check the status of an operation, cancel it, or wait
3980
- # # for results. Here is how to block until completion:
3992
+ # # The returned object is of type Gapic::Operation. You can use it to
3993
+ # # check the status of an operation, cancel it, or wait for results.
3994
+ # # Here is how to wait for a response.
3981
3995
  # result.wait_until_done! timeout: 60
3982
3996
  # if result.response?
3983
3997
  # p result.response
3984
3998
  # else
3985
- # puts "Error!"
3999
+ # puts "No response received."
3986
4000
  # end
3987
4001
  #
3988
4002
  def add_group_migration request, options = nil
@@ -4070,14 +4084,14 @@ module Google
4070
4084
  # # Call the remove_group_migration method.
4071
4085
  # result = client.remove_group_migration request
4072
4086
  #
4073
- # # The returned object is of type Gapic::Operation. You can use this
4074
- # # object to check the status of an operation, cancel it, or wait
4075
- # # for results. Here is how to block until completion:
4087
+ # # The returned object is of type Gapic::Operation. You can use it to
4088
+ # # check the status of an operation, cancel it, or wait for results.
4089
+ # # Here is how to wait for a response.
4076
4090
  # result.wait_until_done! timeout: 60
4077
4091
  # if result.response?
4078
4092
  # p result.response
4079
4093
  # else
4080
- # puts "Error!"
4094
+ # puts "No response received."
4081
4095
  # end
4082
4096
  #
4083
4097
  def remove_group_migration request, options = nil
@@ -4181,13 +4195,11 @@ module Google
4181
4195
  # # Call the list_target_projects method.
4182
4196
  # result = client.list_target_projects request
4183
4197
  #
4184
- # # The returned object is of type Gapic::PagedEnumerable. You can
4185
- # # iterate over all elements by calling #each, and the enumerable
4186
- # # will lazily make API calls to fetch subsequent pages. Other
4187
- # # methods are also available for managing paging directly.
4188
- # result.each do |response|
4198
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
4199
+ # # over elements, and API calls will be issued to fetch pages as needed.
4200
+ # result.each do |item|
4189
4201
  # # Each element is of type ::Google::Cloud::VMMigration::V1::TargetProject.
4190
- # p response
4202
+ # p item
4191
4203
  # end
4192
4204
  #
4193
4205
  def list_target_projects request, options = nil
@@ -4382,14 +4394,14 @@ module Google
4382
4394
  # # Call the create_target_project method.
4383
4395
  # result = client.create_target_project request
4384
4396
  #
4385
- # # The returned object is of type Gapic::Operation. You can use this
4386
- # # object to check the status of an operation, cancel it, or wait
4387
- # # for results. Here is how to block until completion:
4397
+ # # The returned object is of type Gapic::Operation. You can use it to
4398
+ # # check the status of an operation, cancel it, or wait for results.
4399
+ # # Here is how to wait for a response.
4388
4400
  # result.wait_until_done! timeout: 60
4389
4401
  # if result.response?
4390
4402
  # p result.response
4391
4403
  # else
4392
- # puts "Error!"
4404
+ # puts "No response received."
4393
4405
  # end
4394
4406
  #
4395
4407
  def create_target_project request, options = nil
@@ -4498,14 +4510,14 @@ module Google
4498
4510
  # # Call the update_target_project method.
4499
4511
  # result = client.update_target_project request
4500
4512
  #
4501
- # # The returned object is of type Gapic::Operation. You can use this
4502
- # # object to check the status of an operation, cancel it, or wait
4503
- # # for results. Here is how to block until completion:
4513
+ # # The returned object is of type Gapic::Operation. You can use it to
4514
+ # # check the status of an operation, cancel it, or wait for results.
4515
+ # # Here is how to wait for a response.
4504
4516
  # result.wait_until_done! timeout: 60
4505
4517
  # if result.response?
4506
4518
  # p result.response
4507
4519
  # else
4508
- # puts "Error!"
4520
+ # puts "No response received."
4509
4521
  # end
4510
4522
  #
4511
4523
  def update_target_project request, options = nil
@@ -4608,14 +4620,14 @@ module Google
4608
4620
  # # Call the delete_target_project method.
4609
4621
  # result = client.delete_target_project request
4610
4622
  #
4611
- # # The returned object is of type Gapic::Operation. You can use this
4612
- # # object to check the status of an operation, cancel it, or wait
4613
- # # for results. Here is how to block until completion:
4623
+ # # The returned object is of type Gapic::Operation. You can use it to
4624
+ # # check the status of an operation, cancel it, or wait for results.
4625
+ # # Here is how to wait for a response.
4614
4626
  # result.wait_until_done! timeout: 60
4615
4627
  # if result.response?
4616
4628
  # p result.response
4617
4629
  # else
4618
- # puts "Error!"
4630
+ # puts "No response received."
4619
4631
  # end
4620
4632
  #
4621
4633
  def delete_target_project request, options = nil
@@ -4660,6 +4672,196 @@ module Google
4660
4672
  raise ::Google::Cloud::Error.from_error(e)
4661
4673
  end
4662
4674
 
4675
+ ##
4676
+ # Lists ReplicationCycles in a given MigratingVM.
4677
+ #
4678
+ # @overload list_replication_cycles(request, options = nil)
4679
+ # Pass arguments to `list_replication_cycles` via a request object, either of type
4680
+ # {::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest} or an equivalent Hash.
4681
+ #
4682
+ # @param request [::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest, ::Hash]
4683
+ # A request object representing the call parameters. Required. To specify no
4684
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4685
+ # @param options [::Gapic::CallOptions, ::Hash]
4686
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4687
+ #
4688
+ # @overload list_replication_cycles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
4689
+ # Pass arguments to `list_replication_cycles` via keyword arguments. Note that at
4690
+ # least one keyword argument is required. To specify no parameters, or to keep all
4691
+ # the default parameter values, pass an empty Hash as a request object (see above).
4692
+ #
4693
+ # @param parent [::String]
4694
+ # Required. The parent, which owns this collection of ReplicationCycles.
4695
+ # @param page_size [::Integer]
4696
+ # Optional. The maximum number of replication cycles to return. The service
4697
+ # may return fewer than this value. If unspecified, at most 100 migrating VMs
4698
+ # will be returned. The maximum value is 100; values above 100 will be
4699
+ # coerced to 100.
4700
+ # @param page_token [::String]
4701
+ # Required. A page token, received from a previous `ListReplicationCycles`
4702
+ # call. Provide this to retrieve the subsequent page.
4703
+ #
4704
+ # When paginating, all other parameters provided to `ListReplicationCycles`
4705
+ # must match the call that provided the page token.
4706
+ # @param filter [::String]
4707
+ # Optional. The filter request.
4708
+ # @param order_by [::String]
4709
+ # Optional. the order by fields for the result.
4710
+ #
4711
+ # @yield [response, operation] Access the result along with the RPC operation
4712
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>]
4713
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4714
+ #
4715
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>]
4716
+ #
4717
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4718
+ #
4719
+ # @example Basic example
4720
+ # require "google/cloud/vm_migration/v1"
4721
+ #
4722
+ # # Create a client object. The client can be reused for multiple calls.
4723
+ # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new
4724
+ #
4725
+ # # Create a request. To set request fields, pass in keyword arguments.
4726
+ # request = Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.new
4727
+ #
4728
+ # # Call the list_replication_cycles method.
4729
+ # result = client.list_replication_cycles request
4730
+ #
4731
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
4732
+ # # over elements, and API calls will be issued to fetch pages as needed.
4733
+ # result.each do |item|
4734
+ # # Each element is of type ::Google::Cloud::VMMigration::V1::ReplicationCycle.
4735
+ # p item
4736
+ # end
4737
+ #
4738
+ def list_replication_cycles request, options = nil
4739
+ raise ::ArgumentError, "request must be provided" if request.nil?
4740
+
4741
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest
4742
+
4743
+ # Converts hash and nil to an options object
4744
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4745
+
4746
+ # Customize the options with defaults
4747
+ metadata = @config.rpcs.list_replication_cycles.metadata.to_h
4748
+
4749
+ # Set x-goog-api-client and x-goog-user-project headers
4750
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4751
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4752
+ gapic_version: ::Google::Cloud::VMMigration::V1::VERSION
4753
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4754
+
4755
+ header_params = {}
4756
+ if request.parent
4757
+ header_params["parent"] = request.parent
4758
+ end
4759
+
4760
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4761
+ metadata[:"x-goog-request-params"] ||= request_params_header
4762
+
4763
+ options.apply_defaults timeout: @config.rpcs.list_replication_cycles.timeout,
4764
+ metadata: metadata,
4765
+ retry_policy: @config.rpcs.list_replication_cycles.retry_policy
4766
+
4767
+ options.apply_defaults timeout: @config.timeout,
4768
+ metadata: @config.metadata,
4769
+ retry_policy: @config.retry_policy
4770
+
4771
+ @vm_migration_stub.call_rpc :list_replication_cycles, request, options: options do |response, operation|
4772
+ response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_replication_cycles, request, response, operation, options
4773
+ yield response, operation if block_given?
4774
+ return response
4775
+ end
4776
+ rescue ::GRPC::BadStatus => e
4777
+ raise ::Google::Cloud::Error.from_error(e)
4778
+ end
4779
+
4780
+ ##
4781
+ # Gets details of a single ReplicationCycle.
4782
+ #
4783
+ # @overload get_replication_cycle(request, options = nil)
4784
+ # Pass arguments to `get_replication_cycle` via a request object, either of type
4785
+ # {::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest} or an equivalent Hash.
4786
+ #
4787
+ # @param request [::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest, ::Hash]
4788
+ # A request object representing the call parameters. Required. To specify no
4789
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4790
+ # @param options [::Gapic::CallOptions, ::Hash]
4791
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4792
+ #
4793
+ # @overload get_replication_cycle(name: nil)
4794
+ # Pass arguments to `get_replication_cycle` via keyword arguments. Note that at
4795
+ # least one keyword argument is required. To specify no parameters, or to keep all
4796
+ # the default parameter values, pass an empty Hash as a request object (see above).
4797
+ #
4798
+ # @param name [::String]
4799
+ # Required. The name of the ReplicationCycle.
4800
+ #
4801
+ # @yield [response, operation] Access the result along with the RPC operation
4802
+ # @yieldparam response [::Google::Cloud::VMMigration::V1::ReplicationCycle]
4803
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4804
+ #
4805
+ # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle]
4806
+ #
4807
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4808
+ #
4809
+ # @example Basic example
4810
+ # require "google/cloud/vm_migration/v1"
4811
+ #
4812
+ # # Create a client object. The client can be reused for multiple calls.
4813
+ # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new
4814
+ #
4815
+ # # Create a request. To set request fields, pass in keyword arguments.
4816
+ # request = Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.new
4817
+ #
4818
+ # # Call the get_replication_cycle method.
4819
+ # result = client.get_replication_cycle request
4820
+ #
4821
+ # # The returned object is of type Google::Cloud::VMMigration::V1::ReplicationCycle.
4822
+ # p result
4823
+ #
4824
+ def get_replication_cycle request, options = nil
4825
+ raise ::ArgumentError, "request must be provided" if request.nil?
4826
+
4827
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest
4828
+
4829
+ # Converts hash and nil to an options object
4830
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4831
+
4832
+ # Customize the options with defaults
4833
+ metadata = @config.rpcs.get_replication_cycle.metadata.to_h
4834
+
4835
+ # Set x-goog-api-client and x-goog-user-project headers
4836
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4837
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4838
+ gapic_version: ::Google::Cloud::VMMigration::V1::VERSION
4839
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4840
+
4841
+ header_params = {}
4842
+ if request.name
4843
+ header_params["name"] = request.name
4844
+ end
4845
+
4846
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4847
+ metadata[:"x-goog-request-params"] ||= request_params_header
4848
+
4849
+ options.apply_defaults timeout: @config.rpcs.get_replication_cycle.timeout,
4850
+ metadata: metadata,
4851
+ retry_policy: @config.rpcs.get_replication_cycle.retry_policy
4852
+
4853
+ options.apply_defaults timeout: @config.timeout,
4854
+ metadata: @config.metadata,
4855
+ retry_policy: @config.retry_policy
4856
+
4857
+ @vm_migration_stub.call_rpc :get_replication_cycle, request, options: options do |response, operation|
4858
+ yield response, operation if block_given?
4859
+ return response
4860
+ end
4861
+ rescue ::GRPC::BadStatus => e
4862
+ raise ::Google::Cloud::Error.from_error(e)
4863
+ end
4864
+
4663
4865
  ##
4664
4866
  # Configuration class for the VmMigration API.
4665
4867
  #
@@ -5015,6 +5217,16 @@ module Google
5015
5217
  # @return [::Gapic::Config::Method]
5016
5218
  #
5017
5219
  attr_reader :delete_target_project
5220
+ ##
5221
+ # RPC-specific configuration for `list_replication_cycles`
5222
+ # @return [::Gapic::Config::Method]
5223
+ #
5224
+ attr_reader :list_replication_cycles
5225
+ ##
5226
+ # RPC-specific configuration for `get_replication_cycle`
5227
+ # @return [::Gapic::Config::Method]
5228
+ #
5229
+ attr_reader :get_replication_cycle
5018
5230
 
5019
5231
  # @private
5020
5232
  def initialize parent_rpcs = nil
@@ -5106,6 +5318,10 @@ module Google
5106
5318
  @update_target_project = ::Gapic::Config::Method.new update_target_project_config
5107
5319
  delete_target_project_config = parent_rpcs.delete_target_project if parent_rpcs.respond_to? :delete_target_project
5108
5320
  @delete_target_project = ::Gapic::Config::Method.new delete_target_project_config
5321
+ list_replication_cycles_config = parent_rpcs.list_replication_cycles if parent_rpcs.respond_to? :list_replication_cycles
5322
+ @list_replication_cycles = ::Gapic::Config::Method.new list_replication_cycles_config
5323
+ get_replication_cycle_config = parent_rpcs.get_replication_cycle if parent_rpcs.respond_to? :get_replication_cycle
5324
+ @get_replication_cycle = ::Gapic::Config::Method.new get_replication_cycle_config
5109
5325
 
5110
5326
  yield self if block_given?
5111
5327
  end