google-cloud-memorystore-v1 1.8.0 → 1.10.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: f221dfa5b4ca7b06a665c649930aebc03e72da32a9b097edbdfee0986d6c1bd4
4
- data.tar.gz: 63bb48d864495facf7badbf61ecaeebd66ec29b0b574536cc8ce8b0b62f0e526
3
+ metadata.gz: 59f4f92cd0942a56dc9b73212633bfdbe846e7a8f756b1f84c4a82b51deca6a4
4
+ data.tar.gz: bb100937e2db39c8bcba1c789938f77b63aaf8d6f1d0f783d8fd2bfe56a354a3
5
5
  SHA512:
6
- metadata.gz: 54d5dd912e31ba1cdc8ed2b740d599a712a6bb2511895fbe27f97504e64631f44169d658f189985f0ea289c481746e906e314a0919049e43261fe8ce91c26b8f
7
- data.tar.gz: 42002d198f2f2f82f27e226563c504f766c2d6ded17255ecc89948206fc0455079c6145d473c0bcd67f4cb99b46414ee61887418f936ec13b1ff8f95d9be92d3
6
+ metadata.gz: a64a4d0a02c34c25fae85ef44436ef5b77ac6a44e6beec5bda05c4c2a1b84a7b27a084e6b2c2e150329636a067d37ed674fbf9839a53a3f054c52dfef8e820b3
7
+ data.tar.gz: fb62aef6ea69d6d698e46aad60afd9cfc070db75caee03a28fbe53380ff77aad3d4807e8c77f5b1f0b96c0c4364de4b6039360cb8c023e24ba092209022623e0
data/README.md CHANGED
@@ -86,7 +86,7 @@ To browse ready to use code samples check [Google Cloud Samples](https://cloud.g
86
86
 
87
87
  ## Supported Ruby Versions
88
88
 
89
- This library is supported on Ruby 3.0+.
89
+ This library is supported on Ruby 3.2+.
90
90
 
91
91
  Google provides official support for Ruby versions that are actively supported
92
92
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -1073,11 +1073,11 @@ module Google
1073
1073
  # If not specified, a default value of 1000 will be used by the service.
1074
1074
  # Regardless of the page_size value, the response may include a partial list
1075
1075
  # and a caller should only rely on response's
1076
- # {::Google::Cloud::Memorystore::V1::ListBackupCollectionsResponse#next_page_token `next_page_token`}
1076
+ # `next_page_token`
1077
1077
  # to determine if there are more clusters left to be queried.
1078
1078
  # @param page_token [::String]
1079
1079
  # Optional. The `next_page_token` value returned from a previous
1080
- # [ListBackupCollections] request, if any.
1080
+ # `ListBackupCollections` request, if any.
1081
1081
  #
1082
1082
  # @yield [response, operation] Access the result along with the RPC operation
1083
1083
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::BackupCollection>]
@@ -1263,11 +1263,11 @@ module Google
1263
1263
  # If not specified, a default value of 1000 will be used by the service.
1264
1264
  # Regardless of the page_size value, the response may include a partial list
1265
1265
  # and a caller should only rely on response's
1266
- # {::Google::Cloud::Memorystore::V1::ListBackupsResponse#next_page_token `next_page_token`}
1266
+ # `next_page_token`
1267
1267
  # to determine if there are more clusters left to be queried.
1268
1268
  # @param page_token [::String]
1269
1269
  # Optional. The `next_page_token` value returned from a previous
1270
- # [ListBackupCollections] request, if any.
1270
+ # `ListBackupCollections` request, if any.
1271
1271
  #
1272
1272
  # @yield [response, operation] Access the result along with the RPC operation
1273
1273
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::Backup>]
@@ -1732,6 +1732,215 @@ module Google
1732
1732
  raise ::Google::Cloud::Error.from_error(e)
1733
1733
  end
1734
1734
 
