google-cloud-vm_migration-v1 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a30f6da4a3f1af8809b6c56f27467d3fb06702e8ca343a9f59a209cf9b1b7853
4
- data.tar.gz: 4f2adeef296081bdd1129419d7ce196d620a0d0787d26dabd6ffa6440014fc37
3
+ metadata.gz: f1a7b21b9ceb7fb0fb74bc6d87982ca2f325508255fabb29002f2d5d41142a93
4
+ data.tar.gz: eb0cd904ee33122798df3bba81dc6ceff8a8e9e5f3d9946894c9e49ab8bb8bd5
5
5
  SHA512:
6
- metadata.gz: 6efcbb9aca04227611719282a382dbfa3519f188eb6a7a778fe2de3cf6eb5e80199e1fdb9c646cc38e0776b018ddda43b3b885c7db26e00c69afe4509b5de6e4
7
- data.tar.gz: ffffb32bd5dba6f3817e3d82d4687454473f2d280300571375fc4bd0bb6f0b7efcb9dcebc771729296f28192ecf5a362c07752507769b3778c3d38b9c8a830e3
6
+ metadata.gz: e4221887a0ce71e8bf8650e9094735ed2e0f4a0bbc1268523d3742a94b1c896a5caeeafd800f71707d7b5fb848aae81758a2ff634c17124c0e8243ca3647d29c
7
+ data.tar.gz: 6748582517ca2cad348072857a0cab7323363524fc1314d4e2aab5073330f3ff0eb4df4b2dcf931e8fa63b04b713913c4fa2106e421331b89fe3e10a4ea0cddf
data/AUTHENTICATION.md CHANGED
@@ -112,7 +112,7 @@ credentials are discovered.
112
112
  To configure your system for this, simply:
113
113
 
114
114
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
115
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
115
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
116
116
  3. Write code as if already authenticated.
117
117
 
118
118
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
data/README.md CHANGED
@@ -46,7 +46,7 @@ for general usage information.
46
46
  ## Enabling Logging
47
47
 
48
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
49
+ The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
50
  or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
51
51
  that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
52
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module VMMigration
23
23
  module V1
24
- VERSION = "0.2.0"
24
+ VERSION = "0.4.0"
25
25
  end
26
26
  end
27
27
  end
@@ -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
  ##
@@ -809,8 +837,8 @@ module Google
809
837
  # returned. The maximum value is 1000; values above 1000 will be coerced to
810
838
  # 1000.
811
839
  # @param page_token [::String]
812
- # Required. A page token, received from a previous `ListUtilizationReports` call.
813
- # Provide this to retrieve the subsequent page.
840
+ # Required. A page token, received from a previous `ListUtilizationReports`
841
+ # call. Provide this to retrieve the subsequent page.
814
842
  #
815
843
  # When paginating, all other parameters provided to `ListUtilizationReports`
816
844
  # must match the call that provided the page token.
@@ -1001,8 +1029,8 @@ module Google
1001
1029
  # @param utilization_report [::Google::Cloud::VMMigration::V1::UtilizationReport, ::Hash]
1002
1030
  # Required. The report to create.
1003
1031
  # @param utilization_report_id [::String]
1004
- # Required. The ID to use for the report, which will become the final component of
1005
- # the reports's resource name.
1032
+ # Required. The ID to use for the report, which will become the final
1033
+ # component of the reports's resource name.
1006
1034
  #
1007
1035
  # This value maximum length is 63 characters, and valid characters
1008
1036
  # are /[a-z][0-9]-/. It must start with an english letter and must not
@@ -1222,13 +1250,13 @@ module Google
1222
1250
  # @param parent [::String]
1223
1251
  # Required. The parent, which owns this collection of connectors.
1224
1252
  # @param page_size [::Integer]
1225
- # Optional. The maximum number of connectors to return. The service may return
1226
- # fewer than this value. If unspecified, at most 500 sources will be
1253
+ # Optional. The maximum number of connectors to return. The service may
1254
+ # return fewer than this value. If unspecified, at most 500 sources will be
1227
1255
  # returned. The maximum value is 1000; values above 1000 will be coerced to
