|
| 1 | +## About |
| 2 | +```python |
| 3 | +class ObjectStorageManager(): |
| 4 | + """ |
| 5 | + Functions for managing Object Storages. Intended to be used as a mixin for CloudManager. |
| 6 | + """ |
| 7 | +``` |
| 8 | +`ObjectStorageManager` is a mixed into `CloudManager` and the following methods are available by |
| 9 | + |
| 10 | +```python |
| 11 | +manager = CloudManager("api-username", "password") |
| 12 | +manager.method() |
| 13 | +``` |
| 14 | + |
| 15 | +## Methods |
| 16 | + |
| 17 | +```python |
| 18 | +def get_object_storages(self): |
| 19 | + """ |
| 20 | + List all Object Storage devices on the account or those which the subaccount has permissions. |
| 21 | + Returns a list of ObjectStorage objects. |
| 22 | + """ |
| 23 | +``` |
| 24 | + |
| 25 | +```python |
| 26 | +def create_object_storage(self, zone, access_key, secret_key, size, name=None, description=None): |
| 27 | + """ |
| 28 | + Used to create a new Object Storage device with a given name, size and location. |
| 29 | + Zone, access_key, secret_key and size are mandatory while name and description are optional. |
| 30 | + """ |
| 31 | +``` |
| 32 | + |
| 33 | +```python |
| 34 | +def modify_object_storage(self, object_storage, access_key=None, secret_key=None, description=None, size=None): |
| 35 | + """ |
| 36 | + Modify requests can be used to update the details of an Object Storage including description, access_key and secret_key. |
| 37 | + Object_storage is mandatory and can be a uuid or a ObjectStorage object. |
| 38 | + Access_key, secret_key, description and size are optional. |
| 39 | + If passed access_key needs to be provided with secret_key and vice-versa. |
| 40 | + """ |
| 41 | +``` |
| 42 | + |
| 43 | +```python |
| 44 | +def delete_object_storage(self, object_storage): |
| 45 | + """ |
| 46 | + Object Storage devices can be deleted using the following API request. |
| 47 | + Object_storage is mandatory and can be a uuid or a ObjectStorage object. |
| 48 | + """ |
| 49 | +``` |
| 50 | + |
| 51 | +```python |
| 52 | +def get_object_storage_network_statistics( |
| 53 | + self, |
| 54 | + object_storage, |
| 55 | + datetime_from, |
| 56 | + datetime_to=None, |
| 57 | + interval=None, |
| 58 | + bucket=[], |
| 59 | + filename=[], |
| 60 | + method=[], |
| 61 | + status=[], |
| 62 | + group_by=[], |
| 63 | + order_by=[], |
| 64 | + limit=None |
| 65 | + ): |
| 66 | + """ |
| 67 | + The network usage of an Object Storage device is metered and can be reviewed using the statistics request. |
| 68 | + Object_storage is mandatory and can be a uuid or a ObjectStorage object. |
| 69 | + Datetime_from is mandatory and needs to be a string example: 2020-11-03 00:00:00 |
| 70 | + Datetime_to is optional and needs to be a string example: 2020-11-04 00:00:00 |
| 71 | + Interval is optional and needs to be an integer |
| 72 | + Bucket is optional and needs to be a list of bucket name strings |
| 73 | + Filename is optional and needs to be a list of filename strings |
| 74 | + Method is optional and needs to be a list of method name strings |
| 75 | + Status is optional and needs to be a list of http status codes as integers |
| 76 | + Group_by is optional and needs to be a list of specified properties as strings |
| 77 | + Order_by is optional and needs to be a list of specified properties as strings |
| 78 | + Limit is optional and needs to be an integer |
| 79 | + """ |
| 80 | +``` |
0 commit comments