1735
+ ##
1736
+ # Initiates the migration of a source instance to the target Memorystore
1737
+ # instance.
1738
+ #
1739
+ # After the successful completion of this operation, the target instance
1740
+ # will:
1741
+ # 1. Set up replication with the source instance and replicate any writes to
1742
+ # the source instance.
1743
+ # 2. Only allow reads.
1744
+ #
1745
+ # @overload start_migration(request, options = nil)
1746
+ # Pass arguments to `start_migration` via a request object, either of type
1747
+ # {::Google::Cloud::Memorystore::V1::StartMigrationRequest} or an equivalent Hash.
1748
+ #
1749
+ # @param request [::Google::Cloud::Memorystore::V1::StartMigrationRequest, ::Hash]
1750
+ # A request object representing the call parameters. Required. To specify no
1751
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1752
+ # @param options [::Gapic::CallOptions, ::Hash]
1753
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1754
+ #
1755
+ # @overload start_migration(self_managed_source: nil, name: nil)
1756
+ # Pass arguments to `start_migration` via keyword arguments. Note that at
1757
+ # least one keyword argument is required. To specify no parameters, or to keep all
1758
+ # the default parameter values, pass an empty Hash as a request object (see above).
1759
+ #
1760
+ # @param self_managed_source [::Google::Cloud::Memorystore::V1::SelfManagedSource, ::Hash]
1761
+ # Required. Configuration for migrating from a self-managed Valkey/Redis
1762
+ # instance
1763
+ # @param name [::String]
1764
+ # Required. The resource name of the instance to start migration on.
1765
+ # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
1766
+ #
1767
+ # @yield [response, operation] Access the result along with the RPC operation
1768
+ # @yieldparam response [::Gapic::Operation]
1769
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1770
+ #
1771
+ # @return [::Gapic::Operation]
1772
+ #
1773
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1774
+ #
1775
+ # @example Basic example
1776
+ # require "google/cloud/memorystore/v1"
1777
+ #
1778
+ # # Create a client object. The client can be reused for multiple calls.
1779
+ # client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
1780
+ #
1781
+ # # Create a request. To set request fields, pass in keyword arguments.
1782
+ # request = Google::Cloud::Memorystore::V1::StartMigrationRequest.new
1783
+ #
1784
+ # # Call the start_migration method.
1785
+ # result = client.start_migration request
1786
+ #
1787
+ # # The returned object is of type Gapic::Operation. You can use it to
1788
+ # # check the status of an operation, cancel it, or wait for results.
1789
+ # # Here is how to wait for a response.
1790
+ # result.wait_until_done! timeout: 60
1791
+ # if result.response?
1792
+ # p result.response
1793
+ # else
1794
+ # puts "No response received."
1795
+ # end
1796
+ #
1797
+ def start_migration request, options = nil
1798
+ raise ::ArgumentError, "request must be provided" if request.nil?
1799
+
1800
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::StartMigrationRequest
1801
+
1802
+ # Converts hash and nil to an options object
1803
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1804
+
1805
+ # Customize the options with defaults
1806
+ metadata = @config.rpcs.start_migration.metadata.to_h
1807
+
1808
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1809
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1810
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1811
+ gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
1812
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1813
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1814
+
1815
+ header_params = {}
1816
+ if request.name
1817
+ header_params["name"] = request.name
1818
+ end
1819
+
1820
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1821
+ metadata[:"x-goog-request-params"] ||= request_params_header
1822
+
1823
+ options.apply_defaults timeout: @config.rpcs.start_migration.timeout,
1824
+ metadata: metadata,
1825
+ retry_policy: @config.rpcs.start_migration.retry_policy
1826
+
1827
+ options.apply_defaults timeout: @config.timeout,
1828
+ metadata: @config.metadata,
1829
+ retry_policy: @config.retry_policy
1830
+
1831
+ @memorystore_stub.call_rpc :start_migration, request, options: options do |response, operation|
1832
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1833
+ yield response, operation if block_given?
1834
+ throw :response, response
1835
+ end
1836
+ rescue ::GRPC::BadStatus => e
1837
+ raise ::Google::Cloud::Error.from_error(e)
1838
+ end
1839
+
1840
+ ##
1841
+ # Finalizes the migration process.
1842
+ #
1843
+ # After the successful completion of this operation, the target instance
1844
+ # will:
1845
+ # 1. Stop replicating from the source instance.
1846
+ # 2. Allow both reads and writes.
1847
+ #
1848
+ # @overload finish_migration(request, options = nil)
1849
+ # Pass arguments to `finish_migration` via a request object, either of type
1850
+ # {::Google::Cloud::Memorystore::V1::FinishMigrationRequest} or an equivalent Hash.
1851
+ #
1852
+ # @param request [::Google::Cloud::Memorystore::V1::FinishMigrationRequest, ::Hash]
1853
+ # A request object representing the call parameters. Required. To specify no
1854
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1855
+ # @param options [::Gapic::CallOptions, ::Hash]
1856
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1857
+ #
1858
+ # @overload finish_migration(name: nil, force: nil)
1859
+ # Pass arguments to `finish_migration` via keyword arguments. Note that at
1860
+ # least one keyword argument is required. To specify no parameters, or to keep all
1861
+ # the default parameter values, pass an empty Hash as a request object (see above).
1862
+ #
1863
+ # @param name [::String]
1864
+ # Required. The resource name of the instance to finalize migration on.
1865
+ # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
1866
+ # @param force [::Boolean]
1867
+ # Optional. By default, the `FinishMigration` operation ensures the target
1868
+ # replication offset to catch up to the source offset as of the time of the
1869
+ # call. Set this field to `true` to bypass this offset verification check.
1870
+ #
1871
+ # @yield [response, operation] Access the result along with the RPC operation
1872
+ # @yieldparam response [::Gapic::Operation]
1873
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1874
+ #
1875
+ # @return [::Gapic::Operation]
1876
+ #
1877
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1878
+ #
1879
+ # @example Basic example
1880
+ # require "google/cloud/memorystore/v1"
1881
+ #
1882
+ # # Create a client object. The client can be reused for multiple calls.
1883
+ # client = Google::Cloud::Memorystore::V1::Memorystore::Client.new
1884
+ #
1885
+ # # Create a request. To set request fields, pass in keyword arguments.
1886
+ # request = Google::Cloud::Memorystore::V1::FinishMigrationRequest.new
1887
+ #
1888
+ # # Call the finish_migration method.
1889
+ # result = client.finish_migration request
1890
+ #
1891
+ # # The returned object is of type Gapic::Operation. You can use it to
1892
+ # # check the status of an operation, cancel it, or wait for results.
1893
+ # # Here is how to wait for a response.
1894
+ # result.wait_until_done! timeout: 60
1895
+ # if result.response?
1896
+ # p result.response
1897
+ # else
1898
+ # puts "No response received."
1899
+ # end
1900
+ #
1901
+ def finish_migration request, options = nil
1902
+ raise ::ArgumentError, "request must be provided" if request.nil?
1903
+
1904
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::FinishMigrationRequest
1905
+
1906
+ # Converts hash and nil to an options object
1907
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1908
+
1909
+ # Customize the options with defaults
1910
+ metadata = @config.rpcs.finish_migration.metadata.to_h
1911
+
1912
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1913
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1914
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1915
+ gapic_version: ::Google::Cloud::Memorystore::V1::VERSION
1916
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1917
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1918
+
1919
+ header_params = {}
1920
+ if request.name
1921
+ header_params["name"] = request.name
1922
+ end
1923
+
1924
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1925
+ metadata[:"x-goog-request-params"] ||= request_params_header
1926
+
1927
+ options.apply_defaults timeout: @config.rpcs.finish_migration.timeout,
1928
+ metadata: metadata,
1929
+ retry_policy: @config.rpcs.finish_migration.retry_policy
1930
+
1931
+ options.apply_defaults timeout: @config.timeout,
1932
+ metadata: @config.metadata,
1933
+ retry_policy: @config.retry_policy
1934
+
1935
+ @memorystore_stub.call_rpc :finish_migration, request, options: options do |response, operation|
1936
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1937
+ yield response, operation if block_given?
1938
+ throw :response, response
1939
+ end
1940
+ rescue ::GRPC::BadStatus => e
1941
+ raise ::Google::Cloud::Error.from_error(e)
1942
+ end
1943
+
1735
1944
  ##