1228
1256
  # 1000.
1229
1257
  # @param page_token [::String]
1230
- # Required. A page token, received from a previous `ListDatacenterConnectors` call.
1231
- # Provide this to retrieve the subsequent page.
1258
+ # Required. A page token, received from a previous `ListDatacenterConnectors`
1259
+ # call. Provide this to retrieve the subsequent page.
1232
1260
  #
1233
1261
  # When paginating, all other parameters provided to
1234
1262
  # `ListDatacenterConnectors` must match the call that provided the page
@@ -1615,6 +1643,114 @@ module Google
1615
1643
  raise ::Google::Cloud::Error.from_error(e)
1616
1644
  end
1617
1645
 
1646
+ ##
1647
+ # Upgrades the appliance relate to this DatacenterConnector to the in-place
1648
+ # updateable version.
1649
+ #
1650
+ # @overload upgrade_appliance(request, options = nil)
1651
+ # Pass arguments to `upgrade_appliance` via a request object, either of type
1652
+ # {::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest} or an equivalent Hash.
1653
+ #
1654
+ # @param request [::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest, ::Hash]
1655
+ # A request object representing the call parameters. Required. To specify no
1656
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1657
+ # @param options [::Gapic::CallOptions, ::Hash]
1658
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1659
+ #
1660
+ # @overload upgrade_appliance(datacenter_connector: nil, request_id: nil)
1661
+ # Pass arguments to `upgrade_appliance` via keyword arguments. Note that at
1662
+ # least one keyword argument is required. To specify no parameters, or to keep all
1663
+ # the default parameter values, pass an empty Hash as a request object (see above).
1664
+ #
1665
+ # @param datacenter_connector [::String]
1666
+ # Required. The DatacenterConnector name.
1667
+ # @param request_id [::String]
1668
+ # A request ID to identify requests. Specify a unique request ID
1669
+ # so that if you must retry your request, the server will know to ignore
1670
+ # the request if it has already been completed. The server will guarantee
1671
+ # that for at least 60 minutes after the first request.
1672
+ #
1673
+ # For example, consider a situation where you make an initial request and t
1674
+ # he request times out. If you make the request again with the same request
1675
+ # ID, the server can check if original operation with the same request ID
1676
+ # was received, and if so, will ignore the second request. This prevents
1677
+ # clients from accidentally creating duplicate commitments.
1678
+ #
1679
+ # The request ID must be a valid UUID with the exception that zero UUID is
1680
+ # not supported (00000000-0000-0000-0000-000000000000).
1681
+ #
1682
+ # @yield [response, operation] Access the result along with the RPC operation
1683
+ # @yieldparam response [::Gapic::Operation]
1684
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1685
+ #
1686
+ # @return [::Gapic::Operation]
1687
+ #
1688
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1689
+ #
1690
+ # @example Basic example
1691
+ # require "google/cloud/vm_migration/v1"
1692
+ #
1693
+ # # Create a client object. The client can be reused for multiple calls.
1694
+ # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new
1695
+ #
1696
+ # # Create a request. To set request fields, pass in keyword arguments.
1697
+ # request = Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new
1698
+ #
1699
+ # # Call the upgrade_appliance method.
1700
+ # result = client.upgrade_appliance request
1701
+ #
1702
+ # # The returned object is of type Gapic::Operation. You can use this
1703
+ # # object to check the status of an operation, cancel it, or wait
1704
+ # # for results. Here is how to block until completion:
1705
+ # result.wait_until_done! timeout: 60
1706
+ # if result.response?
1707
+ # p result.response
1708
+ # else
1709
+ # puts "Error!"
1710
+ # end
1711
+ #
1712
+ def upgrade_appliance request, options = nil
1713
+ raise ::ArgumentError, "request must be provided" if request.nil?
1714
+
1715
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest
1716
+
1717
+ # Converts hash and nil to an options object
1718
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1719
+
1720
+ # Customize the options with defaults
1721
+ metadata = @config.rpcs.upgrade_appliance.metadata.to_h
1722
+
1723
+ # Set x-goog-api-client and x-goog-user-project headers
1724
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1725
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1726
+ gapic_version: ::Google::Cloud::VMMigration::V1::VERSION
1727
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1728
+
1729
+ header_params = {}
1730
+ if request.datacenter_connector
1731
+ header_params["datacenter_connector"] = request.datacenter_connector
1732
+ end
1733
+
1734
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1735
+ metadata[:"x-goog-request-params"] ||= request_params_header
1736
+
1737
+ options.apply_defaults timeout: @config.rpcs.upgrade_appliance.timeout,
1738
+ metadata: metadata,
1739
+ retry_policy: @config.rpcs.upgrade_appliance.retry_policy
1740
+
1741
+ options.apply_defaults timeout: @config.timeout,
1742
+ metadata: @config.metadata,
1743
+ retry_policy: @config.retry_policy
1744
+
1745
+ @vm_migration_stub.call_rpc :upgrade_appliance, request, options: options do |response, operation|
1746
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1747
+ yield response, operation if block_given?
1748
+ return response
1749
+ end
1750
+ rescue ::GRPC::BadStatus => e
1751
+ raise ::Google::Cloud::Error.from_error(e)
1752
+ end
1753
+
1618
1754
  ##
