@@ -173,7 +173,8 @@ def update_database_ddl(self):
173173 def drop_database (self ):
174174 """Return the gRPC stub for :meth:`DatabaseAdminClient.drop_database`.
175175
176- Drops (aka deletes) a Cloud Spanner database.
176+ Drops (aka deletes) a Cloud Spanner database. Completed backups for the
177+ database will be retained according to their ``expire_time``.
177178
178179 Returns:
179180 Callable: A callable which accepts the appropriate
@@ -201,11 +202,12 @@ def get_database_ddl(self):
201202 def set_iam_policy (self ):
202203 """Return the gRPC stub for :meth:`DatabaseAdminClient.set_iam_policy`.
203204
204- Sets the access control policy on a database resource. Replaces any
205- existing policy.
205+ Sets the access control policy on a database or backup resource.
206+ Replaces any existing policy.
206207
207208 Authorization requires ``spanner.databases.setIamPolicy`` permission on
208- ``resource``.
209+ ``resource``. For backups, authorization requires
210+ ``spanner.backups.setIamPolicy`` permission on ``resource``.
209211
210212 Returns:
211213 Callable: A callable which accepts the appropriate
@@ -218,11 +220,13 @@ def set_iam_policy(self):
218220 def get_iam_policy (self ):
219221 """Return the gRPC stub for :meth:`DatabaseAdminClient.get_iam_policy`.
220222
221- Gets the access control policy for a database resource. Returns an empty
222- policy if a database exists but does not have a policy set.
223+ Gets the access control policy for a database or backup resource.
224+ Returns an empty policy if a database or backup exists but does not have
225+ a policy set.
223226
224227 Authorization requires ``spanner.databases.getIamPolicy`` permission on
225- ``resource``.
228+ ``resource``. For backups, authorization requires
229+ ``spanner.backups.getIamPolicy`` permission on ``resource``.
226230
227231 Returns:
228232 Callable: A callable which accepts the appropriate
@@ -235,13 +239,15 @@ def get_iam_policy(self):
235239 def test_iam_permissions (self ):
236240 """Return the gRPC stub for :meth:`DatabaseAdminClient.test_iam_permissions`.
237241
238- Returns permissions that the caller has on the specified database
239- resource.
242+ Returns permissions that the caller has on the specified database or
243+ backup resource.
240244
241245 Attempting this RPC on a non-existent Cloud Spanner database will result
242246 in a NOT\_FOUND error if the user has ``spanner.databases.list``
243247 permission on the containing Cloud Spanner instance. Otherwise returns
244- an empty set of permissions.
248+ an empty set of permissions. Calling this method on a backup that does
249+ not exist will result in a NOT\_FOUND error if the user has
250+ ``spanner.backups.list`` permission on the containing instance.
245251
246252 Returns:
247253 Callable: A callable which accepts the appropriate
@@ -250,6 +256,146 @@ def test_iam_permissions(self):
250256 """
251257 return self ._stubs ["database_admin_stub" ].TestIamPermissions
252258
259+ @property
260+ def create_backup (self ):
261+ """Return the gRPC stub for :meth:`DatabaseAdminClient.create_backup`.
262+
263+ Starts creating a new Cloud Spanner Backup. The returned backup
264+ ``long-running operation`` will have a name of the format
265+ ``projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>``
266+ and can be used to track creation of the backup. The ``metadata`` field
267+ type is ``CreateBackupMetadata``. The ``response`` field type is
268+ ``Backup``, if successful. Cancelling the returned operation will stop
269+ the creation and delete the backup. There can be only one pending backup
270+ creation per database. Backup creation of different databases can run
271+ concurrently.
272+
273+ Returns:
274+ Callable: A callable which accepts the appropriate
275+ deserialized request object and returns a
276+ deserialized response object.
277+ """
278+ return self ._stubs ["database_admin_stub" ].CreateBackup
279+
280+ @property
281+ def get_backup (self ):
282+ """Return the gRPC stub for :meth:`DatabaseAdminClient.get_backup`.
283+
284+ Gets metadata on a pending or completed ``Backup``.
285+
286+ Returns:
287+ Callable: A callable which accepts the appropriate
288+ deserialized request object and returns a
289+ deserialized response object.
290+ """
291+ return self ._stubs ["database_admin_stub" ].GetBackup
292+
293+ @property
294+ def update_backup (self ):
295+ """Return the gRPC stub for :meth:`DatabaseAdminClient.update_backup`.
296+
297+ Updates a pending or completed ``Backup``.
298+
299+ Returns:
300+ Callable: A callable which accepts the appropriate
301+ deserialized request object and returns a
302+ deserialized response object.
303+ """
304+ return self ._stubs ["database_admin_stub" ].UpdateBackup
305+
306+ @property
307+ def delete_backup (self ):
308+ """Return the gRPC stub for :meth:`DatabaseAdminClient.delete_backup`.
309+
310+ Deletes a pending or completed ``Backup``.
311+
312+ Returns:
313+ Callable: A callable which accepts the appropriate
314+ deserialized request object and returns a
315+ deserialized response object.
316+ """
317+ return self ._stubs ["database_admin_stub" ].DeleteBackup
318+
319+ @property
320+ def list_backups (self ):
321+ """Return the gRPC stub for :meth:`DatabaseAdminClient.list_backups`.
322+
323+ Lists completed and pending backups. Backups returned are ordered by
324+ ``create_time`` in descending order, starting from the most recent
325+ ``create_time``.
326+
327+ Returns:
328+ Callable: A callable which accepts the appropriate
329+ deserialized request object and returns a
330+ deserialized response object.
331+ """
332+ return self ._stubs ["database_admin_stub" ].ListBackups
333+
334+ @property
335+ def restore_database (self ):
336+ """Return the gRPC stub for :meth:`DatabaseAdminClient.restore_database`.
337+
338+ Create a new database by restoring from a completed backup. The new
339+ database must be in the same project and in an instance with the same
340+ instance configuration as the instance containing the backup. The
341+ returned database ``long-running operation`` has a name of the format
342+ ``projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>``,
343+ and can be used to track the progress of the operation, and to cancel
344+ it. The ``metadata`` field type is ``RestoreDatabaseMetadata``. The
345+ ``response`` type is ``Database``, if successful. Cancelling the
346+ returned operation will stop the restore and delete the database. There
347+ can be only one database being restored into an instance at a time. Once
348+ the restore operation completes, a new restore operation can be
349+ initiated, without waiting for the optimize operation associated with
350+ the first restore to complete.
351+
352+ Returns:
353+ Callable: A callable which accepts the appropriate
354+ deserialized request object and returns a
355+ deserialized response object.
356+ """
357+ return self ._stubs ["database_admin_stub" ].RestoreDatabase
358+
359+ @property
360+ def list_database_operations (self ):
361+ """Return the gRPC stub for :meth:`DatabaseAdminClient.list_database_operations`.
362+
363+ Lists database ``longrunning-operations``. A database operation has a
364+ name of the form
365+ ``projects/<project>/instances/<instance>/databases/<database>/operations/<operation>``.
366+ The long-running operation ``metadata`` field type ``metadata.type_url``
367+ describes the type of the metadata. Operations returned include those
368+ that have completed/failed/canceled within the last 7 days, and pending
369+ operations.
370+
371+ Returns:
372+ Callable: A callable which accepts the appropriate
373+ deserialized request object and returns a
374+ deserialized response object.
375+ """
376+ return self ._stubs ["database_admin_stub" ].ListDatabaseOperations
377+
378+ @property
379+ def list_backup_operations (self ):
380+ """Return the gRPC stub for :meth:`DatabaseAdminClient.list_backup_operations`.
381+
382+ Lists the backup ``long-running operations`` in the given instance. A
383+ backup operation has a name of the form
384+ ``projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>``.
385+ The long-running operation ``metadata`` field type ``metadata.type_url``
386+ describes the type of the metadata. Operations returned include those
387+ that have completed/failed/canceled within the last 7 days, and pending
388+ operations. Operations returned are ordered by
389+ ``operation.metadata.value.progress.start_time`` in descending order
390+ starting from the most recently started operation.
391+
392+ Returns:
393+ Callable: A callable which accepts the appropriate
394+ deserialized request object and returns a
395+ deserialized response object.
396+ """
397+ return self ._stubs ["database_admin_stub" ].ListBackupOperations
398+
253399 @property
254400 def list_databases (self ):
255401 """Return the gRPC stub for :meth:`DatabaseAdminClient.list_databases`.
0 commit comments