1736
1945
  # Configuration class for the Memorystore API.
1737
1946
  #
@@ -1828,6 +2037,7 @@ module Google
1828
2037
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1829
2038
  # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1830
2039
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2040
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1831
2041
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1832
2042
  # trigger a retry.
1833
2043
  # @return [::Hash]
@@ -1911,6 +2121,7 @@ module Google
1911
2121
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1912
2122
  # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1913
2123
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2124
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1914
2125
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1915
2126
  # trigger a retry.
1916
2127
  #
@@ -1990,6 +2201,16 @@ module Google
1990
2201
  # @return [::Gapic::Config::Method]
1991
2202
  #
1992
2203
  attr_reader :backup_instance
2204
+ ##
2205
+ # RPC-specific configuration for `start_migration`
2206
+ # @return [::Gapic::Config::Method]
2207
+ #
2208
+ attr_reader :start_migration
2209
+ ##
2210
+ # RPC-specific configuration for `finish_migration`
2211
+ # @return [::Gapic::Config::Method]
2212
+ #
2213
+ attr_reader :finish_migration
1993
2214
 
1994
2215
  # @private
1995
2216
  def initialize parent_rpcs = nil
@@ -2023,6 +2244,10 @@ module Google
2023
2244
  @export_backup = ::Gapic::Config::Method.new export_backup_config