1619
1755
  # Creates a new MigratingVm in a given Source.
1620
1756
  #
@@ -1739,7 +1875,7 @@ module Google
1739
1875
  # @param options [::Gapic::CallOptions, ::Hash]
1740
1876
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1741
1877
  #
1742
- # @overload list_migrating_vms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1878
+ # @overload list_migrating_vms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil)
1743
1879
  # Pass arguments to `list_migrating_vms` via keyword arguments. Note that at
1744
1880
  # least one keyword argument is required. To specify no parameters, or to keep all
1745
1881
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -1747,10 +1883,10 @@ module Google
1747
1883
  # @param parent [::String]
1748
1884
  # Required. The parent, which owns this collection of MigratingVms.
1749
1885
  # @param page_size [::Integer]
1750
- # Optional. The maximum number of migrating VMs to return. The service may return
1751
- # fewer than this value. If unspecified, at most 500 migrating VMs will be
1752
- # returned. The maximum value is 1000; values above 1000 will be coerced to
1753
- # 1000.
1886
+ # Optional. The maximum number of migrating VMs to return. The service may
1887
+ # return fewer than this value. If unspecified, at most 500 migrating VMs
1888
+ # will be returned. The maximum value is 1000; values above 1000 will be
1889
+ # coerced to 1000.
1754
1890
  # @param page_token [::String]
1755
1891
  # Required. A page token, received from a previous `ListMigratingVms` call.
1756
1892
  # Provide this to retrieve the subsequent page.
@@ -1761,6 +1897,8 @@ module Google
1761
1897
  # Optional. The filter request.
1762
1898
  # @param order_by [::String]
1763
1899
  # Optional. the order by fields for the result.
1900
+ # @param view [::Google::Cloud::VMMigration::V1::MigratingVmView]
1901
+ # Optional. The level of details of each migrating VM.
1764
1902
  #
1765
1903
  # @yield [response, operation] Access the result along with the RPC operation
1766
1904
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::MigratingVm>]
@@ -1846,13 +1984,15 @@ module Google
1846
1984
  # @param options [::Gapic::CallOptions, ::Hash]
1847
1985
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1848
1986
  #
1849
- # @overload get_migrating_vm(name: nil)
1987
+ # @overload get_migrating_vm(name: nil, view: nil)
1850
1988
  # Pass arguments to `get_migrating_vm` via keyword arguments. Note that at
1851
1989
  # least one keyword argument is required. To specify no parameters, or to keep all
