Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
48ea0f0
Rename libcloud.resources.lb to libcloud.loadbalancer'
pquerna May 14, 2011
df2f026
Simply deploy_node a bit and actually retry the process if it fails.
Kami May 14, 2011
727dca1
If a ssh timeout is not provided default to 20 seconds.
Kami May 14, 2011
bd39a98
Add LBAlgorithm class and set DEFAULT_ALGORITHM variable to ROUND_ROBIN.
Kami May 14, 2011
478f891
Rename 'node{,s}' in the load balancer API to be 'member{,s}', as thi…
pquerna May 14, 2011
6203a80
remove unused variables
pquerna May 14, 2011
38ccb6a
fix simplejson fallback
pquerna May 14, 2011
b95fc39
remove unused imports
pquerna May 14, 2011
64b09ee
Have attach_member actually take a LBMember object as its parameter, …
pquerna May 14, 2011
85ac5df
Add two new instance variables and utility methods to the base LBDriv…
Kami May 14, 2011
f76a5da
Fix formatting.
Kami May 14, 2011
4960b18
Add balancer_attach_compute_node, which takes a normal libcloud compu…
pquerna May 14, 2011
6837080
LBNode -> LBMember in example_lb.py
Kami May 14, 2011
c1d263f
Rename example_lb.py -> example_loadbalancer.py.
Kami May 14, 2011
9c569a2
Fix a typo and make instance variables uppercase.
Kami May 14, 2011
e7c5b1f
Add missing attach_member method.
Kami May 14, 2011
ee52920
1. Don't use kwargs
Kami May 14, 2011
e5fb843
Add reverse_dict utility function.
Kami May 14, 2011
5d899fa
Don't use kwargs here.
Kami May 14, 2011
d742118
Pass in the algorithm to the create_balancer method.
Kami May 14, 2011
6e02b62
Centralize the new compute drivers list in the CHANGES file
pquerna May 14, 2011
ef2466e
Rename the balancer_detail to get_balancer and change the method sign…
Kami May 14, 2011
585219d
Rename the balancer_details method to get_balancer and refactor id.
Kami May 14, 2011
afc1f46
Do the same with the balancer_detail method in the Rackspace LB driver.
Kami May 14, 2011
751dc00
Rewrite changes for 0.5, grouping things by relevant driver
pquerna May 14, 2011
fe5dedf
Sort drivers alphabetically, fixup some formatting
pquerna May 14, 2011
632c7bf
Add release date for 0.4.2
pquerna May 14, 2011
8755dc3
Update / sync docs with actual args
pquerna May 14, 2011
940fc1c
Change the create_balancer method signature and add list_protocols me…
Kami May 14, 2011
6198094
Remove the LB prefix to most libcloud.loadbalancer.* types
pquerna May 14, 2011
d99132f
remove unused imports
pquerna May 14, 2011
5174840
fix __all__ for load balancers
pquerna May 14, 2011
eb48f8a
Ooops, used old name here
pquerna May 14, 2011
c17ec3c
Remove unused imports
pquerna May 14, 2011
25c4bef
remove unused import
pquerna May 14, 2011
1f048da
Update create_balancer method in the GoGrid driver.
Kami May 14, 2011
d9fd09c
remove more unused imports (padding my stats yo)
pquerna May 14, 2011
90d3587
Update the create_balancer method in rackspace driver.
Kami May 14, 2011
f8f97a6
Use DEFAULT_ALGORITHM constant.
Kami May 14, 2011
86b4557
Add list_protocols method to the Rackspace LB driver.
Kami May 14, 2011
ce98896
Forgot to add this file.
Kami May 14, 2011
824d738
Remove file_hash and add verify_hash argument and make it consistent …
Kami May 14, 2011
db2ab54
Make get_meta_data and extension method and update affected tests.
Kami May 15, 2011
63f6454
Fix a bug in the gogrid driver and add a test case for it.
Kami May 15, 2011
a5c9bd2
Make sure the correct parameters are sent when creating a load balanc…
Kami May 15, 2011
50882e0
Add license header and update the example.
Kami May 15, 2011
5233e53
Remove print statement.
Kami May 15, 2011
a8d0550
Properly set object hash value when using get_object method in the Cl…
Kami May 15, 2011
7d2d797
Update affected test.
Kami May 15, 2011
7198f67
Properly capture errors if they happen in the RawResponse part.
Kami May 15, 2011
2f8cb97
Update loadbalancer example.
Kami May 16, 2011
089ba94
Minor style fixes for loadbalancer example.
novel May 17, 2011
e30defe
Remove no longer used resource directory.
novel May 17, 2011
3373c67
Chase rename of LB and LBNode classes for loadbalancers.
novel May 17, 2011
7fba13b
GoGrid Compute Driver: add 16GB node size.
novel May 17, 2011
6aced03
Also include actual error value when calling str on Error object.
Kami May 21, 2011
a4478d9
Fix a bug with using the incorrect URL when performing a raw request.
Kami May 21, 2011
edeb8d8
Don't lowercase the amz header values in the request signature.
Kami May 21, 2011
47b1ad3
Fix Gandi.net tests so they work with Python 2.7
Kami May 21, 2011
7bbc12b
Fix a bug with unittest module in Python 2.7 in the GoGrid load-balan…
Kami May 21, 2011
fa1a26d
Add a new MockHttpTestCase class which behaves the same as the base M…
Kami May 21, 2011
295c3b4
Add missing license hader.
Kami May 21, 2011
d35f528
Add another missing license header.
Kami May 21, 2011
3893043
Update .ratignore (Ignore loadbalancer fixtures and empty __init__.py…
Kami May 21, 2011
8cf91d7
Add a notice to the balancer_detach_member method.
Kami May 21, 2011
d80a719
Remove type attribute from the Loadbalancer driver classes.
Kami May 21, 2011
8771ed3
Rename RACKSPACE load-balancer provider constant to RACKSPACE_US.
Kami May 21, 2011
4ca057b
Should be round robin.
Kami May 21, 2011
545c7f3
Index needs to start with 1 otherwise Unexpected server error is thrown.
Kami May 21, 2011
8241315
Update gogrid test.
Kami May 21, 2011
2e64343
Revert back to the old behavior and start with 0.
Kami May 21, 2011
6ddb8b2
Should be 'least connect'.
Kami May 21, 2011
99929b6
Capture unexpected server error when creating a new load-balancer and…
Kami May 21, 2011
c5896f3
Add a new test for the GoGrid LB driver.
Kami May 21, 2011
000b235
Forgot to commit this.
Kami May 21, 2011
3d3a73e
pyflakes cleanup.
Kami May 21, 2011
2b89b30
Update the version string.
Kami May 21, 2011
325b28c
Read the version number from the libcloud/__init__.py file
Kami May 21, 2011
357223a
Forgot to pop it.
Kami May 21, 2011
7f2210f
Add a note about api refactoring and the compute modules being moved to
Kami May 21, 2011
045bbde
Update setup.py, include storage packages.
Kami May 21, 2011
61abb0b
Add missing data file to setup.py.
Kami May 21, 2011
9f41922
Update setup.py and MANIFEST.in
Kami May 21, 2011
a3d75ea
ex_create_tags should be a pass-through in Nimbus driver since Nimbus…
Kami May 23, 2011
5ff56ff
Add a base LibcloudTestCase which eventually all the test cases shoul…
Kami May 23, 2011
4c5b9c4
Refactor EC2 test to inherit from LibcloudTestCase and use the new as…
Kami May 23, 2011
7f603e0
Properly handle response errors in the Rackspace driver and only thro…
Kami May 23, 2011
a07e1ea
Update changes.
Kami May 23, 2011
ed282ff
Update changes and add missing driver info.
Kami May 24, 2011
d6d53a5
Added openstack base connection class, swift storage driver, and test…
pschwartz May 26, 2011
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .ratignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ CHANGES
HACKING
test/storage/fixtures/
test/compute/fixtures/
test/loadbalancer/fixtures/
coverage_html_report/
.coverage
.coveragerc
data/pricing.json
test/pricing_test.json

common/__init__.py
compute/__init__.py
storage/__init__.py
libcloud/data/pricing.json
libcloud/common/__init__.py
libcloud/compute/__init__.py
libcloud/storage/__init__.py
test/storage/__init__.py
test/pricing_test.json
125 changes: 55 additions & 70 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,85 +1,70 @@
-*- coding: utf-8 -*-

Changes with Apache Libcloud 0.4.3
*) Add implementation for the following methods to the CloudFiles
storage driver: enable_container_cdn(), get_container_cdn_url(),
get_object_cdn_url()
Changes with Apache Libcloud 0.5.1
*) Rackspace driver:
- Properly handle response errors and only throw InvalidCredsError if
the returned status code is 401
[Brad Morgan]