2024
2245
  backup_instance_config = parent_rpcs.backup_instance if parent_rpcs.respond_to? :backup_instance
2025
2246
  @backup_instance = ::Gapic::Config::Method.new backup_instance_config
2247
+ start_migration_config = parent_rpcs.start_migration if parent_rpcs.respond_to? :start_migration
2248
+ @start_migration = ::Gapic::Config::Method.new start_migration_config
2249
+ finish_migration_config = parent_rpcs.finish_migration if parent_rpcs.respond_to? :finish_migration
2250
+ @finish_migration = ::Gapic::Config::Method.new finish_migration_config
2026
2251
 
2027
2252
  yield self if block_given?
2028
2253
  end
@@ -26,7 +26,9 @@ module Google
26
26
  # Credentials for the Memorystore API.
27
27
  class Credentials < ::Google::Auth::Credentials
28
28
  self.scope = [
29
- "https://www.googleapis.com/auth/cloud-platform"
29
+ "https://www.googleapis.com/auth/cloud-platform",
30
+ "https://www.googleapis.com/auth/memorystore.read-only",
31
+ "https://www.googleapis.com/auth/memorystore.read-write"
30
32
  ]
31
33
  self.env_vars = [
32
34
  "GOOGLE_CLOUD_CREDENTIALS",
@@ -703,6 +703,7 @@ module Google
703
703
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
704
704
  # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
705
705
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
706
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
706
707
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
707
708
  # trigger a retry.
708
709
  # @return [::Hash]
@@ -786,6 +787,7 @@ module Google
786
787
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
787
788
  # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
788
789
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
790
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
789
791
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
790
792
  # trigger a retry.
791
793
  #
@@ -199,6 +199,25 @@ module Google
199
199
  "projects/#{project}/global/networks/#{network}"
200
200
  end
201
201
 
202
+ ##
203
+ # Create a fully-qualified NetworkAttachment resource string.
204
+ #
205
+ # The resource will be in the following format:
206
+ #
207
+ # `projects/{project}/regions/{region}/networkAttachments/{network_attachment}`
208
+ #
209
+ # @param project [String]
210
+ # @param region [String]
211
+ # @param network_attachment [String]
212
+ #
213
+ # @return [::String]
214
+ def network_attachment_path project:, region:, network_attachment:
215
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
216
+ raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/"
217
+
218
+ "projects/#{project}/regions/#{region}/networkAttachments/#{network_attachment}"
219
+ end
220
+
202
221
  ##
203
222
  # Create a fully-qualified ServiceAttachment resource string.
204
223
  #
@@ -1011,11 +1011,11 @@ module Google
1011
1011
  # If not specified, a default value of 1000 will be used by the service.
1012
1012
  # Regardless of the page_size value, the response may include a partial list
1013
1013
  # and a caller should only rely on response's
1014
- # {::Google::Cloud::Memorystore::V1::ListBackupCollectionsResponse#next_page_token `next_page_token`}
1014
+ # `next_page_token`
1015
1015
  # to determine if there are more clusters left to be queried.
1016
1016
  # @param page_token [::String]
1017
1017
  # Optional. The `next_page_token` value returned from a previous
1018
- # [ListBackupCollections] request, if any.
1018
+ # `ListBackupCollections` request, if any.
1019
1019
  # @yield [result, operation] Access the result along with the TransportOperation object
1020
1020
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::BackupCollection>]
1021
1021
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -1187,11 +1187,11 @@ module Google
1187
1187
  # If not specified, a default value of 1000 will be used by the service.