1852
1990
  # the default parameter values, pass an empty Hash as a request object (see above).
1853
1991
  #
1854
1992
  # @param name [::String]
1855
1993
  # Required. The name of the MigratingVm.
1994
+ # @param view [::Google::Cloud::VMMigration::V1::MigratingVmView]
1995
+ # Optional. The level of details of the migrating VM.
1856
1996
  #
1857
1997
  # @yield [response, operation] Access the result along with the RPC operation
1858
1998
  # @yieldparam response [::Google::Cloud::VMMigration::V1::MigratingVm]
@@ -2728,10 +2868,10 @@ module Google
2728
2868
  # @param parent [::String]
2729
2869
  # Required. The parent, which owns this collection of source VMs.
2730
2870
  # @param page_size [::Integer]
2731
- # Optional. The maximum number of clone jobs to return. The service may return
2732
- # fewer than this value. If unspecified, at most 500 clone jobs will be
2733
- # returned. The maximum value is 1000; values above 1000 will be coerced to
2734
- # 1000.
2871
+ # Optional. The maximum number of clone jobs to return. The service may
2872
+ # return fewer than this value. If unspecified, at most 500 clone jobs will
2873
+ # be returned. The maximum value is 1000; values above 1000 will be coerced
2874
+ # to 1000.
2735
2875
  # @param page_token [::String]
2736
2876
  # Required. A page token, received from a previous `ListCloneJobs` call.
2737
2877
  # Provide this to retrieve the subsequent page.
@@ -3126,10 +3266,10 @@ module Google
3126
3266
  # @param parent [::String]
3127
3267
  # Required. The parent, which owns this collection of migrating VMs.
3128
3268
  # @param page_size [::Integer]
3129
- # Optional. The maximum number of cutover jobs to return. The service may return
3130
- # fewer than this value. If unspecified, at most 500 cutover jobs will be
3131
- # returned. The maximum value is 1000; values above 1000 will be coerced to
3132
- # 1000.
3269
+ # Optional. The maximum number of cutover jobs to return. The service may
3270
+ # return fewer than this value. If unspecified, at most 500 cutover jobs will
3271
+ # be returned. The maximum value is 1000; values above 1000 will be coerced
3272
+ # to 1000.
3133
3273
  # @param page_token [::String]
3134
3274
  # Required. A page token, received from a previous `ListCutoverJobs` call.
3135
3275
  # Provide this to retrieve the subsequent page.
@@ -4548,6 +4688,198 @@ module Google
4548
4688
  raise ::Google::Cloud::Error.from_error(e)
4549
4689
  end
4550
4690
 