*) Nimbus driver:
- Fix the create_node method and make the "ex_create_tag" method a no-op,
because Nimbus doesn't support creating tags.

Changes with Apache Libcloud 0.5.0

*) Existing APIs directly on the libcloud.* module have been
deprecated and will be removed in version 0.6.0. Most methods
were moved to the libcloud.compute.* module.

*) Add new libcloud.loadbalancers API, with initial support for:
- GoGrid Load Balancers
- Rackspace Load Balancers
[Roman Bogorodskiy]

*) Add new libcloud.storage API, with initial support for:
- Amazon S3
- Rackspace CloudFiles
[Tomaz Muraus]

*) Add OpenStack driver, which is actually an extension for
Rackspace driver that allows to specify custom port and
host of user's OpenStack installation
[Roman Bogorodskiy]

*) Add support for Load Balancing services, available through
libcloud.resource.lb. Drivers for Rackspace and GoGrid are
included.
[Roman Bogorodskiy]

*) Update GoGrid driver to use API Version 1.8. Sandbox flag
for servers is no longer used.
[Roman Bogorodskiy]

*) When creating an EC2 node, don't ignore the name argument
and create a "Name" tag with the value of this argument.
[Tomaz Muraus]

*) Add Gandi.net driver.
[Aymeric Barantal]

