Skip to content

Commit d4fb19a

Browse files
authored
Add warnings to deprecated OBJ API usage (#410)
* add deprecated * add dependency * fix deprecated
1 parent 90b43ab commit d4fb19a

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

linode_api4/groups/obj.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from deprecated import deprecated
2+
13
from linode_api4.errors import UnexpectedResponseError
24
from linode_api4.groups import Group
35
from linode_api4.objects import Base, ObjectStorageCluster, ObjectStorageKeys
@@ -9,8 +11,14 @@ class ObjectStorageGroup(Group):
911
available clusters and managing keys.
1012
"""
1113

14+
@deprecated(
15+
reason="deprecated to use regions list API for listing available OJB clusters"
16+
)
1217
def clusters(self, *filters):
1318
"""
19+
This endpoint will be deprecated to use the regions list API to list available OBJ clusters,
20+
and a new access key API will directly expose the S3 endpoint hostname.
21+
1422
Returns a list of available Object Storage Clusters. You may filter
1523
this query to return only Clusters that are available in a specific region::
1624

linode_api4/groups/object_storage.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from urllib import parse
22

3+
from deprecated import deprecated
4+
35
from linode_api4.errors import UnexpectedResponseError
46
from linode_api4.groups import Group
57
from linode_api4.objects import (
@@ -19,8 +21,14 @@ class ObjectStorageGroup(Group):
1921
available clusters, buckets, and managing keys and TLS/SSL certs, etc.
2022
"""
2123

24+
@deprecated(
25+
reason="deprecated to use regions list API for listing available OJB clusters"
26+
)
2227
def clusters(self, *filters):
2328
"""
29+
This endpoint will be deprecated to use the regions list API to list available OBJ clusters,
30+
and a new access key API will directly expose the S3 endpoint hostname.
31+
2432
Returns a list of available Object Storage Clusters. You may filter
2533
this query to return only Clusters that are available in a specific region::
2634

linode_api4/objects/object_storage.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from urllib import parse
22

3+
from deprecated import deprecated
4+
35
from linode_api4.errors import UnexpectedResponseError
46
from linode_api4.objects import (
57
Base,
@@ -463,8 +465,14 @@ def access(self, cluster, bucket_name, permissions):
463465
}
464466

465467

468+
@deprecated(
469+
reason="deprecated to use regions list API for viewing available OJB clusters"
470+
)
466471
class ObjectStorageCluster(Base):
467472
"""
473+
This class will be deprecated to use the regions list to view available OBJ clusters,
474+
and a new access key API will directly expose the S3 endpoint hostname.
475+
468476
A cluster where Object Storage is available.
469477
470478
API documentation: https://www.linode.com/docs/api/object-storage/#cluster-view

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ classifiers = [
3131
"Programming Language :: Python :: 3.11",
3232
"Programming Language :: Python :: 3.12",
3333
]
34-
dependencies = ["requests", "polling"]
34+
dependencies = ["requests", "polling", "deprecated"]
3535
dynamic = ["version"]
3636

3737
[project.optional-dependencies]

0 commit comments

Comments
 (0)