4691
+ ##
4692
+ # Lists ReplicationCycles in a given MigratingVM.
4693
+ #
4694
+ # @overload list_replication_cycles(request, options = nil)
4695
+ # Pass arguments to `list_replication_cycles` via a request object, either of type
4696
+ # {::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest} or an equivalent Hash.
4697
+ #
4698
+ # @param request [::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest, ::Hash]
4699
+ # A request object representing the call parameters. Required. To specify no
4700
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4701
+ # @param options [::Gapic::CallOptions, ::Hash]
4702
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4703
+ #
4704
+ # @overload list_replication_cycles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
4705
+ # Pass arguments to `list_replication_cycles` via keyword arguments. Note that at
4706
+ # least one keyword argument is required. To specify no parameters, or to keep all
4707
+ # the default parameter values, pass an empty Hash as a request object (see above).
4708
+ #
4709
+ # @param parent [::String]
4710
+ # Required. The parent, which owns this collection of ReplicationCycles.
4711
+ # @param page_size [::Integer]
4712
+ # Optional. The maximum number of replication cycles to return. The service
4713
+ # may return fewer than this value. If unspecified, at most 100 migrating VMs
4714
+ # will be returned. The maximum value is 100; values above 100 will be
4715
+ # coerced to 100.
4716
+ # @param page_token [::String]
4717
+ # Required. A page token, received from a previous `ListReplicationCycles`
4718
+ # call. Provide this to retrieve the subsequent page.
4719
+ #
4720
+ # When paginating, all other parameters provided to `ListReplicationCycles`
4721
+ # must match the call that provided the page token.
4722
+ # @param filter [::String]
4723
+ # Optional. The filter request.
4724
+ # @param order_by [::String]
4725
+ # Optional. the order by fields for the result.
4726
+ #
4727
+ # @yield [response, operation] Access the result along with the RPC operation
4728
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>]
4729
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4730
+ #
4731
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>]
4732
+ #
4733
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4734
+ #
4735
+ # @example Basic example
4736
+ # require "google/cloud/vm_migration/v1"
4737
+ #
4738
+ # # Create a client object. The client can be reused for multiple calls.
4739
+ # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new
4740
+ #
4741
+ # # Create a request. To set request fields, pass in keyword arguments.
4742
+ # request = Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.new
4743
+ #
4744
+ # # Call the list_replication_cycles method.
4745
+ # result = client.list_replication_cycles request
4746
+ #
4747
+ # # The returned object is of type Gapic::PagedEnumerable. You can
4748
+ # # iterate over all elements by calling #each, and the enumerable
4749
+ # # will lazily make API calls to fetch subsequent pages. Other
4750
+ # # methods are also available for managing paging directly.
4751
+ # result.each do |response|
4752
+ # # Each element is of type ::Google::Cloud::VMMigration::V1::ReplicationCycle.
4753
+ # p response
4754
+ # end
4755
+ #
4756
+ def list_replication_cycles request, options = nil
4757
+ raise ::ArgumentError, "request must be provided" if request.nil?
4758
+
4759
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest
4760
+
4761
+ # Converts hash and nil to an options object
4762
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4763
+
4764
+ # Customize the options with defaults
4765
+ metadata = @config.rpcs.list_replication_cycles.metadata.to_h
4766
+
4767
+ # Set x-goog-api-client and x-goog-user-project headers
4768
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4769
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4770
+ gapic_version: ::Google::Cloud::VMMigration::V1::VERSION
4771
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4772
+
4773
+ header_params = {}
4774
+ if request.parent
4775
+ header_params["parent"] = request.parent
4776
+ end
4777
+
4778
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4779
+ metadata[:"x-goog-request-params"] ||= request_params_header
4780
+
4781
+ options.apply_defaults timeout: @config.rpcs.list_replication_cycles.timeout,
4782
+ metadata: metadata,
4783
+ retry_policy: @config.rpcs.list_replication_cycles.retry_policy
4784
+
4785
+ options.apply_defaults timeout: @config.timeout,
4786
+ metadata: @config.metadata,
4787
+ retry_policy: @config.retry_policy
4788
+
4789
+ @vm_migration_stub.call_rpc :list_replication_cycles, request, options: options do |response, operation|
4790
+ response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_replication_cycles, request, response, operation, options
4791
+ yield response, operation if block_given?
4792
+ return response
4793
+ end
4794
+ rescue ::GRPC::BadStatus => e
4795
+ raise ::Google::Cloud::Error.from_error(e)
4796
+ end
4797
+
4798
+ ##
4799
+ # Gets details of a single ReplicationCycle.
4800
+ #
4801
+ # @overload get_replication_cycle(request, options = nil)
4802
+ # Pass arguments to `get_replication_cycle` via a request object, either of type
4803
+ # {::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest} or an equivalent Hash.
4804
+ #
4805
+ # @param request [::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest, ::Hash]
4806
+ # A request object representing the call parameters. Required. To specify no
4807
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4808
+ # @param options [::Gapic::CallOptions, ::Hash]
4809
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4810
+ #
4811
+ # @overload get_replication_cycle(name: nil)
4812
+ # Pass arguments to `get_replication_cycle` via keyword arguments. Note that at
4813
+ # least one keyword argument is required. To specify no parameters, or to keep all
4814
+ # the default parameter values, pass an empty Hash as a request object (see above).
4815
+ #
4816
+ # @param name [::String]
4817
+ # Required. The name of the ReplicationCycle.
4818
+ #
4819
+ # @yield [response, operation] Access the result along with the RPC operation
4820
+ # @yieldparam response [::Google::Cloud::VMMigration::V1::ReplicationCycle]
4821
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4822
+ #
4823
+ # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle]
4824
+ #
4825
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4826
+ #
4827
+ # @example Basic example
4828
+ # require "google/cloud/vm_migration/v1"
4829
+ #
4830
+ # # Create a client object. The client can be reused for multiple calls.
4831
+ # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new
4832
+ #
4833
+ # # Create a request. To set request fields, pass in keyword arguments.
4834
+ # request = Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.new
4835
+ #
4836
+ # # Call the get_replication_cycle method.
4837
+ # result = client.get_replication_cycle request
4838
+ #
4839
+ # # The returned object is of type Google::Cloud::VMMigration::V1::ReplicationCycle.
4840
+ # p result
4841
+ #
4842
+ def get_replication_cycle request, options = nil
4843
+ raise ::ArgumentError, "request must be provided" if request.nil?
4844
+
4845
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest
4846
+
4847
+ # Converts hash and nil to an options object
4848
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4849
+
4850
+ # Customize the options with defaults
4851
+ metadata = @config.rpcs.get_replication_cycle.metadata.to_h
4852
+
4853
+ # Set x-goog-api-client and x-goog-user-project headers
4854
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4855
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4856
+ gapic_version: ::Google::Cloud::VMMigration::V1::VERSION
4857
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4858
+
4859
+ header_params = {}
4860
+ if request.name
4861
+ header_params["name"] = request.name
4862
+ end
4863
+
4864
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4865
+ metadata[:"x-goog-request-params"] ||= request_params_header
4866
+
4867
+ options.apply_defaults timeout: @config.rpcs.get_replication_cycle.timeout,
4868
+ metadata: metadata,
4869
+ retry_policy: @config.rpcs.get_replication_cycle.retry_policy
4870
+
4871
+ options.apply_defaults timeout: @config.timeout,
4872
+ metadata: @config.metadata,
4873
+ retry_policy: @config.retry_policy
4874
+
4875
+ @vm_migration_stub.call_rpc :get_replication_cycle, request, options: options do |response, operation|
4876
+ yield response, operation if block_given?
4877
+ return response
4878
+ end
4879
+ rescue ::GRPC::BadStatus => e
4880
+ raise ::Google::Cloud::Error.from_error(e)
4881
+ end
4882
+
4551
4883
  ##