1188
1188
  # Regardless of the page_size value, the response may include a partial list
1189
1189
  # and a caller should only rely on response's
1190
- # {::Google::Cloud::Memorystore::V1::ListBackupsResponse#next_page_token `next_page_token`}
1190
+ # `next_page_token`
1191
1191
  # to determine if there are more clusters left to be queried.
1192
1192
  # @param page_token [::String]
1193
1193
  # Optional. The `next_page_token` value returned from a previous
1194
- # [ListBackupCollections] request, if any.
1194
+ # `ListBackupCollections` request, if any.
1195
1195
  # @yield [result, operation] Access the result along with the TransportOperation object
1196
1196
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::Backup>]
1197
1197
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -1621,6 +1621,201 @@ module Google
1621
1621
  raise ::Google::Cloud::Error.from_error(e)
1622
1622
  end
1623
1623
 
1624
+ ##
1625
+ # Initiates the migration of a source instance to the target Memorystore
1626
+ # instance.
1627
+ #
1628
+ # After the successful completion of this operation, the target instance
1629
+ # will:
1630
+ # 1. Set up replication with the source instance and replicate any writes to
1631
+ # the source instance.
1632
+ # 2. Only allow reads.
1633
+ #
1634
+ # @overload start_migration(request, options = nil)
1635
+ # Pass arguments to `start_migration` via a request object, either of type
1636
+ # {::Google::Cloud::Memorystore::V1::StartMigrationRequest} or an equivalent Hash.
1637
+ #
1638
+ # @param request [::Google::Cloud::Memorystore::V1::StartMigrationRequest, ::Hash]
1639
+ # A request object representing the call parameters. Required. To specify no
1640
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1641
+ # @param options [::Gapic::CallOptions, ::Hash]
1642
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1643
+ #
1644
+ # @overload start_migration(self_managed_source: nil, name: nil)
1645
+ # Pass arguments to `start_migration` via keyword arguments. Note that at
1646
+ # least one keyword argument is required. To specify no parameters, or to keep all
1647
+ # the default parameter values, pass an empty Hash as a request object (see above).
1648
+ #
1649
+ # @param self_managed_source [::Google::Cloud::Memorystore::V1::SelfManagedSource, ::Hash]
1650
+ # Required. Configuration for migrating from a self-managed Valkey/Redis
1651
+ # instance
1652
+ # @param name [::String]
1653
+ # Required. The resource name of the instance to start migration on.
1654
+ # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
1655
+ # @yield [result, operation] Access the result along with the TransportOperation object
1656
+ # @yieldparam result [::Gapic::Operation]
1657
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1658
+ #
1659
+ # @return [::Gapic::Operation]
1660
+ #
1661
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1662
+ #
1663
+ # @example Basic example
1664
+ # require "google/cloud/memorystore/v1"
1665
+ #
1666
+ # # Create a client object. The client can be reused for multiple calls.
1667
+ # client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
1668
+ #
1669
+ # # Create a request. To set request fields, pass in keyword arguments.
1670
+ # request = Google::Cloud::Memorystore::V1::StartMigrationRequest.new
1671
+ #
1672
+ # # Call the start_migration method.
1673
+ # result = client.start_migration request
1674
+ #
1675
+ # # The returned object is of type Gapic::Operation. You can use it to
1676
+ # # check the status of an operation, cancel it, or wait for results.
1677
+ # # Here is how to wait for a response.
1678
+ # result.wait_until_done! timeout: 60
1679
+ # if result.response?
1680
+ # p result.response
1681
+ # else
1682
+ # puts "No response received."
1683
+ # end
1684
+ #
1685
+ def start_migration request, options = nil
1686
+ raise ::ArgumentError, "request must be provided" if request.nil?
1687
+
1688
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::StartMigrationRequest
1689
+
1690
+ # Converts hash and nil to an options object
1691
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1692
+
1693
+ # Customize the options with defaults
1694
+ call_metadata = @config.rpcs.start_migration.metadata.to_h
1695
+
1696
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1697
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1698
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1699
+ gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
1700
+ transports_version_send: [:rest]
1701
+
1702
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1703
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1704
+
1705
+ options.apply_defaults timeout: @config.rpcs.start_migration.timeout,
1706
+ metadata: call_metadata,
1707
+ retry_policy: @config.rpcs.start_migration.retry_policy
1708
+
1709
+ options.apply_defaults timeout: @config.timeout,
1710
+ metadata: @config.metadata,
1711
+ retry_policy: @config.retry_policy
1712
+
1713
+ @memorystore_stub.start_migration request, options do |result, operation|
1714
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1715
+ yield result, operation if block_given?
1716
+ throw :response, result
1717
+ end
1718
+ rescue ::Gapic::Rest::Error => e
1719
+ raise ::Google::Cloud::Error.from_error(e)
1720
+ end
1721
+
1722
+ ##
1723
+ # Finalizes the migration process.
1724
+ #
1725
+ # After the successful completion of this operation, the target instance
1726
+ # will:
1727
+ # 1. Stop replicating from the source instance.
1728
+ # 2. Allow both reads and writes.
1729
+ #
1730
+ # @overload finish_migration(request, options = nil)
1731
+ # Pass arguments to `finish_migration` via a request object, either of type
1732
+ # {::Google::Cloud::Memorystore::V1::FinishMigrationRequest} or an equivalent Hash.
1733
+ #
1734
+ # @param request [::Google::Cloud::Memorystore::V1::FinishMigrationRequest, ::Hash]
1735
+ # A request object representing the call parameters. Required. To specify no
1736
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1737
+ # @param options [::Gapic::CallOptions, ::Hash]
1738
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1739
+ #
1740
+ # @overload finish_migration(name: nil, force: nil)
1741
+ # Pass arguments to `finish_migration` via keyword arguments. Note that at
1742
+ # least one keyword argument is required. To specify no parameters, or to keep all
1743
+ # the default parameter values, pass an empty Hash as a request object (see above).
1744
+ #
1745
+ # @param name [::String]
1746
+ # Required. The resource name of the instance to finalize migration on.
1747
+ # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
1748
+ # @param force [::Boolean]
1749
+ # Optional. By default, the `FinishMigration` operation ensures the target
1750
+ # replication offset to catch up to the source offset as of the time of the
1751
+ # call. Set this field to `true` to bypass this offset verification check.
1752
+ # @yield [result, operation] Access the result along with the TransportOperation object
1753
+ # @yieldparam result [::Gapic::Operation]
1754
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1755
+ #
1756
+ # @return [::Gapic::Operation]
1757
+ #
1758
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1759
+ #
1760
+ # @example Basic example
1761
+ # require "google/cloud/memorystore/v1"
1762
+ #
1763
+ # # Create a client object. The client can be reused for multiple calls.
1764
+ # client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
1765
+ #
1766
+ # # Create a request. To set request fields, pass in keyword arguments.
1767
+ # request = Google::Cloud::Memorystore::V1::FinishMigrationRequest.new
1768
+ #
1769
+ # # Call the finish_migration method.
1770
+ # result = client.finish_migration request
1771
+ #
1772
+ # # The returned object is of type Gapic::Operation. You can use it to
1773
+ # # check the status of an operation, cancel it, or wait for results.
1774
+ # # Here is how to wait for a response.
1775
+ # result.wait_until_done! timeout: 60
1776
+ # if result.response?
1777
+ # p result.response
1778
+ # else
1779
+ # puts "No response received."
1780
+ # end
1781
+ #
1782
+ def finish_migration request, options = nil
1783
+ raise ::ArgumentError, "request must be provided" if request.nil?
1784
+
1785
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::FinishMigrationRequest
1786
+
1787
+ # Converts hash and nil to an options object
1788
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1789
+
1790
+ # Customize the options with defaults
1791
+ call_metadata = @config.rpcs.finish_migration.metadata.to_h
1792
+
1793
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1794
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1795
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1796
+ gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
1797
+ transports_version_send: [:rest]
1798
+
1799
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1800
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1801
+
1802
+ options.apply_defaults timeout: @config.rpcs.finish_migration.timeout,
1803
+ metadata: call_metadata,
1804
+ retry_policy: @config.rpcs.finish_migration.retry_policy
1805
+
1806
+ options.apply_defaults timeout: @config.timeout,
1807
+ metadata: @config.metadata,
1808
+ retry_policy: @config.retry_policy
1809
+
1810
+ @memorystore_stub.finish_migration request, options do |result, operation|
1811
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1812
+ yield result, operation if block_given?
1813
+ throw :response, result
1814
+ end
1815
+ rescue ::Gapic::Rest::Error => e
1816
+ raise ::Google::Cloud::Error.from_error(e)
1817
+ end
1818
+
1624
1819
  ##
1625
1820
  # Configuration class for the Memorystore REST API.
1626
1821
  #
@@ -1691,6 +1886,7 @@ module Google
1691
1886
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1692
1887
  # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1693
1888
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1889
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1694
1890
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1695
1891
  # trigger a retry.
1696
1892
  # @return [::Hash]
@@ -1770,6 +1966,7 @@ module Google
1770
1966
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1771
1967
  # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1772
1968
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1969
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1773
1970
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1774
1971
  # trigger a retry.
1775
1972
  #
@@ -1849,6 +2046,16 @@ module Google
1849
2046
  # @return [::Gapic::Config::Method]
1850
2047
  #
1851
2048
  attr_reader :backup_instance
2049
+ ##
2050
+ # RPC-specific configuration for `start_migration`
2051
+ # @return [::Gapic::Config::Method]
2052
+ #
2053
+ attr_reader :start_migration
2054
+ ##
2055
+ # RPC-specific configuration for `finish_migration`
2056
+ # @return [::Gapic::Config::Method]
2057
+ #
2058
+ attr_reader :finish_migration
1852
2059
 
1853
2060
  # @private
1854
2061
  def initialize parent_rpcs = nil
@@ -1882,6 +2089,10 @@ module Google
1882
2089
  @export_backup = ::Gapic::Config::Method.new export_backup_config
1883
2090
  backup_instance_config = parent_rpcs.backup_instance if parent_rpcs.respond_to? :backup_instance
1884
2091
  @backup_instance = ::Gapic::Config::Method.new backup_instance_config
2092
+ start_migration_config = parent_rpcs.start_migration if parent_rpcs.respond_to? :start_migration
2093
+ @start_migration = ::Gapic::Config::Method.new start_migration_config
2094
+ finish_migration_config = parent_rpcs.finish_migration if parent_rpcs.respond_to? :finish_migration
2095
+ @finish_migration = ::Gapic::Config::Method.new finish_migration_config
1885
2096
 
1886
2097
  yield self if block_given?
1887
2098
  end
@@ -541,6 +541,7 @@ module Google
541
541
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
542
542
  # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
543
543
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
544
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
544
545
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
545
546
  # trigger a retry.
546
547
  # @return [::Hash]
@@ -613,6 +614,7 @@ module Google
613
614
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
614
615
  # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
615
616
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
617
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
616
618
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
617
619
  # trigger a retry.
618
620
  #