5
5
6
6
from deprecated import deprecated
7
7
8
+ from linode_api4 import (
9
+ ObjectStorageEndpoint ,
10
+ ObjectStorageEndpointType ,
11
+ PaginatedList ,
12
+ )
8
13
from linode_api4 .errors import UnexpectedResponseError
9
14
from linode_api4 .groups import Group
10
15
from linode_api4 .objects import (
@@ -272,6 +277,30 @@ def transfer(self):
272
277
273
278
return MappedObject (** result )
274
279
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
+
275
304
def buckets (self , * filters ):
276
305
"""
277
306
Returns a paginated list of all Object Storage Buckets that you own.
@@ -299,6 +328,8 @@ def bucket_create(
299
328
label : str ,
300
329
acl : ObjectStorageACL = ObjectStorageACL .PRIVATE ,
301
330
cors_enabled = False ,
331
+ s3_endpoint : Optional [str ] = None ,
332
+ endpoint_type : Optional [ObjectStorageEndpointType ] = None ,
302
333
):
303
334
"""
304
335
Creates an Object Storage Bucket in the specified cluster. Accounts with
@@ -320,6 +351,13 @@ def bucket_create(
320
351
should be created.
321
352
:type cluster: str
322
353
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
+
323
361
:param cors_enabled: If true, the bucket will be created with CORS enabled for
324
362
all origins. For more fine-grained controls of CORS, use
325
363
the S3 API directly.
@@ -346,6 +384,8 @@ def bucket_create(
346
384
"label" : label ,
347
385
"acl" : acl ,
348
386
"cors_enabled" : cors_enabled ,
387
+ "s3_endpoint" : s3_endpoint ,
388
+ "endpoint_type" : endpoint_type ,
349
389
}
350
390
351
391
if self .is_cluster (cluster_or_region_id ):
0 commit comments