*) Add extension method for modifying node attributes and
changing the node size (EC2 driver).
[Tomaz Muraus]

*) Add Bluebox driver.
[Christian Paredes]

*) Add Nimbus driver.
[David LaBissoniere]

*) Minor fixes to get the library and tests working on
Python 2.7 and PyPy.
[Tomaz Muraus]
*) Add new libcloud.compute drivers for:
- Bluebox [Christian Paredes]
- Gandi.net [Aymeric Barantal]
- Nimbus [David LaBissoniere]
- OpenStack [Roman Bogorodskiy]
- Opsource.net [Joe Miller]

*) Added "pricing" module and improved pricing handling.
[Tomaz Muraus]

*) Add support for the new Amazon Region (Tokyo)
[Tomaz Muraus]

*) Implement ex_rebuild() and ex_get_node_details()
routines for Rackspace driver.
[Andrew Klochkov]

*) Implement ex_list_ips() for GoGrid driver to list
IP addresses assigned to the account. Make use of
it in _get_first_ip().
*) Updates to the GoGrid compute driver:
- Use API version 1.0.
- Remove sandbox flag.
- Add ex_list_ips() to list IP addresses assigned to the account.
- Implement ex_edit_image method which allows changing image attributes
like name, description and make image public or private.
[Roman Bogorodskiy]

*) Added ex_create_tags and ex_delete_tags methods to the
EC2 driver.
[Brandon Rhodes]

*) Include node Elastic IP addresses in the node public_ip
attribute for the EC2 nodes.
[Tomaz Muraus]

