Skip to content

Commit 592d23f

Browse files
Merge branch 'dev' into zhiwei/obj-quotas
2 parents 48ebe5a + d692eef commit 592d23f

27 files changed

Lines changed: 533 additions & 326 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: ubuntu-latest
3232
strategy:
3333
matrix:
34-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
34+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
3535
steps:
3636
- uses: actions/checkout@v6
3737
- uses: actions/setup-python@v6

.github/workflows/e2e-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ on:
5555
- dev
5656

5757
env:
58-
DEFAULT_PYTHON_VERSION: "3.10"
59-
EOL_PYTHON_VERSION: "3.9"
58+
DEFAULT_PYTHON_VERSION: "3.13"
59+
EOL_PYTHON_VERSION: "3.10"
6060
EXIT_STATUS: 0
6161

6262
jobs:

CODEOWNERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
* @linode/dx
2-
1+
* @linode/dx @linode/dx-sdets

linode_api4/groups/region.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
from linode_api4.groups import Group
22
from linode_api4.objects import Region
3-
from linode_api4.objects.region import RegionAvailabilityEntry
3+
from linode_api4.objects.region import (
4+
RegionAvailabilityEntry,
5+
RegionVPCAvailability,
6+
)
47

58

69
class RegionGroup(Group):
@@ -43,3 +46,34 @@ def availability(self, *filters):
4346
return self.client._get_and_filter(
4447
RegionAvailabilityEntry, *filters, endpoint="/regions/availability"
4548
)
49+
50+
def vpc_availability(self, *filters):
51+
"""
52+
Returns VPC availability data for all regions.
53+
54+
NOTE: IPv6 VPCs may not currently be available to all users.
55+
56+
This endpoint supports pagination with the following parameters:
57+
- page: Page number (>= 1)
58+
- page_size: Number of items per page (25-500)
59+
60+
Pagination is handled automatically by PaginatedList. To configure page_size,
61+
set it when creating the LinodeClient:
62+
63+
client = LinodeClient(token, page_size=100)
64+
65+
API Documentation: https://techdocs.akamai.com/linode-api/reference/get-regions-vpc-availability
66+
67+
:param filters: Any number of filters to apply to this query.
68+
See :doc:`Filtering Collections</linode_api4/objects/filtering>`
69+
for more details on filtering.
70+
71+
:returns: A list of VPC availability data for regions.
72+
:rtype: PaginatedList of RegionVPCAvailability
73+
"""
74+
75+
return self.client._get_and_filter(
76+
RegionVPCAvailability,
77+
*filters,
78+
endpoint="/regions/vpc-availability",
79+
)

linode_api4/objects/database.py

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
from dataclasses import dataclass, field
22
from typing import Optional
33

