Skip to content

Add warnings to deprecated OBJ API usage #410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions linode_api4/groups/obj.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from deprecated import deprecated

from linode_api4.errors import UnexpectedResponseError
from linode_api4.groups import Group
from linode_api4.objects import Base, ObjectStorageCluster, ObjectStorageKeys
Expand All @@ -9,8 +11,14 @@ class ObjectStorageGroup(Group):
available clusters and managing keys.
"""

@deprecated(
reason="deprecated to use regions list API for listing available OJB clusters"
)
def clusters(self, *filters):
"""
This endpoint will be deprecated to use the regions list API to list available OBJ clusters,
and a new access key API will directly expose the S3 endpoint hostname.

Returns a list of available Object Storage Clusters. You may filter
this query to return only Clusters that are available in a specific region::

Expand Down
8 changes: 8 additions & 0 deletions linode_api4/groups/object_storage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from urllib import parse

from deprecated import deprecated

from linode_api4.errors import UnexpectedResponseError
from linode_api4.groups import Group
from linode_api4.objects import (
Expand All @@ -19,8 +21,14 @@ class ObjectStorageGroup(Group):
available clusters, buckets, and managing keys and TLS/SSL certs, etc.
"""

@deprecated(
reason="deprecated to use regions list API for listing available OJB clusters"
)
def clusters(self, *filters):
"""
This endpoint will be deprecated to use the regions list API to list available OBJ clusters,
and a new access key API will directly expose the S3 endpoint hostname.

Returns a list of available Object Storage Clusters. You may filter
this query to return only Clusters that are available in a specific region::

Expand Down
8 changes: 8 additions & 0 deletions linode_api4/objects/object_storage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from urllib import parse

from deprecated import deprecated

from linode_api4.errors import UnexpectedResponseError
from linode_api4.objects import (
Base,
Expand Down Expand Up @@ -463,8 +465,14 @@ def access(self, cluster, bucket_name, permissions):
}


@deprecated(
Copy link
Contributor Author

@yec-akamai yec-akamai May 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we need to deprecate the cluster-view, I assume that we want to deprecate the ObjectStorageCluster class. I'm also wondering if we should move the function buckets_in_cluster from here to the obj_storage group.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a good idea 👍

reason="deprecated to use regions list API for viewing available OJB clusters"
)
class ObjectStorageCluster(Base):
"""
This class will be deprecated to use the regions list to view available OBJ clusters,
and a new access key API will directly expose the S3 endpoint hostname.

A cluster where Object Storage is available.

API documentation: https://www.linode.com/docs/api/object-storage/#cluster-view
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = ["requests", "polling"]
dependencies = ["requests", "polling", "deprecated"]
dynamic = ["version"]

[project.optional-dependencies]
Expand Down