4552
4884
  # Configuration class for the VmMigration API.
4553
4885
  #
@@ -4754,6 +5086,11 @@ module Google
4754
5086
  #
4755
5087
  attr_reader :delete_datacenter_connector
4756
5088
  ##
5089
+ # RPC-specific configuration for `upgrade_appliance`
5090
+ # @return [::Gapic::Config::Method]
5091
+ #
5092
+ attr_reader :upgrade_appliance
5093
+ ##
4757
5094
  # RPC-specific configuration for `create_migrating_vm`
4758
5095
  # @return [::Gapic::Config::Method]
4759
5096
  #
@@ -4898,6 +5235,16 @@ module Google
4898
5235
  # @return [::Gapic::Config::Method]
4899
5236
  #
4900
5237
  attr_reader :delete_target_project
5238
+ ##
5239
+ # RPC-specific configuration for `list_replication_cycles`
5240
+ # @return [::Gapic::Config::Method]
5241
+ #
5242
+ attr_reader :list_replication_cycles
5243
+ ##
5244
+ # RPC-specific configuration for `get_replication_cycle`
5245
+ # @return [::Gapic::Config::Method]
5246
+ #
5247
+ attr_reader :get_replication_cycle
4901
5248
 
4902
5249
  # @private
4903
5250
  def initialize parent_rpcs = nil
