repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_documentation_string
stringlengths
1
47.2k
func_code_url
stringlengths
85
339
pycontribs/pyrax
pyrax/object_storage.py
assure_container
def assure_container(fnc): """ Assures that whether a Container or a name of a container is passed, a Container object is available. """ @wraps(fnc) def _wrapped(self, container, *args, **kwargs): if not isinstance(container, Container): # Must be the name contain...
python
def assure_container(fnc): """ Assures that whether a Container or a name of a container is passed, a Container object is available. """ @wraps(fnc) def _wrapped(self, container, *args, **kwargs): if not isinstance(container, Container): # Must be the name contain...
Assures that whether a Container or a name of a container is passed, a Container object is available.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L68-L79
pycontribs/pyrax
pyrax/object_storage.py
_massage_metakeys
def _massage_metakeys(dct, prfx): """ Returns a copy of the supplied dictionary, prefixing any keys that do not begin with the specified prefix accordingly. """ lowprefix = prfx.lower() ret = {} for k, v in list(dct.items()): if not k.lower().startswith(lowprefix): k = "%...
python
def _massage_metakeys(dct, prfx): """ Returns a copy of the supplied dictionary, prefixing any keys that do not begin with the specified prefix accordingly. """ lowprefix = prfx.lower() ret = {} for k, v in list(dct.items()): if not k.lower().startswith(lowprefix): k = "%...
Returns a copy of the supplied dictionary, prefixing any keys that do not begin with the specified prefix accordingly.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L82-L93
pycontribs/pyrax
pyrax/object_storage.py
get_file_size
def get_file_size(fileobj): """ Returns the size of a file-like object. """ currpos = fileobj.tell() fileobj.seek(0, 2) total_size = fileobj.tell() fileobj.seek(currpos) return total_size
python
def get_file_size(fileobj): """ Returns the size of a file-like object. """ currpos = fileobj.tell() fileobj.seek(0, 2) total_size = fileobj.tell() fileobj.seek(currpos) return total_size
Returns the size of a file-like object.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L147-L155
pycontribs/pyrax
pyrax/object_storage.py
Container._set_cdn_defaults
def _set_cdn_defaults(self): """Sets all the CDN-related attributes to default values.""" if self._cdn_enabled is FAULT: self._cdn_enabled = False self._cdn_uri = None self._cdn_ttl = DEFAULT_CDN_TTL self._cdn_ssl_uri = None self._cdn_streaming_uri = None ...
python
def _set_cdn_defaults(self): """Sets all the CDN-related attributes to default values.""" if self._cdn_enabled is FAULT: self._cdn_enabled = False self._cdn_uri = None self._cdn_ttl = DEFAULT_CDN_TTL self._cdn_ssl_uri = None self._cdn_streaming_uri = None ...
Sets all the CDN-related attributes to default values.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L196-L205
pycontribs/pyrax
pyrax/object_storage.py
Container._fetch_cdn_data
def _fetch_cdn_data(self): """Fetches the container's CDN data from the CDN service""" if self._cdn_enabled is FAULT: headers = self.manager.fetch_cdn_data(self) else: headers = {} # Set defaults in case not all headers are present. self._set_cdn_defaults(...
python
def _fetch_cdn_data(self): """Fetches the container's CDN data from the CDN service""" if self._cdn_enabled is FAULT: headers = self.manager.fetch_cdn_data(self) else: headers = {} # Set defaults in case not all headers are present. self._set_cdn_defaults(...
Fetches the container's CDN data from the CDN service
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L208-L234
pycontribs/pyrax
pyrax/object_storage.py
Container.set_metadata
def set_metadata(self, metadata, clear=False, prefix=None): """ Accepts a dictionary of metadata key/value pairs and updates the specified container metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Otherwise, the ...
python
def set_metadata(self, metadata, clear=False, prefix=None): """ Accepts a dictionary of metadata key/value pairs and updates the specified container metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Otherwise, the ...
Accepts a dictionary of metadata key/value pairs and updates the specified container metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Otherwise, the values passed here update the container's metadata. The 'extra_...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L244-L263
pycontribs/pyrax
pyrax/object_storage.py
Container.purge_cdn_object
def purge_cdn_object(self, obj, email_addresses=None): """ Removes a CDN-enabled object from public access before the TTL expires. Please note that there is a limit (at this time) of 25 such requests; if you need to purge more than that, you must contact support. If one or more ...
python
def purge_cdn_object(self, obj, email_addresses=None): """ Removes a CDN-enabled object from public access before the TTL expires. Please note that there is a limit (at this time) of 25 such requests; if you need to purge more than that, you must contact support. If one or more ...
Removes a CDN-enabled object from public access before the TTL expires. Please note that there is a limit (at this time) of 25 such requests; if you need to purge more than that, you must contact support. If one or more email_addresses are included, an email confirming the purge is sent...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L309-L318
pycontribs/pyrax
pyrax/object_storage.py
Container.get_object
def get_object(self, item): """ Returns a StorageObject matching the specified item. If no such object exists, a NotFound exception is raised. If 'item' is not a string, that item is returned unchanged. """ if isinstance(item, six.string_types): item = self.ob...
python
def get_object(self, item): """ Returns a StorageObject matching the specified item. If no such object exists, a NotFound exception is raised. If 'item' is not a string, that item is returned unchanged. """ if isinstance(item, six.string_types): item = self.ob...
Returns a StorageObject matching the specified item. If no such object exists, a NotFound exception is raised. If 'item' is not a string, that item is returned unchanged.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L321-L329
pycontribs/pyrax
pyrax/object_storage.py
Container.list
def list(self, marker=None, limit=None, prefix=None, delimiter=None, end_marker=None, full_listing=False, return_raw=False): """ List the objects in this container, using the parameters to control the number and content of objects. Note that this is limited by the absolute re...
python
def list(self, marker=None, limit=None, prefix=None, delimiter=None, end_marker=None, full_listing=False, return_raw=False): """ List the objects in this container, using the parameters to control the number and content of objects. Note that this is limited by the absolute re...
List the objects in this container, using the parameters to control the number and content of objects. Note that this is limited by the absolute request limits of Swift (currently 10,000 objects). If you need to list all objects in the container, use the `list_all()` method instead.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L332-L346
pycontribs/pyrax
pyrax/object_storage.py
Container.list_object_names
def list_object_names(self, marker=None, limit=None, prefix=None, delimiter=None, end_marker=None, full_listing=False): """ Returns a list of the names of all the objects in this container. The same pagination parameters apply as in self.list(). """ if full_listing: ...
python
def list_object_names(self, marker=None, limit=None, prefix=None, delimiter=None, end_marker=None, full_listing=False): """ Returns a list of the names of all the objects in this container. The same pagination parameters apply as in self.list(). """ if full_listing: ...
Returns a list of the names of all the objects in this container. The same pagination parameters apply as in self.list().
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L358-L369
pycontribs/pyrax
pyrax/object_storage.py
Container.create
def create(self, file_or_path=None, data=None, obj_name=None, content_type=None, etag=None, content_encoding=None, content_length=None, ttl=None, chunked=False, metadata=None, chunk_size=None, headers=None, return_none=False): """ Creates or replaces a storage object ...
python
def create(self, file_or_path=None, data=None, obj_name=None, content_type=None, etag=None, content_encoding=None, content_length=None, ttl=None, chunked=False, metadata=None, chunk_size=None, headers=None, return_none=False): """ Creates or replaces a storage object ...
Creates or replaces a storage object in this container. The content of the object can either be a stream of bytes (`data`), or a file on disk (`file_or_path`). The disk file can be either an open file-like object, or an absolute path to the file on disk. When creating object from a dat...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L392-L430
pycontribs/pyrax
pyrax/object_storage.py
Container.store_object
def store_object(self, obj_name, data, content_type=None, etag=None, content_encoding=None, ttl=None, return_none=False, headers=None, extra_info=None): """ Creates a new object in this container, and populates it with the given data. A StorageObject reference to the uplo...
python
def store_object(self, obj_name, data, content_type=None, etag=None, content_encoding=None, ttl=None, return_none=False, headers=None, extra_info=None): """ Creates a new object in this container, and populates it with the given data. A StorageObject reference to the uplo...
Creates a new object in this container, and populates it with the given data. A StorageObject reference to the uploaded file will be returned, unless 'return_none' is set to True. The 'extra_info' parameter is included for backwards compatibility. It is no longer used at all, and will n...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L433-L448
pycontribs/pyrax
pyrax/object_storage.py
Container.upload_file
def upload_file(self, file_or_path, obj_name=None, content_type=None, etag=None, return_none=False, content_encoding=None, ttl=None, content_length=None, headers=None): """ Uploads the specified file to this container. If no name is supplied, the file's name will be used....
python
def upload_file(self, file_or_path, obj_name=None, content_type=None, etag=None, return_none=False, content_encoding=None, ttl=None, content_length=None, headers=None): """ Uploads the specified file to this container. If no name is supplied, the file's name will be used....
Uploads the specified file to this container. If no name is supplied, the file's name will be used. Either a file path or an open file-like object may be supplied. A StorageObject reference to the uploaded file will be returned, unless 'return_none' is set to True. You may optionally se...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L451-L478
pycontribs/pyrax
pyrax/object_storage.py
Container.fetch
def fetch(self, obj, include_meta=False, chunk_size=None, size=None, extra_info=None): """ Fetches the object from storage. If 'include_meta' is False, only the bytes representing the stored object are returned. Note: if 'chunk_size' is defined, you must fully read ...
python
def fetch(self, obj, include_meta=False, chunk_size=None, size=None, extra_info=None): """ Fetches the object from storage. If 'include_meta' is False, only the bytes representing the stored object are returned. Note: if 'chunk_size' is defined, you must fully read ...
Fetches the object from storage. If 'include_meta' is False, only the bytes representing the stored object are returned. Note: if 'chunk_size' is defined, you must fully read the object's contents before making another request. If 'size' is specified, only the first 'size' byt...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L481-L506
pycontribs/pyrax
pyrax/object_storage.py
Container.fetch_object
def fetch_object(self, obj_name, include_meta=False, chunk_size=None): """ Alias for self.fetch(); included for backwards compatibility """ return self.fetch(obj=obj_name, include_meta=include_meta, chunk_size=chunk_size)
python
def fetch_object(self, obj_name, include_meta=False, chunk_size=None): """ Alias for self.fetch(); included for backwards compatibility """ return self.fetch(obj=obj_name, include_meta=include_meta, chunk_size=chunk_size)
Alias for self.fetch(); included for backwards compatibility
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L509-L514
pycontribs/pyrax
pyrax/object_storage.py
Container.download
def download(self, obj, directory, structure=True): """ Fetches the object from storage, and writes it to the specified directory. The directory must exist before calling this method. If the object name represents a nested folder structure, such as "foo/bar/baz.txt", that folder...
python
def download(self, obj, directory, structure=True): """ Fetches the object from storage, and writes it to the specified directory. The directory must exist before calling this method. If the object name represents a nested folder structure, such as "foo/bar/baz.txt", that folder...
Fetches the object from storage, and writes it to the specified directory. The directory must exist before calling this method. If the object name represents a nested folder structure, such as "foo/bar/baz.txt", that folder structure will be created in the target directory by default. I...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L525-L535
pycontribs/pyrax
pyrax/object_storage.py
Container.download_object
def download_object(self, obj_name, directory, structure=True): """ Alias for self.download(); included for backwards compatibility """ return self.download(obj=obj_name, directory=directory, structure=structure)
python
def download_object(self, obj_name, directory, structure=True): """ Alias for self.download(); included for backwards compatibility """ return self.download(obj=obj_name, directory=directory, structure=structure)
Alias for self.download(); included for backwards compatibility
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L538-L543
pycontribs/pyrax
pyrax/object_storage.py
Container.delete
def delete(self, del_objects=False): """ Deletes this Container. If the container contains objects, the command will fail unless 'del_objects' is passed as True. In that case, each object will be deleted first, and then the container. """ return self.manager.delete(self, ...
python
def delete(self, del_objects=False): """ Deletes this Container. If the container contains objects, the command will fail unless 'del_objects' is passed as True. In that case, each object will be deleted first, and then the container. """ return self.manager.delete(self, ...
Deletes this Container. If the container contains objects, the command will fail unless 'del_objects' is passed as True. In that case, each object will be deleted first, and then the container.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L546-L552
pycontribs/pyrax
pyrax/object_storage.py
Container.delete_object_in_seconds
def delete_object_in_seconds(self, obj, seconds, extra_info=None): """ Sets the object in this container to be deleted after the specified number of seconds. The 'extra_info' parameter is included for backwards compatibility. It is no longer used at all, and will not be modified...
python
def delete_object_in_seconds(self, obj, seconds, extra_info=None): """ Sets the object in this container to be deleted after the specified number of seconds. The 'extra_info' parameter is included for backwards compatibility. It is no longer used at all, and will not be modified...
Sets the object in this container to be deleted after the specified number of seconds. The 'extra_info' parameter is included for backwards compatibility. It is no longer used at all, and will not be modified with swiftclient info, since swiftclient is not used any more.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L565-L574
pycontribs/pyrax
pyrax/object_storage.py
Container.delete_all_objects
def delete_all_objects(self, async_=False): """ Deletes all objects from this container. By default the call will block until all objects have been deleted. By passing True for the 'async_' parameter, this method will not block, and instead return an object that can be used to f...
python
def delete_all_objects(self, async_=False): """ Deletes all objects from this container. By default the call will block until all objects have been deleted. By passing True for the 'async_' parameter, this method will not block, and instead return an object that can be used to f...
Deletes all objects from this container. By default the call will block until all objects have been deleted. By passing True for the 'async_' parameter, this method will not block, and instead return an object that can be used to follow the progress of the deletion. When deletion is com...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L577-L596
pycontribs/pyrax
pyrax/object_storage.py
Container.copy_object
def copy_object(self, obj, new_container, new_obj_name=None, content_type=None): """ Copies the object to the new container, optionally giving it a new name. If you copy to the same container, you must supply a different name. """ return self.manager.copy_object(self,...
python
def copy_object(self, obj, new_container, new_obj_name=None, content_type=None): """ Copies the object to the new container, optionally giving it a new name. If you copy to the same container, you must supply a different name. """ return self.manager.copy_object(self,...
Copies the object to the new container, optionally giving it a new name. If you copy to the same container, you must supply a different name.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L599-L606
pycontribs/pyrax
pyrax/object_storage.py
Container.move_object
def move_object(self, obj, new_container, new_obj_name=None, new_reference=False, content_type=None, extra_info=None): """ Works just like copy_object, except that the source object is deleted after a successful copy. You can optionally change the content_type of the object ...
python
def move_object(self, obj, new_container, new_obj_name=None, new_reference=False, content_type=None, extra_info=None): """ Works just like copy_object, except that the source object is deleted after a successful copy. You can optionally change the content_type of the object ...
Works just like copy_object, except that the source object is deleted after a successful copy. You can optionally change the content_type of the object by supplying that in the 'content_type' parameter. NOTE: any references to the original object will no longer be valid; you wi...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L609-L630
pycontribs/pyrax
pyrax/object_storage.py
Container.change_object_content_type
def change_object_content_type(self, obj, new_ctype, guess=False): """ Copies object to itself, but applies a new content-type. The guess feature requires this container to be CDN-enabled. If not, then the content-type must be supplied. If using guess with a CDN-enabled container...
python
def change_object_content_type(self, obj, new_ctype, guess=False): """ Copies object to itself, but applies a new content-type. The guess feature requires this container to be CDN-enabled. If not, then the content-type must be supplied. If using guess with a CDN-enabled container...
Copies object to itself, but applies a new content-type. The guess feature requires this container to be CDN-enabled. If not, then the content-type must be supplied. If using guess with a CDN-enabled container, new_ctype can be set to None. Failure during the put will result in an except...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L633-L642
pycontribs/pyrax
pyrax/object_storage.py
Container.get_temp_url
def get_temp_url(self, obj, seconds, method="GET", key=None, cached=True): """ Given a storage object in this container, returns a URL that can be used to access that object. The URL will expire after `seconds` seconds. The only methods supported are GET and PUT. Anything else w...
python
def get_temp_url(self, obj, seconds, method="GET", key=None, cached=True): """ Given a storage object in this container, returns a URL that can be used to access that object. The URL will expire after `seconds` seconds. The only methods supported are GET and PUT. Anything else w...
Given a storage object in this container, returns a URL that can be used to access that object. The URL will expire after `seconds` seconds. The only methods supported are GET and PUT. Anything else will raise an `InvalidTemporaryURLMethod` exception. If you have your Temporary...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L645-L659
pycontribs/pyrax
pyrax/object_storage.py
Container.set_object_metadata
def set_object_metadata(self, obj, metadata, clear=False, extra_info=None, prefix=None): """ Accepts a dictionary of metadata key/value pairs and updates the specified object metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed...
python
def set_object_metadata(self, obj, metadata, clear=False, extra_info=None, prefix=None): """ Accepts a dictionary of metadata key/value pairs and updates the specified object metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed...
Accepts a dictionary of metadata key/value pairs and updates the specified object metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Otherwise, the values passed here update the object's metadata. The 'extra_info' ...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L669-L688
pycontribs/pyrax
pyrax/object_storage.py
Container.list_subdirs
def list_subdirs(self, marker=None, limit=None, prefix=None, delimiter=None, full_listing=False): """ Return a list of the namesrepresenting the pseudo-subdirectories in this container. You can use the marker and limit params to handle pagination, and the prefix param to filt...
python
def list_subdirs(self, marker=None, limit=None, prefix=None, delimiter=None, full_listing=False): """ Return a list of the namesrepresenting the pseudo-subdirectories in this container. You can use the marker and limit params to handle pagination, and the prefix param to filt...
Return a list of the namesrepresenting the pseudo-subdirectories in this container. You can use the marker and limit params to handle pagination, and the prefix param to filter the objects returned. The delimiter param is there for backwards compatibility only, as the call requires the d...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L691-L701
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.list
def list(self, limit=None, marker=None, end_marker=None, prefix=None): """ Swift doesn't return listings in the same format as the rest of OpenStack, so this method has to be overriden. """ uri = "/%s" % self.uri_base qs = utils.dict_to_qs({"marker": marker, "limit": limi...
python
def list(self, limit=None, marker=None, end_marker=None, prefix=None): """ Swift doesn't return listings in the same format as the rest of OpenStack, so this method has to be overriden. """ uri = "/%s" % self.uri_base qs = utils.dict_to_qs({"marker": marker, "limit": limi...
Swift doesn't return listings in the same format as the rest of OpenStack, so this method has to be overriden.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L788-L800
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.get
def get(self, container): """ Returns a Container matching the specified container name. If no such container exists, a NoSuchContainer exception is raised. """ name = utils.get_name(container) uri = "/%s" % name resp, resp_body = self.api.method_head(uri) ...
python
def get(self, container): """ Returns a Container matching the specified container name. If no such container exists, a NoSuchContainer exception is raised. """ name = utils.get_name(container) uri = "/%s" % name resp, resp_body = self.api.method_head(uri) ...
Returns a Container matching the specified container name. If no such container exists, a NoSuchContainer exception is raised.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L804-L816
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.create
def create(self, name, metadata=None, prefix=None, *args, **kwargs): """ Creates a new container, and returns a Container object that represents that contianer. If a container by the same name already exists, no exception is raised; instead, a reference to that existing container is ...
python
def create(self, name, metadata=None, prefix=None, *args, **kwargs): """ Creates a new container, and returns a Container object that represents that contianer. If a container by the same name already exists, no exception is raised; instead, a reference to that existing container is ...
Creates a new container, and returns a Container object that represents that contianer. If a container by the same name already exists, no exception is raised; instead, a reference to that existing container is returned.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L819-L843
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.delete
def delete(self, container, del_objects=False): """ Deletes the specified container. If the container contains objects, the command will fail unless 'del_objects' is passed as True. In that case, each object will be deleted first, and then the container. """ if del_object...
python
def delete(self, container, del_objects=False): """ Deletes the specified container. If the container contains objects, the command will fail unless 'del_objects' is passed as True. In that case, each object will be deleted first, and then the container. """ if del_object...
Deletes the specified container. If the container contains objects, the command will fail unless 'del_objects' is passed as True. In that case, each object will be deleted first, and then the container.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L847-L857
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.fetch_cdn_data
def fetch_cdn_data(self, container): """ Returns a dict containing the CDN information for the specified container. If the container is not CDN-enabled, returns an empty dict. """ name = utils.get_name(container) uri = "/%s" % name try: resp, resp_body...
python
def fetch_cdn_data(self, container): """ Returns a dict containing the CDN information for the specified container. If the container is not CDN-enabled, returns an empty dict. """ name = utils.get_name(container) uri = "/%s" % name try: resp, resp_body...
Returns a dict containing the CDN information for the specified container. If the container is not CDN-enabled, returns an empty dict.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L868-L879
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.get_headers
def get_headers(self, container): """ Return the headers for the specified container. """ uri = "/%s" % utils.get_name(container) resp, resp_body = self.api.method_head(uri) return resp.headers
python
def get_headers(self, container): """ Return the headers for the specified container. """ uri = "/%s" % utils.get_name(container) resp, resp_body = self.api.method_head(uri) return resp.headers
Return the headers for the specified container.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L893-L899
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.get_account_metadata
def get_account_metadata(self, prefix=None): """ Returns a dictionary containing metadata about the account. """ headers = self.get_account_headers() if prefix is None: prefix = ACCOUNT_META_PREFIX low_prefix = prefix.lower() ret = {} for hkey,...
python
def get_account_metadata(self, prefix=None): """ Returns a dictionary containing metadata about the account. """ headers = self.get_account_headers() if prefix is None: prefix = ACCOUNT_META_PREFIX low_prefix = prefix.lower() ret = {} for hkey,...
Returns a dictionary containing metadata about the account.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L902-L916
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.set_account_metadata
def set_account_metadata(self, metadata, clear=False, prefix=None): """ Accepts a dictionary of metadata key/value pairs and updates the account metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Otherwise, the valu...
python
def set_account_metadata(self, metadata, clear=False, prefix=None): """ Accepts a dictionary of metadata key/value pairs and updates the account metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Otherwise, the valu...
Accepts a dictionary of metadata key/value pairs and updates the account metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Otherwise, the values passed here update the account's metadata. By default, the standard ...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L919-L945
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.delete_account_metadata
def delete_account_metadata(self, prefix=None): """ Removes all metadata matching the specified prefix from the account. By default, the standard account metadata prefix ('X-Account-Meta-') is prepended to the header name if it isn't present. For non-standard headers, you must i...
python
def delete_account_metadata(self, prefix=None): """ Removes all metadata matching the specified prefix from the account. By default, the standard account metadata prefix ('X-Account-Meta-') is prepended to the header name if it isn't present. For non-standard headers, you must i...
Removes all metadata matching the specified prefix from the account. By default, the standard account metadata prefix ('X-Account-Meta-') is prepended to the header name if it isn't present. For non-standard headers, you must include a non-None prefix, such as an empty string.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L948-L965
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.get_metadata
def get_metadata(self, container, prefix=None): """ Returns a dictionary containing the metadata for the container. """ headers = self.get_headers(container) if prefix is None: prefix = CONTAINER_META_PREFIX low_prefix = prefix.lower() ret = {} ...
python
def get_metadata(self, container, prefix=None): """ Returns a dictionary containing the metadata for the container. """ headers = self.get_headers(container) if prefix is None: prefix = CONTAINER_META_PREFIX low_prefix = prefix.lower() ret = {} ...
Returns a dictionary containing the metadata for the container.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L968-L981
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.set_metadata
def set_metadata(self, container, metadata, clear=False, prefix=None): """ Accepts a dictionary of metadata key/value pairs and updates the specified container metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Othe...
python
def set_metadata(self, container, metadata, clear=False, prefix=None): """ Accepts a dictionary of metadata key/value pairs and updates the specified container metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Othe...
Accepts a dictionary of metadata key/value pairs and updates the specified container metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Otherwise, the values passed here update the container's metadata. By default,...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L985-L1013
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.remove_metadata_key
def remove_metadata_key(self, container, key): """ Removes the specified key from the container's metadata. If the key does not exist in the metadata, nothing is done. """ meta_dict = {key: ""} return self.set_metadata(container, meta_dict)
python
def remove_metadata_key(self, container, key): """ Removes the specified key from the container's metadata. If the key does not exist in the metadata, nothing is done. """ meta_dict = {key: ""} return self.set_metadata(container, meta_dict)
Removes the specified key from the container's metadata. If the key does not exist in the metadata, nothing is done.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1016-L1022
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.delete_metadata
def delete_metadata(self, container, prefix=None): """ Removes all of the container's metadata. By default, all metadata beginning with the standard container metadata prefix ('X-Container-Meta-') is removed. If you wish to remove all metadata beginning with a different prefix, ...
python
def delete_metadata(self, container, prefix=None): """ Removes all of the container's metadata. By default, all metadata beginning with the standard container metadata prefix ('X-Container-Meta-') is removed. If you wish to remove all metadata beginning with a different prefix, ...
Removes all of the container's metadata. By default, all metadata beginning with the standard container metadata prefix ('X-Container-Meta-') is removed. If you wish to remove all metadata beginning with a different prefix, you must specify that prefix.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1026-L1044
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.get_cdn_metadata
def get_cdn_metadata(self, container): """ Returns a dictionary containing the CDN metadata for the container. If the container does not exist, a NotFound exception is raised. If the container exists, but is not CDN-enabled, a NotCDNEnabled exception is raised. """ ...
python
def get_cdn_metadata(self, container): """ Returns a dictionary containing the CDN metadata for the container. If the container does not exist, a NotFound exception is raised. If the container exists, but is not CDN-enabled, a NotCDNEnabled exception is raised. """ ...
Returns a dictionary containing the CDN metadata for the container. If the container does not exist, a NotFound exception is raised. If the container exists, but is not CDN-enabled, a NotCDNEnabled exception is raised.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1048-L1062
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.set_cdn_metadata
def set_cdn_metadata(self, container, metadata): """ Accepts a dictionary of metadata key/value pairs and updates the specified container metadata with them. NOTE: arbitrary metadata headers are not allowed. The only metadata you can update are: X-Log-Retention, X-CDN-enabled, a...
python
def set_cdn_metadata(self, container, metadata): """ Accepts a dictionary of metadata key/value pairs and updates the specified container metadata with them. NOTE: arbitrary metadata headers are not allowed. The only metadata you can update are: X-Log-Retention, X-CDN-enabled, a...
Accepts a dictionary of metadata key/value pairs and updates the specified container metadata with them. NOTE: arbitrary metadata headers are not allowed. The only metadata you can update are: X-Log-Retention, X-CDN-enabled, and X-TTL.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1066-L1089
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.get_temp_url
def get_temp_url(self, container, obj, seconds, method="GET", key=None, cached=True): """ Given a storage object in a container, returns a URL that can be used to access that object. The URL will expire after `seconds` seconds. The only methods supported are GET and PUT. Any...
python
def get_temp_url(self, container, obj, seconds, method="GET", key=None, cached=True): """ Given a storage object in a container, returns a URL that can be used to access that object. The URL will expire after `seconds` seconds. The only methods supported are GET and PUT. Any...
Given a storage object in a container, returns a URL that can be used to access that object. The URL will expire after `seconds` seconds. The only methods supported are GET and PUT. Anything else will raise an `InvalidTemporaryURLMethod` exception. If you have your Temporary URL key, y...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1092-L1137
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.list_containers_info
def list_containers_info(self, limit=None, marker=None): """Returns a list of info on Containers. For each container, a dict containing the following keys is returned: \code name - the name of the container count - the number of objects in the container bytes...
python
def list_containers_info(self, limit=None, marker=None): """Returns a list of info on Containers. For each container, a dict containing the following keys is returned: \code name - the name of the container count - the number of objects in the container bytes...
Returns a list of info on Containers. For each container, a dict containing the following keys is returned: \code name - the name of the container count - the number of objects in the container bytes - the total bytes in the container
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1140-L1154
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.list_public_containers
def list_public_containers(self): """ Returns a list of the names of all CDN-enabled containers. """ resp, resp_body = self.api.cdn_request("", "GET") return [cont["name"] for cont in resp_body]
python
def list_public_containers(self): """ Returns a list of the names of all CDN-enabled containers. """ resp, resp_body = self.api.cdn_request("", "GET") return [cont["name"] for cont in resp_body]
Returns a list of the names of all CDN-enabled containers.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1157-L1162
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.make_public
def make_public(self, container, ttl=None): """ Enables CDN access for the specified container, and optionally sets the TTL for the container. """ return self._set_cdn_access(container, public=True, ttl=ttl)
python
def make_public(self, container, ttl=None): """ Enables CDN access for the specified container, and optionally sets the TTL for the container. """ return self._set_cdn_access(container, public=True, ttl=ttl)
Enables CDN access for the specified container, and optionally sets the TTL for the container.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1165-L1170
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager._set_cdn_access
def _set_cdn_access(self, container, public, ttl=None): """ Enables or disables CDN access for the specified container, and optionally sets the TTL for the container when enabling access. """ headers = {"X-Cdn-Enabled": "%s" % public} if public and ttl: header...
python
def _set_cdn_access(self, container, public, ttl=None): """ Enables or disables CDN access for the specified container, and optionally sets the TTL for the container when enabling access. """ headers = {"X-Cdn-Enabled": "%s" % public} if public and ttl: header...
Enables or disables CDN access for the specified container, and optionally sets the TTL for the container when enabling access.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1182-L1191
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.get_cdn_log_retention
def get_cdn_log_retention(self, container): """ Returns the status of the setting for CDN log retention for the specified container. """ resp, resp_body = self.api.cdn_request("/%s" % utils.get_name(container), method="HEAD") return resp.headers.get("x-log...
python
def get_cdn_log_retention(self, container): """ Returns the status of the setting for CDN log retention for the specified container. """ resp, resp_body = self.api.cdn_request("/%s" % utils.get_name(container), method="HEAD") return resp.headers.get("x-log...
Returns the status of the setting for CDN log retention for the specified container.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1195-L1202
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.set_cdn_log_retention
def set_cdn_log_retention(self, container, enabled): """ Enables or disables whether CDN access logs for the specified container are collected and stored on Cloud Files. """ headers = {"X-Log-Retention": "%s" % enabled} self.api.cdn_request("/%s" % utils.get_name(containe...
python
def set_cdn_log_retention(self, container, enabled): """ Enables or disables whether CDN access logs for the specified container are collected and stored on Cloud Files. """ headers = {"X-Log-Retention": "%s" % enabled} self.api.cdn_request("/%s" % utils.get_name(containe...
Enables or disables whether CDN access logs for the specified container are collected and stored on Cloud Files.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1206-L1213
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.get_container_streaming_uri
def get_container_streaming_uri(self, container): """ Returns the URI for streaming content, or None if CDN is not enabled. """ resp, resp_body = self.api.cdn_request("/%s" % utils.get_name(container), method="HEAD") return resp.headers.get("x-cdn-streaming-uri")
python
def get_container_streaming_uri(self, container): """ Returns the URI for streaming content, or None if CDN is not enabled. """ resp, resp_body = self.api.cdn_request("/%s" % utils.get_name(container), method="HEAD") return resp.headers.get("x-cdn-streaming-uri")
Returns the URI for streaming content, or None if CDN is not enabled.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1217-L1223
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.set_web_index_page
def set_web_index_page(self, container, page): """ Sets the header indicating the index page in a container when creating a static website. Note: the container must be CDN-enabled for this to have any effect. """ headers = {"X-Container-Meta-Web-Index": "%s" % pa...
python
def set_web_index_page(self, container, page): """ Sets the header indicating the index page in a container when creating a static website. Note: the container must be CDN-enabled for this to have any effect. """ headers = {"X-Container-Meta-Web-Index": "%s" % pa...
Sets the header indicating the index page in a container when creating a static website. Note: the container must be CDN-enabled for this to have any effect.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1237-L1247
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.purge_cdn_object
def purge_cdn_object(self, container, obj, email_addresses=None): """ Removes a CDN-enabled object from public access before the TTL expires. Please note that there is a limit (at this time) of 25 such requests; if you need to purge more than that, you must contact support. If o...
python
def purge_cdn_object(self, container, obj, email_addresses=None): """ Removes a CDN-enabled object from public access before the TTL expires. Please note that there is a limit (at this time) of 25 such requests; if you need to purge more than that, you must contact support. If o...
Removes a CDN-enabled object from public access before the TTL expires. Please note that there is a limit (at this time) of 25 such requests; if you need to purge more than that, you must contact support. If one or more email_addresses are included, an email confirming the purge is sent...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1265-L1274
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.list_objects
def list_objects(self, container, limit=None, marker=None, prefix=None, delimiter=None, end_marker=None, full_listing=False): """ Return a list of StorageObjects representing the objects in this container. You can use the marker, end_marker, and limit params to handle paginat...
python
def list_objects(self, container, limit=None, marker=None, prefix=None, delimiter=None, end_marker=None, full_listing=False): """ Return a list of StorageObjects representing the objects in this container. You can use the marker, end_marker, and limit params to handle paginat...
Return a list of StorageObjects representing the objects in this container. You can use the marker, end_marker, and limit params to handle pagination, and the prefix and delimiter params to filter the objects returned. By default only the first 10,000 objects are returned; if you need to...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1278-L1291
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.list_object_names
def list_object_names(self, container, marker=None, limit=None, prefix=None, delimiter=None, end_marker=None, full_listing=False): """ Return a list of then names of the objects in this container. You can use the marker, end_marker, and limit params to handle pagination, and ...
python
def list_object_names(self, container, marker=None, limit=None, prefix=None, delimiter=None, end_marker=None, full_listing=False): """ Return a list of then names of the objects in this container. You can use the marker, end_marker, and limit params to handle pagination, and ...
Return a list of then names of the objects in this container. You can use the marker, end_marker, and limit params to handle pagination, and the prefix and delimiter params to filter the objects returned. By default only the first 10,000 objects are returned; if you need to access more t...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1295-L1306
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.list_subdirs
def list_subdirs(self, container, marker=None, limit=None, prefix=None, delimiter=None, full_listing=False): """ Returns a list of StorageObjects representing the pseudo-subdirectories in the specified container. You can use the marker and limit params to handle pagination, a...
python
def list_subdirs(self, container, marker=None, limit=None, prefix=None, delimiter=None, full_listing=False): """ Returns a list of StorageObjects representing the pseudo-subdirectories in the specified container. You can use the marker and limit params to handle pagination, a...
Returns a list of StorageObjects representing the pseudo-subdirectories in the specified container. You can use the marker and limit params to handle pagination, and the prefix param to filter the objects returned. The 'delimiter' parameter is ignored, as the only meaningful value is '/'...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1319-L1333
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.download_object
def download_object(self, container, obj, directory, structure=True): """ Fetches the object from storage, and writes it to the specified directory. The directory must exist before calling this method. If the object name represents a nested folder structure, such as "foo/bar/baz...
python
def download_object(self, container, obj, directory, structure=True): """ Fetches the object from storage, and writes it to the specified directory. The directory must exist before calling this method. If the object name represents a nested folder structure, such as "foo/bar/baz...
Fetches the object from storage, and writes it to the specified directory. The directory must exist before calling this method. If the object name represents a nested folder structure, such as "foo/bar/baz.txt", that folder structure will be created in the target directory by default. I...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1421-L1431
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.copy_object
def copy_object(self, container, obj, new_container, new_obj_name=None, content_type=None): """ Copies the object to the new container, optionally giving it a new name. If you copy to the same container, you must supply a different name. Returns the etag of the newly-copied ...
python
def copy_object(self, container, obj, new_container, new_obj_name=None, content_type=None): """ Copies the object to the new container, optionally giving it a new name. If you copy to the same container, you must supply a different name. Returns the etag of the newly-copied ...
Copies the object to the new container, optionally giving it a new name. If you copy to the same container, you must supply a different name. Returns the etag of the newly-copied object. You can optionally change the content_type of the object by supplying that in the 'content_type' pa...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1446-L1465
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.move_object
def move_object(self, container, obj, new_container, new_obj_name=None, new_reference=False, content_type=None): """ Works just like copy_object, except that the source object is deleted after a successful copy. You can optionally change the content_type of the object by sup...
python
def move_object(self, container, obj, new_container, new_obj_name=None, new_reference=False, content_type=None): """ Works just like copy_object, except that the source object is deleted after a successful copy. You can optionally change the content_type of the object by sup...
Works just like copy_object, except that the source object is deleted after a successful copy. You can optionally change the content_type of the object by supplying that in the 'content_type' parameter. NOTE: any references to the original object will no longer be valid; you wi...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1468-L1492
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.change_object_content_type
def change_object_content_type(self, container, obj, new_ctype, guess=False): """ Copies object to itself, but applies a new content-type. The guess feature requires the container to be CDN-enabled. If not, then the content-type must be supplied. If using guess with a CDN-ena...
python
def change_object_content_type(self, container, obj, new_ctype, guess=False): """ Copies object to itself, but applies a new content-type. The guess feature requires the container to be CDN-enabled. If not, then the content-type must be supplied. If using guess with a CDN-ena...
Copies object to itself, but applies a new content-type. The guess feature requires the container to be CDN-enabled. If not, then the content-type must be supplied. If using guess with a CDN-enabled container, new_ctype can be set to None. Failure during the put will result in an excepti...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1496-L1512
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.delete_object_in_seconds
def delete_object_in_seconds(self, cont, obj, seconds, extra_info=None): """ Sets the object in the specified container to be deleted after the specified number of seconds. The 'extra_info' parameter is included for backwards compatibility. It is no longer used at all, and will ...
python
def delete_object_in_seconds(self, cont, obj, seconds, extra_info=None): """ Sets the object in the specified container to be deleted after the specified number of seconds. The 'extra_info' parameter is included for backwards compatibility. It is no longer used at all, and will ...
Sets the object in the specified container to be deleted after the specified number of seconds. The 'extra_info' parameter is included for backwards compatibility. It is no longer used at all, and will not be modified with swiftclient info, since swiftclient is not used any more.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1515-L1525
pycontribs/pyrax
pyrax/object_storage.py
ContainerManager.set_object_metadata
def set_object_metadata(self, container, obj, metadata, clear=False, extra_info=None, prefix=None): """ Accepts a dictionary of metadata key/value pairs and updates the specified object metadata with them. If 'clear' is True, any existing metadata is deleted and only the ...
python
def set_object_metadata(self, container, obj, metadata, clear=False, extra_info=None, prefix=None): """ Accepts a dictionary of metadata key/value pairs and updates the specified object metadata with them. If 'clear' is True, any existing metadata is deleted and only the ...
Accepts a dictionary of metadata key/value pairs and updates the specified object metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Otherwise, the values passed here update the object's metadata. 'extra_info; is a...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1537-L1556
pycontribs/pyrax
pyrax/object_storage.py
StorageObject.get
def get(self, include_meta=False, chunk_size=None): """ Fetches the object from storage. If 'include_meta' is False, only the bytes representing the file is returned. Note: if 'chunk_size' is defined, you must fully read the object's contents before making another reque...
python
def get(self, include_meta=False, chunk_size=None): """ Fetches the object from storage. If 'include_meta' is False, only the bytes representing the file is returned. Note: if 'chunk_size' is defined, you must fully read the object's contents before making another reque...
Fetches the object from storage. If 'include_meta' is False, only the bytes representing the file is returned. Note: if 'chunk_size' is defined, you must fully read the object's contents before making another request. When 'include_meta' is True, what is returned from this met...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1605-L1621
pycontribs/pyrax
pyrax/object_storage.py
StorageObject.download
def download(self, directory, structure=True): """ Fetches the object from storage, and writes it to the specified directory. The directory must exist before calling this method. If the object name represents a nested folder structure, such as "foo/bar/baz.txt", that folder stru...
python
def download(self, directory, structure=True): """ Fetches the object from storage, and writes it to the specified directory. The directory must exist before calling this method. If the object name represents a nested folder structure, such as "foo/bar/baz.txt", that folder stru...
Fetches the object from storage, and writes it to the specified directory. The directory must exist before calling this method. If the object name represents a nested folder structure, such as "foo/bar/baz.txt", that folder structure will be created in the target directory by default. I...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1626-L1636
pycontribs/pyrax
pyrax/object_storage.py
StorageObject.copy
def copy(self, new_container, new_obj_name=None, extra_info=None): """ Copies this object to the new container, optionally giving it a new name. If you copy to the same container, you must supply a different name. """ return self.container.copy_object(self, new_container...
python
def copy(self, new_container, new_obj_name=None, extra_info=None): """ Copies this object to the new container, optionally giving it a new name. If you copy to the same container, you must supply a different name. """ return self.container.copy_object(self, new_container...
Copies this object to the new container, optionally giving it a new name. If you copy to the same container, you must supply a different name.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1639-L1646
pycontribs/pyrax
pyrax/object_storage.py
StorageObject.move
def move(self, new_container, new_obj_name=None, extra_info=None): """ Works just like copy_object, except that this object is deleted after a successful copy. This means that this storage_object reference will no longer be valid. """ return self.container.move_object(sel...
python
def move(self, new_container, new_obj_name=None, extra_info=None): """ Works just like copy_object, except that this object is deleted after a successful copy. This means that this storage_object reference will no longer be valid. """ return self.container.move_object(sel...
Works just like copy_object, except that this object is deleted after a successful copy. This means that this storage_object reference will no longer be valid.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1649-L1656
pycontribs/pyrax
pyrax/object_storage.py
StorageObject.change_content_type
def change_content_type(self, new_ctype, guess=False): """ Copies object to itself, but applies a new content-type. The guess feature requires the container to be CDN-enabled. If not then the content-type must be supplied. If using guess with a CDN-enabled container, new_ctype ca...
python
def change_content_type(self, new_ctype, guess=False): """ Copies object to itself, but applies a new content-type. The guess feature requires the container to be CDN-enabled. If not then the content-type must be supplied. If using guess with a CDN-enabled container, new_ctype ca...
Copies object to itself, but applies a new content-type. The guess feature requires the container to be CDN-enabled. If not then the content-type must be supplied. If using guess with a CDN-enabled container, new_ctype can be set to None. Failure during the put will result in a swift exc...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1659-L1668
pycontribs/pyrax
pyrax/object_storage.py
StorageObject.remove_metadata_key
def remove_metadata_key(self, key, prefix=None): """ Removes the specified key from the storage object's metadata. If the key does not exist in the metadata, nothing is done. """ self.manager.remove_metadata_key(self, key, prefix=prefix)
python
def remove_metadata_key(self, key, prefix=None): """ Removes the specified key from the storage object's metadata. If the key does not exist in the metadata, nothing is done. """ self.manager.remove_metadata_key(self, key, prefix=prefix)
Removes the specified key from the storage object's metadata. If the key does not exist in the metadata, nothing is done.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1707-L1712
pycontribs/pyrax
pyrax/object_storage.py
StorageObject.get_temp_url
def get_temp_url(self, seconds, method="GET"): """ Returns a URL that can be used to access this object. The URL will expire after `seconds` seconds. The only methods supported are GET and PUT. Anything else will raise an InvalidTemporaryURLMethod exception. """ ...
python
def get_temp_url(self, seconds, method="GET"): """ Returns a URL that can be used to access this object. The URL will expire after `seconds` seconds. The only methods supported are GET and PUT. Anything else will raise an InvalidTemporaryURLMethod exception. """ ...
Returns a URL that can be used to access this object. The URL will expire after `seconds` seconds. The only methods supported are GET and PUT. Anything else will raise an InvalidTemporaryURLMethod exception.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1715-L1724
pycontribs/pyrax
pyrax/object_storage.py
StorageObjectManager.get
def get(self, obj): """ Gets the information about the specified object. This overrides the base behavior, since Swift uses HEAD to get information, and GET to download the object. """ name = utils.get_name(obj) uri = "/%s/%s" % (self.uri_base, name) resp...
python
def get(self, obj): """ Gets the information about the specified object. This overrides the base behavior, since Swift uses HEAD to get information, and GET to download the object. """ name = utils.get_name(obj) uri = "/%s/%s" % (self.uri_base, name) resp...
Gets the information about the specified object. This overrides the base behavior, since Swift uses HEAD to get information, and GET to download the object.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1783-L1805
pycontribs/pyrax
pyrax/object_storage.py
StorageObjectManager.create
def create(self, file_or_path=None, data=None, obj_name=None, content_type=None, etag=None, content_encoding=None, content_length=None, ttl=None, chunked=False, metadata=None, chunk_size=None, headers=None, return_none=False): """ Creates or replaces a storage object ...
python
def create(self, file_or_path=None, data=None, obj_name=None, content_type=None, etag=None, content_encoding=None, content_length=None, ttl=None, chunked=False, metadata=None, chunk_size=None, headers=None, return_none=False): """ Creates or replaces a storage object ...
Creates or replaces a storage object in this container. The content of the object can either be a stream of bytes (`data`), or a file on disk (`file_or_path`). The disk file can be either an open file-like object, or an absolute path to the file on disk. When creating object from a dat...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1808-L1878
pycontribs/pyrax
pyrax/object_storage.py
StorageObjectManager._upload
def _upload(self, obj_name, content, content_type, content_encoding, content_length, etag, chunked, chunk_size, headers): """ Handles the uploading of content, including working around the 5GB maximum file size. """ if content_type is not None: headers["Co...
python
def _upload(self, obj_name, content, content_type, content_encoding, content_length, etag, chunked, chunk_size, headers): """ Handles the uploading of content, including working around the 5GB maximum file size. """ if content_type is not None: headers["Co...
Handles the uploading of content, including working around the 5GB maximum file size.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1881-L1924
pycontribs/pyrax
pyrax/object_storage.py
StorageObjectManager._store_object
def _store_object(self, obj_name, content, etag=None, chunked=False, chunk_size=None, headers=None): """ Handles the low-level creation of a storage object and the uploading of the contents of that object. """ head_etag = headers.pop("ETag", "") if chunked: ...
python
def _store_object(self, obj_name, content, etag=None, chunked=False, chunk_size=None, headers=None): """ Handles the low-level creation of a storage object and the uploading of the contents of that object. """ head_etag = headers.pop("ETag", "") if chunked: ...
Handles the low-level creation of a storage object and the uploading of the contents of that object.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1927-L1945
pycontribs/pyrax
pyrax/object_storage.py
StorageObjectManager.fetch
def fetch(self, obj, include_meta=False, chunk_size=None, size=None, extra_info=None): """ Fetches the object from storage. If 'include_meta' is False, only the bytes representing the stored object are returned. Note: if 'chunk_size' is defined, the 'include_meta' p...
python
def fetch(self, obj, include_meta=False, chunk_size=None, size=None, extra_info=None): """ Fetches the object from storage. If 'include_meta' is False, only the bytes representing the stored object are returned. Note: if 'chunk_size' is defined, the 'include_meta' p...
Fetches the object from storage. If 'include_meta' is False, only the bytes representing the stored object are returned. Note: if 'chunk_size' is defined, the 'include_meta' parameter is ignored. If 'size' is specified, only the first 'size' bytes of the object will be...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1949-L1988
pycontribs/pyrax
pyrax/object_storage.py
StorageObjectManager._fetch_chunker
def _fetch_chunker(self, uri, chunk_size, size, obj_size): """ Returns a generator that returns an object in chunks. """ pos = 0 total_bytes = 0 size = size or obj_size max_size = min(size, obj_size) while True: endpos = min(obj_size, pos + chu...
python
def _fetch_chunker(self, uri, chunk_size, size, obj_size): """ Returns a generator that returns an object in chunks. """ pos = 0 total_bytes = 0 size = size or obj_size max_size = min(size, obj_size) while True: endpos = min(obj_size, pos + chu...
Returns a generator that returns an object in chunks.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L1991-L2011
pycontribs/pyrax
pyrax/object_storage.py
StorageObjectManager.delete_all_objects
def delete_all_objects(self, nms, async_=False): """ Deletes all objects from this container. By default the call will block until all objects have been deleted. By passing True for the 'async_' parameter, this method will not block, and instead return an object that can be used...
python
def delete_all_objects(self, nms, async_=False): """ Deletes all objects from this container. By default the call will block until all objects have been deleted. By passing True for the 'async_' parameter, this method will not block, and instead return an object that can be used...
Deletes all objects from this container. By default the call will block until all objects have been deleted. By passing True for the 'async_' parameter, this method will not block, and instead return an object that can be used to follow the progress of the deletion. When deletion is com...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2031-L2051
pycontribs/pyrax
pyrax/object_storage.py
StorageObjectManager.download
def download(self, obj, directory, structure=True): """ Fetches the object from storage, and writes it to the specified directory. The directory must exist before calling this method. If the object name represents a nested folder structure, such as "foo/bar/baz.txt", that folder...
python
def download(self, obj, directory, structure=True): """ Fetches the object from storage, and writes it to the specified directory. The directory must exist before calling this method. If the object name represents a nested folder structure, such as "foo/bar/baz.txt", that folder...
Fetches the object from storage, and writes it to the specified directory. The directory must exist before calling this method. If the object name represents a nested folder structure, such as "foo/bar/baz.txt", that folder structure will be created in the target directory by default. I...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2055-L2083
pycontribs/pyrax
pyrax/object_storage.py
StorageObjectManager.purge
def purge(self, obj, email_addresses=None): """ Removes a CDN-enabled object from public access before the TTL expires. Please note that there is a limit (at this time) of 25 such requests; if you need to purge more than that, you must contact support. If one or more email_addre...
python
def purge(self, obj, email_addresses=None): """ Removes a CDN-enabled object from public access before the TTL expires. Please note that there is a limit (at this time) of 25 such requests; if you need to purge more than that, you must contact support. If one or more email_addre...
Removes a CDN-enabled object from public access before the TTL expires. Please note that there is a limit (at this time) of 25 such requests; if you need to purge more than that, you must contact support. If one or more email_addresses are included, an email confirming the purge is sent...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2087-L2104
pycontribs/pyrax
pyrax/object_storage.py
StorageObjectManager.get_metadata
def get_metadata(self, obj, prefix=None): """ Returns the metadata for the specified object as a dict. """ uri = "/%s/%s" % (self.uri_base, utils.get_name(obj)) resp, resp_body = self.api.method_head(uri) ret = {} # Add the metadata prefix, if needed. if p...
python
def get_metadata(self, obj, prefix=None): """ Returns the metadata for the specified object as a dict. """ uri = "/%s/%s" % (self.uri_base, utils.get_name(obj)) resp, resp_body = self.api.method_head(uri) ret = {} # Add the metadata prefix, if needed. if p...
Returns the metadata for the specified object as a dict.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2108-L2124
pycontribs/pyrax
pyrax/object_storage.py
StorageObjectManager.set_metadata
def set_metadata(self, obj, metadata, clear=False, prefix=None): """ Accepts a dictionary of metadata key/value pairs and updates the specified object metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Otherwise, th...
python
def set_metadata(self, obj, metadata, clear=False, prefix=None): """ Accepts a dictionary of metadata key/value pairs and updates the specified object metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Otherwise, th...
Accepts a dictionary of metadata key/value pairs and updates the specified object metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Otherwise, the values passed here update the object's metadata. By default, the s...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2128-L2165
pycontribs/pyrax
pyrax/object_storage.py
StorageObjectManager.remove_metadata_key
def remove_metadata_key(self, obj, key): """ Removes the specified key from the object's metadata. If the key does not exist in the metadata, nothing is done. """ meta_dict = {key: ""} return self.set_metadata(obj, meta_dict)
python
def remove_metadata_key(self, obj, key): """ Removes the specified key from the object's metadata. If the key does not exist in the metadata, nothing is done. """ meta_dict = {key: ""} return self.set_metadata(obj, meta_dict)
Removes the specified key from the object's metadata. If the key does not exist in the metadata, nothing is done.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2169-L2175
pycontribs/pyrax
pyrax/object_storage.py
StorageClient._configure_cdn
def _configure_cdn(self): """ Initialize CDN-related endpoints, if available. """ ident = self.identity cdn_svc = ident.services.get("object_cdn") if cdn_svc: ep = cdn_svc.endpoints.get(self.region_name) if ep: self.cdn_management_u...
python
def _configure_cdn(self): """ Initialize CDN-related endpoints, if available. """ ident = self.identity cdn_svc = ident.services.get("object_cdn") if cdn_svc: ep = cdn_svc.endpoints.get(self.region_name) if ep: self.cdn_management_u...
Initialize CDN-related endpoints, if available.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2219-L2228
pycontribs/pyrax
pyrax/object_storage.py
StorageClient._backwards_aliases
def _backwards_aliases(self): """ In order to keep this backwards-compatible with previous versions, alias the old names to the new methods. """ self.list_containers = self.list_container_names self.get_all_containers = self.list self.get_container = self.get ...
python
def _backwards_aliases(self): """ In order to keep this backwards-compatible with previous versions, alias the old names to the new methods. """ self.list_containers = self.list_container_names self.get_all_containers = self.list self.get_container = self.get ...
In order to keep this backwards-compatible with previous versions, alias the old names to the new methods.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2231-L2243
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.get
def get(self, item): """ Returns the container whose name is provided as 'item'. If 'item' is not a string, the original item is returned unchanged. """ if isinstance(item, six.string_types): item = super(StorageClient, self).get(item) return item
python
def get(self, item): """ Returns the container whose name is provided as 'item'. If 'item' is not a string, the original item is returned unchanged. """ if isinstance(item, six.string_types): item = super(StorageClient, self).get(item) return item
Returns the container whose name is provided as 'item'. If 'item' is not a string, the original item is returned unchanged.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2246-L2253
pycontribs/pyrax
pyrax/object_storage.py
StorageClient._configure_manager
def _configure_manager(self): """ Creates a manager to handle interacting with Containers. """ self._manager = ContainerManager(self, resource_class=Container, response_key="", uri_base="")
python
def _configure_manager(self): """ Creates a manager to handle interacting with Containers. """ self._manager = ContainerManager(self, resource_class=Container, response_key="", uri_base="")
Creates a manager to handle interacting with Containers.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2256-L2261
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.get_account_details
def get_account_details(self): """ Returns a dictionary containing information about the account. """ headers = self._manager.get_account_headers() acct_prefix = "x-account-" meta_prefix = ACCOUNT_META_PREFIX.lower() ret = {} for hkey, hval in list(headers...
python
def get_account_details(self): """ Returns a dictionary containing information about the account. """ headers = self._manager.get_account_headers() acct_prefix = "x-account-" meta_prefix = ACCOUNT_META_PREFIX.lower() ret = {} for hkey, hval in list(headers...
Returns a dictionary containing information about the account.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2271-L2289
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.get_account_info
def get_account_info(self): """ Returns a tuple for the number of containers and total bytes in the account. """ headers = self._manager.get_account_headers() return (headers.get("x-account-container-count"), headers.get("x-account-bytes-used"))
python
def get_account_info(self): """ Returns a tuple for the number of containers and total bytes in the account. """ headers = self._manager.get_account_headers() return (headers.get("x-account-container-count"), headers.get("x-account-bytes-used"))
Returns a tuple for the number of containers and total bytes in the account.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2292-L2299
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.set_account_metadata
def set_account_metadata(self, metadata, clear=False, prefix=None, extra_info=None): """ Accepts a dictionary of metadata key/value pairs and updates the account's metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata i...
python
def set_account_metadata(self, metadata, clear=False, prefix=None, extra_info=None): """ Accepts a dictionary of metadata key/value pairs and updates the account's metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata i...
Accepts a dictionary of metadata key/value pairs and updates the account's metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Otherwise, the values passed here update the account's metadata. By default, the standar...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2309-L2328
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.get_temp_url_key
def get_temp_url_key(self, cached=True): """ Returns the current TempURL key, or None if it has not been set. By default the value returned is cached. To force an API call to get the current value on the server, pass `cached=False`. """ meta = self._cached_temp_url_key ...
python
def get_temp_url_key(self, cached=True): """ Returns the current TempURL key, or None if it has not been set. By default the value returned is cached. To force an API call to get the current value on the server, pass `cached=False`. """ meta = self._cached_temp_url_key ...
Returns the current TempURL key, or None if it has not been set. By default the value returned is cached. To force an API call to get the current value on the server, pass `cached=False`.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2342-L2354
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.set_temp_url_key
def set_temp_url_key(self, key=None): """ Sets the key for the Temporary URL for the account. It should be a key that is secret to the owner. If no key is provided, a UUID value will be generated and used. It can later be obtained by calling get_temp_url_key(). """ ...
python
def set_temp_url_key(self, key=None): """ Sets the key for the Temporary URL for the account. It should be a key that is secret to the owner. If no key is provided, a UUID value will be generated and used. It can later be obtained by calling get_temp_url_key(). """ ...
Sets the key for the Temporary URL for the account. It should be a key that is secret to the owner. If no key is provided, a UUID value will be generated and used. It can later be obtained by calling get_temp_url_key().
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2357-L2369
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.get_temp_url
def get_temp_url(self, container, obj, seconds, method="GET", key=None, cached=True): """ Given a storage object in a container, returns a URL that can be used to access that object. The URL will expire after `seconds` seconds. The only methods supported are GET and PUT. Any...
python
def get_temp_url(self, container, obj, seconds, method="GET", key=None, cached=True): """ Given a storage object in a container, returns a URL that can be used to access that object. The URL will expire after `seconds` seconds. The only methods supported are GET and PUT. Any...
Given a storage object in a container, returns a URL that can be used to access that object. The URL will expire after `seconds` seconds. The only methods supported are GET and PUT. Anything else will raise an `InvalidTemporaryURLMethod` exception. If you have your Temporary URL key, y...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2372-L2386
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.list
def list(self, limit=None, marker=None, end_marker=None, prefix=None): """ List the containers in this account, using the parameters to control the pagination of containers, since by default only the first 10,000 containers are returned. """ return self._manager.list(limi...
python
def list(self, limit=None, marker=None, end_marker=None, prefix=None): """ List the containers in this account, using the parameters to control the pagination of containers, since by default only the first 10,000 containers are returned. """ return self._manager.list(limi...
List the containers in this account, using the parameters to control the pagination of containers, since by default only the first 10,000 containers are returned.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2389-L2396
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.make_container_public
def make_container_public(self, container, ttl=None): """ Enables CDN access for the specified container, and optionally sets the TTL for the container. """ return self._manager.make_public(container, ttl=ttl)
python
def make_container_public(self, container, ttl=None): """ Enables CDN access for the specified container, and optionally sets the TTL for the container. """ return self._manager.make_public(container, ttl=ttl)
Enables CDN access for the specified container, and optionally sets the TTL for the container.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2406-L2411
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.list_containers_info
def list_containers_info(self, limit=None, marker=None): """Returns a list of info on Containers. For each container, a dict containing the following keys is returned: \code name - the name of the container count - the number of objects in the container bytes...
python
def list_containers_info(self, limit=None, marker=None): """Returns a list of info on Containers. For each container, a dict containing the following keys is returned: \code name - the name of the container count - the number of objects in the container bytes...
Returns a list of info on Containers. For each container, a dict containing the following keys is returned: \code name - the name of the container count - the number of objects in the container bytes - the total bytes in the container
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2494-L2503
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.list_container_subdirs
def list_container_subdirs(self, container, limit=None, marker=None, prefix=None, delimiter=None, full_listing=False): """ Although you cannot nest directories, you can simulate a hierarchical structure within a single container by adding forward slash characters (/) in the o...
python
def list_container_subdirs(self, container, limit=None, marker=None, prefix=None, delimiter=None, full_listing=False): """ Although you cannot nest directories, you can simulate a hierarchical structure within a single container by adding forward slash characters (/) in the o...
Although you cannot nest directories, you can simulate a hierarchical structure within a single container by adding forward slash characters (/) in the object name. This method returns a list of all of these pseudo-subdirectories in the specified container.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2506-L2516
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.list_container_object_names
def list_container_object_names(self, container, limit=None, marker=None, prefix=None, delimiter=None, full_listing=False): """ Returns the names of all the objects in the specified container, optionally limited by the pagination parameters. """ return self._manager.l...
python
def list_container_object_names(self, container, limit=None, marker=None, prefix=None, delimiter=None, full_listing=False): """ Returns the names of all the objects in the specified container, optionally limited by the pagination parameters. """ return self._manager.l...
Returns the names of all the objects in the specified container, optionally limited by the pagination parameters.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2519-L2527
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.get_container_metadata
def get_container_metadata(self, container, prefix=None): """ Returns a dictionary containing the metadata for the container. """ return self._manager.get_metadata(container, prefix=prefix)
python
def get_container_metadata(self, container, prefix=None): """ Returns a dictionary containing the metadata for the container. """ return self._manager.get_metadata(container, prefix=prefix)
Returns a dictionary containing the metadata for the container.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2530-L2534
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.set_container_metadata
def set_container_metadata(self, container, metadata, clear=False, prefix=None): """ Accepts a dictionary of metadata key/value pairs and updates the specified container metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed meta...
python
def set_container_metadata(self, container, metadata, clear=False, prefix=None): """ Accepts a dictionary of metadata key/value pairs and updates the specified container metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed meta...
Accepts a dictionary of metadata key/value pairs and updates the specified container metadata with them. If 'clear' is True, any existing metadata is deleted and only the passed metadata is retained. Otherwise, the values passed here update the container's metadata. By default,...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2537-L2553
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.delete_container_metadata
def delete_container_metadata(self, container, prefix=None): """ Removes all of thethe container's metadata. By default, all metadata beginning with the standard container metadata prefix ('X-Container-Meta-') is removed. If you wish to remove all metadata beginning with a diffe...
python
def delete_container_metadata(self, container, prefix=None): """ Removes all of thethe container's metadata. By default, all metadata beginning with the standard container metadata prefix ('X-Container-Meta-') is removed. If you wish to remove all metadata beginning with a diffe...
Removes all of thethe container's metadata. By default, all metadata beginning with the standard container metadata prefix ('X-Container-Meta-') is removed. If you wish to remove all metadata beginning with a different prefix, you must specify that prefix.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2564-L2573
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.get_object_metadata
def get_object_metadata(self, container, obj, prefix=None): """ Returns the metadata for the specified object as a dict. """ return self._manager.get_object_metadata(container, obj, prefix=prefix)
python
def get_object_metadata(self, container, obj, prefix=None): """ Returns the metadata for the specified object as a dict. """ return self._manager.get_object_metadata(container, obj, prefix=prefix)
Returns the metadata for the specified object as a dict.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2594-L2598
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.remove_object_metadata_key
def remove_object_metadata_key(self, container, obj, key, prefix=None): """ Removes the specified key from the storage object's metadata. If the key does not exist in the metadata, nothing is done. """ self.set_object_metadata(container, obj, {key: ""}, prefix=prefix)
python
def remove_object_metadata_key(self, container, obj, key, prefix=None): """ Removes the specified key from the storage object's metadata. If the key does not exist in the metadata, nothing is done. """ self.set_object_metadata(container, obj, {key: ""}, prefix=prefix)
Removes the specified key from the storage object's metadata. If the key does not exist in the metadata, nothing is done.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2623-L2628
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.list_container_objects
def list_container_objects(self, container, limit=None, marker=None, prefix=None, delimiter=None, end_marker=None, full_listing=False): """ Return a list of StorageObjects representing the objects in the container. You can use the marker, end_marker, and limit params to handl...
python
def list_container_objects(self, container, limit=None, marker=None, prefix=None, delimiter=None, end_marker=None, full_listing=False): """ Return a list of StorageObjects representing the objects in the container. You can use the marker, end_marker, and limit params to handl...
Return a list of StorageObjects representing the objects in the container. You can use the marker, end_marker, and limit params to handle pagination, and the prefix and delimiter params to filter the objects returned. Also, by default only the first 10,000 objects are returned; if you s...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2631-L2648