*) Use ipAddress and privateIpAddress attribute for
the EC 2node public and private ip
[Tomaz Muraus]

*) Add ex_describe_addresses method to the EC2 driver.
*) Updates to the Amazon EC2 compute driver:
- When creating a Node, use the name argument to set a Tag with the
value. [Tomaz Muraus]
- Add extension method for modifying node attributes and changing the
node size. [Tomaz Muraus]
- Add support for the new Amazon Region (Tokyo). [Tomaz Muraus]
- Added ex_create_tags and ex_delete_tags. [Brandon Rhodes]
- Include node Elastic IP addresses in the node public_ip attribute
for the EC2 nodes. [Tomaz Muraus]
- Use ipAddress and privateIpAddress attribute for the EC 2node public
and private ip. [Tomaz Muraus]
- Add ex_describe_addresses method to the EC2 driver. [Tomaz Muraus]

*) Updates to the Rackspace CloudServers compute driver:
- Add ex_rebuild() and ex_get_node_details() [Andrew Klochkov]
- Expose URI of a Rackspace node to the node meta data. [Paul Querna]

*) Minor fixes to get the library and tests working on Python 2.7 and PyPy.
[Tomaz Muraus]

*) Expose URI of a Rackspace node to the node meta data.
[Paul Querna]

*) Implement ex_edit_image method for GoGrid driver
which allows changing image attributes like name,
description and make image public or private.
[Roman Bogorodskiy]

Changes with Apache Libcloud 0.4.2
Changes with Apache Libcloud 0.4.2 (Released January 18, 2011)

*) Fix EC2 create_node to become backward compatible for
NodeLocation.
Expand Down
13 changes: 10 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
include LICENSE
include NOTICE
include DISCLAIMER
include example.py
include example_*.py
include CONTRIBUTORS
include CHANGES
include HACKING
include README
include libcloud/data/pricing.json
prune test/secrets.py
include test/*.py
include demos/*
include test/*.py
include test/pricing_test.json
include test/secrets.py-dist
include test/fixtures/*/*
include test/compute/*.py
include test/storage/*.py
include test/loadbalancer/*.py
include test/compute/fixtures/*/*
include test/storage/fixtures/*/*
include test/loadbalancer/fixtures/*/*
54 changes: 0 additions & 54 deletions example_lb.py

This file was deleted.

71 changes: 71 additions & 0 deletions example_loadbalancer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


import os
import time

from libcloud.loadbalancer.base import Member, Algorithm
from libcloud.loadbalancer.types import Provider, State
from libcloud.loadbalancer.providers import get_driver

def main():
Rackspace = get_driver(Provider.RACKSPACE_US)

driver = Rackspace('username', 'api key')

balancers = driver.list_balancers()

print balancers

# creating a balancer which balances traffic across two
# nodes: 192.168.86.1:80 and 192.168.86.2:8080. Balancer
# itself listens on port 80/tcp
new_balancer_name = 'testlb' + os.urandom(4).encode('hex')
new_balancer = driver.create_balancer(name=new_balancer_name,
algorithm=Algorithm.ROUND_ROBIN,
port=80,
protocol='http',
members=(Member(None, '192.168.86.1', 80),
Member(None, '192.168.86.2', 8080))
)

print new_balancer

# wait for balancer to become ready
# NOTE: in real life code add timeout to not end up in
# endless loop when things go wrong on provider side
while True:
balancer = driver.get_balancer(balancer_id=new_balancer.id)

if balancer.state == State.RUNNING:
break

print "sleeping for 30 seconds for balancers to become ready"
time.sleep(30)

# fetch list of members
members = balancer.list_members()
print members

# remove first member
balancer.detach_member(members[0])

# remove the balancer
driver.destroy_balancer(new_balancer)

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion libcloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

__all__ = ["__version__", "enable_debug"]

__version__ = "0.5.0-dev"
__version__ = "0.5.0"

def enable_debug(fo):
"""
Expand Down
Loading