Skip to content
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
7 changes: 6 additions & 1 deletion linode_api4/groups/object_storage.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import List, Optional, Union
from urllib import parse

from linode_api4.errors import UnexpectedResponseError
Expand Down Expand Up @@ -53,7 +54,11 @@ def keys(self, *filters):
"""
return self.client._get_and_filter(ObjectStorageKeys, *filters)

def keys_create(self, label, bucket_access=None):
def keys_create(
self,
label: str,
bucket_access: Optional[Union[dict, List[dict]]] = None,
):
"""
Creates a new Object Storage keypair that may be used to interact directly
with Linode Object Storage in third-party applications. This response is
Expand Down
52 changes: 2 additions & 50 deletions linode_api4/objects/object_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ def access_modify(

API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-bucket-access-modify

:param cluster_id: The ID of the cluster this bucket exists in.
:type cluster_id: str

:param bucket: The bucket name.
:type bucket: str

:param acl: The Access Control Level of the bucket using a canned ACL string.
For more fine-grained control of ACLs, use the S3 API directly.
:type acl: str
Expand Down Expand Up @@ -126,12 +120,6 @@ def access_update(

API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-bucket-access-update

:param cluster_id: The ID of the cluster this bucket exists in.
:type cluster_id: str

:param bucket: The bucket name.
:type bucket: str

:param acl: The Access Control Level of the bucket using a canned ACL string.
For more fine-grained control of ACLs, use the S3 API directly.
:type acl: str
Expand Down Expand Up @@ -168,12 +156,6 @@ def ssl_cert_delete(self):

API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-tlsssl-cert-delete

:param cluster_id: The ID of the cluster this bucket exists in.
:type cluster_id: str

:param bucket: The bucket name.
:type bucket: str

:returns: True if the TLS/SSL certificate and private key in the bucket were successfully deleted.
:rtype: bool
"""
Expand All @@ -199,12 +181,6 @@ def ssl_cert(self):

API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-tlsssl-cert-view

:param cluster_id: The ID of the cluster this bucket exists in.
:type cluster_id: str

:param bucket: The bucket name.
:type bucket: str

:returns: A result object which has a bool field indicating if this Bucket has a corresponding
TLS/SSL certificate that was uploaded by an Account user.
:rtype: MappedObject
Expand Down Expand Up @@ -234,12 +210,6 @@ def ssl_cert_upload(self, certificate, private_key):

API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-tlsssl-cert-upload

:param cluster_id: The ID of the cluster this bucket exists in.
:type cluster_id: str

:param bucket: The bucket name.
:type bucket: str

:param certificate: Your Base64 encoded and PEM formatted SSL certificate.
Line breaks must be represented as “\n” in the string
for requests (but not when using the Linode CLI)
Expand Down Expand Up @@ -291,12 +261,6 @@ def contents(

API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-bucket-contents-list

:param cluster_id: The ID of the cluster this bucket exists in.
:type cluster_id: str

:param bucket: The bucket name.
:type bucket: str

:param marker: The “marker” for this request, which can be used to paginate
through large buckets. Its value should be the value of the
next_marker property returned with the last page. Listing
Expand Down Expand Up @@ -357,12 +321,6 @@ def object_acl_config(self, name=None):

API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-object-acl-config-view

:param cluster_id: The ID of the cluster this bucket exists in.
:type cluster_id: str

:param bucket: The bucket name.
:type bucket: str

:param name: The name of the object for which to retrieve its Access Control
List (ACL). Use the Object Storage Bucket Contents List endpoint
to access all object names in a bucket.
Expand All @@ -376,7 +334,7 @@ def object_acl_config(self, name=None):
}

result = self._client.get(
f"{ObjectStorageBucket.api_endpoint}/object-acl",
f"{type(self).api_endpoint}/object-acl",
model=self,
data=drop_null_keys(params),
)
Expand All @@ -400,12 +358,6 @@ def object_acl_config_update(self, acl: ObjectStorageACL, name):

API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-object-acl-config-update

:param cluster_id: The ID of the cluster this bucket exists in.
:type cluster_id: str

:param bucket: The bucket name.
:type bucket: str

:param acl: The Access Control Level of the bucket, as a canned ACL string.
For more fine-grained control of ACLs, use the S3 API directly.
:type acl: str
Expand All @@ -425,7 +377,7 @@ def object_acl_config_update(self, acl: ObjectStorageACL, name):
}

result = self._client.put(
f"{ObjectStorageBucket.api_endpoint}/object-acl",
f"{type(self).api_endpoint}/object-acl",
model=self,
data=params,
)
Expand Down