google-cloud-memorystore-v1 1.1.1 → 1.2.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.
@@ -803,6 +803,743 @@ module Google
803
803
  raise ::Google::Cloud::Error.from_error(e)
804
804
  end
805
805
 
806
+ ##
807
+ # Reschedules upcoming maintenance event.
808
+ #
809
+ # @overload reschedule_maintenance(request, options = nil)
810
+ # Pass arguments to `reschedule_maintenance` via a request object, either of type
811
+ # {::Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest} or an equivalent Hash.
812
+ #
813
+ # @param request [::Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest, ::Hash]
814
+ # A request object representing the call parameters. Required. To specify no
815
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
816
+ # @param options [::Gapic::CallOptions, ::Hash]
817
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
818
+ #
819
+ # @overload reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil)
820
+ # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at
821
+ # least one keyword argument is required. To specify no parameters, or to keep all
822
+ # the default parameter values, pass an empty Hash as a request object (see above).
823
+ #
824
+ # @param name [::String]
825
+ # Required. Name of the instance to reschedule maintenance for:
826
+ # `projects/{project}/locations/{location_id}/instances/{instance}`
827
+ # @param reschedule_type [::Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest::RescheduleType]
828
+ # Required. If reschedule type is SPECIFIC_TIME, schedule_time must be set.
829
+ # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash]
830
+ # Optional. Timestamp when the maintenance shall be rescheduled to if
831
+ # reschedule_type=SPECIFIC_TIME, in RFC 3339 format.
832
+ # Example: `2012-11-15T16:19:00.094Z`.
833
+ # @yield [result, operation] Access the result along with the TransportOperation object
834
+ # @yieldparam result [::Gapic::Operation]
835
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
836
+ #
837
+ # @return [::Gapic::Operation]
838
+ #
839
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
840
+ #
841
+ # @example Basic example
842
+ # require "google/cloud/memorystore/v1"
843
+ #
844
+ # # Create a client object. The client can be reused for multiple calls.
845
+ # client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
846
+ #
847
+ # # Create a request. To set request fields, pass in keyword arguments.
848
+ # request = Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest.new
849
+ #
850
+ # # Call the reschedule_maintenance method.
851
+ # result = client.reschedule_maintenance request
852
+ #
853
+ # # The returned object is of type Gapic::Operation. You can use it to
854
+ # # check the status of an operation, cancel it, or wait for results.
855
+ # # Here is how to wait for a response.
856
+ # result.wait_until_done! timeout: 60
857
+ # if result.response?
858
+ # p result.response
859
+ # else
860
+ # puts "No response received."
861
+ # end
862
+ #
863
+ def reschedule_maintenance request, options = nil
864
+ raise ::ArgumentError, "request must be provided" if request.nil?
865
+
866
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest
867
+
868
+ # Converts hash and nil to an options object
869
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
870
+
871
+ # Customize the options with defaults
872
+ call_metadata = @config.rpcs.reschedule_maintenance.metadata.to_h
873
+
874
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
875
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
876
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
877
+ gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
878
+ transports_version_send: [:rest]
879
+
880
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
881
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
882
+
883
+ options.apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout,
884
+ metadata: call_metadata,
885
+ retry_policy: @config.rpcs.reschedule_maintenance.retry_policy
886
+
887
+ options.apply_defaults timeout: @config.timeout,
888
+ metadata: @config.metadata,
889
+ retry_policy: @config.retry_policy
890
+
891
+ @memorystore_stub.reschedule_maintenance request, options do |result, operation|
892
+ result = ::Gapic::Operation.new result, @operations_client, options: options
893
+ yield result, operation if block_given?
894
+ throw :response, result
895
+ end
896
+ rescue ::Gapic::Rest::Error => e
897
+ raise ::Google::Cloud::Error.from_error(e)
898
+ end
899
+
900
+ ##
901
+ # Lists all backup collections owned by a consumer project in either the
902
+ # specified location (region) or all locations.
903
+ #
904
+ # If `location_id` is specified as `-` (wildcard), then all regions
905
+ # available to the project are queried, and the results are aggregated.
906
+ #
907
+ # @overload list_backup_collections(request, options = nil)
908
+ # Pass arguments to `list_backup_collections` via a request object, either of type
909
+ # {::Google::Cloud::Memorystore::V1::ListBackupCollectionsRequest} or an equivalent Hash.
910
+ #
911
+ # @param request [::Google::Cloud::Memorystore::V1::ListBackupCollectionsRequest, ::Hash]
912
+ # A request object representing the call parameters. Required. To specify no
913
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
914
+ # @param options [::Gapic::CallOptions, ::Hash]
915
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
916
+ #
917
+ # @overload list_backup_collections(parent: nil, page_size: nil, page_token: nil)
918
+ # Pass arguments to `list_backup_collections` via keyword arguments. Note that at
919
+ # least one keyword argument is required. To specify no parameters, or to keep all
920
+ # the default parameter values, pass an empty Hash as a request object (see above).
921
+ #
922
+ # @param parent [::String]
923
+ # Required. The resource name of the backupCollection location using the
924
+ # form:
925
+ # `projects/{project_id}/locations/{location_id}`
926
+ # where `location_id` refers to a Google Cloud region.
927
+ # @param page_size [::Integer]
928
+ # Optional. The maximum number of items to return.
929
+ #
930
+ # If not specified, a default value of 1000 will be used by the service.
931
+ # Regardless of the page_size value, the response may include a partial list
932
+ # and a caller should only rely on response's
933
+ # {::Google::Cloud::Memorystore::V1::ListBackupCollectionsResponse#next_page_token `next_page_token`}
934
+ # to determine if there are more clusters left to be queried.
935
+ # @param page_token [::String]
936
+ # Optional. The `next_page_token` value returned from a previous
937
+ # [ListBackupCollections] request, if any.
938
+ # @yield [result, operation] Access the result along with the TransportOperation object
939
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::BackupCollection>]
940
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
941
+ #
942
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::BackupCollection>]
943
+ #
944
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
945
+ #
946
+ # @example Basic example
947
+ # require "google/cloud/memorystore/v1"
948
+ #
949
+ # # Create a client object. The client can be reused for multiple calls.
950
+ # client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
951
+ #
952
+ # # Create a request. To set request fields, pass in keyword arguments.
953
+ # request = Google::Cloud::Memorystore::V1::ListBackupCollectionsRequest.new
954
+ #
955
+ # # Call the list_backup_collections method.
956
+ # result = client.list_backup_collections request
957
+ #
958
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
959
+ # # over elements, and API calls will be issued to fetch pages as needed.
960
+ # result.each do |item|
961
+ # # Each element is of type ::Google::Cloud::Memorystore::V1::BackupCollection.
962
+ # p item
963
+ # end
964
+ #
965
+ def list_backup_collections request, options = nil
966
+ raise ::ArgumentError, "request must be provided" if request.nil?
967
+
968
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::ListBackupCollectionsRequest
969
+
970
+ # Converts hash and nil to an options object
971
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
972
+
973
+ # Customize the options with defaults
974
+ call_metadata = @config.rpcs.list_backup_collections.metadata.to_h
975
+
976
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
977
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
978
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
979
+ gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
980
+ transports_version_send: [:rest]
981
+
982
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
983
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
984
+
985
+ options.apply_defaults timeout: @config.rpcs.list_backup_collections.timeout,
986
+ metadata: call_metadata,
987
+ retry_policy: @config.rpcs.list_backup_collections.retry_policy
988
+
989
+ options.apply_defaults timeout: @config.timeout,
990
+ metadata: @config.metadata,
991
+ retry_policy: @config.retry_policy
992
+
993
+ @memorystore_stub.list_backup_collections request, options do |result, operation|
994
+ result = ::Gapic::Rest::PagedEnumerable.new @memorystore_stub, :list_backup_collections, "backup_collections", request, result, options
995
+ yield result, operation if block_given?
996
+ throw :response, result
997
+ end
998
+ rescue ::Gapic::Rest::Error => e
999
+ raise ::Google::Cloud::Error.from_error(e)
1000
+ end
1001
+
1002
+ ##
1003
+ # Get a backup collection.
1004
+ #
1005
+ # @overload get_backup_collection(request, options = nil)
1006
+ # Pass arguments to `get_backup_collection` via a request object, either of type
1007
+ # {::Google::Cloud::Memorystore::V1::GetBackupCollectionRequest} or an equivalent Hash.
1008
+ #
1009
+ # @param request [::Google::Cloud::Memorystore::V1::GetBackupCollectionRequest, ::Hash]
1010
+ # A request object representing the call parameters. Required. To specify no
1011
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1012
+ # @param options [::Gapic::CallOptions, ::Hash]
1013
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1014
+ #
1015
+ # @overload get_backup_collection(name: nil)
1016
+ # Pass arguments to `get_backup_collection` via keyword arguments. Note that at
1017
+ # least one keyword argument is required. To specify no parameters, or to keep all
1018
+ # the default parameter values, pass an empty Hash as a request object (see above).
1019
+ #
1020
+ # @param name [::String]
1021
+ # Required. Instance backupCollection resource name using the form:
1022
+ # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}`
1023
+ # where `location_id` refers to a Google Cloud region.
1024
+ # @yield [result, operation] Access the result along with the TransportOperation object
1025
+ # @yieldparam result [::Google::Cloud::Memorystore::V1::BackupCollection]
1026
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1027
+ #
1028
+ # @return [::Google::Cloud::Memorystore::V1::BackupCollection]
1029
+ #
1030
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1031
+ #
1032
+ # @example Basic example
1033
+ # require "google/cloud/memorystore/v1"
1034
+ #
1035
+ # # Create a client object. The client can be reused for multiple calls.
1036
+ # client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
1037
+ #
1038
+ # # Create a request. To set request fields, pass in keyword arguments.
1039
+ # request = Google::Cloud::Memorystore::V1::GetBackupCollectionRequest.new
1040
+ #
1041
+ # # Call the get_backup_collection method.
1042
+ # result = client.get_backup_collection request
1043
+ #
1044
+ # # The returned object is of type Google::Cloud::Memorystore::V1::BackupCollection.
1045
+ # p result
1046
+ #
1047
+ def get_backup_collection request, options = nil
1048
+ raise ::ArgumentError, "request must be provided" if request.nil?
1049
+
1050
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::GetBackupCollectionRequest
1051
+
1052
+ # Converts hash and nil to an options object
1053
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1054
+
1055
+ # Customize the options with defaults
1056
+ call_metadata = @config.rpcs.get_backup_collection.metadata.to_h
1057
+
1058
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1059
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1060
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1061
+ gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
1062
+ transports_version_send: [:rest]
1063
+
1064
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1065
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1066
+
1067
+ options.apply_defaults timeout: @config.rpcs.get_backup_collection.timeout,
1068
+ metadata: call_metadata,
1069
+ retry_policy: @config.rpcs.get_backup_collection.retry_policy
1070
+
1071
+ options.apply_defaults timeout: @config.timeout,
1072
+ metadata: @config.metadata,
1073
+ retry_policy: @config.retry_policy
1074
+
1075
+ @memorystore_stub.get_backup_collection request, options do |result, operation|
1076
+ yield result, operation if block_given?
1077
+ end
1078
+ rescue ::Gapic::Rest::Error => e
1079
+ raise ::Google::Cloud::Error.from_error(e)
1080
+ end
1081
+
1082
+ ##
1083
+ # Lists all backups owned by a backup collection.
1084
+ #
1085
+ # @overload list_backups(request, options = nil)
1086
+ # Pass arguments to `list_backups` via a request object, either of type
1087
+ # {::Google::Cloud::Memorystore::V1::ListBackupsRequest} or an equivalent Hash.
1088
+ #
1089
+ # @param request [::Google::Cloud::Memorystore::V1::ListBackupsRequest, ::Hash]
1090
+ # A request object representing the call parameters. Required. To specify no
1091
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1092
+ # @param options [::Gapic::CallOptions, ::Hash]
1093
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1094
+ #
1095
+ # @overload list_backups(parent: nil, page_size: nil, page_token: nil)
1096
+ # Pass arguments to `list_backups` via keyword arguments. Note that at
1097
+ # least one keyword argument is required. To specify no parameters, or to keep all
1098
+ # the default parameter values, pass an empty Hash as a request object (see above).
1099
+ #
1100
+ # @param parent [::String]
1101
+ # Required. The resource name of the backupCollection using the form:
1102
+ # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}`
1103
+ # @param page_size [::Integer]
1104
+ # Optional. The maximum number of items to return.
1105
+ #
1106
+ # If not specified, a default value of 1000 will be used by the service.
1107
+ # Regardless of the page_size value, the response may include a partial list
1108
+ # and a caller should only rely on response's
1109
+ # {::Google::Cloud::Memorystore::V1::ListBackupsResponse#next_page_token `next_page_token`}
1110
+ # to determine if there are more clusters left to be queried.
1111
+ # @param page_token [::String]
1112
+ # Optional. The `next_page_token` value returned from a previous
1113
+ # [ListBackupCollections] request, if any.
1114
+ # @yield [result, operation] Access the result along with the TransportOperation object
1115
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::Backup>]
1116
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1117
+ #
1118
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::Backup>]
1119
+ #
1120
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1121
+ #
1122
+ # @example Basic example
1123
+ # require "google/cloud/memorystore/v1"
1124
+ #
1125
+ # # Create a client object. The client can be reused for multiple calls.
1126
+ # client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
1127
+ #
1128
+ # # Create a request. To set request fields, pass in keyword arguments.
1129
+ # request = Google::Cloud::Memorystore::V1::ListBackupsRequest.new
1130
+ #
1131
+ # # Call the list_backups method.
1132
+ # result = client.list_backups request
1133
+ #
1134
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1135
+ # # over elements, and API calls will be issued to fetch pages as needed.
1136
+ # result.each do |item|
1137
+ # # Each element is of type ::Google::Cloud::Memorystore::V1::Backup.
1138
+ # p item
1139
+ # end
1140
+ #
1141
+ def list_backups request, options = nil
1142
+ raise ::ArgumentError, "request must be provided" if request.nil?
1143
+
1144
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::ListBackupsRequest
1145
+
1146
+ # Converts hash and nil to an options object
1147
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1148
+
1149
+ # Customize the options with defaults
1150
+ call_metadata = @config.rpcs.list_backups.metadata.to_h
1151
+
1152
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1153
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1154
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1155
+ gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
1156
+ transports_version_send: [:rest]
1157
+
1158
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1159
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1160
+
1161
+ options.apply_defaults timeout: @config.rpcs.list_backups.timeout,
1162
+ metadata: call_metadata,
1163
+ retry_policy: @config.rpcs.list_backups.retry_policy
1164
+
1165
+ options.apply_defaults timeout: @config.timeout,
1166
+ metadata: @config.metadata,
1167
+ retry_policy: @config.retry_policy
1168
+
1169
+ @memorystore_stub.list_backups request, options do |result, operation|
1170
+ result = ::Gapic::Rest::PagedEnumerable.new @memorystore_stub, :list_backups, "backups", request, result, options
1171
+ yield result, operation if block_given?
1172
+ throw :response, result
1173
+ end
1174
+ rescue ::Gapic::Rest::Error => e
1175
+ raise ::Google::Cloud::Error.from_error(e)
1176
+ end
1177
+
1178
+ ##
1179
+ # Gets the details of a specific backup.
1180
+ #
1181
+ # @overload get_backup(request, options = nil)
1182
+ # Pass arguments to `get_backup` via a request object, either of type
1183
+ # {::Google::Cloud::Memorystore::V1::GetBackupRequest} or an equivalent Hash.
1184
+ #
1185
+ # @param request [::Google::Cloud::Memorystore::V1::GetBackupRequest, ::Hash]
1186
+ # A request object representing the call parameters. Required. To specify no
1187
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1188
+ # @param options [::Gapic::CallOptions, ::Hash]
1189
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1190
+ #
1191
+ # @overload get_backup(name: nil)
1192
+ # Pass arguments to `get_backup` via keyword arguments. Note that at
1193
+ # least one keyword argument is required. To specify no parameters, or to keep all
1194
+ # the default parameter values, pass an empty Hash as a request object (see above).
1195
+ #
1196
+ # @param name [::String]
1197
+ # Required. Instance backup resource name using the form:
1198
+ # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}`
1199
+ # @yield [result, operation] Access the result along with the TransportOperation object
1200
+ # @yieldparam result [::Google::Cloud::Memorystore::V1::Backup]
1201
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1202
+ #
1203
+ # @return [::Google::Cloud::Memorystore::V1::Backup]
1204
+ #
1205
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1206
+ #
1207
+ # @example Basic example
1208
+ # require "google/cloud/memorystore/v1"
1209
+ #
1210
+ # # Create a client object. The client can be reused for multiple calls.
1211
+ # client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
1212
+ #
1213
+ # # Create a request. To set request fields, pass in keyword arguments.
1214
+ # request = Google::Cloud::Memorystore::V1::GetBackupRequest.new
1215
+ #
1216
+ # # Call the get_backup method.
1217
+ # result = client.get_backup request
1218
+ #
1219
+ # # The returned object is of type Google::Cloud::Memorystore::V1::Backup.
1220
+ # p result
1221
+ #
1222
+ def get_backup request, options = nil
1223
+ raise ::ArgumentError, "request must be provided" if request.nil?
1224
+
1225
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::GetBackupRequest
1226
+
1227
+ # Converts hash and nil to an options object
1228
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1229
+
1230
+ # Customize the options with defaults
1231
+ call_metadata = @config.rpcs.get_backup.metadata.to_h
1232
+
1233
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1234
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1235
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1236
+ gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
1237
+ transports_version_send: [:rest]
1238
+
1239
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1240
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1241
+
1242
+ options.apply_defaults timeout: @config.rpcs.get_backup.timeout,
1243
+ metadata: call_metadata,
1244
+ retry_policy: @config.rpcs.get_backup.retry_policy
1245
+
1246
+ options.apply_defaults timeout: @config.timeout,
1247
+ metadata: @config.metadata,
1248
+ retry_policy: @config.retry_policy
1249
+
1250
+ @memorystore_stub.get_backup request, options do |result, operation|
1251
+ yield result, operation if block_given?
1252
+ end
1253
+ rescue ::Gapic::Rest::Error => e
1254
+ raise ::Google::Cloud::Error.from_error(e)
1255
+ end
1256
+
1257
+ ##
1258
+ # Deletes a specific backup.
1259
+ #
1260
+ # @overload delete_backup(request, options = nil)
1261
+ # Pass arguments to `delete_backup` via a request object, either of type
1262
+ # {::Google::Cloud::Memorystore::V1::DeleteBackupRequest} or an equivalent Hash.
1263
+ #
1264
+ # @param request [::Google::Cloud::Memorystore::V1::DeleteBackupRequest, ::Hash]
1265
+ # A request object representing the call parameters. Required. To specify no
1266
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1267
+ # @param options [::Gapic::CallOptions, ::Hash]
1268
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1269
+ #
1270
+ # @overload delete_backup(name: nil, request_id: nil)
1271
+ # Pass arguments to `delete_backup` via keyword arguments. Note that at
1272
+ # least one keyword argument is required. To specify no parameters, or to keep all
1273
+ # the default parameter values, pass an empty Hash as a request object (see above).
1274
+ #
1275
+ # @param name [::String]
1276
+ # Required. Instance backup resource name using the form:
1277
+ # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}`
1278
+ # @param request_id [::String]
1279
+ # Optional. Idempotent request UUID.
1280
+ # @yield [result, operation] Access the result along with the TransportOperation object
1281
+ # @yieldparam result [::Gapic::Operation]
1282
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1283
+ #
1284
+ # @return [::Gapic::Operation]
1285
+ #
1286
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1287
+ #
1288
+ # @example Basic example
1289
+ # require "google/cloud/memorystore/v1"
1290
+ #
1291
+ # # Create a client object. The client can be reused for multiple calls.
1292
+ # client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
1293
+ #
1294
+ # # Create a request. To set request fields, pass in keyword arguments.
1295
+ # request = Google::Cloud::Memorystore::V1::DeleteBackupRequest.new
1296
+ #
1297
+ # # Call the delete_backup method.
1298
+ # result = client.delete_backup request
1299
+ #
1300
+ # # The returned object is of type Gapic::Operation. You can use it to
1301
+ # # check the status of an operation, cancel it, or wait for results.
1302
+ # # Here is how to wait for a response.
1303
+ # result.wait_until_done! timeout: 60
1304
+ # if result.response?
1305
+ # p result.response
1306
+ # else
1307
+ # puts "No response received."
1308
+ # end
1309
+ #
1310
+ def delete_backup request, options = nil
1311
+ raise ::ArgumentError, "request must be provided" if request.nil?
1312
+
1313
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::DeleteBackupRequest
1314
+
1315
+ # Converts hash and nil to an options object
1316
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1317
+
1318
+ # Customize the options with defaults
1319
+ call_metadata = @config.rpcs.delete_backup.metadata.to_h
1320
+
1321
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1322
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1323
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1324
+ gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
1325
+ transports_version_send: [:rest]
1326
+
1327
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1328
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1329
+
1330
+ options.apply_defaults timeout: @config.rpcs.delete_backup.timeout,
1331
+ metadata: call_metadata,
1332
+ retry_policy: @config.rpcs.delete_backup.retry_policy
1333
+
1334
+ options.apply_defaults timeout: @config.timeout,
1335
+ metadata: @config.metadata,
1336
+ retry_policy: @config.retry_policy
1337
+
1338
+ @memorystore_stub.delete_backup request, options do |result, operation|
1339
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1340
+ yield result, operation if block_given?
1341
+ throw :response, result
1342
+ end
1343
+ rescue ::Gapic::Rest::Error => e
1344
+ raise ::Google::Cloud::Error.from_error(e)
1345
+ end
1346
+
1347
+ ##
1348
+ # Exports a specific backup to a customer target Cloud Storage URI.
1349
+ #
1350
+ # @overload export_backup(request, options = nil)
1351
+ # Pass arguments to `export_backup` via a request object, either of type
1352
+ # {::Google::Cloud::Memorystore::V1::ExportBackupRequest} or an equivalent Hash.
1353
+ #
1354
+ # @param request [::Google::Cloud::Memorystore::V1::ExportBackupRequest, ::Hash]
1355
+ # A request object representing the call parameters. Required. To specify no
1356
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1357
+ # @param options [::Gapic::CallOptions, ::Hash]
1358
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1359
+ #
1360
+ # @overload export_backup(gcs_bucket: nil, name: nil)
1361
+ # Pass arguments to `export_backup` via keyword arguments. Note that at
1362
+ # least one keyword argument is required. To specify no parameters, or to keep all
1363
+ # the default parameter values, pass an empty Hash as a request object (see above).
1364
+ #
1365
+ # @param gcs_bucket [::String]
1366
+ # Google Cloud Storage bucket, like "my-bucket".
1367
+ # @param name [::String]
1368
+ # Required. Instance backup resource name using the form:
1369
+ # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}`
1370
+ # @yield [result, operation] Access the result along with the TransportOperation object
1371
+ # @yieldparam result [::Gapic::Operation]
1372
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1373
+ #
1374
+ # @return [::Gapic::Operation]
1375
+ #
1376
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1377
+ #
1378
+ # @example Basic example
1379
+ # require "google/cloud/memorystore/v1"
1380
+ #
1381
+ # # Create a client object. The client can be reused for multiple calls.
1382
+ # client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
1383
+ #
1384
+ # # Create a request. To set request fields, pass in keyword arguments.
1385
+ # request = Google::Cloud::Memorystore::V1::ExportBackupRequest.new
1386
+ #
1387
+ # # Call the export_backup method.
1388
+ # result = client.export_backup request
1389
+ #
1390
+ # # The returned object is of type Gapic::Operation. You can use it to
1391
+ # # check the status of an operation, cancel it, or wait for results.
1392
+ # # Here is how to wait for a response.
1393
+ # result.wait_until_done! timeout: 60
1394
+ # if result.response?
1395
+ # p result.response
1396
+ # else
1397
+ # puts "No response received."
1398
+ # end
1399
+ #
1400
+ def export_backup request, options = nil
1401
+ raise ::ArgumentError, "request must be provided" if request.nil?
1402
+
1403
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::ExportBackupRequest
1404
+
1405
+ # Converts hash and nil to an options object
1406
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1407
+
1408
+ # Customize the options with defaults
1409
+ call_metadata = @config.rpcs.export_backup.metadata.to_h
1410
+
1411
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1412
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1413
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1414
+ gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
1415
+ transports_version_send: [:rest]
1416
+
1417
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1418
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1419
+
1420
+ options.apply_defaults timeout: @config.rpcs.export_backup.timeout,
1421
+ metadata: call_metadata,
1422
+ retry_policy: @config.rpcs.export_backup.retry_policy
1423
+
1424
+ options.apply_defaults timeout: @config.timeout,
1425
+ metadata: @config.metadata,
1426
+ retry_policy: @config.retry_policy
1427
+
1428
+ @memorystore_stub.export_backup request, options do |result, operation|
1429
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1430
+ yield result, operation if block_given?
1431
+ throw :response, result
1432
+ end
1433
+ rescue ::Gapic::Rest::Error => e
1434
+ raise ::Google::Cloud::Error.from_error(e)
1435
+ end
1436
+
1437
+ ##
1438
+ # Backup Instance.
1439
+ # If this is the first time a backup is being created, a backup collection
1440
+ # will be created at the backend, and this backup belongs to this collection.
1441
+ # Both collection and backup will have a resource name. Backup will be
1442
+ # executed for each shard. A replica (primary if nonHA) will be selected to
1443
+ # perform the execution. Backup call will be rejected if there is an ongoing
1444
+ # backup or update operation. Be aware that during preview, if the instance's
1445
+ # internal software version is too old, critical update will be performed
1446
+ # before actual backup. Once the internal software version is updated to the
1447
+ # minimum version required by the backup feature, subsequent backups will not
1448
+ # require critical update. After preview, there will be no critical update
1449
+ # needed for backup.
1450
+ #
1451
+ # @overload backup_instance(request, options = nil)
1452
+ # Pass arguments to `backup_instance` via a request object, either of type
1453
+ # {::Google::Cloud::Memorystore::V1::BackupInstanceRequest} or an equivalent Hash.
1454
+ #
1455
+ # @param request [::Google::Cloud::Memorystore::V1::BackupInstanceRequest, ::Hash]
1456
+ # A request object representing the call parameters. Required. To specify no
1457
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1458
+ # @param options [::Gapic::CallOptions, ::Hash]
1459
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1460
+ #
1461
+ # @overload backup_instance(name: nil, ttl: nil, backup_id: nil)
1462
+ # Pass arguments to `backup_instance` via keyword arguments. Note that at
1463
+ # least one keyword argument is required. To specify no parameters, or to keep all
1464
+ # the default parameter values, pass an empty Hash as a request object (see above).
1465
+ #
1466
+ # @param name [::String]
1467
+ # Required. Instance resource name using the form:
1468
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
1469
+ # where `location_id` refers to a Google Cloud region.
1470
+ # @param ttl [::Google::Protobuf::Duration, ::Hash]
1471
+ # Optional. TTL for the backup to expire. Value range is 1 day to 100 years.
1472
+ # If not specified, the default value is 100 years.
1473
+ # @param backup_id [::String]
1474
+ # Optional. The id of the backup to be created. If not specified, the
1475
+ # default value ([YYYYMMDDHHMMSS]_[Shortened Instance UID] is used.
1476
+ # @yield [result, operation] Access the result along with the TransportOperation object
1477
+ # @yieldparam result [::Gapic::Operation]
1478
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1479
+ #
1480
+ # @return [::Gapic::Operation]
1481
+ #
1482
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1483
+ #
1484
+ # @example Basic example
1485
+ # require "google/cloud/memorystore/v1"
1486
+ #
1487
+ # # Create a client object. The client can be reused for multiple calls.
1488
+ # client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
1489
+ #
1490
+ # # Create a request. To set request fields, pass in keyword arguments.
1491
+ # request = Google::Cloud::Memorystore::V1::BackupInstanceRequest.new
1492
+ #
1493
+ # # Call the backup_instance method.
1494
+ # result = client.backup_instance request
1495
+ #
1496
+ # # The returned object is of type Gapic::Operation. You can use it to
1497
+ # # check the status of an operation, cancel it, or wait for results.
1498
+ # # Here is how to wait for a response.
1499
+ # result.wait_until_done! timeout: 60
1500
+ # if result.response?
1501
+ # p result.response
1502
+ # else
1503
+ # puts "No response received."
1504
+ # end
1505
+ #
1506
+ def backup_instance request, options = nil
1507
+ raise ::ArgumentError, "request must be provided" if request.nil?
1508
+
1509
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::BackupInstanceRequest
1510
+
1511
+ # Converts hash and nil to an options object
1512
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1513
+
1514
+ # Customize the options with defaults
1515
+ call_metadata = @config.rpcs.backup_instance.metadata.to_h
1516
+
1517
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1518
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1519
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1520
+ gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
1521
+ transports_version_send: [:rest]
1522
+
1523
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1524
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1525
+
1526
+ options.apply_defaults timeout: @config.rpcs.backup_instance.timeout,
1527
+ metadata: call_metadata,
1528
+ retry_policy: @config.rpcs.backup_instance.retry_policy
1529
+
1530
+ options.apply_defaults timeout: @config.timeout,
1531
+ metadata: @config.metadata,
1532
+ retry_policy: @config.retry_policy
1533
+
1534
+ @memorystore_stub.backup_instance request, options do |result, operation|
1535
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1536
+ yield result, operation if block_given?
1537
+ throw :response, result
1538
+ end
1539
+ rescue ::Gapic::Rest::Error => e
1540
+ raise ::Google::Cloud::Error.from_error(e)
1541
+ end
1542
+
806
1543
  ##
