-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add support for Object Storage Gen 2 #503
Conversation
linode_api4/groups/object_storage.py
Outdated
s3_endpoint: str = None, | ||
endpoint_type: ObjectStorageEndpointType = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could these two be given Optional[...]
types to be consistent with their default values?
|
||
|
||
@dataclass | ||
class ObjectStorageEndpoint(JSONObject): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
if json is not None: | ||
cluster_or_region = json.get("region") or json.get("cluster") | ||
if parent_id is None and cluster_or_region: | ||
parent_id = cluster_or_region |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional: This snippet can be simplified a bit 🙂
if json is not None: | |
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 json is not None: | |
parent_id = parent_id or json.get("region") or json.get("cluster") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice simplification!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests are passing on my end and the implementation looks great other than a small style suggestion. Great work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
📝 Description
Added support for OBJ Gen 2. Also fixed issue with cluster_id and region ambiguity.
✔️ How to Test
Unit Tests
make test-unit
Integration Tests
make test-int TEST_SUITE=object_storage