Created
January 29, 2014 07:31
-
-
Save major/8683358 to your computer and use it in GitHub Desktop.
Clone a Rackspace Cloud Load Balancer from HTTP -> HTTPS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import pyrax | |
import sys | |
pyrax.set_setting("identity_type", "rackspace") | |
pyrax.set_setting("region", "IAD") | |
pyrax.set_credentials("username", "API_KEY") | |
clb = pyrax.cloud_loadbalancers | |
cs = pyrax.cloudservers | |
new_lb = clb.list()[0] | |
virtual_ips = new_lb.virtual_ips | |
shared_vips = [] | |
for vip in virtual_ips: | |
pprint(vip) | |
shared_vips.append(clb.VirtualIP(id=vip.id)) | |
node = clb.Node(address="<your-server-IP>", port=443, condition="ENABLED") | |
lb = clb.create("pyrax-https-clond", port=443, protocol="HTTPS", nodes=[node], virtual_ips=shared_vips) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment