google-cloud-memorystore-v1 1.9.0 → 1.11.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 +4 -4
- data/lib/google/cloud/memorystore/v1/memorystore/client.rb +1076 -4
- data/lib/google/cloud/memorystore/v1/memorystore/credentials.rb +3 -1
- data/lib/google/cloud/memorystore/v1/memorystore/paths.rb +63 -0
- data/lib/google/cloud/memorystore/v1/memorystore/rest/client.rb +1006 -4
- data/lib/google/cloud/memorystore/v1/memorystore/rest/service_stub.rb +614 -0
- data/lib/google/cloud/memorystore/v1/memorystore_pb.rb +20 -1
- data/lib/google/cloud/memorystore/v1/memorystore_services_pb.rb +32 -0
- data/lib/google/cloud/memorystore/v1/version.rb +1 -1
- data/proto_docs/google/cloud/memorystore/v1/memorystore.rb +377 -22
- metadata +1 -1
|
@@ -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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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,938 @@ 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
|
+
|
|
1819
|
+
##
|
|
1820
|
+
# Lists all the token auth users for a token based auth enabled instance.
|
|
1821
|
+
#
|
|
1822
|
+
# @overload list_token_auth_users(request, options = nil)
|
|
1823
|
+
# Pass arguments to `list_token_auth_users` via a request object, either of type
|
|
1824
|
+
# {::Google::Cloud::Memorystore::V1::ListTokenAuthUsersRequest} or an equivalent Hash.
|
|
1825
|
+
#
|
|
1826
|
+
# @param request [::Google::Cloud::Memorystore::V1::ListTokenAuthUsersRequest, ::Hash]
|
|
1827
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1828
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1829
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1830
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1831
|
+
#
|
|
1832
|
+
# @overload list_token_auth_users(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
|
1833
|
+
# Pass arguments to `list_token_auth_users` via keyword arguments. Note that at
|
|
1834
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1835
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1836
|
+
#
|
|
1837
|
+
# @param parent [::String]
|
|
1838
|
+
# Required. The parent to list token auth users from.
|
|
1839
|
+
# Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
|
|
1840
|
+
# @param page_size [::Integer]
|
|
1841
|
+
# Optional. The maximum number of items to return. The maximum value is 1000;
|
|
1842
|
+
# values above 1000 will be coerced to 1000. If not specified, a default
|
|
1843
|
+
# value of 1000 will be used by the service. Regardless of the page_size
|
|
1844
|
+
# value, the response may include a partial list and a caller should only
|
|
1845
|
+
# rely on response's `next_page_token` to determine if there are more token
|
|
1846
|
+
# auth users left to be queried.
|
|
1847
|
+
# @param page_token [::String]
|
|
1848
|
+
# Optional. The `next_page_token` value returned from a previous
|
|
1849
|
+
# `ListTokenAuthUsers` request, if any.
|
|
1850
|
+
# @param filter [::String]
|
|
1851
|
+
# Optional. Expression for filtering results.
|
|
1852
|
+
# @param order_by [::String]
|
|
1853
|
+
# Optional. Sort results by a defined order.
|
|
1854
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1855
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::TokenAuthUser>]
|
|
1856
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1857
|
+
#
|
|
1858
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::TokenAuthUser>]
|
|
1859
|
+
#
|
|
1860
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1861
|
+
#
|
|
1862
|
+
# @example Basic example
|
|
1863
|
+
# require "google/cloud/memorystore/v1"
|
|
1864
|
+
#
|
|
1865
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1866
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
|
|
1867
|
+
#
|
|
1868
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1869
|
+
# request = Google::Cloud::Memorystore::V1::ListTokenAuthUsersRequest.new
|
|
1870
|
+
#
|
|
1871
|
+
# # Call the list_token_auth_users method.
|
|
1872
|
+
# result = client.list_token_auth_users request
|
|
1873
|
+
#
|
|
1874
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
1875
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
1876
|
+
# result.each do |item|
|
|
1877
|
+
# # Each element is of type ::Google::Cloud::Memorystore::V1::TokenAuthUser.
|
|
1878
|
+
# p item
|
|
1879
|
+
# end
|
|
1880
|
+
#
|
|
1881
|
+
def list_token_auth_users request, options = nil
|
|
1882
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1883
|
+
|
|
1884
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::ListTokenAuthUsersRequest
|
|
1885
|
+
|
|
1886
|
+
# Converts hash and nil to an options object
|
|
1887
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1888
|
+
|
|
1889
|
+
# Customize the options with defaults
|
|
1890
|
+
call_metadata = @config.rpcs.list_token_auth_users.metadata.to_h
|
|
1891
|
+
|
|
1892
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1893
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1894
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1895
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
|
|
1896
|
+
transports_version_send: [:rest]
|
|
1897
|
+
|
|
1898
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1899
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1900
|
+
|
|
1901
|
+
options.apply_defaults timeout: @config.rpcs.list_token_auth_users.timeout,
|
|
1902
|
+
metadata: call_metadata,
|
|
1903
|
+
retry_policy: @config.rpcs.list_token_auth_users.retry_policy
|
|
1904
|
+
|
|
1905
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1906
|
+
metadata: @config.metadata,
|
|
1907
|
+
retry_policy: @config.retry_policy
|
|
1908
|
+
|
|
1909
|
+
@memorystore_stub.list_token_auth_users request, options do |result, operation|
|
|
1910
|
+
result = ::Gapic::Rest::PagedEnumerable.new @memorystore_stub, :list_token_auth_users, "token_auth_users", request, result, options
|
|
1911
|
+
yield result, operation if block_given?
|
|
1912
|
+
throw :response, result
|
|
1913
|
+
end
|
|
1914
|
+
rescue ::Gapic::Rest::Error => e
|
|
1915
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1916
|
+
end
|
|
1917
|
+
|
|
1918
|
+
##
|
|
1919
|
+
# Gets a specific token auth user for a token based auth enabled instance.
|
|
1920
|
+
#
|
|
1921
|
+
# @overload get_token_auth_user(request, options = nil)
|
|
1922
|
+
# Pass arguments to `get_token_auth_user` via a request object, either of type
|
|
1923
|
+
# {::Google::Cloud::Memorystore::V1::GetTokenAuthUserRequest} or an equivalent Hash.
|
|
1924
|
+
#
|
|
1925
|
+
# @param request [::Google::Cloud::Memorystore::V1::GetTokenAuthUserRequest, ::Hash]
|
|
1926
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1927
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1928
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1929
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1930
|
+
#
|
|
1931
|
+
# @overload get_token_auth_user(name: nil)
|
|
1932
|
+
# Pass arguments to `get_token_auth_user` via keyword arguments. Note that at
|
|
1933
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1934
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1935
|
+
#
|
|
1936
|
+
# @param name [::String]
|
|
1937
|
+
# Required. The name of token auth user for a basic auth enabled instance.
|
|
1938
|
+
# Format:
|
|
1939
|
+
# projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user}
|
|
1940
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1941
|
+
# @yieldparam result [::Google::Cloud::Memorystore::V1::TokenAuthUser]
|
|
1942
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1943
|
+
#
|
|
1944
|
+
# @return [::Google::Cloud::Memorystore::V1::TokenAuthUser]
|
|
1945
|
+
#
|
|
1946
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1947
|
+
#
|
|
1948
|
+
# @example Basic example
|
|
1949
|
+
# require "google/cloud/memorystore/v1"
|
|
1950
|
+
#
|
|
1951
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1952
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
|
|
1953
|
+
#
|
|
1954
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1955
|
+
# request = Google::Cloud::Memorystore::V1::GetTokenAuthUserRequest.new
|
|
1956
|
+
#
|
|
1957
|
+
# # Call the get_token_auth_user method.
|
|
1958
|
+
# result = client.get_token_auth_user request
|
|
1959
|
+
#
|
|
1960
|
+
# # The returned object is of type Google::Cloud::Memorystore::V1::TokenAuthUser.
|
|
1961
|
+
# p result
|
|
1962
|
+
#
|
|
1963
|
+
def get_token_auth_user request, options = nil
|
|
1964
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1965
|
+
|
|
1966
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::GetTokenAuthUserRequest
|
|
1967
|
+
|
|
1968
|
+
# Converts hash and nil to an options object
|
|
1969
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1970
|
+
|
|
1971
|
+
# Customize the options with defaults
|
|
1972
|
+
call_metadata = @config.rpcs.get_token_auth_user.metadata.to_h
|
|
1973
|
+
|
|
1974
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1975
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1976
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1977
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
|
|
1978
|
+
transports_version_send: [:rest]
|
|
1979
|
+
|
|
1980
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1981
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1982
|
+
|
|
1983
|
+
options.apply_defaults timeout: @config.rpcs.get_token_auth_user.timeout,
|
|
1984
|
+
metadata: call_metadata,
|
|
1985
|
+
retry_policy: @config.rpcs.get_token_auth_user.retry_policy
|
|
1986
|
+
|
|
1987
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1988
|
+
metadata: @config.metadata,
|
|
1989
|
+
retry_policy: @config.retry_policy
|
|
1990
|
+
|
|
1991
|
+
@memorystore_stub.get_token_auth_user request, options do |result, operation|
|
|
1992
|
+
yield result, operation if block_given?
|
|
1993
|
+
end
|
|
1994
|
+
rescue ::Gapic::Rest::Error => e
|
|
1995
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1996
|
+
end
|
|
1997
|
+
|
|
1998
|
+
##
|
|
1999
|
+
# Lists all the auth tokens for a specific token auth user.
|
|
2000
|
+
#
|
|
2001
|
+
# @overload list_auth_tokens(request, options = nil)
|
|
2002
|
+
# Pass arguments to `list_auth_tokens` via a request object, either of type
|
|
2003
|
+
# {::Google::Cloud::Memorystore::V1::ListAuthTokensRequest} or an equivalent Hash.
|
|
2004
|
+
#
|
|
2005
|
+
# @param request [::Google::Cloud::Memorystore::V1::ListAuthTokensRequest, ::Hash]
|
|
2006
|
+
# A request object representing the call parameters. Required. To specify no
|
|
2007
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
2008
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
2009
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
2010
|
+
#
|
|
2011
|
+
# @overload list_auth_tokens(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
|
2012
|
+
# Pass arguments to `list_auth_tokens` via keyword arguments. Note that at
|
|
2013
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
2014
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
2015
|
+
#
|
|
2016
|
+
# @param parent [::String]
|
|
2017
|
+
# Required. The parent to list auth tokens from.
|
|
2018
|
+
# Format:
|
|
2019
|
+
# projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user}
|
|
2020
|
+
# @param page_size [::Integer]
|
|
2021
|
+
# Optional. The maximum number of items to return. The maximum value is 1000;
|
|
2022
|
+
# values above 1000 will be coerced to 1000.
|
|
2023
|
+
#
|
|
2024
|
+
# If not specified, a default value of 1000 will be used by the service.
|
|
2025
|
+
# Regardless of the page_size value, the response may include a partial list
|
|
2026
|
+
# and a caller should only rely on response's
|
|
2027
|
+
# `next_page_token`
|
|
2028
|
+
# to determine if there are more auth tokens left to be queried.
|
|
2029
|
+
# @param page_token [::String]
|
|
2030
|
+
# Optional. The `next_page_token` value returned from a previous
|
|
2031
|
+
# `ListAuthTokens` request, if any.
|
|
2032
|
+
# @param filter [::String]
|
|
2033
|
+
# Optional. Expression for filtering results.
|
|
2034
|
+
# @param order_by [::String]
|
|
2035
|
+
# Optional. Sort results by a defined order.
|
|
2036
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
2037
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::AuthToken>]
|
|
2038
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
2039
|
+
#
|
|
2040
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::AuthToken>]
|
|
2041
|
+
#
|
|
2042
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
2043
|
+
#
|
|
2044
|
+
# @example Basic example
|
|
2045
|
+
# require "google/cloud/memorystore/v1"
|
|
2046
|
+
#
|
|
2047
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
2048
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
|
|
2049
|
+
#
|
|
2050
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
2051
|
+
# request = Google::Cloud::Memorystore::V1::ListAuthTokensRequest.new
|
|
2052
|
+
#
|
|
2053
|
+
# # Call the list_auth_tokens method.
|
|
2054
|
+
# result = client.list_auth_tokens request
|
|
2055
|
+
#
|
|
2056
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
2057
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
2058
|
+
# result.each do |item|
|
|
2059
|
+
# # Each element is of type ::Google::Cloud::Memorystore::V1::AuthToken.
|
|
2060
|
+
# p item
|
|
2061
|
+
# end
|
|
2062
|
+
#
|
|
2063
|
+
def list_auth_tokens request, options = nil
|
|
2064
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
2065
|
+
|
|
2066
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::ListAuthTokensRequest
|
|
2067
|
+
|
|
2068
|
+
# Converts hash and nil to an options object
|
|
2069
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
2070
|
+
|
|
2071
|
+
# Customize the options with defaults
|
|
2072
|
+
call_metadata = @config.rpcs.list_auth_tokens.metadata.to_h
|
|
2073
|
+
|
|
2074
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
2075
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
2076
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
2077
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
|
|
2078
|
+
transports_version_send: [:rest]
|
|
2079
|
+
|
|
2080
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
2081
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
2082
|
+
|
|
2083
|
+
options.apply_defaults timeout: @config.rpcs.list_auth_tokens.timeout,
|
|
2084
|
+
metadata: call_metadata,
|
|
2085
|
+
retry_policy: @config.rpcs.list_auth_tokens.retry_policy
|
|
2086
|
+
|
|
2087
|
+
options.apply_defaults timeout: @config.timeout,
|
|
2088
|
+
metadata: @config.metadata,
|
|
2089
|
+
retry_policy: @config.retry_policy
|
|
2090
|
+
|
|
2091
|
+
@memorystore_stub.list_auth_tokens request, options do |result, operation|
|
|
2092
|
+
result = ::Gapic::Rest::PagedEnumerable.new @memorystore_stub, :list_auth_tokens, "auth_tokens", request, result, options
|
|
2093
|
+
yield result, operation if block_given?
|
|
2094
|
+
throw :response, result
|
|
2095
|
+
end
|
|
2096
|
+
rescue ::Gapic::Rest::Error => e
|
|
2097
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
2098
|
+
end
|
|
2099
|
+
|
|
2100
|
+
##
|
|
2101
|
+
# Gets a token based auth enabled instance's auth token for a given user.
|
|
2102
|
+
#
|
|
2103
|
+
# @overload get_auth_token(request, options = nil)
|
|
2104
|
+
# Pass arguments to `get_auth_token` via a request object, either of type
|
|
2105
|
+
# {::Google::Cloud::Memorystore::V1::GetAuthTokenRequest} or an equivalent Hash.
|
|
2106
|
+
#
|
|
2107
|
+
# @param request [::Google::Cloud::Memorystore::V1::GetAuthTokenRequest, ::Hash]
|
|
2108
|
+
# A request object representing the call parameters. Required. To specify no
|
|
2109
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
2110
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
2111
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
2112
|
+
#
|
|
2113
|
+
# @overload get_auth_token(name: nil)
|
|
2114
|
+
# Pass arguments to `get_auth_token` via keyword arguments. Note that at
|
|
2115
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
2116
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
2117
|
+
#
|
|
2118
|
+
# @param name [::String]
|
|
2119
|
+
# Required. The name of token auth user for a token auth enabled instance.
|
|
2120
|
+
# Format:
|
|
2121
|
+
# projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user}/authTokens/\\{auth_token}
|
|
2122
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
2123
|
+
# @yieldparam result [::Google::Cloud::Memorystore::V1::AuthToken]
|
|
2124
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
2125
|
+
#
|
|
2126
|
+
# @return [::Google::Cloud::Memorystore::V1::AuthToken]
|
|
2127
|
+
#
|
|
2128
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
2129
|
+
#
|
|
2130
|
+
# @example Basic example
|
|
2131
|
+
# require "google/cloud/memorystore/v1"
|
|
2132
|
+
#
|
|
2133
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
2134
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
|
|
2135
|
+
#
|
|
2136
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
2137
|
+
# request = Google::Cloud::Memorystore::V1::GetAuthTokenRequest.new
|
|
2138
|
+
#
|
|
2139
|
+
# # Call the get_auth_token method.
|
|
2140
|
+
# result = client.get_auth_token request
|
|
2141
|
+
#
|
|
2142
|
+
# # The returned object is of type Google::Cloud::Memorystore::V1::AuthToken.
|
|
2143
|
+
# p result
|
|
2144
|
+
#
|
|
2145
|
+
def get_auth_token request, options = nil
|
|
2146
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
2147
|
+
|
|
2148
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::GetAuthTokenRequest
|
|
2149
|
+
|
|
2150
|
+
# Converts hash and nil to an options object
|
|
2151
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
2152
|
+
|
|
2153
|
+
# Customize the options with defaults
|
|
2154
|
+
call_metadata = @config.rpcs.get_auth_token.metadata.to_h
|
|
2155
|
+
|
|
2156
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
2157
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
2158
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
2159
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
|
|
2160
|
+
transports_version_send: [:rest]
|
|
2161
|
+
|
|
2162
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
2163
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
2164
|
+
|
|
2165
|
+
options.apply_defaults timeout: @config.rpcs.get_auth_token.timeout,
|
|
2166
|
+
metadata: call_metadata,
|
|
2167
|
+
retry_policy: @config.rpcs.get_auth_token.retry_policy
|
|
2168
|
+
|
|
2169
|
+
options.apply_defaults timeout: @config.timeout,
|
|
2170
|
+
metadata: @config.metadata,
|
|
2171
|
+
retry_policy: @config.retry_policy
|
|
2172
|
+
|
|
2173
|
+
@memorystore_stub.get_auth_token request, options do |result, operation|
|
|
2174
|
+
yield result, operation if block_given?
|
|
2175
|
+
end
|
|
2176
|
+
rescue ::Gapic::Rest::Error => e
|
|
2177
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
2178
|
+
end
|
|
2179
|
+
|
|
2180
|
+
##
|
|
2181
|
+
# Adds a token auth user for a token based auth enabled instance.
|
|
2182
|
+
#
|
|
2183
|
+
# @overload add_token_auth_user(request, options = nil)
|
|
2184
|
+
# Pass arguments to `add_token_auth_user` via a request object, either of type
|
|
2185
|
+
# {::Google::Cloud::Memorystore::V1::AddTokenAuthUserRequest} or an equivalent Hash.
|
|
2186
|
+
#
|
|
2187
|
+
# @param request [::Google::Cloud::Memorystore::V1::AddTokenAuthUserRequest, ::Hash]
|
|
2188
|
+
# A request object representing the call parameters. Required. To specify no
|
|
2189
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
2190
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
2191
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
2192
|
+
#
|
|
2193
|
+
# @overload add_token_auth_user(instance: nil, token_auth_user: nil)
|
|
2194
|
+
# Pass arguments to `add_token_auth_user` via keyword arguments. Note that at
|
|
2195
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
2196
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
2197
|
+
#
|
|
2198
|
+
# @param instance [::String]
|
|
2199
|
+
# Required. The instance resource that this token auth user will be added
|
|
2200
|
+
# for. Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
|
|
2201
|
+
# @param token_auth_user [::String]
|
|
2202
|
+
# Required. The name of the token auth user to add.
|
|
2203
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
2204
|
+
# @yieldparam result [::Gapic::Operation]
|
|
2205
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
2206
|
+
#
|
|
2207
|
+
# @return [::Gapic::Operation]
|
|
2208
|
+
#
|
|
2209
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
2210
|
+
#
|
|
2211
|
+
# @example Basic example
|
|
2212
|
+
# require "google/cloud/memorystore/v1"
|
|
2213
|
+
#
|
|
2214
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
2215
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
|
|
2216
|
+
#
|
|
2217
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
2218
|
+
# request = Google::Cloud::Memorystore::V1::AddTokenAuthUserRequest.new
|
|
2219
|
+
#
|
|
2220
|
+
# # Call the add_token_auth_user method.
|
|
2221
|
+
# result = client.add_token_auth_user request
|
|
2222
|
+
#
|
|
2223
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
2224
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
2225
|
+
# # Here is how to wait for a response.
|
|
2226
|
+
# result.wait_until_done! timeout: 60
|
|
2227
|
+
# if result.response?
|
|
2228
|
+
# p result.response
|
|
2229
|
+
# else
|
|
2230
|
+
# puts "No response received."
|
|
2231
|
+
# end
|
|
2232
|
+
#
|
|
2233
|
+
def add_token_auth_user request, options = nil
|
|
2234
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
2235
|
+
|
|
2236
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::AddTokenAuthUserRequest
|
|
2237
|
+
|
|
2238
|
+
# Converts hash and nil to an options object
|
|
2239
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
2240
|
+
|
|
2241
|
+
# Customize the options with defaults
|
|
2242
|
+
call_metadata = @config.rpcs.add_token_auth_user.metadata.to_h
|
|
2243
|
+
|
|
2244
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
2245
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
2246
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
2247
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
|
|
2248
|
+
transports_version_send: [:rest]
|
|
2249
|
+
|
|
2250
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
2251
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
2252
|
+
|
|
2253
|
+
options.apply_defaults timeout: @config.rpcs.add_token_auth_user.timeout,
|
|
2254
|
+
metadata: call_metadata,
|
|
2255
|
+
retry_policy: @config.rpcs.add_token_auth_user.retry_policy
|
|
2256
|
+
|
|
2257
|
+
options.apply_defaults timeout: @config.timeout,
|
|
2258
|
+
metadata: @config.metadata,
|
|
2259
|
+
retry_policy: @config.retry_policy
|
|
2260
|
+
|
|
2261
|
+
@memorystore_stub.add_token_auth_user request, options do |result, operation|
|
|
2262
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
|
2263
|
+
yield result, operation if block_given?
|
|
2264
|
+
throw :response, result
|
|
2265
|
+
end
|
|
2266
|
+
rescue ::Gapic::Rest::Error => e
|
|
2267
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
2268
|
+
end
|
|
2269
|
+
|
|
2270
|
+
##
|
|
2271
|
+
# Deletes a token auth user for a token based auth enabled instance.
|
|
2272
|
+
#
|
|
2273
|
+
# @overload delete_token_auth_user(request, options = nil)
|
|
2274
|
+
# Pass arguments to `delete_token_auth_user` via a request object, either of type
|
|
2275
|
+
# {::Google::Cloud::Memorystore::V1::DeleteTokenAuthUserRequest} or an equivalent Hash.
|
|
2276
|
+
#
|
|
2277
|
+
# @param request [::Google::Cloud::Memorystore::V1::DeleteTokenAuthUserRequest, ::Hash]
|
|
2278
|
+
# A request object representing the call parameters. Required. To specify no
|
|
2279
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
2280
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
2281
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
2282
|
+
#
|
|
2283
|
+
# @overload delete_token_auth_user(name: nil, request_id: nil, force: nil)
|
|
2284
|
+
# Pass arguments to `delete_token_auth_user` via keyword arguments. Note that at
|
|
2285
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
2286
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
2287
|
+
#
|
|
2288
|
+
# @param name [::String]
|
|
2289
|
+
# Required. The name of the token auth user to delete.
|
|
2290
|
+
# Format:
|
|
2291
|
+
# projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user}
|
|
2292
|
+
# @param request_id [::String]
|
|
2293
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
|
2294
|
+
# request ID so that if you must retry your request, the server will know to
|
|
2295
|
+
# ignore the request if it has already been completed. The server will
|
|
2296
|
+
# guarantee that for at least 60 minutes after the first request.
|
|
2297
|
+
#
|
|
2298
|
+
# For example, consider a situation where you make an initial request and the
|
|
2299
|
+
# request times out. If you make the request again with the same request
|
|
2300
|
+
# ID, the server can check if original operation with the same request ID
|
|
2301
|
+
# was received, and if so, will ignore the second request. This prevents
|
|
2302
|
+
# clients from accidentally creating duplicate commitments.
|
|
2303
|
+
#
|
|
2304
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
|
2305
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
|
2306
|
+
# @param force [::Boolean]
|
|
2307
|
+
# Optional. If set to true, any auth tokens from this user will also be
|
|
2308
|
+
# deleted. Otherwise, the request will only work if the user has no auth
|
|
2309
|
+
# tokens.
|
|
2310
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
2311
|
+
# @yieldparam result [::Gapic::Operation]
|
|
2312
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
2313
|
+
#
|
|
2314
|
+
# @return [::Gapic::Operation]
|
|
2315
|
+
#
|
|
2316
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
2317
|
+
#
|
|
2318
|
+
# @example Basic example
|
|
2319
|
+
# require "google/cloud/memorystore/v1"
|
|
2320
|
+
#
|
|
2321
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
2322
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
|
|
2323
|
+
#
|
|
2324
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
2325
|
+
# request = Google::Cloud::Memorystore::V1::DeleteTokenAuthUserRequest.new
|
|
2326
|
+
#
|
|
2327
|
+
# # Call the delete_token_auth_user method.
|
|
2328
|
+
# result = client.delete_token_auth_user request
|
|
2329
|
+
#
|
|
2330
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
2331
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
2332
|
+
# # Here is how to wait for a response.
|
|
2333
|
+
# result.wait_until_done! timeout: 60
|
|
2334
|
+
# if result.response?
|
|
2335
|
+
# p result.response
|
|
2336
|
+
# else
|
|
2337
|
+
# puts "No response received."
|
|
2338
|
+
# end
|
|
2339
|
+
#
|
|
2340
|
+
def delete_token_auth_user request, options = nil
|
|
2341
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
2342
|
+
|
|
2343
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::DeleteTokenAuthUserRequest
|
|
2344
|
+
|
|
2345
|
+
# Converts hash and nil to an options object
|
|
2346
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
2347
|
+
|
|
2348
|
+
# Customize the options with defaults
|
|
2349
|
+
call_metadata = @config.rpcs.delete_token_auth_user.metadata.to_h
|
|
2350
|
+
|
|
2351
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
2352
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
2353
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
2354
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
|
|
2355
|
+
transports_version_send: [:rest]
|
|
2356
|
+
|
|
2357
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
2358
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
2359
|
+
|
|
2360
|
+
options.apply_defaults timeout: @config.rpcs.delete_token_auth_user.timeout,
|
|
2361
|
+
metadata: call_metadata,
|
|
2362
|
+
retry_policy: @config.rpcs.delete_token_auth_user.retry_policy
|
|
2363
|
+
|
|
2364
|
+
options.apply_defaults timeout: @config.timeout,
|
|
2365
|
+
metadata: @config.metadata,
|
|
2366
|
+
retry_policy: @config.retry_policy
|
|
2367
|
+
|
|
2368
|
+
@memorystore_stub.delete_token_auth_user request, options do |result, operation|
|
|
2369
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
|
2370
|
+
yield result, operation if block_given?
|
|
2371
|
+
throw :response, result
|
|
2372
|
+
end
|
|
2373
|
+
rescue ::Gapic::Rest::Error => e
|
|
2374
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
2375
|
+
end
|
|
2376
|
+
|
|
2377
|
+
##
|
|
2378
|
+
# Adds a token for a user of a token based auth enabled instance.
|
|
2379
|
+
#
|
|
2380
|
+
# @overload add_auth_token(request, options = nil)
|
|
2381
|
+
# Pass arguments to `add_auth_token` via a request object, either of type
|
|
2382
|
+
# {::Google::Cloud::Memorystore::V1::AddAuthTokenRequest} or an equivalent Hash.
|
|
2383
|
+
#
|
|
2384
|
+
# @param request [::Google::Cloud::Memorystore::V1::AddAuthTokenRequest, ::Hash]
|
|
2385
|
+
# A request object representing the call parameters. Required. To specify no
|
|
2386
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
2387
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
2388
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
2389
|
+
#
|
|
2390
|
+
# @overload add_auth_token(token_auth_user: nil, auth_token: nil)
|
|
2391
|
+
# Pass arguments to `add_auth_token` via keyword arguments. Note that at
|
|
2392
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
2393
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
2394
|
+
#
|
|
2395
|
+
# @param token_auth_user [::String]
|
|
2396
|
+
# Required. The name of the token auth user resource that this token will be
|
|
2397
|
+
# added for.
|
|
2398
|
+
# @param auth_token [::Google::Cloud::Memorystore::V1::AuthToken, ::Hash]
|
|
2399
|
+
# Required. The auth token to add.
|
|
2400
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
2401
|
+
# @yieldparam result [::Gapic::Operation]
|
|
2402
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
2403
|
+
#
|
|
2404
|
+
# @return [::Gapic::Operation]
|
|
2405
|
+
#
|
|
2406
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
2407
|
+
#
|
|
2408
|
+
# @example Basic example
|
|
2409
|
+
# require "google/cloud/memorystore/v1"
|
|
2410
|
+
#
|
|
2411
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
2412
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
|
|
2413
|
+
#
|
|
2414
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
2415
|
+
# request = Google::Cloud::Memorystore::V1::AddAuthTokenRequest.new
|
|
2416
|
+
#
|
|
2417
|
+
# # Call the add_auth_token method.
|
|
2418
|
+
# result = client.add_auth_token request
|
|
2419
|
+
#
|
|
2420
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
2421
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
2422
|
+
# # Here is how to wait for a response.
|
|
2423
|
+
# result.wait_until_done! timeout: 60
|
|
2424
|
+
# if result.response?
|
|
2425
|
+
# p result.response
|
|
2426
|
+
# else
|
|
2427
|
+
# puts "No response received."
|
|
2428
|
+
# end
|
|
2429
|
+
#
|
|
2430
|
+
def add_auth_token request, options = nil
|
|
2431
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
2432
|
+
|
|
2433
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::AddAuthTokenRequest
|
|
2434
|
+
|
|
2435
|
+
# Converts hash and nil to an options object
|
|
2436
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
2437
|
+
|
|
2438
|
+
# Customize the options with defaults
|
|
2439
|
+
call_metadata = @config.rpcs.add_auth_token.metadata.to_h
|
|
2440
|
+
|
|
2441
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
2442
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
2443
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
2444
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
|
|
2445
|
+
transports_version_send: [:rest]
|
|
2446
|
+
|
|
2447
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
2448
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
2449
|
+
|
|
2450
|
+
options.apply_defaults timeout: @config.rpcs.add_auth_token.timeout,
|
|
2451
|
+
metadata: call_metadata,
|
|
2452
|
+
retry_policy: @config.rpcs.add_auth_token.retry_policy
|
|
2453
|
+
|
|
2454
|
+
options.apply_defaults timeout: @config.timeout,
|
|
2455
|
+
metadata: @config.metadata,
|
|
2456
|
+
retry_policy: @config.retry_policy
|
|
2457
|
+
|
|
2458
|
+
@memorystore_stub.add_auth_token request, options do |result, operation|
|
|
2459
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
|
2460
|
+
yield result, operation if block_given?
|
|
2461
|
+
throw :response, result
|
|
2462
|
+
end
|
|
2463
|
+
rescue ::Gapic::Rest::Error => e
|
|
2464
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
2465
|
+
end
|
|
2466
|
+
|
|
2467
|
+
##
|
|
2468
|
+
# Deletes a token for a user of a token based auth enabled instance.
|
|
2469
|
+
#
|
|
2470
|
+
# @overload delete_auth_token(request, options = nil)
|
|
2471
|
+
# Pass arguments to `delete_auth_token` via a request object, either of type
|
|
2472
|
+
# {::Google::Cloud::Memorystore::V1::DeleteAuthTokenRequest} or an equivalent Hash.
|
|
2473
|
+
#
|
|
2474
|
+
# @param request [::Google::Cloud::Memorystore::V1::DeleteAuthTokenRequest, ::Hash]
|
|
2475
|
+
# A request object representing the call parameters. Required. To specify no
|
|
2476
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
2477
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
2478
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
2479
|
+
#
|
|
2480
|
+
# @overload delete_auth_token(name: nil)
|
|
2481
|
+
# Pass arguments to `delete_auth_token` via keyword arguments. Note that at
|
|
2482
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
2483
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
2484
|
+
#
|
|
2485
|
+
# @param name [::String]
|
|
2486
|
+
# Required. The name of the token auth user resource that this token will be
|
|
2487
|
+
# deleted from. Format:
|
|
2488
|
+
# projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user}/authTokens/\\{name}
|
|
2489
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
2490
|
+
# @yieldparam result [::Gapic::Operation]
|
|
2491
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
2492
|
+
#
|
|
2493
|
+
# @return [::Gapic::Operation]
|
|
2494
|
+
#
|
|
2495
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
2496
|
+
#
|
|
2497
|
+
# @example Basic example
|
|
2498
|
+
# require "google/cloud/memorystore/v1"
|
|
2499
|
+
#
|
|
2500
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
2501
|
+
# client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
|
|
2502
|
+
#
|
|
2503
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
2504
|
+
# request = Google::Cloud::Memorystore::V1::DeleteAuthTokenRequest.new
|
|
2505
|
+
#
|
|
2506
|
+
# # Call the delete_auth_token method.
|
|
2507
|
+
# result = client.delete_auth_token request
|
|
2508
|
+
#
|
|
2509
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
2510
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
2511
|
+
# # Here is how to wait for a response.
|
|
2512
|
+
# result.wait_until_done! timeout: 60
|
|
2513
|
+
# if result.response?
|
|
2514
|
+
# p result.response
|
|
2515
|
+
# else
|
|
2516
|
+
# puts "No response received."
|
|
2517
|
+
# end
|
|
2518
|
+
#
|
|
2519
|
+
def delete_auth_token request, options = nil
|
|
2520
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
2521
|
+
|
|
2522
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::DeleteAuthTokenRequest
|
|
2523
|
+
|
|
2524
|
+
# Converts hash and nil to an options object
|
|
2525
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
2526
|
+
|
|
2527
|
+
# Customize the options with defaults
|
|
2528
|
+
call_metadata = @config.rpcs.delete_auth_token.metadata.to_h
|
|
2529
|
+
|
|
2530
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
2531
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
2532
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
2533
|
+
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
|
|
2534
|
+
transports_version_send: [:rest]
|
|
2535
|
+
|
|
2536
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
2537
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
2538
|
+
|
|
2539
|
+
options.apply_defaults timeout: @config.rpcs.delete_auth_token.timeout,
|
|
2540
|
+
metadata: call_metadata,
|
|
2541
|
+
retry_policy: @config.rpcs.delete_auth_token.retry_policy
|
|
2542
|
+
|
|
2543
|
+
options.apply_defaults timeout: @config.timeout,
|
|
2544
|
+
metadata: @config.metadata,
|
|
2545
|
+
retry_policy: @config.retry_policy
|
|
2546
|
+
|
|
2547
|
+
@memorystore_stub.delete_auth_token request, options do |result, operation|
|
|
2548
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
|
2549
|
+
yield result, operation if block_given?
|
|
2550
|
+
throw :response, result
|
|
2551
|
+
end
|
|
2552
|
+
rescue ::Gapic::Rest::Error => e
|
|
2553
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
2554
|
+
end
|
|
2555
|
+
|
|
1624
2556
|
##
|
|
1625
2557
|
# Configuration class for the Memorystore REST API.
|
|
1626
2558
|
#
|
|
@@ -1851,6 +2783,56 @@ module Google
|
|
|
1851
2783
|
# @return [::Gapic::Config::Method]
|
|
1852
2784
|
#
|
|
1853
2785
|
attr_reader :backup_instance
|
|
2786
|
+
##
|
|
2787
|
+
# RPC-specific configuration for `start_migration`
|
|
2788
|
+
# @return [::Gapic::Config::Method]
|
|
2789
|
+
#
|
|
2790
|
+
attr_reader :start_migration
|
|
2791
|
+
##
|
|
2792
|
+
# RPC-specific configuration for `finish_migration`
|
|
2793
|
+
# @return [::Gapic::Config::Method]
|
|
2794
|
+
#
|
|
2795
|
+
attr_reader :finish_migration
|
|
2796
|
+
##
|
|
2797
|
+
# RPC-specific configuration for `list_token_auth_users`
|
|
2798
|
+
# @return [::Gapic::Config::Method]
|
|
2799
|
+
#
|
|
2800
|
+
attr_reader :list_token_auth_users
|
|
2801
|
+
##
|
|
2802
|
+
# RPC-specific configuration for `get_token_auth_user`
|
|
2803
|
+
# @return [::Gapic::Config::Method]
|
|
2804
|
+
#
|
|
2805
|
+
attr_reader :get_token_auth_user
|
|
2806
|
+
##
|
|
2807
|
+
# RPC-specific configuration for `list_auth_tokens`
|
|
2808
|
+
# @return [::Gapic::Config::Method]
|
|
2809
|
+
#
|
|
2810
|
+
attr_reader :list_auth_tokens
|
|
2811
|
+
##
|
|
2812
|
+
# RPC-specific configuration for `get_auth_token`
|
|
2813
|
+
# @return [::Gapic::Config::Method]
|
|
2814
|
+
#
|
|
2815
|
+
attr_reader :get_auth_token
|
|
2816
|
+
##
|
|
2817
|
+
# RPC-specific configuration for `add_token_auth_user`
|
|
2818
|
+
# @return [::Gapic::Config::Method]
|
|
2819
|
+
#
|
|
2820
|
+
attr_reader :add_token_auth_user
|
|
2821
|
+
##
|
|
2822
|
+
# RPC-specific configuration for `delete_token_auth_user`
|
|
2823
|
+
# @return [::Gapic::Config::Method]
|
|
2824
|
+
#
|
|
2825
|
+
attr_reader :delete_token_auth_user
|
|
2826
|
+
##
|
|
2827
|
+
# RPC-specific configuration for `add_auth_token`
|
|
2828
|
+
# @return [::Gapic::Config::Method]
|
|
2829
|
+
#
|
|
2830
|
+
attr_reader :add_auth_token
|
|
2831
|
+
##
|
|
2832
|
+
# RPC-specific configuration for `delete_auth_token`
|
|
2833
|
+
# @return [::Gapic::Config::Method]
|
|
2834
|
+
#
|
|
2835
|
+
attr_reader :delete_auth_token
|
|
1854
2836
|
|
|
1855
2837
|
# @private
|
|
1856
2838
|
def initialize parent_rpcs = nil
|
|
@@ -1884,6 +2866,26 @@ module Google
|
|
|
1884
2866
|
@export_backup = ::Gapic::Config::Method.new export_backup_config
|
|
1885
2867
|
backup_instance_config = parent_rpcs.backup_instance if parent_rpcs.respond_to? :backup_instance
|
|
1886
2868
|
@backup_instance = ::Gapic::Config::Method.new backup_instance_config
|
|
2869
|
+
start_migration_config = parent_rpcs.start_migration if parent_rpcs.respond_to? :start_migration
|
|
2870
|
+
@start_migration = ::Gapic::Config::Method.new start_migration_config
|
|
2871
|
+
finish_migration_config = parent_rpcs.finish_migration if parent_rpcs.respond_to? :finish_migration
|
|
2872
|
+
@finish_migration = ::Gapic::Config::Method.new finish_migration_config
|
|
2873
|
+
list_token_auth_users_config = parent_rpcs.list_token_auth_users if parent_rpcs.respond_to? :list_token_auth_users
|
|
2874
|
+
@list_token_auth_users = ::Gapic::Config::Method.new list_token_auth_users_config
|
|
2875
|
+
get_token_auth_user_config = parent_rpcs.get_token_auth_user if parent_rpcs.respond_to? :get_token_auth_user
|
|
2876
|
+
@get_token_auth_user = ::Gapic::Config::Method.new get_token_auth_user_config
|
|
2877
|
+
list_auth_tokens_config = parent_rpcs.list_auth_tokens if parent_rpcs.respond_to? :list_auth_tokens
|
|
2878
|
+
@list_auth_tokens = ::Gapic::Config::Method.new list_auth_tokens_config
|
|
2879
|
+
get_auth_token_config = parent_rpcs.get_auth_token if parent_rpcs.respond_to? :get_auth_token
|
|
2880
|
+
@get_auth_token = ::Gapic::Config::Method.new get_auth_token_config
|
|
2881
|
+
add_token_auth_user_config = parent_rpcs.add_token_auth_user if parent_rpcs.respond_to? :add_token_auth_user
|
|
2882
|
+
@add_token_auth_user = ::Gapic::Config::Method.new add_token_auth_user_config
|
|
2883
|
+
delete_token_auth_user_config = parent_rpcs.delete_token_auth_user if parent_rpcs.respond_to? :delete_token_auth_user
|
|
2884
|
+
@delete_token_auth_user = ::Gapic::Config::Method.new delete_token_auth_user_config
|
|
2885
|
+
add_auth_token_config = parent_rpcs.add_auth_token if parent_rpcs.respond_to? :add_auth_token
|
|
2886
|
+
@add_auth_token = ::Gapic::Config::Method.new add_auth_token_config
|
|
2887
|
+
delete_auth_token_config = parent_rpcs.delete_auth_token if parent_rpcs.respond_to? :delete_auth_token
|
|
2888
|
+
@delete_auth_token = ::Gapic::Config::Method.new delete_auth_token_config
|
|
1887
2889
|
|
|
1888
2890
|
yield self if block_given?
|
|
1889
2891
|
end
|