55
66from deprecated import deprecated
77
8+ from linode_api4 import (
9+ ObjectStorageEndpoint ,
10+ ObjectStorageEndpointType ,
11+ PaginatedList ,
12+ )
813from linode_api4 .errors import UnexpectedResponseError
914from linode_api4 .groups import Group
1015from linode_api4 .objects import (
@@ -272,6 +277,30 @@ def transfer(self):
272277
273278 return MappedObject (** result )
274279
280+ def endpoints (self , * filters ) -> PaginatedList :
281+ """
282+ Returns a paginated list of all Object Storage endpoints available in your account.
283+
284+ This is intended to be called from the :any:`LinodeClient`
285+ class, like this::
286+
287+ endpoints = client.object_storage.endpoints()
288+
289+ API Documentation: https://techdocs.akamai.com/linode-api/reference/get-object-storage-endpoints
290+
291+ :param filters: Any number of filters to apply to this query.
292+ See :doc:`Filtering Collections</linode_api4/objects/filtering>`
293+ for more details on filtering.
294+
295+ :returns: A list of Object Storage Endpoints that matched the query.
296+ :rtype: PaginatedList of ObjectStorageEndpoint
297+ """
298+ return self .client ._get_and_filter (
299+ ObjectStorageEndpoint ,
300+ * filters ,
301+ endpoint = "/object-storage/endpoints" ,
302+ )
303+
275304 def buckets (self , * filters ):
276305 """
277306 Returns a paginated list of all Object Storage Buckets that you own.
@@ -299,6 +328,8 @@ def bucket_create(
299328 label : str ,
300329 acl : ObjectStorageACL = ObjectStorageACL .PRIVATE ,
301330 cors_enabled = False ,
331+ s3_endpoint : Optional [str ] = None ,
332+ endpoint_type : Optional [ObjectStorageEndpointType ] = None ,
302333 ):
303334 """
304335 Creates an Object Storage Bucket in the specified cluster. Accounts with
@@ -320,6 +351,13 @@ def bucket_create(
320351 should be created.
321352 :type cluster: str
322353
354+ :param endpoint_type: The type of s3_endpoint available to the active user in this region.
355+ :type endpoint_type: str
356+ Enum: E0,E1,E2,E3
357+
358+ :param s3_endpoint: The active user's s3 endpoint URL, based on the endpoint_type and region.
359+ :type s3_endpoint: str
360+
323361 :param cors_enabled: If true, the bucket will be created with CORS enabled for
324362 all origins. For more fine-grained controls of CORS, use
325363 the S3 API directly.
@@ -346,6 +384,8 @@ def bucket_create(
346384 "label" : label ,
347385 "acl" : acl ,
348386 "cors_enabled" : cors_enabled ,
387+ "s3_endpoint" : s3_endpoint ,
388+ "endpoint_type" : endpoint_type ,
349389 }
350390
351391 if self .is_cluster (cluster_or_region_id ):
0 commit comments