@@ -4929,6 +5276,8 @@ module Google
4929
5276
  @create_datacenter_connector = ::Gapic::Config::Method.new create_datacenter_connector_config
4930
5277
  delete_datacenter_connector_config = parent_rpcs.delete_datacenter_connector if parent_rpcs.respond_to? :delete_datacenter_connector
4931
5278
  @delete_datacenter_connector = ::Gapic::Config::Method.new delete_datacenter_connector_config
5279
+ upgrade_appliance_config = parent_rpcs.upgrade_appliance if parent_rpcs.respond_to? :upgrade_appliance
5280
+ @upgrade_appliance = ::Gapic::Config::Method.new upgrade_appliance_config
4932
5281
  create_migrating_vm_config = parent_rpcs.create_migrating_vm if parent_rpcs.respond_to? :create_migrating_vm
4933
5282
  @create_migrating_vm = ::Gapic::Config::Method.new create_migrating_vm_config
4934
5283
  list_migrating_vms_config = parent_rpcs.list_migrating_vms if parent_rpcs.respond_to? :list_migrating_vms
@@ -4987,6 +5336,10 @@ module Google
4987
5336
  @update_target_project = ::Gapic::Config::Method.new update_target_project_config
4988
5337
  delete_target_project_config = parent_rpcs.delete_target_project if parent_rpcs.respond_to? :delete_target_project
4989
5338
  @delete_target_project = ::Gapic::Config::Method.new delete_target_project_config
5339
+ list_replication_cycles_config = parent_rpcs.list_replication_cycles if parent_rpcs.respond_to? :list_replication_cycles
5340
+ @list_replication_cycles = ::Gapic::Config::Method.new list_replication_cycles_config
5341
+ get_replication_cycle_config = parent_rpcs.get_replication_cycle if parent_rpcs.respond_to? :get_replication_cycle
5342
+ @get_replication_cycle = ::Gapic::Config::Method.new get_replication_cycle_config
4990
5343
 
4991
5344
  yield self if block_given?
4992
5345
  end
@@ -148,6 +148,29 @@ module Google
148
148
  "projects/#{project}/locations/#{location}/sources/#{source}/migratingVms/#{migrating_vm}"
149
149
  end
150
150
 
151
+ ##
152
+ # Create a fully-qualified ReplicationCycle resource string.
153
+ #
154
+ # The resource will be in the following format:
155
+ #
156
+ # `projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/replicationCycles/{replication_cycle}`
157
+ #
158
+ # @param project [String]
159
+ # @param location [String]
160
+ # @param source [String]
161
+ # @param migrating_vm [String]
162
+ # @param replication_cycle [String]
163
+ #
164
+ # @return [::String]
165
+ def replication_cycle_path project:, location:, source:, migrating_vm:, replication_cycle:
166
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
167
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
168
+ raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/"
169
+ raise ::ArgumentError, "migrating_vm cannot contain /" if migrating_vm.to_s.include? "/"
170
+
171
+ "projects/#{project}/locations/#{location}/sources/#{source}/migratingVms/#{migrating_vm}/replicationCycles/#{replication_cycle}"
172
+ end
173
+
151
174
  ##
152
175
  # Create a fully-qualified Source resource string.
153
176
  #
@@ -34,7 +34,7 @@ module Google
34
34
  ##
35
35
  # VM Migration Service
36
36
  #
37
- # To load this service and instantiate a client:
37
+ # @example Load this service and instantiate a gRPC client
38
38
  #
39
39
  # require "google/cloud/vm_migration/v1/vm_migration"
40
40
  # client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new
@@ -23,9 +23,9 @@ module Google
23
23
  module Cloud
24
24
  module VMMigration
25
25
  ##
26
- # To load this package, including all its services, and instantiate a client:
26
+ # API client module.
27
27
  #
28
- # @example
28
+ # @example Load this package, including all its services, and instantiate a gRPC client
29
29
  #
30
30
  # require "google/cloud/vm_migration/v1"
31
31
  # client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new