From 8528b62ad8540c1ea1ce9146560250a0aa9ce372 Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Wed, 5 Feb 2025 14:13:13 -0500 Subject: [PATCH 1/2] Deprecate DBaaS backup-related methods & classes --- linode_api4/objects/database.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/linode_api4/objects/database.py b/linode_api4/objects/database.py index ea833eb8a..e8bc02e38 100644 --- a/linode_api4/objects/database.py +++ b/linode_api4/objects/database.py @@ -1,3 +1,5 @@ +from warnings import deprecated + from linode_api4.objects import Base, DerivedBase, MappedObject, Property @@ -63,6 +65,9 @@ def invalidate(self): Base.invalidate(self) +@deprecated( + reason="Backups are not supported for non-legacy database clusters." +) class DatabaseBackup(DerivedBase): """ A generic Managed Database backup. @@ -97,6 +102,9 @@ def restore(self): ) +@deprecated( + reason="Backups are not supported for non-legacy database clusters." +) class MySQLDatabaseBackup(DatabaseBackup): """ A backup for an accessible Managed MySQL Database. @@ -107,6 +115,9 @@ class MySQLDatabaseBackup(DatabaseBackup): api_endpoint = "/databases/mysql/instances/{database_id}/backups/{id}" +@deprecated( + reason="Backups are not supported for non-legacy database clusters." +) class PostgreSQLDatabaseBackup(DatabaseBackup): """ A backup for an accessible Managed PostgreSQL Database. @@ -221,6 +232,9 @@ def patch(self): "{}/patch".format(MySQLDatabase.api_endpoint), model=self ) + @deprecated( + reason="Backups are not supported for non-legacy database clusters." + ) def backup_create(self, label, **kwargs): """ Creates a snapshot backup of a Managed MySQL Database. @@ -358,6 +372,9 @@ def patch(self): "{}/patch".format(PostgreSQLDatabase.api_endpoint), model=self ) + @deprecated( + reason="Backups are not supported for non-legacy database clusters." + ) def backup_create(self, label, **kwargs): """ Creates a snapshot backup of a Managed PostgreSQL Database. From 55696141cea891aace0227cf75bc88e17214a446 Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Wed, 5 Feb 2025 14:30:19 -0500 Subject: [PATCH 2/2] Fix import --- linode_api4/objects/database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linode_api4/objects/database.py b/linode_api4/objects/database.py index e8bc02e38..58044edb0 100644 --- a/linode_api4/objects/database.py +++ b/linode_api4/objects/database.py @@ -1,4 +1,4 @@ -from warnings import deprecated +from deprecated import deprecated from linode_api4.objects import Base, DerivedBase, MappedObject, Property