Skip to content

Instantly share code, notes, and snippets.

@major
Created January 29, 2014 07:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save major/8683358 to your computer and use it in GitHub Desktop.
Save major/8683358 to your computer and use it in GitHub Desktop.
Clone a Rackspace Cloud Load Balancer from HTTP -> HTTPS
#!/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