GitHub user aimonb opened a pull request:
https://github.com/apache/libcloud/pull/855
Enhance get_list_of_xx calls by allowing for filter by network id
Enhance get_list_of_xx calls by allowing for filter by network id
Description
While developing utils using libcloud, I found that there were several
routines in the LoadBalancer driver that just did not seem right. Specifically,
these were the "get a list of XXX"-type routines. I felt (and others agreed)
that it was "less than ideal" that these routines all defaulted to "return
EVERYTHING from your company across ALL networks". Initially, I assumed that it
would filter by network (since I had already told the LB Driver what my network
Id was. However, in testing my util, I found that it return LoadBalancers (in
my case) from networks that I had never heard of.
Therefore, I created this PR. The interface changes are BACKWARDS
compatible.
For example:
def list_balancers(self) ==> def list_balancers(self, network_id=None)
Status
This code has been tested to show that:
by default, the original all-encompassing lists are returned.
using the new parameter, a list that only applies to the given network id
is returned.
I do have several more tests that I want to run. I won't be able to get to
those until 8/31/16 though.
Checklist (tick everything that applies)
I will get to these (and update the PR as needed) on the 31st.
I just wanted to get you this code as soon as possible.
Code linting (required, can be done after the PR checks)
Documentation
Tests
ICLA (required for bigger changes)
NOTE: We took this "concept" and applied to all the places that WE needed.
This may apply to the compute and backup drivers as well.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/NexusIS/libcloud trunk
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/libcloud/pull/855.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #855
----
commit 605d27b77f2651fc14a19df93627f9559c0db64d
Author: Mike Outland <[email protected]>
Date: 2016-08-25T18:50:40Z
Merge pull request #1 from apache/trunk
Update repo
commit 3b7e4ad576b87fa57f163dc9ccd3e61f91a387e6
Author: jr2730 <[email protected]>
Date: 2016-08-25T22:51:31Z
Enhance get_list_of_xx calls by allowing for filter by network id
commit d57770de80b03230b7c89b393949f0e9c18a659d
Author: Aimon Bustardo <[email protected]>
Date: 2016-08-26T02:37:00Z
Merge pull request #2 from jr2730/add_auto_network_filtering
Enhance get_list_of_xx calls by allowing for filter by network id
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---