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
StorageClient.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#L2655-L2664
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.store_object
def store_object(self, container, obj_name, data, content_type=None, etag=None, content_encoding=None, ttl=None, return_none=False, chunk_size=None, headers=None, metadata=None, extra_info=None): """ Creates a new object in the specified container, and populates it with t...
python
def store_object(self, container, obj_name, data, content_type=None, etag=None, content_encoding=None, ttl=None, return_none=False, chunk_size=None, headers=None, metadata=None, extra_info=None): """ Creates a new object in the specified container, and populates it with t...
Creates a new object in the specified 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, a...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2674-L2690
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.upload_file
def upload_file(self, container, file_or_path, obj_name=None, content_type=None, etag=None, content_encoding=None, ttl=None, content_length=None, return_none=False, headers=None, metadata=None, extra_info=None): """ Uploads the specified file to the container. If no n...
python
def upload_file(self, container, file_or_path, obj_name=None, content_type=None, etag=None, content_encoding=None, ttl=None, content_length=None, return_none=False, headers=None, metadata=None, extra_info=None): """ Uploads the specified file to the container. If no n...
Uploads the specified file to the 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 set...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2693-L2720
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.fetch_object
def fetch_object(self, container, 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, yo...
python
def fetch_object(self, container, 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, yo...
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#L2763-L2788
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.fetch_partial
def fetch_partial(self, container, obj, size): """ Returns the first 'size' bytes of an object. If the object is smaller than the specified 'size' value, the entire object is returned. """ return self._manager.fetch_partial(container, obj, size)
python
def fetch_partial(self, container, obj, size): """ Returns the first 'size' bytes of an object. If the object is smaller than the specified 'size' value, the entire object is returned. """ return self._manager.fetch_partial(container, obj, size)
Returns the first 'size' bytes of an object. If the object is smaller than the specified 'size' value, the entire object is returned.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2791-L2796
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.fetch_dlo
def fetch_dlo(self, container, name, chunk_size=None, verbose=False): """ Returns a list of 2-tuples in the form of (object_name, fetch_generator) representing the components of a multi-part DLO (Dynamic Large Object). Each fetch_generator object can be interated to retrieve its...
python
def fetch_dlo(self, container, name, chunk_size=None, verbose=False): """ Returns a list of 2-tuples in the form of (object_name, fetch_generator) representing the components of a multi-part DLO (Dynamic Large Object). Each fetch_generator object can be interated to retrieve its...
Returns a list of 2-tuples in the form of (object_name, fetch_generator) representing the components of a multi-part DLO (Dynamic Large Object). Each fetch_generator object can be interated to retrieve its contents. This is useful when transferring a DLO from one object storage system ...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2799-L2843
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.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#L2846-L2857
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.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. """ return self._...
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. """ return self._...
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#L2860-L2866
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.copy_object
def copy_object(self, container, obj, new_container, new_obj_name=None, content_type=None, extra_info=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. You can optionally c...
python
def copy_object(self, container, obj, new_container, new_obj_name=None, content_type=None, extra_info=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. You can optionally c...
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. You can optionally change the content_type of the object by supplying that in the 'content_type' parameter. The 'extra_info' parameter is includ...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2879-L2893
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.move_object
def move_object(self, container, 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 ...
python
def move_object(self, container, 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 ...
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#L2896-L2917
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.change_object_content_type
def change_object_content_type(self, container, obj, new_ctype, guess=False, extra_info=None): """ 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 gues...
python
def change_object_content_type(self, container, obj, new_ctype, guess=False, extra_info=None): """ 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 gues...
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#L2920-L2934
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.upload_folder
def upload_folder(self, folder_path, container=None, ignore=None, ttl=None): """ Convenience method for uploading an entire folder, including any sub-folders, to Cloud Files. All files will be uploaded to objects with the same name as the file. In the case of nested folders, fil...
python
def upload_folder(self, folder_path, container=None, ignore=None, ttl=None): """ Convenience method for uploading an entire folder, including any sub-folders, to Cloud Files. All files will be uploaded to objects with the same name as the file. In the case of nested folders, fil...
Convenience method for uploading an entire folder, including any sub-folders, to Cloud Files. All files will be uploaded to objects with the same name as the file. In the case of nested folders, files will be named with the full path relative to the base folder. E.g., if the folder you ...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2937-L2987
pycontribs/pyrax
pyrax/object_storage.py
StorageClient._upload_folder_in_background
def _upload_folder_in_background(self, folder_path, container, ignore, upload_key, ttl=None): """Runs the folder upload in the background.""" uploader = FolderUploader(folder_path, container, ignore, upload_key, self, ttl=ttl) uploader.start()
python
def _upload_folder_in_background(self, folder_path, container, ignore, upload_key, ttl=None): """Runs the folder upload in the background.""" uploader = FolderUploader(folder_path, container, ignore, upload_key, self, ttl=ttl) uploader.start()
Runs the folder upload in the background.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2990-L2995
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.sync_folder_to_container
def sync_folder_to_container(self, folder_path, container, delete=False, include_hidden=False, ignore=None, ignore_timestamps=False, object_prefix="", verbose=False): """ Compares the contents of the specified folder, and checks to make sure that the corresponding object ...
python
def sync_folder_to_container(self, folder_path, container, delete=False, include_hidden=False, ignore=None, ignore_timestamps=False, object_prefix="", verbose=False): """ Compares the contents of the specified folder, and checks to make sure that the corresponding object ...
Compares the contents of the specified folder, and checks to make sure that the corresponding object is present in the specified container. If there is no remote object matching the local file, it is created. If a matching object exists, the etag is examined to determine if the object in...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L2998-L3071
pycontribs/pyrax
pyrax/object_storage.py
StorageClient._sync_folder_to_container
def _sync_folder_to_container(self, folder_path, container, prefix, delete, include_hidden, ignore, ignore_timestamps, object_prefix, verbose): """ This is the internal method that is called recursively to handle nested folder structures. """ fnames = os.listdir(folde...
python
def _sync_folder_to_container(self, folder_path, container, prefix, delete, include_hidden, ignore, ignore_timestamps, object_prefix, verbose): """ This is the internal method that is called recursively to handle nested folder structures. """ fnames = os.listdir(folde...
This is the internal method that is called recursively to handle nested folder structures.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L3074-L3149
pycontribs/pyrax
pyrax/object_storage.py
StorageClient._delete_objects_not_in_list
def _delete_objects_not_in_list(self, cont, object_prefix=""): """ Finds all the objects in the specified container that are not present in the self._local_files list, and deletes them. """ objnames = set(cont.get_object_names(prefix=object_prefix, full_listing=Tr...
python
def _delete_objects_not_in_list(self, cont, object_prefix=""): """ Finds all the objects in the specified container that are not present in the self._local_files list, and deletes them. """ objnames = set(cont.get_object_names(prefix=object_prefix, full_listing=Tr...
Finds all the objects in the specified container that are not present in the self._local_files list, and deletes them.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L3152-L3164
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.bulk_delete
def bulk_delete(self, container, object_names, async_=False): """ Deletes multiple objects from a container in a single call. The bulk deletion call does not return until all of the specified objects have been processed. For large numbers of objects, this can take quite a while,...
python
def bulk_delete(self, container, object_names, async_=False): """ Deletes multiple objects from a container in a single call. The bulk deletion call does not return until all of the specified objects have been processed. For large numbers of objects, this can take quite a while,...
Deletes multiple objects from a container in a single call. The bulk deletion call does not return until all of the specified objects have been processed. For large numbers of objects, this can take quite a while, so there is an 'async_' parameter to give you the option to have this cal...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L3167-L3199
pycontribs/pyrax
pyrax/object_storage.py
StorageClient.cdn_request
def cdn_request(self, uri, method, *args, **kwargs): """ If the service supports CDN, use this method to access CDN-specific URIs. """ if not self.cdn_management_url: raise exc.NotCDNEnabled("CDN is not enabled for this service.") cdn_uri = "%s%s" % (self.cdn_...
python
def cdn_request(self, uri, method, *args, **kwargs): """ If the service supports CDN, use this method to access CDN-specific URIs. """ if not self.cdn_management_url: raise exc.NotCDNEnabled("CDN is not enabled for this service.") cdn_uri = "%s%s" % (self.cdn_...
If the service supports CDN, use this method to access CDN-specific URIs.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L3202-L3222
pycontribs/pyrax
pyrax/object_storage.py
FolderUploader.upload_files_in_folder
def upload_files_in_folder(self, dirname, fnames): """Handles the iteration across files within a folder.""" if utils.match_pattern(dirname, self.ignore): return False good_names = (nm for nm in fnames if not utils.match_pattern(nm, self.ignore)) for fname in ...
python
def upload_files_in_folder(self, dirname, fnames): """Handles the iteration across files within a folder.""" if utils.match_pattern(dirname, self.ignore): return False good_names = (nm for nm in fnames if not utils.match_pattern(nm, self.ignore)) for fname in ...
Handles the iteration across files within a folder.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L3282-L3296
pycontribs/pyrax
pyrax/object_storage.py
FolderUploader.run
def run(self): """Starts the uploading thread.""" root_path, folder_name = os.path.split(self.root_folder) self.root_folder = os.path.join(root_path, folder_name) for dirname, _, fnames in os.walk(self.root_folder): self.upload_files_in_folder(dirname, fnames)
python
def run(self): """Starts the uploading thread.""" root_path, folder_name = os.path.split(self.root_folder) self.root_folder = os.path.join(root_path, folder_name) for dirname, _, fnames in os.walk(self.root_folder): self.upload_files_in_folder(dirname, fnames)
Starts the uploading thread.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/object_storage.py#L3299-L3304
pycontribs/pyrax
samples/cloud_monitoring/util.py
option_chooser
def option_chooser(options, attr=None): """Given an iterable, enumerate its contents for a user to choose from. If the optional `attr` is not None, that attribute in each iterated object will be printed. This function will exit the program if the user chooses the escape option. """ for num, opt...
python
def option_chooser(options, attr=None): """Given an iterable, enumerate its contents for a user to choose from. If the optional `attr` is not None, that attribute in each iterated object will be printed. This function will exit the program if the user chooses the escape option. """ for num, opt...
Given an iterable, enumerate its contents for a user to choose from. If the optional `attr` is not None, that attribute in each iterated object will be printed. This function will exit the program if the user chooses the escape option.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/samples/cloud_monitoring/util.py#L24-L53
pycontribs/pyrax
pyrax/queueing.py
assure_queue
def assure_queue(fnc): """ Converts a queue ID or name passed as the 'queue' parameter to a Queue object. """ @wraps(fnc) def _wrapped(self, queue, *args, **kwargs): if not isinstance(queue, Queue): # Must be the ID queue = self._manager.get(queue) return ...
python
def assure_queue(fnc): """ Converts a queue ID or name passed as the 'queue' parameter to a Queue object. """ @wraps(fnc) def _wrapped(self, queue, *args, **kwargs): if not isinstance(queue, Queue): # Must be the ID queue = self._manager.get(queue) return ...
Converts a queue ID or name passed as the 'queue' parameter to a Queue object.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L54-L65
pycontribs/pyrax
pyrax/queueing.py
Queue.delete_message
def delete_message(self, msg_id, claim_id=None): """ Deletes the message whose ID matches the supplied msg_id from the specified queue. If the message has been claimed, the ID of that claim must be passed as the 'claim_id' parameter. """ return self._message_manager.delet...
python
def delete_message(self, msg_id, claim_id=None): """ Deletes the message whose ID matches the supplied msg_id from the specified queue. If the message has been claimed, the ID of that claim must be passed as the 'claim_id' parameter. """ return self._message_manager.delet...
Deletes the message whose ID matches the supplied msg_id from the specified queue. If the message has been claimed, the ID of that claim must be passed as the 'claim_id' parameter.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L112-L118
pycontribs/pyrax
pyrax/queueing.py
Queue.list
def list(self, include_claimed=False, echo=False, marker=None, limit=None): """ Returns a list of messages for this queue. By default only unclaimed messages are returned; if you want claimed messages included, pass `include_claimed=True`. Also, the requester's own messages are ...
python
def list(self, include_claimed=False, echo=False, marker=None, limit=None): """ Returns a list of messages for this queue. By default only unclaimed messages are returned; if you want claimed messages included, pass `include_claimed=True`. Also, the requester's own messages are ...
Returns a list of messages for this queue. By default only unclaimed messages are returned; if you want claimed messages included, pass `include_claimed=True`. Also, the requester's own messages are not returned by default; if you want them included, pass `echo=True`. The 'mark...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L121-L135
pycontribs/pyrax
pyrax/queueing.py
Queue.list_by_claim
def list_by_claim(self, claim): """ Returns a list of all the messages from this queue that have been claimed by the specified claim. The claim can be either a claim ID or a QueueClaim object. """ if not isinstance(claim, QueueClaim): claim = self._claim_manag...
python
def list_by_claim(self, claim): """ Returns a list of all the messages from this queue that have been claimed by the specified claim. The claim can be either a claim ID or a QueueClaim object. """ if not isinstance(claim, QueueClaim): claim = self._claim_manag...
Returns a list of all the messages from this queue that have been claimed by the specified claim. The claim can be either a claim ID or a QueueClaim object.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L155-L163
pycontribs/pyrax
pyrax/queueing.py
Queue.claim_messages
def claim_messages(self, ttl, grace, count=None): """ Claims up to `count` unclaimed messages from this queue. If count is not specified, the default is to claim 10 messages. The `ttl` parameter specifies how long the server should wait before releasing the claim. The ttl value ...
python
def claim_messages(self, ttl, grace, count=None): """ Claims up to `count` unclaimed messages from this queue. If count is not specified, the default is to claim 10 messages. The `ttl` parameter specifies how long the server should wait before releasing the claim. The ttl value ...
Claims up to `count` unclaimed messages from this queue. If count is not specified, the default is to claim 10 messages. The `ttl` parameter specifies how long the server should wait before releasing the claim. The ttl value MUST be between 60 and 43200 seconds. The `grace` parameter i...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L174-L193
pycontribs/pyrax
pyrax/queueing.py
Queue.update_claim
def update_claim(self, claim, ttl=None, grace=None): """ Updates the specified claim with either a new TTL or grace period, or both. """ return self._claim_manager.update(claim, ttl=ttl, grace=grace)
python
def update_claim(self, claim, ttl=None, grace=None): """ Updates the specified claim with either a new TTL or grace period, or both. """ return self._claim_manager.update(claim, ttl=ttl, grace=grace)
Updates the specified claim with either a new TTL or grace period, or both.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L204-L209
pycontribs/pyrax
pyrax/queueing.py
QueueMessage._add_details
def _add_details(self, info): """ The 'id' and 'claim_id' attributes are not supplied directly, but included as part of the 'href' value. """ super(QueueMessage, self)._add_details(info) if self.href is None: return parsed = urllib.parse.urlparse(self....
python
def _add_details(self, info): """ The 'id' and 'claim_id' attributes are not supplied directly, but included as part of the 'href' value. """ super(QueueMessage, self)._add_details(info) if self.href is None: return parsed = urllib.parse.urlparse(self....
The 'id' and 'claim_id' attributes are not supplied directly, but included as part of the 'href' value.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L244-L256
pycontribs/pyrax
pyrax/queueing.py
QueueClaim._add_details
def _add_details(self, info): """ The 'id' attribute is not supplied directly, but included as part of the 'href' value. Also, convert the dicts for messages into QueueMessage objects. """ msg_dicts = info.pop("messages", []) super(QueueClaim, self)._add_details(i...
python
def _add_details(self, info): """ The 'id' attribute is not supplied directly, but included as part of the 'href' value. Also, convert the dicts for messages into QueueMessage objects. """ msg_dicts = info.pop("messages", []) super(QueueClaim, self)._add_details(i...
The 'id' attribute is not supplied directly, but included as part of the 'href' value. Also, convert the dicts for messages into QueueMessage objects.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L276-L287
pycontribs/pyrax
pyrax/queueing.py
QueueMessageManager.list
def list(self, include_claimed=False, echo=False, marker=None, limit=None): """ Need to form the URI differently, so we can't use the default list(). """ return self._iterate_list(include_claimed=include_claimed, echo=echo, marker=marker, limit=limit)
python
def list(self, include_claimed=False, echo=False, marker=None, limit=None): """ Need to form the URI differently, so we can't use the default list(). """ return self._iterate_list(include_claimed=include_claimed, echo=echo, marker=marker, limit=limit)
Need to form the URI differently, so we can't use the default list().
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L306-L311
pycontribs/pyrax
pyrax/queueing.py
QueueMessageManager._iterate_list
def _iterate_list(self, include_claimed, echo, marker, limit): """ Recursive method to work around the hard limit of 10 items per call. """ ret = [] if limit is None: this_limit = MSG_LIMIT else: this_limit = min(MSG_LIMIT, limit) limit...
python
def _iterate_list(self, include_claimed, echo, marker, limit): """ Recursive method to work around the hard limit of 10 items per call. """ ret = [] if limit is None: this_limit = MSG_LIMIT else: this_limit = min(MSG_LIMIT, limit) limit...
Recursive method to work around the hard limit of 10 items per call.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L314-L344
pycontribs/pyrax
pyrax/queueing.py
QueueMessageManager.delete
def delete(self, msg, claim_id=None): """ Deletes the specified message from its queue. If the message has been claimed, the ID of that claim must be passed as the 'claim_id' parameter. """ msg_id = utils.get_id(msg) if claim_id: uri = "/%s/%s?claim_id...
python
def delete(self, msg, claim_id=None): """ Deletes the specified message from its queue. If the message has been claimed, the ID of that claim must be passed as the 'claim_id' parameter. """ msg_id = utils.get_id(msg) if claim_id: uri = "/%s/%s?claim_id...
Deletes the specified message from its queue. If the message has been claimed, the ID of that claim must be passed as the 'claim_id' parameter.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L347-L358
pycontribs/pyrax
pyrax/queueing.py
QueueMessageManager.list_by_ids
def list_by_ids(self, ids): """ If you wish to retrieve a list of messages from this queue and know the IDs of those messages, you can pass in a list of those IDs, and only the matching messages will be returned. This avoids pulling down all the messages in a queue and filtering ...
python
def list_by_ids(self, ids): """ If you wish to retrieve a list of messages from this queue and know the IDs of those messages, you can pass in a list of those IDs, and only the matching messages will be returned. This avoids pulling down all the messages in a queue and filtering ...
If you wish to retrieve a list of messages from this queue and know the IDs of those messages, you can pass in a list of those IDs, and only the matching messages will be returned. This avoids pulling down all the messages in a queue and filtering on the client side.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L361-L377
pycontribs/pyrax
pyrax/queueing.py
QueueMessageManager.delete_by_ids
def delete_by_ids(self, ids): """ Deletes the messages whose IDs are passed in from this queue. """ ids = utils.coerce_to_list(ids) uri = "/%s?ids=%s" % (self.uri_base, ",".join(ids)) return self.api.method_delete(uri)
python
def delete_by_ids(self, ids): """ Deletes the messages whose IDs are passed in from this queue. """ ids = utils.coerce_to_list(ids) uri = "/%s?ids=%s" % (self.uri_base, ",".join(ids)) return self.api.method_delete(uri)
Deletes the messages whose IDs are passed in from this queue.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L380-L386
pycontribs/pyrax
pyrax/queueing.py
QueueClaimManager.claim
def claim(self, ttl, grace, count=None): """ Claims up to `count` unclaimed messages from this queue. If count is not specified, the default is to claim 10 messages. The `ttl` parameter specifies how long the server should wait before releasing the claim. The ttl value MUST be b...
python
def claim(self, ttl, grace, count=None): """ Claims up to `count` unclaimed messages from this queue. If count is not specified, the default is to claim 10 messages. The `ttl` parameter specifies how long the server should wait before releasing the claim. The ttl value MUST be b...
Claims up to `count` unclaimed messages from this queue. If count is not specified, the default is to claim 10 messages. The `ttl` parameter specifies how long the server should wait before releasing the claim. The ttl value MUST be between 60 and 43200 seconds. The `grace` parameter i...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L394-L428
pycontribs/pyrax
pyrax/queueing.py
QueueClaimManager.update
def update(self, claim, ttl=None, grace=None): """ Updates the specified claim with either a new TTL or grace period, or both. """ body = {} if ttl is not None: body["ttl"] = ttl if grace is not None: body["grace"] = grace if not bo...
python
def update(self, claim, ttl=None, grace=None): """ Updates the specified claim with either a new TTL or grace period, or both. """ body = {} if ttl is not None: body["ttl"] = ttl if grace is not None: body["grace"] = grace if not bo...
Updates the specified claim with either a new TTL or grace period, or both.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L431-L445
pycontribs/pyrax
pyrax/queueing.py
QueueManager.get
def get(self, id_): """ Need to customize, since Queues are not returned with normal response bodies. """ if self.api.queue_exists(id_): return Queue(self, {"queue": {"name": id_, "id_": id_}}, key="queue") raise exc.NotFound("The queue '%s' does not exist." %...
python
def get(self, id_): """ Need to customize, since Queues are not returned with normal response bodies. """ if self.api.queue_exists(id_): return Queue(self, {"queue": {"name": id_, "id_": id_}}, key="queue") raise exc.NotFound("The queue '%s' does not exist." %...
Need to customize, since Queues are not returned with normal response bodies.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L464-L471
pycontribs/pyrax
pyrax/queueing.py
QueueManager.get_stats
def get_stats(self, queue): """ Returns the message stats for the specified queue. """ uri = "/%s/%s/stats" % (self.uri_base, utils.get_id(queue)) resp, resp_body = self.api.method_get(uri) return resp_body.get("messages")
python
def get_stats(self, queue): """ Returns the message stats for the specified queue. """ uri = "/%s/%s/stats" % (self.uri_base, utils.get_id(queue)) resp, resp_body = self.api.method_get(uri) return resp_body.get("messages")
Returns the message stats for the specified queue.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L486-L492
pycontribs/pyrax
pyrax/queueing.py
QueueManager.get_metadata
def get_metadata(self, queue): """ Returns the metadata for the specified queue. """ uri = "/%s/%s/metadata" % (self.uri_base, utils.get_id(queue)) resp, resp_body = self.api.method_get(uri) return resp_body
python
def get_metadata(self, queue): """ Returns the metadata for the specified queue. """ uri = "/%s/%s/metadata" % (self.uri_base, utils.get_id(queue)) resp, resp_body = self.api.method_get(uri) return resp_body
Returns the metadata for the specified queue.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L495-L501
pycontribs/pyrax
pyrax/queueing.py
QueueManager.set_metadata
def set_metadata(self, queue, metadata, clear=False): """ Accepts a dictionary and adds that to the specified queue's metadata. If the 'clear' argument is passed as True, any existing metadata is replaced with the new metadata. """ uri = "/%s/%s/metadata" % (self.uri_base...
python
def set_metadata(self, queue, metadata, clear=False): """ Accepts a dictionary and adds that to the specified queue's metadata. If the 'clear' argument is passed as True, any existing metadata is replaced with the new metadata. """ uri = "/%s/%s/metadata" % (self.uri_base...
Accepts a dictionary and adds that to the specified queue's metadata. If the 'clear' argument is passed as True, any existing metadata is replaced with the new metadata.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L504-L516
pycontribs/pyrax
pyrax/queueing.py
QueueClient._configure_manager
def _configure_manager(self): """ Create the manager to handle queues. """ self._manager = QueueManager(self, resource_class=Queue, response_key="queue", uri_base="queues")
python
def _configure_manager(self): """ Create the manager to handle queues. """ self._manager = QueueManager(self, resource_class=Queue, response_key="queue", uri_base="queues")
Create the manager to handle queues.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L528-L534
pycontribs/pyrax
pyrax/queueing.py
QueueClient._add_custom_headers
def _add_custom_headers(self, dct): """ Add the Client-ID header required by Cloud Queues """ if self.client_id is None: self.client_id = os.environ.get("CLOUD_QUEUES_ID") if self.client_id: dct["Client-ID"] = self.client_id
python
def _add_custom_headers(self, dct): """ Add the Client-ID header required by Cloud Queues """ if self.client_id is None: self.client_id = os.environ.get("CLOUD_QUEUES_ID") if self.client_id: dct["Client-ID"] = self.client_id
Add the Client-ID header required by Cloud Queues
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L537-L544
pycontribs/pyrax
pyrax/queueing.py
QueueClient._api_request
def _api_request(self, uri, method, **kwargs): """ Any request that involves messages must define the client ID. This handles all failures due to lack of client ID and raises the appropriate exception. """ try: return super(QueueClient, self)._api_request(uri,...
python
def _api_request(self, uri, method, **kwargs): """ Any request that involves messages must define the client ID. This handles all failures due to lack of client ID and raises the appropriate exception. """ try: return super(QueueClient, self)._api_request(uri,...
Any request that involves messages must define the client ID. This handles all failures due to lack of client ID and raises the appropriate exception.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L547-L561
pycontribs/pyrax
pyrax/queueing.py
QueueClient.queue_exists
def queue_exists(self, name): """ Returns True or False, depending on the existence of the named queue. """ try: queue = self._manager.head(name) return True except exc.NotFound: return False
python
def queue_exists(self, name): """ Returns True or False, depending on the existence of the named queue. """ try: queue = self._manager.head(name) return True except exc.NotFound: return False
Returns True or False, depending on the existence of the named queue.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L591-L599
pycontribs/pyrax
pyrax/queueing.py
QueueClient.create
def create(self, name): """ Cloud Queues works differently, in that they use the name as the ID for the resource. So for create(), we need to check if a queue by that name exists already, and raise an exception if it does. If not, create the queue and return a reference object fo...
python
def create(self, name): """ Cloud Queues works differently, in that they use the name as the ID for the resource. So for create(), we need to check if a queue by that name exists already, and raise an exception if it does. If not, create the queue and return a reference object fo...
Cloud Queues works differently, in that they use the name as the ID for the resource. So for create(), we need to check if a queue by that name exists already, and raise an exception if it does. If not, create the queue and return a reference object for it.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L602-L611
pycontribs/pyrax
pyrax/queueing.py
QueueClient.set_metadata
def set_metadata(self, queue, metadata, clear=False): """ Accepts a dictionary and adds that to the specified queue's metadata. If the 'clear' argument is passed as True, any existing metadata is replaced with the new metadata. """ return self._manager.set_metadata(queue,...
python
def set_metadata(self, queue, metadata, clear=False): """ Accepts a dictionary and adds that to the specified queue's metadata. If the 'clear' argument is passed as True, any existing metadata is replaced with the new metadata. """ return self._manager.set_metadata(queue,...
Accepts a dictionary and adds that to the specified queue's metadata. If the 'clear' argument is passed as True, any existing metadata is replaced with the new metadata.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L628-L634
pycontribs/pyrax
pyrax/queueing.py
QueueClient.delete_message
def delete_message(self, queue, msg_id, claim_id=None): """ Deletes the message whose ID matches the supplied msg_id from the specified queue. If the message has been claimed, the ID of that claim must be passed as the 'claim_id' parameter. """ return queue.delete_message...
python
def delete_message(self, queue, msg_id, claim_id=None): """ Deletes the message whose ID matches the supplied msg_id from the specified queue. If the message has been claimed, the ID of that claim must be passed as the 'claim_id' parameter. """ return queue.delete_message...
Deletes the message whose ID matches the supplied msg_id from the specified queue. If the message has been claimed, the ID of that claim must be passed as the 'claim_id' parameter.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L647-L653
pycontribs/pyrax
pyrax/queueing.py
QueueClient.list_messages
def list_messages(self, queue, include_claimed=False, echo=False, marker=None, limit=None): """ Returns a list of messages for the specified queue. By default only unclaimed messages are returned; if you want claimed messages included, pass `include_claimed=True`. Also, the ...
python
def list_messages(self, queue, include_claimed=False, echo=False, marker=None, limit=None): """ Returns a list of messages for the specified queue. By default only unclaimed messages are returned; if you want claimed messages included, pass `include_claimed=True`. Also, the ...
Returns a list of messages for the specified queue. By default only unclaimed messages are returned; if you want claimed messages included, pass `include_claimed=True`. Also, the requester's own messages are not returned by default; if you want them included, pass `echo=True`. ...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L657-L672
pycontribs/pyrax
pyrax/queueing.py
QueueClient.claim_messages
def claim_messages(self, queue, ttl, grace, count=None): """ Claims up to `count` unclaimed messages from the specified queue. If count is not specified, the default is to claim 10 messages. The `ttl` parameter specifies how long the server should wait before releasing the claim...
python
def claim_messages(self, queue, ttl, grace, count=None): """ Claims up to `count` unclaimed messages from the specified queue. If count is not specified, the default is to claim 10 messages. The `ttl` parameter specifies how long the server should wait before releasing the claim...
Claims up to `count` unclaimed messages from the specified queue. If count is not specified, the default is to claim 10 messages. The `ttl` parameter specifies how long the server should wait before releasing the claim. The ttl value MUST be between 60 and 43200 seconds. The `grace` pa...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L714-L733
pycontribs/pyrax
pyrax/queueing.py
QueueClient.update_claim
def update_claim(self, queue, claim, ttl=None, grace=None): """ Updates the specified claim with either a new TTL or grace period, or both. """ return queue.update_claim(claim, ttl=ttl, grace=grace)
python
def update_claim(self, queue, claim, ttl=None, grace=None): """ Updates the specified claim with either a new TTL or grace period, or both. """ return queue.update_claim(claim, ttl=ttl, grace=grace)
Updates the specified claim with either a new TTL or grace period, or both.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/queueing.py#L746-L751
pycontribs/pyrax
pyrax/cloudcdn.py
CloudCDNClient._configure_manager
def _configure_manager(self): """ Creates the Manager instances to handle monitoring. """ self._flavor_manager = CloudCDNFlavorManager(self, uri_base="flavors", resource_class=CloudCDNFlavor, response_key=None, plural_response_key="flavors") self._...
python
def _configure_manager(self): """ Creates the Manager instances to handle monitoring. """ self._flavor_manager = CloudCDNFlavorManager(self, uri_base="flavors", resource_class=CloudCDNFlavor, response_key=None, plural_response_key="flavors") self._...
Creates the Manager instances to handle monitoring.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudcdn.py#L118-L127
pycontribs/pyrax
pyrax/cloudcdn.py
CloudCDNClient.list_services
def list_services(self, limit=None, marker=None): """List CDN services.""" return self._services_manager.list(limit=limit, marker=marker)
python
def list_services(self, limit=None, marker=None): """List CDN services.""" return self._services_manager.list(limit=limit, marker=marker)
List CDN services.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudcdn.py#L144-L146
pycontribs/pyrax
pyrax/cloudcdn.py
CloudCDNClient.create_service
def create_service(self, name, flavor_id, domains, origins, restrictions=None, caching=None): """Create a new CDN service. Arguments: name: The name of the service. flavor_id: The ID of the flavor to use for this service. domains: A list of dictionaries, e...
python
def create_service(self, name, flavor_id, domains, origins, restrictions=None, caching=None): """Create a new CDN service. Arguments: name: The name of the service. flavor_id: The ID of the flavor to use for this service. domains: A list of dictionaries, e...
Create a new CDN service. Arguments: name: The name of the service. flavor_id: The ID of the flavor to use for this service. domains: A list of dictionaries, each of which has a required key "domain" and optional key "protocol" (the default protocol is ...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudcdn.py#L152-L171
pycontribs/pyrax
pyrax/cloudcdn.py
CloudCDNClient.delete_assets
def delete_assets(self, service_id, url=None, all=False): """Delete CDN assets Arguments: service_id: The ID of the service to delete from. url: The URL at which to delete assets all: When True, delete all assets associated with the service_id. You cannot specifiy both ...
python
def delete_assets(self, service_id, url=None, all=False): """Delete CDN assets Arguments: service_id: The ID of the service to delete from. url: The URL at which to delete assets all: When True, delete all assets associated with the service_id. You cannot specifiy both ...
Delete CDN assets Arguments: service_id: The ID of the service to delete from. url: The URL at which to delete assets all: When True, delete all assets associated with the service_id. You cannot specifiy both url and all.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudcdn.py#L190-L200
pycontribs/pyrax
pyrax/service_catalog.py
ServiceCatalog.url_for
def url_for(self, attr=None, filter_value=None, service_type=None, endpoint_type="publicURL", service_name=None, volume_service_name=None): """Fetches the public URL from the given service for a particular endpoint attribute. If none given, returns the first. See tests fo...
python
def url_for(self, attr=None, filter_value=None, service_type=None, endpoint_type="publicURL", service_name=None, volume_service_name=None): """Fetches the public URL from the given service for a particular endpoint attribute. If none given, returns the first. See tests fo...
Fetches the public URL from the given service for a particular endpoint attribute. If none given, returns the first. See tests for sample service catalog.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/service_catalog.py#L34-L61
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancer.get_usage
def get_usage(self, start=None, end=None): """ Return the usage records for this load balancer. You may optionally include a start datetime or an end datetime, or both, which will limit the records to those on or after the start time, and those before or on the end time. These ti...
python
def get_usage(self, start=None, end=None): """ Return the usage records for this load balancer. You may optionally include a start datetime or an end datetime, or both, which will limit the records to those on or after the start time, and those before or on the end time. These ti...
Return the usage records for this load balancer. You may optionally include a start datetime or an end datetime, or both, which will limit the records to those on or after the start time, and those before or on the end time. These times should be Python datetime.datetime objects, Python ...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L76-L85
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancer._add_details
def _add_details(self, info): """Override the base behavior to add Nodes, VirtualIPs, etc.""" for (key, val) in six.iteritems(info): if key == "nodes": val = [Node(parent=self, **nd) for nd in val] elif key == "sessionPersistence": val = val['persi...
python
def _add_details(self, info): """Override the base behavior to add Nodes, VirtualIPs, etc.""" for (key, val) in six.iteritems(info): if key == "nodes": val = [Node(parent=self, **nd) for nd in val] elif key == "sessionPersistence": val = val['persi...
Override the base behavior to add Nodes, VirtualIPs, etc.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L94-L106
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancer.update
def update(self, name=None, algorithm=None, protocol=None, halfClosed=None, port=None, timeout=None, httpsRedirect=None): """ Provides a way to modify the following attributes of a load balancer: - name - algorithm - protocol - halfClosed ...
python
def update(self, name=None, algorithm=None, protocol=None, halfClosed=None, port=None, timeout=None, httpsRedirect=None): """ Provides a way to modify the following attributes of a load balancer: - name - algorithm - protocol - halfClosed ...
Provides a way to modify the following attributes of a load balancer: - name - algorithm - protocol - halfClosed - port - timeout - httpsRedirect
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L109-L123
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancer.update_node
def update_node(self, node, diff=None): """Updates the node's attributes.""" return self.manager.update_node(node, diff=diff)
python
def update_node(self, node, diff=None): """Updates the node's attributes.""" return self.manager.update_node(node, diff=diff)
Updates the node's attributes.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L131-L133
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancer.add_health_monitor
def add_health_monitor(self, type, delay=10, timeout=10, attemptsBeforeDeactivation=3, path="/", statusRegex=None, bodyRegex=None, hostHeader=None): """ Adds a health monitor to the load balancer. If a monitor already exists, it is updated with the supplied settings. ...
python
def add_health_monitor(self, type, delay=10, timeout=10, attemptsBeforeDeactivation=3, path="/", statusRegex=None, bodyRegex=None, hostHeader=None): """ Adds a health monitor to the load balancer. If a monitor already exists, it is updated with the supplied settings. ...
Adds a health monitor to the load balancer. If a monitor already exists, it is updated with the supplied settings.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L193-L204
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancer.add_connection_throttle
def add_connection_throttle(self, maxConnectionRate=None, maxConnections=None, minConnections=None, rateInterval=None): """ Updates the connection throttling information for the load balancer with the supplied values. At least one of the parameters must be supplied. """ ...
python
def add_connection_throttle(self, maxConnectionRate=None, maxConnections=None, minConnections=None, rateInterval=None): """ Updates the connection throttling information for the load balancer with the supplied values. At least one of the parameters must be supplied. """ ...
Updates the connection throttling information for the load balancer with the supplied values. At least one of the parameters must be supplied.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L223-L235
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancer.add_ssl_termination
def add_ssl_termination(self, securePort, privatekey, certificate, intermediateCertificate=None, enabled=True, secureTrafficOnly=False): """ Adds SSL termination information to the load balancer. If SSL termination has already been configured, it is updated with the ...
python
def add_ssl_termination(self, securePort, privatekey, certificate, intermediateCertificate=None, enabled=True, secureTrafficOnly=False): """ Adds SSL termination information to the load balancer. If SSL termination has already been configured, it is updated with the ...
Adds SSL termination information to the load balancer. If SSL termination has already been configured, it is updated with the supplied settings.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L254-L265
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancer.update_ssl_termination
def update_ssl_termination(self, securePort=None, enabled=None, secureTrafficOnly=None): """ Updates existing SSL termination information for the load balancer without affecting the existing certificates/keys. """ return self.manager.update_ssl_termination(self, secur...
python
def update_ssl_termination(self, securePort=None, enabled=None, secureTrafficOnly=None): """ Updates existing SSL termination information for the load balancer without affecting the existing certificates/keys. """ return self.manager.update_ssl_termination(self, secur...
Updates existing SSL termination information for the load balancer without affecting the existing certificates/keys.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L268-L275
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancer.set_metadata_for_node
def set_metadata_for_node(self, node, metadata): """ Sets the metadata for the specified node to the supplied dictionary of values. Any existing metadata is cleared. """ return self.manager.set_metadata(self, metadata, node=node)
python
def set_metadata_for_node(self, node, metadata): """ Sets the metadata for the specified node to the supplied dictionary of values. Any existing metadata is cleared. """ return self.manager.set_metadata(self, metadata, node=node)
Sets the metadata for the specified node to the supplied dictionary of values. Any existing metadata is cleared.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L324-L329
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancer.update_metadata_for_node
def update_metadata_for_node(self, node, metadata): """ Updates the existing metadata for the specified node with the supplied dictionary. """ return self.manager.update_metadata(self, metadata, node=node)
python
def update_metadata_for_node(self, node, metadata): """ Updates the existing metadata for the specified node with the supplied dictionary. """ return self.manager.update_metadata(self, metadata, node=node)
Updates the existing metadata for the specified node with the supplied dictionary.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L332-L337
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancer.delete_metadata_for_node
def delete_metadata_for_node(self, node, keys=None): """ Deletes metadata items specified by the 'keys' parameter for the specified node. If no value for 'keys' is provided, all metadata is deleted. """ return self.manager.delete_metadata(self, keys=keys, node=node)
python
def delete_metadata_for_node(self, node, keys=None): """ Deletes metadata items specified by the 'keys' parameter for the specified node. If no value for 'keys' is provided, all metadata is deleted. """ return self.manager.delete_metadata(self, keys=keys, node=node)
Deletes metadata items specified by the 'keys' parameter for the specified node. If no value for 'keys' is provided, all metadata is deleted.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L340-L346
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.update
def update(self, lb, name=None, algorithm=None, protocol=None, halfClosed=None, port=None, timeout=None, httpsRedirect=None): """ Provides a way to modify the following attributes of a load balancer: - name - algorithm - protocol - halfClosed ...
python
def update(self, lb, name=None, algorithm=None, protocol=None, halfClosed=None, port=None, timeout=None, httpsRedirect=None): """ Provides a way to modify the following attributes of a load balancer: - name - algorithm - protocol - halfClosed ...
Provides a way to modify the following attributes of a load balancer: - name - algorithm - protocol - halfClosed - port - timeout - httpsRedirect
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L434-L476
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager._create_body
def _create_body(self, name, port=None, protocol=None, nodes=None, virtual_ips=None, algorithm=None, halfClosed=None, accessList=None, connectionLogging=None, connectionThrottle=None, healthMonitor=None, metadata=None, timeout=None, sessionPersistence=None, httpsRedirect=...
python
def _create_body(self, name, port=None, protocol=None, nodes=None, virtual_ips=None, algorithm=None, halfClosed=None, accessList=None, connectionLogging=None, connectionThrottle=None, healthMonitor=None, metadata=None, timeout=None, sessionPersistence=None, httpsRedirect=...
Used to create the dict required to create a load balancer instance.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L479-L519
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.add_nodes
def add_nodes(self, lb, nodes): """Adds the list of nodes to the specified load balancer.""" if not isinstance(nodes, (list, tuple)): nodes = [nodes] node_dicts = [nd.to_dict() for nd in nodes] resp, body = self.api.method_post("/loadbalancers/%s/nodes" % lb.id, ...
python
def add_nodes(self, lb, nodes): """Adds the list of nodes to the specified load balancer.""" if not isinstance(nodes, (list, tuple)): nodes = [nodes] node_dicts = [nd.to_dict() for nd in nodes] resp, body = self.api.method_post("/loadbalancers/%s/nodes" % lb.id, ...
Adds the list of nodes to the specified load balancer.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L522-L529
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.delete_node
def delete_node(self, loadbalancer, node): """Removes the node from its load balancer.""" lb = node.parent if not lb: raise exc.UnattachedNode("No parent Load Balancer for this node " "could be determined.") resp, body = self.api.method_delete("/loadbalanc...
python
def delete_node(self, loadbalancer, node): """Removes the node from its load balancer.""" lb = node.parent if not lb: raise exc.UnattachedNode("No parent Load Balancer for this node " "could be determined.") resp, body = self.api.method_delete("/loadbalanc...
Removes the node from its load balancer.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L532-L540
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.update_node
def update_node(self, node, diff=None): """Updates the node's attributes.""" lb = node.parent if not lb: raise exc.UnattachedNode("No parent Load Balancer for this node " "could be determined.") if diff is None: diff = node._diff() req_...
python
def update_node(self, node, diff=None): """Updates the node's attributes.""" lb = node.parent if not lb: raise exc.UnattachedNode("No parent Load Balancer for this node " "could be determined.") if diff is None: diff = node._diff() req_...
Updates the node's attributes.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L543-L554
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.add_virtualip
def add_virtualip(self, lb, vip): """Adds the VirtualIP to the specified load balancer.""" resp, body = self.api.method_post("/loadbalancers/%s/virtualips" % lb.id, body=vip.to_dict()) return resp, body
python
def add_virtualip(self, lb, vip): """Adds the VirtualIP to the specified load balancer.""" resp, body = self.api.method_post("/loadbalancers/%s/virtualips" % lb.id, body=vip.to_dict()) return resp, body
Adds the VirtualIP to the specified load balancer.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L557-L561
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.delete_virtualip
def delete_virtualip(self, loadbalancer, vip): """Deletes the VirtualIP from its load balancer.""" lb = vip.parent if not lb: raise exc.UnattachedVirtualIP("No parent Load Balancer for this " "VirtualIP could be determined.") resp, body = self.api.method_d...
python
def delete_virtualip(self, loadbalancer, vip): """Deletes the VirtualIP from its load balancer.""" lb = vip.parent if not lb: raise exc.UnattachedVirtualIP("No parent Load Balancer for this " "VirtualIP could be determined.") resp, body = self.api.method_d...
Deletes the VirtualIP from its load balancer.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L564-L572
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.add_access_list
def add_access_list(self, loadbalancer, access_list): """ Adds the access list provided to the load balancer. The 'access_list' should be a list of dicts in the following format: [{"address": "192.0.43.10", "type": "DENY"}, {"address": "192.0.43.11", "type": "ALLOW"}, ...
python
def add_access_list(self, loadbalancer, access_list): """ Adds the access list provided to the load balancer. The 'access_list' should be a list of dicts in the following format: [{"address": "192.0.43.10", "type": "DENY"}, {"address": "192.0.43.11", "type": "ALLOW"}, ...
Adds the access list provided to the load balancer. The 'access_list' should be a list of dicts in the following format: [{"address": "192.0.43.10", "type": "DENY"}, {"address": "192.0.43.11", "type": "ALLOW"}, ... {"address": "192.0.43.99", "type": "DENY"}, ...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L584-L602
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.delete_access_list
def delete_access_list(self, loadbalancer): """ Removes the access list from this load balancer. """ uri = "/loadbalancers/%s/accesslist" % utils.get_id(loadbalancer) resp, body = self.api.method_delete(uri) return body
python
def delete_access_list(self, loadbalancer): """ Removes the access list from this load balancer. """ uri = "/loadbalancers/%s/accesslist" % utils.get_id(loadbalancer) resp, body = self.api.method_delete(uri) return body
Removes the access list from this load balancer.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L605-L611
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.delete_access_list_items
def delete_access_list_items(self, loadbalancer, item_ids): """ Removes the item(s) from the load balancer's access list that match the provided IDs. 'item_ids' should be one or more access list item IDs. """ if not isinstance(item_ids, (list, tuple)): item_id...
python
def delete_access_list_items(self, loadbalancer, item_ids): """ Removes the item(s) from the load balancer's access list that match the provided IDs. 'item_ids' should be one or more access list item IDs. """ if not isinstance(item_ids, (list, tuple)): item_id...
Removes the item(s) from the load balancer's access list that match the provided IDs. 'item_ids' should be one or more access list item IDs.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L614-L632
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.get_health_monitor
def get_health_monitor(self, loadbalancer): """ Returns a dict representing the health monitor for the load balancer. If no monitor has been configured, returns an empty dict. """ uri = "/loadbalancers/%s/healthmonitor" % utils.get_id(loadbalancer) resp, body = se...
python
def get_health_monitor(self, loadbalancer): """ Returns a dict representing the health monitor for the load balancer. If no monitor has been configured, returns an empty dict. """ uri = "/loadbalancers/%s/healthmonitor" % utils.get_id(loadbalancer) resp, body = se...
Returns a dict representing the health monitor for the load balancer. If no monitor has been configured, returns an empty dict.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L635-L643
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.add_health_monitor
def add_health_monitor(self, loadbalancer, type, delay=10, timeout=10, attemptsBeforeDeactivation=3, path="/", statusRegex=None, bodyRegex=None, hostHeader=None): """ Adds a health monitor to the load balancer. If a monitor already exists, it is updated with the supplied ...
python
def add_health_monitor(self, loadbalancer, type, delay=10, timeout=10, attemptsBeforeDeactivation=3, path="/", statusRegex=None, bodyRegex=None, hostHeader=None): """ Adds a health monitor to the load balancer. If a monitor already exists, it is updated with the supplied ...
Adds a health monitor to the load balancer. If a monitor already exists, it is updated with the supplied settings.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L646-L678
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.add_connection_throttle
def add_connection_throttle(self, loadbalancer, maxConnectionRate=None, maxConnections=None, minConnections=None, rateInterval=None): """ Creates or updates the connection throttling information for the load balancer. When first creating the connection throttle, all 4 parameters ...
python
def add_connection_throttle(self, loadbalancer, maxConnectionRate=None, maxConnections=None, minConnections=None, rateInterval=None): """ Creates or updates the connection throttling information for the load balancer. When first creating the connection throttle, all 4 parameters ...
Creates or updates the connection throttling information for the load balancer. When first creating the connection throttle, all 4 parameters must be supplied. When updating an existing connection throttle, at least one of the parameters must be supplied.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L700-L720
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.get_ssl_termination
def get_ssl_termination(self, loadbalancer): """ Returns a dict representing the SSL termination configuration for the load balancer. If SSL termination has not been configured, returns an empty dict. """ uri = "/loadbalancers/%s/ssltermination" % utils.get_id(loadbalance...
python
def get_ssl_termination(self, loadbalancer): """ Returns a dict representing the SSL termination configuration for the load balancer. If SSL termination has not been configured, returns an empty dict. """ uri = "/loadbalancers/%s/ssltermination" % utils.get_id(loadbalance...
Returns a dict representing the SSL termination configuration for the load balancer. If SSL termination has not been configured, returns an empty dict.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L731-L744
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.add_ssl_termination
def add_ssl_termination(self, loadbalancer, securePort, privatekey, certificate, intermediateCertificate, enabled=True, secureTrafficOnly=False): """ Adds SSL termination information to the load balancer. If SSL termination has already been configured, it is updated with the supplied...
python
def add_ssl_termination(self, loadbalancer, securePort, privatekey, certificate, intermediateCertificate, enabled=True, secureTrafficOnly=False): """ Adds SSL termination information to the load balancer. If SSL termination has already been configured, it is updated with the supplied...
Adds SSL termination information to the load balancer. If SSL termination has already been configured, it is updated with the supplied settings.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L747-L763
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.update_ssl_termination
def update_ssl_termination(self, loadbalancer, securePort=None, enabled=None, secureTrafficOnly=None): """ Updates existing SSL termination information for the load balancer without affecting the existing certificates/keys. """ ssl_info = self.get_ssl_termination(load...
python
def update_ssl_termination(self, loadbalancer, securePort=None, enabled=None, secureTrafficOnly=None): """ Updates existing SSL termination information for the load balancer without affecting the existing certificates/keys. """ ssl_info = self.get_ssl_termination(load...
Updates existing SSL termination information for the load balancer without affecting the existing certificates/keys.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L766-L790
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.get_metadata
def get_metadata(self, loadbalancer, node=None, raw=False): """ Returns the current metadata for the load balancer. If 'node' is provided, returns the current metadata for that node. """ if node: uri = "/loadbalancers/%s/nodes/%s/metadata" % ( util...
python
def get_metadata(self, loadbalancer, node=None, raw=False): """ Returns the current metadata for the load balancer. If 'node' is provided, returns the current metadata for that node. """ if node: uri = "/loadbalancers/%s/nodes/%s/metadata" % ( util...
Returns the current metadata for the load balancer. If 'node' is provided, returns the current metadata for that node.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L801-L816
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.set_metadata
def set_metadata(self, loadbalancer, metadata, node=None): """ Sets the metadata for the load balancer to the supplied dictionary of values. Any existing metadata is cleared. If 'node' is provided, the metadata for that node is set instead of for the load balancer. """ # ...
python
def set_metadata(self, loadbalancer, metadata, node=None): """ Sets the metadata for the load balancer to the supplied dictionary of values. Any existing metadata is cleared. If 'node' is provided, the metadata for that node is set instead of for the load balancer. """ # ...
Sets the metadata for the load balancer to the supplied dictionary of values. Any existing metadata is cleared. If 'node' is provided, the metadata for that node is set instead of for the load balancer.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L819-L837
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.update_metadata
def update_metadata(self, loadbalancer, metadata, node=None): """ Updates the existing metadata with the supplied dictionary. If 'node' is supplied, the metadata for that node is updated instead of for the load balancer. """ # Get the existing metadata md = self.g...
python
def update_metadata(self, loadbalancer, metadata, node=None): """ Updates the existing metadata with the supplied dictionary. If 'node' is supplied, the metadata for that node is updated instead of for the load balancer. """ # Get the existing metadata md = self.g...
Updates the existing metadata with the supplied dictionary. If 'node' is supplied, the metadata for that node is updated instead of for the load balancer.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L840-L873
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.delete_metadata
def delete_metadata(self, loadbalancer, keys=None, node=None): """ Deletes metadata items specified by the 'keys' parameter. If no value for 'keys' is provided, all metadata is deleted. If 'node' is supplied, the metadata for that node is deleted instead of the load balancer. """...
python
def delete_metadata(self, loadbalancer, keys=None, node=None): """ Deletes metadata items specified by the 'keys' parameter. If no value for 'keys' is provided, all metadata is deleted. If 'node' is supplied, the metadata for that node is deleted instead of the load balancer. """...
Deletes metadata items specified by the 'keys' parameter. If no value for 'keys' is provided, all metadata is deleted. If 'node' is supplied, the metadata for that node is deleted instead of the load balancer.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L876-L898
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.get_error_page
def get_error_page(self, loadbalancer): """ Load Balancers all have a default error page that is shown to an end user who is attempting to access a load balancer node that is offline/unavailable. """ uri = "/loadbalancers/%s/errorpage" % utils.get_id(loadbalancer) ...
python
def get_error_page(self, loadbalancer): """ Load Balancers all have a default error page that is shown to an end user who is attempting to access a load balancer node that is offline/unavailable. """ uri = "/loadbalancers/%s/errorpage" % utils.get_id(loadbalancer) ...
Load Balancers all have a default error page that is shown to an end user who is attempting to access a load balancer node that is offline/unavailable.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L901-L909
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.set_error_page
def set_error_page(self, loadbalancer, html): """ A single custom error page may be added per account load balancer with an HTTP protocol. Page updates will override existing content. If a custom error page is deleted, or the load balancer is changed to a non-HTTP protocol, the d...
python
def set_error_page(self, loadbalancer, html): """ A single custom error page may be added per account load balancer with an HTTP protocol. Page updates will override existing content. If a custom error page is deleted, or the load balancer is changed to a non-HTTP protocol, the d...
A single custom error page may be added per account load balancer with an HTTP protocol. Page updates will override existing content. If a custom error page is deleted, or the load balancer is changed to a non-HTTP protocol, the default error page will be restored.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L912-L922
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.get_usage
def get_usage(self, loadbalancer=None, start=None, end=None): """ Return the load balancer usage records for this account. If 'loadbalancer' is None, records for all load balancers are returned. You may optionally include a start datetime or an end datetime, or both, which will limit ...
python
def get_usage(self, loadbalancer=None, start=None, end=None): """ Return the load balancer usage records for this account. If 'loadbalancer' is None, records for all load balancers are returned. You may optionally include a start datetime or an end datetime, or both, which will limit ...
Return the load balancer usage records for this account. If 'loadbalancer' is None, records for all load balancers are returned. You may optionally include a start datetime or an end datetime, or both, which will limit the records to those on or after the start time, and those before or on the ...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L934-L962
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.get_session_persistence
def get_session_persistence(self, loadbalancer): """ Returns the session persistence setting for the given load balancer. """ uri = "/loadbalancers/%s/sessionpersistence" % utils.get_id(loadbalancer) resp, body = self.api.method_get(uri) ret = body["sessionPersistence"].g...
python
def get_session_persistence(self, loadbalancer): """ Returns the session persistence setting for the given load balancer. """ uri = "/loadbalancers/%s/sessionpersistence" % utils.get_id(loadbalancer) resp, body = self.api.method_get(uri) ret = body["sessionPersistence"].g...
Returns the session persistence setting for the given load balancer.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L974-L981
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.set_session_persistence
def set_session_persistence(self, loadbalancer, val): """ Sets the session persistence for the given load balancer. """ val = val.upper() uri = "/loadbalancers/%s/sessionpersistence" % utils.get_id(loadbalancer) req_body = {"sessionPersistence": { "persist...
python
def set_session_persistence(self, loadbalancer, val): """ Sets the session persistence for the given load balancer. """ val = val.upper() uri = "/loadbalancers/%s/sessionpersistence" % utils.get_id(loadbalancer) req_body = {"sessionPersistence": { "persist...
Sets the session persistence for the given load balancer.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L984-L994
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.get_connection_logging
def get_connection_logging(self, loadbalancer): """ Returns the connection logging setting for the given load balancer. """ uri = "/loadbalancers/%s/connectionlogging" % utils.get_id(loadbalancer) resp, body = self.api.method_get(uri) ret = body.get("connectionLogging", {...
python
def get_connection_logging(self, loadbalancer): """ Returns the connection logging setting for the given load balancer. """ uri = "/loadbalancers/%s/connectionlogging" % utils.get_id(loadbalancer) resp, body = self.api.method_get(uri) ret = body.get("connectionLogging", {...
Returns the connection logging setting for the given load balancer.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L1006-L1013
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager.set_connection_logging
def set_connection_logging(self, loadbalancer, val): """ Sets the connection logging for the given load balancer. """ uri = "/loadbalancers/%s/connectionlogging" % utils.get_id(loadbalancer) val = str(val).lower() req_body = {"connectionLogging": { "enable...
python
def set_connection_logging(self, loadbalancer, val): """ Sets the connection logging for the given load balancer. """ uri = "/loadbalancers/%s/connectionlogging" % utils.get_id(loadbalancer) val = str(val).lower() req_body = {"connectionLogging": { "enable...
Sets the connection logging for the given load balancer.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L1016-L1026
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerManager._get_lb
def _get_lb(self, lb_or_id): """ Accepts either a loadbalancer or the ID of a loadbalancer, and returns the CloudLoadBalancer instance. """ if isinstance(lb_or_id, CloudLoadBalancer): ret = lb_or_id else: ret = self.get(lb_or_id) return ret
python
def _get_lb(self, lb_or_id): """ Accepts either a loadbalancer or the ID of a loadbalancer, and returns the CloudLoadBalancer instance. """ if isinstance(lb_or_id, CloudLoadBalancer): ret = lb_or_id else: ret = self.get(lb_or_id) return ret
Accepts either a loadbalancer or the ID of a loadbalancer, and returns the CloudLoadBalancer instance.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L1052-L1061
pycontribs/pyrax
pyrax/cloudloadbalancers.py
Node.to_dict
def to_dict(self): """Convert this Node to a dict representation for passing to the API.""" return {"address": self.address, "port": self.port, "condition": self.condition, "type": self.type, "id": self.id, }
python
def to_dict(self): """Convert this Node to a dict representation for passing to the API.""" return {"address": self.address, "port": self.port, "condition": self.condition, "type": self.type, "id": self.id, }
Convert this Node to a dict representation for passing to the API.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L1099-L1106
pycontribs/pyrax
pyrax/cloudloadbalancers.py
Node.update
def update(self): """ Pushes any local changes to the object up to the actual load balancer node. """ diff = self._diff() if not diff: # Nothing to do! return self.parent.update_node(self, diff)
python
def update(self): """ Pushes any local changes to the object up to the actual load balancer node. """ diff = self._diff() if not diff: # Nothing to do! return self.parent.update_node(self, diff)
Pushes any local changes to the object up to the actual load balancer node.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L1157-L1166
pycontribs/pyrax
pyrax/cloudloadbalancers.py
Node.get_device
def get_device(self): """ Returns a reference to the device that is represented by this node. Returns None if no such device can be determined. """ addr = self.address servers = [server for server in pyrax.cloudservers.list() if addr in server.networks.get...
python
def get_device(self): """ Returns a reference to the device that is represented by this node. Returns None if no such device can be determined. """ addr = self.address servers = [server for server in pyrax.cloudservers.list() if addr in server.networks.get...
Returns a reference to the device that is represented by this node. Returns None if no such device can be determined.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L1169-L1180
pycontribs/pyrax
pyrax/cloudloadbalancers.py
VirtualIP.to_dict
def to_dict(self): """ Convert this VirtualIP to a dict representation for passing to the API. """ if self.id: return {"id": self.id} return {"type": self.type, "ipVersion": self.ip_version}
python
def to_dict(self): """ Convert this VirtualIP to a dict representation for passing to the API. """ if self.id: return {"id": self.id} return {"type": self.type, "ipVersion": self.ip_version}
Convert this VirtualIP to a dict representation for passing to the API.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L1210-L1217
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerClient._configure_manager
def _configure_manager(self): """ Creates a manager to handle the instances, and another to handle flavors. """ self._manager = CloudLoadBalancerManager(self, resource_class=CloudLoadBalancer, response_key="loadBalancer", uri_base="loadbalancers")
python
def _configure_manager(self): """ Creates a manager to handle the instances, and another to handle flavors. """ self._manager = CloudLoadBalancerManager(self, resource_class=CloudLoadBalancer, response_key="loadBalancer", uri_base="loadbalancers")
Creates a manager to handle the instances, and another to handle flavors.
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L1242-L1249
pycontribs/pyrax
pyrax/cloudloadbalancers.py
CloudLoadBalancerClient.get_usage
def get_usage(self, loadbalancer=None, start=None, end=None): """ Return the load balancer usage records for this account. If 'loadbalancer' is None, records for all load balancers are returned. You may optionally include a start datetime or an end datetime, or both, which will limit ...
python
def get_usage(self, loadbalancer=None, start=None, end=None): """ Return the load balancer usage records for this account. If 'loadbalancer' is None, records for all load balancers are returned. You may optionally include a start datetime or an end datetime, or both, which will limit ...
Return the load balancer usage records for this account. If 'loadbalancer' is None, records for all load balancers are returned. You may optionally include a start datetime or an end datetime, or both, which will limit the records to those on or after the start time, and those before or on the ...
https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/cloudloadbalancers.py#L1252-L1263