4-
from deprecated import deprecated
5-
64
from linode_api4.objects import (
75
Base,
8-
DerivedBase,
96
JSONObject,
107
MappedObject,
118
Property,
@@ -86,69 +83,6 @@ class DatabasePrivateNetwork(JSONObject):
8683
public_access: Optional[bool] = None
8784

8885

89-
@deprecated(
90-
reason="Backups are not supported for non-legacy database clusters."
91-
)
92-
class DatabaseBackup(DerivedBase):
93-
"""
94-
A generic Managed Database backup.
95-
96-
This class is not intended to be used on its own.
97-
Use the appropriate subclasses for the corresponding database engine. (e.g. MySQLDatabaseBackup)
98-
"""
99-
100-
api_endpoint = ""
101-
derived_url_path = "backups"
102-
parent_id_name = "database_id"
103-
104-
properties = {
105-
"created": Property(is_datetime=True),
106-
"id": Property(identifier=True),
107-
"label": Property(),
108-
"type": Property(),
109-
}
110-
111-
def restore(self):
112-
"""
113-
Restore a backup to a Managed Database on your Account.
114-
115-
API Documentation:
116-
117-
- MySQL: https://techdocs.akamai.com/linode-api/reference/post-databases-mysql-instance-backup-restore
118-
- PostgreSQL: https://techdocs.akamai.com/linode-api/reference/post-databases-postgre-sql-instance-backup-restore
119-
"""
120-
121-
return self._client.post(
122-
"{}/restore".format(self.api_endpoint), model=self
123-
)
124-
125-
126-
@deprecated(
127-
reason="Backups are not supported for non-legacy database clusters."
128-
)
129-
class MySQLDatabaseBackup(DatabaseBackup):
130-
"""
131-
A backup for an accessible Managed MySQL Database.
132-
133-
API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-mysql-instance-backup
134-
"""
135-
136-
api_endpoint = "/databases/mysql/instances/{database_id}/backups/{id}"
137-
138-
139-
@deprecated(
140-
reason="Backups are not supported for non-legacy database clusters."
141-
)
142-
class PostgreSQLDatabaseBackup(DatabaseBackup):
143-
"""
144-
A backup for an accessible Managed PostgreSQL Database.
145-
146-
API Documentation: https://techdocs.akamai.com/linode-api/reference/get-databases-postgresql-instance-backup
147-
"""
148-
149-
api_endpoint = "/databases/postgresql/instances/{database_id}/backups/{id}"
150-
151-
15286
@dataclass
15387
class MySQLDatabaseConfigMySQLOptions(JSONObject):
15488
"""
@@ -296,15 +230,13 @@ class MySQLDatabase(Base):
296230
"id": Property(identifier=True),
297231
"label": Property(mutable=True),
298232
"allow_list": Property(mutable=True, unordered=True),
299-
"backups": Property(derived_class=MySQLDatabaseBackup),
300233
"cluster_size": Property(mutable=True),
301234
"created": Property(is_datetime=True),
302235
"encrypted": Property(),
303236
"engine": Property(),
304237
"hosts": Property(),
305238
"port": Property(),
306239
"region": Property(),
307-
"replication_type": Property(),
308240
"ssl_connection": Property(),
309241
"status": Property(volatile=True),
310242
"type": Property(mutable=True),
@@ -393,28 +325,6 @@ def patch(self):
393325
"{}/patch".format(MySQLDatabase.api_endpoint), model=self
394326
)
395327

396-
@deprecated(
397-
reason="Backups are not supported for non-legacy database clusters."
398-
)
399-
def backup_create(self, label, **kwargs):
400-
"""
401-
Creates a snapshot backup of a Managed MySQL Database.
402-
403-
API Documentation: https://techdocs.akamai.com/linode-api/reference/post-databases-mysql-instance-backup
404-
"""
405-
406-
params = {
407-
"label": label,
408-
}
409-
params.update(kwargs)
410-
411-
self._client.post(
412-
"{}/backups".format(MySQLDatabase.api_endpoint),
413-
model=self,
414-
data=params,
415-
)
416-
self.invalidate()
417-
418328
def invalidate(self):
419329
"""
420330
Clear out cached properties.
@@ -464,16 +374,13 @@ class PostgreSQLDatabase(Base):
464374
"id": Property(identifier=True),
465375
"label": Property(mutable=True),
466376
"allow_list": Property(mutable=True, unordered=True),
467-
"backups": Property(derived_class=PostgreSQLDatabaseBackup),
468377
"cluster_size": Property(mutable=True),
469378
"created": Property(is_datetime=True),
470379
"encrypted": Property(),
471380
"engine": Property(),
472381
"hosts": Property(),
473382
"port": Property(),
474383
"region": Property(),
475-
"replication_commit_type": Property(),
476-
"replication_type": Property(),
477384
"ssl_connection": Property(),
478385
"status": Property(volatile=True),
479386
"type": Property(mutable=True),
@@ -563,28 +470,6 @@ def patch(self):
563470
"{}/patch".format(PostgreSQLDatabase.api_endpoint), model=self
564471
)
565472

566-
@deprecated(
567-
reason="Backups are not supported for non-legacy database clusters."
568-
)
569-
def backup_create(self, label, **kwargs):
570-
"""
571-
Creates a snapshot backup of a Managed PostgreSQL Database.
572-
573-
API Documentation: https://techdocs.akamai.com/linode-api/reference/post-databases-postgre-sql-instance-backup
574-
"""
575-
576-
params = {
577-
"label": label,
578-
}
579-
params.update(kwargs)
580-
581-
self._client.post(
582-
"{}/backups".format(PostgreSQLDatabase.api_endpoint),
583-
model=self,
584-
data=params,
585-
)
586-
self.invalidate()
587-
588473
def invalidate(self):
589474
"""
590475
Clear out cached properties.

0 commit comments

Comments
 (0)