807
1544
  # Configuration class for the Memorystore REST API.
808
1545
  #
@@ -986,6 +1723,46 @@ module Google
986
1723
  # @return [::Gapic::Config::Method]
987
1724
  #
988
1725
  attr_reader :get_certificate_authority
1726
+ ##
1727
+ # RPC-specific configuration for `reschedule_maintenance`
1728
+ # @return [::Gapic::Config::Method]
1729
+ #
1730
+ attr_reader :reschedule_maintenance
1731
+ ##
1732
+ # RPC-specific configuration for `list_backup_collections`
1733
+ # @return [::Gapic::Config::Method]
1734
+ #
1735
+ attr_reader :list_backup_collections
1736
+ ##
1737
+ # RPC-specific configuration for `get_backup_collection`
1738
+ # @return [::Gapic::Config::Method]
1739
+ #
1740
+ attr_reader :get_backup_collection
1741
+ ##
1742
+ # RPC-specific configuration for `list_backups`
1743
+ # @return [::Gapic::Config::Method]
1744
+ #
1745
+ attr_reader :list_backups
1746
+ ##
1747
+ # RPC-specific configuration for `get_backup`
1748
+ # @return [::Gapic::Config::Method]
1749
+ #
1750
+ attr_reader :get_backup
1751
+ ##
1752
+ # RPC-specific configuration for `delete_backup`
1753
+ # @return [::Gapic::Config::Method]
1754
+ #
1755
+ attr_reader :delete_backup
1756
+ ##
1757
+ # RPC-specific configuration for `export_backup`
1758
+ # @return [::Gapic::Config::Method]
1759
+ #
1760
+ attr_reader :export_backup
1761
+ ##
1762
+ # RPC-specific configuration for `backup_instance`
1763
+ # @return [::Gapic::Config::Method]
1764
+ #
1765
+ attr_reader :backup_instance
989
1766
 
