@@ -453,6 +453,53 @@ def get_service(
453
453
)
454
454
return result
455
455
456
+ @GoogleBaseHook .fallback_to_default_project_id
457
+ def get_backup (
458
+ self ,
459
+ project_id : str ,
460
+ region : str ,
461
+ service_id : str ,
462
+ backup_id : str ,
463
+ retry : Optional [Retry ] = None ,
464
+ timeout : Optional [float ] = None ,
465
+ metadata : Sequence [Tuple [str , str ]] = (),
466
+ ) -> Backup :
467
+ """
468
+ Get backup from a service.
469
+
470
+ :param project_id: Required. The ID of the Google Cloud project that the service belongs to.
471
+ :type project_id: str
472
+ :param region: Required. The ID of the Google Cloud region that the service belongs to.
473
+ :type region: str
474
+ :param service_id: Required. The ID of the metastore service, which is used as the final component of
475
+ the metastore service's name. This value must be between 2 and 63 characters long inclusive, begin
476
+ with a letter, end with a letter or number, and consist of alphanumeric ASCII characters or
477
+ hyphens.
478
+
479
+ This corresponds to the ``service_id`` field on the ``request`` instance; if ``request`` is
480
+ provided, this should not be set.
481
+ :type service_id: str
482
+ :param backup_id: Required. The ID of the metastore service backup to restore from
483
+ :type backup_id: str
484
+ :param retry: Designation of what errors, if any, should be retried.
485
+ :type retry: google.api_core.retry.Retry
486
+ :param timeout: The timeout for this request.
487
+ :type timeout: float
488
+ :param metadata: Strings which should be sent along with the request as metadata.
489
+ :type metadata: Sequence[Tuple[str, str]]
490
+ """
491
+ backup = f'projects/{ project_id } /locations/{ region } /services/{ service_id } /backups/{ backup_id } '
492
+ client = self .get_dataproc_metastore_client ()
493
+ result = client .get_backup (
494
+ request = {
495
+ 'name' : backup ,
496
+ },
497
+ retry = retry ,
498
+ timeout = timeout ,
499
+ metadata = metadata ,
500
+ )
501
+ return result
502
+
456
503
@GoogleBaseHook .fallback_to_default_project_id
457
504
def list_backups (
458
505
self ,
0 commit comments