@@ -229,7 +229,7 @@ async def list_instances(
229
229
Returns:
230
230
google.cloud.redis_v1beta1.services.cloud_redis.pagers.ListInstancesAsyncPager:
231
231
Response for
232
- [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances].
232
+ [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances].
233
233
234
234
Iterating over this object will yield results and
235
235
resolve additional pages automatically.
@@ -348,6 +348,79 @@ async def get_instance(
348
348
# Done; return the response.
349
349
return response
350
350
351
+ async def get_instance_auth_string (
352
+ self ,
353
+ request : Union [cloud_redis .GetInstanceAuthStringRequest , dict ] = None ,
354
+ * ,
355
+ name : str = None ,
356
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
357
+ timeout : float = None ,
358
+ metadata : Sequence [Tuple [str , str ]] = (),
359
+ ) -> cloud_redis .InstanceAuthString :
360
+ r"""Gets the AUTH string for a Redis instance. If AUTH is
361
+ not enabled for the instance the response will be empty.
362
+ This information is not included in the details returned
363
+ to GetInstance.
364
+
365
+ Args:
366
+ request (Union[google.cloud.redis_v1beta1.types.GetInstanceAuthStringRequest, dict]):
367
+ The request object. Request for
368
+ [GetInstanceAuthString][google.cloud.redis.v1beta1.CloudRedis.GetInstanceAuthString].
369
+ name (:class:`str`):
370
+ Required. Redis instance resource name using the form:
371
+ ``projects/{project_id}/locations/{location_id}/instances/{instance_id}``
372
+ where ``location_id`` refers to a GCP region.
373
+
374
+ This corresponds to the ``name`` field
375
+ on the ``request`` instance; if ``request`` is provided, this
376
+ should not be set.
377
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
378
+ should be retried.
379
+ timeout (float): The timeout for this request.
380
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
381
+ sent along with the request as metadata.
382
+
383
+ Returns:
384
+ google.cloud.redis_v1beta1.types.InstanceAuthString:
385
+ Instance AUTH string details.
386
+ """
387
+ # Create or coerce a protobuf request object.
388
+ # Sanity check: If we got a request object, we should *not* have
389
+ # gotten any keyword arguments that map to the request.
390
+ has_flattened_params = any ([name ])
391
+ if request is not None and has_flattened_params :
392
+ raise ValueError (
393
+ "If the `request` argument is set, then none of "
394
+ "the individual field arguments should be set."
395
+ )
396
+
397
+ request = cloud_redis .GetInstanceAuthStringRequest (request )
398
+
399
+ # If we have keyword arguments corresponding to fields on the
400
+ # request, apply these.
401
+ if name is not None :
402
+ request .name = name
403
+
404
+ # Wrap the RPC method; this adds retry and timeout information,
405
+ # and friendly error handling.
406
+ rpc = gapic_v1 .method_async .wrap_method (
407
+ self ._client ._transport .get_instance_auth_string ,
408
+ default_timeout = 600.0 ,
409
+ client_info = DEFAULT_CLIENT_INFO ,
410
+ )
411
+
412
+ # Certain fields should be provided within the metadata header;
413
+ # add these here.
414
+ metadata = tuple (metadata ) + (
415
+ gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
416
+ )
417
+
418
+ # Send the request.
419
+ response = await rpc (request , retry = retry , timeout = timeout , metadata = metadata ,)
420
+
421
+ # Done; return the response.
422
+ return response
423
+
351
424
async def create_instance (
352
425
self ,
353
426
request : Union [cloud_redis .CreateInstanceRequest , dict ] = None ,
@@ -1059,6 +1132,111 @@ async def delete_instance(
1059
1132
# Done; return the response.
1060
1133
return response
1061
1134
1135
+ async def reschedule_maintenance (
1136
+ self ,
1137
+ request : Union [cloud_redis .RescheduleMaintenanceRequest , dict ] = None ,
1138
+ * ,
1139
+ name : str = None ,
1140
+ reschedule_type : cloud_redis .RescheduleMaintenanceRequest .RescheduleType = None ,
1141
+ schedule_time : timestamp_pb2 .Timestamp = None ,
1142
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
1143
+ timeout : float = None ,
1144
+ metadata : Sequence [Tuple [str , str ]] = (),
1145
+ ) -> operation_async .AsyncOperation :
1146
+ r"""Reschedule maintenance for a given instance in a
1147
+ given project and location.
1148
+
1149
+ Args:
1150
+ request (Union[google.cloud.redis_v1beta1.types.RescheduleMaintenanceRequest, dict]):
1151
+ The request object. Request for
1152
+ [RescheduleMaintenance][google.cloud.redis.v1beta1.CloudRedis.RescheduleMaintenance].
1153
+ name (:class:`str`):
1154
+ Required. Redis instance resource name using the form:
1155
+ ``projects/{project_id}/locations/{location_id}/instances/{instance_id}``
1156
+ where ``location_id`` refers to a GCP region.
1157
+
1158
+ This corresponds to the ``name`` field
1159
+ on the ``request`` instance; if ``request`` is provided, this
1160
+ should not be set.
1161
+ reschedule_type (:class:`google.cloud.redis_v1beta1.types.RescheduleMaintenanceRequest.RescheduleType`):
1162
+ Required. If reschedule type is SPECIFIC_TIME, must set
1163
+ up schedule_time as well.
1164
+
1165
+ This corresponds to the ``reschedule_type`` field
1166
+ on the ``request`` instance; if ``request`` is provided, this
1167
+ should not be set.
1168
+ schedule_time (:class:`google.protobuf.timestamp_pb2.Timestamp`):
1169
+ Optional. Timestamp when the maintenance shall be
1170
+ rescheduled to if reschedule_type=SPECIFIC_TIME, in RFC
1171
+ 3339 format, for example ``2012-11-15T16:19:00.094Z``.
1172
+
1173
+ This corresponds to the ``schedule_time`` field
1174
+ on the ``request`` instance; if ``request`` is provided, this
1175
+ should not be set.
1176
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1177
+ should be retried.
1178
+ timeout (float): The timeout for this request.
1179
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
1180
+ sent along with the request as metadata.
1181
+
1182
+ Returns:
1183
+ google.api_core.operation_async.AsyncOperation:
1184
+ An object representing a long-running operation.
1185
+
1186
+ The result type for the operation will be
1187
+ :class:`google.cloud.redis_v1beta1.types.Instance` A
1188
+ Google Cloud Redis instance.
1189
+
1190
+ """
1191
+ # Create or coerce a protobuf request object.
1192
+ # Sanity check: If we got a request object, we should *not* have
1193
+ # gotten any keyword arguments that map to the request.
1194
+ has_flattened_params = any ([name , reschedule_type , schedule_time ])
1195
+ if request is not None and has_flattened_params :
1196
+ raise ValueError (
1197
+ "If the `request` argument is set, then none of "
1198
+ "the individual field arguments should be set."
1199
+ )
1200
+
1201
+ request = cloud_redis .RescheduleMaintenanceRequest (request )
1202
+
1203
+ # If we have keyword arguments corresponding to fields on the
1204
+ # request, apply these.
1205
+ if name is not None :
1206
+ request .name = name
1207
+ if reschedule_type is not None :
1208
+ request .reschedule_type = reschedule_type
1209
+ if schedule_time is not None :
1210
+ request .schedule_time = schedule_time
1211
+
1212
+ # Wrap the RPC method; this adds retry and timeout information,
1213
+ # and friendly error handling.
1214
+ rpc = gapic_v1 .method_async .wrap_method (
1215
+ self ._client ._transport .reschedule_maintenance ,
1216
+ default_timeout = None ,
1217
+ client_info = DEFAULT_CLIENT_INFO ,
1218
+ )
1219
+
1220
+ # Certain fields should be provided within the metadata header;
1221
+ # add these here.
1222
+ metadata = tuple (metadata ) + (
1223
+ gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
1224
+ )
1225
+
1226
+ # Send the request.
1227
+ response = await rpc (request , retry = retry , timeout = timeout , metadata = metadata ,)
1228
+
1229
+ # Wrap the response in an operation future.
1230
+ response = operation_async .from_gapic (
1231
+ response ,
1232
+ self ._client ._transport .operations_client ,
1233
+ cloud_redis .Instance ,
1234
+ metadata_type = any_pb2 .Any ,
1235
+ )
1236
+
1237
+ # Done; return the response.
1238
+ return response
1239
+
1062
1240
async def __aenter__ (self ):
1063
1241
return self
1064
1242
0 commit comments