-
Notifications
You must be signed in to change notification settings - Fork 87
Update OBJ Group and Objects for MultiCluster Object Storage API Changes #426
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
Changes from all commits
599514b
40dcb4a
72672c3
47631e3
d2b0297
8c5ecd4
4a302f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,19 +23,25 @@ class ObjectStorageACL(StrEnum): | |
| CUSTOM = "custom" | ||
|
|
||
|
|
||
| class ObjectStorageKeyPermission(StrEnum): | ||
| READ_ONLY = "read_only" | ||
| READ_WRITE = "read_write" | ||
|
|
||
|
|
||
| class ObjectStorageBucket(DerivedBase): | ||
| """ | ||
| A bucket where objects are stored in. | ||
|
|
||
| API documentation: https://www.linode.com/docs/api/object-storage/#object-storage-bucket-view | ||
| """ | ||
|
|
||
| api_endpoint = "/object-storage/buckets/{cluster}/{label}" | ||
| parent_id_name = "cluster" | ||
| api_endpoint = "/object-storage/buckets/{region}/{label}" | ||
| parent_id_name = "region" | ||
| id_attribute = "label" | ||
|
|
||
| properties = { | ||
| "cluster": Property(identifier=True), | ||
| "region": Property(identifier=True), | ||
| "cluster": Property(), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add a deprecated note to the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the head up! I think there isn't a clear way to mark it as deprecated in Python since the property is in a dict... Let me think about it maybe we can modify |
||
| "created": Property(is_datetime=True), | ||
| "hostname": Property(), | ||
| "label": Property(identifier=True), | ||
|
|
@@ -59,8 +65,11 @@ def make_instance(cls, id, client, parent_id=None, json=None): | |
| """ | ||
| if json is None: | ||
| return None | ||
| if parent_id is None and json["cluster"]: | ||
| parent_id = json["cluster"] | ||
|
|
||
| cluster_or_region = json.get("region") or json.get("cluster") | ||
|
|
||
| if parent_id is None and cluster_or_region: | ||
| parent_id = cluster_or_region | ||
|
|
||
| if parent_id: | ||
| return super().make(id, client, cls, parent_id=parent_id, json=json) | ||
|
|
@@ -388,6 +397,13 @@ def object_acl_config_update(self, acl: ObjectStorageACL, name): | |
|
|
||
| return MappedObject(**result) | ||
|
|
||
| @deprecated( | ||
| reason=( | ||
| "'access' method has been deprecated in favor of the class method " | ||
| "'bucket_access' in ObjectStorageGroup, which can be accessed by " | ||
| "'client.object_storage.access'" | ||
| ) | ||
| ) | ||
| def access(self, cluster, bucket_name, permissions): | ||
| """ | ||
| Returns a dict formatted to be included in the `bucket_access` argument | ||
|
|
@@ -436,6 +452,13 @@ class ObjectStorageCluster(Base): | |
| "static_site_domain": Property(), | ||
| } | ||
|
|
||
| @deprecated( | ||
|
lgarber-akamai marked this conversation as resolved.
|
||
| reason=( | ||
| "'buckets_in_cluster' method has been deprecated, please consider " | ||
| "switching to 'buckets_in_region' in the object storage group (can " | ||
| "be accessed via 'client.object_storage.buckets_in_cluster')." | ||
| ) | ||
| ) | ||
| def buckets_in_cluster(self, *filters): | ||
| """ | ||
| Returns a list of Buckets in this cluster belonging to this Account. | ||
|
|
@@ -478,4 +501,5 @@ class ObjectStorageKeys(Base): | |
| "secret_key": Property(), | ||
| "bucket_access": Property(), | ||
| "limited": Property(), | ||
| "regions": Property(unordered=True), | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.