990
1767
  # @private
991
1768
  def initialize parent_rpcs = nil
@@ -1001,6 +1778,22 @@ module Google
1001
1778
  @delete_instance = ::Gapic::Config::Method.new delete_instance_config
1002
1779
  get_certificate_authority_config = parent_rpcs.get_certificate_authority if parent_rpcs.respond_to? :get_certificate_authority
1003
1780
  @get_certificate_authority = ::Gapic::Config::Method.new get_certificate_authority_config
1781
+ reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance
1782
+ @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config
1783
+ list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections
1784
+ @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config
1785
+ get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection
1786
+ @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config
1787
+ list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
1788
+ @list_backups = ::Gapic::Config::Method.new list_backups_config
1789
+ get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
1790
+ @get_backup = ::Gapic::Config::Method.new get_backup_config
1791
+ delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
1792
+ @delete_backup = ::Gapic::Config::Method.new delete_backup_config
1793
+ export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup
1794
+ @export_backup = ::Gapic::Config::Method.new export_backup_config
1795
+ backup_instance_config = parent_rpcs.backup_instance if parent_rpcs.respond_to? :backup_instance
1796
+ @backup_instance = ::Gapic::Config::Method.new backup_instance_config
1004
1797
 
1005
1798
  yield self if block_given?
1006
1799
  end