Apache Libcloud Documentation Release 0.14.0-Dev
Total Page:16
File Type:pdf, Size:1020Kb
Apache Libcloud Documentation Release 0.14.0-dev The Apache Software Foundation January 13, 2017 Contents 1 Documentation 3 1.1 Main...................................................3 1.1.1 Getting Started.........................................3 1.1.2 Supported Providers......................................4 1.1.3 Third Party Drivers....................................... 21 1.1.4 Compute............................................ 22 1.1.5 Object Storage......................................... 23 1.1.6 Load Balancer.......................................... 24 1.1.7 DNS............................................... 24 1.1.8 Container............................................ 25 1.1.9 Backup............................................. 27 1.1.10 Troubleshooting......................................... 28 1.1.11 API Documentation....................................... 31 1.1.12 Frequently Asked Questions (FAQ).............................. 32 1.1.13 Changes in Apache Libcloud v2.0.0RC1............................ 33 1.1.14 Registering a third party driver................................. 35 1.1.15 SSL Certificate Validation in <v2.0............................... 36 1.1.16 Using an HTTP proxy..................................... 38 1.1.17 Using Libcloud in multi-threaded and async environments.................. 40 1.1.18 Working with the object oriented APIs............................. 41 1.2 Developer Information.......................................... 44 1.2.1 Developer Information..................................... 44 1.2.2 Development.......................................... 45 1.3 Committer Guide............................................. 52 1.3.1 Committer Guide........................................ 52 1.4 Other................................................... 60 1.4.1 Changelog............................................ 60 1.4.2 Upgrade Notes......................................... 113 1.4.3 Security............................................. 126 i ii Apache Libcloud Documentation, Release 0.14.0-dev Apache Libcloud is a Python library which hides differences between different cloud provider APIs and allows you to manage different cloud resources through a unified and easy to use API. Resource you can manage with Libcloud are divided in the following categories: • Cloud Servers and Block Storage - services such as Amazon EC2 and Rackspace CloudServers • Cloud Object Storage and CDN - services such as Amazon S3 and Rackspace CloudFiles • Load Balancers as a Service - services such as Amazon Elastic Load Balancer and GoGrid LoadBalancers • DNS as a Service - services such as Amazon Route 53 and Zerigo • Container Services - container virtualization like Docker and Rkt as well as container based services • Backup as a Service - services such as Amazon EBS and OpenStack Freezer Fig. 1: A subset of supported providers in Libcloud. Contents 1 Apache Libcloud Documentation, Release 0.14.0-dev 2 Contents CHAPTER 1 Documentation 1.1 Main 1.1.1 Getting Started Installation (stable version) Libcloud is available on PyPi. You can install latest stable version using pip: pip install apache-libcloud Installation (development version) You can install latest development version from our Git repository: pip install -e git+https://git-wip-us.apache.org/repos/asf/libcloud.git@trunk#egg=apache-libcloud Upgrading If you used pip to install the library you can also use it to upgrade it: pip install --upgrade apache-libcloud Using it This section describes a standard work-flow which you follow when working with any of the Libcloud drivers. 1. Obtain reference to the provider driver from pprint import pprint import libcloud cls= libcloud.get_driver(libcloud.DriverType.COMPUTE, libcloud.DriverType.COMPUTE.RACKSPACE) 2. Instantiate the driver with your provider credentials driver= cls('my username','my api key') 3 Apache Libcloud Documentation, Release 0.14.0-dev Keep in mind that some drivers take additional arguments such as region and api_version. For more information on which arguments you can pass to your provider driver, see provider-specific documentation and the driver docstrings. 3. Start using the driver pprint(driver.list_sizes()) pprint(driver.list_nodes()) 4. Putting it all together from pprint import pprint import libcloud cls= libcloud.get_driver(libcloud.DriverType.COMPUTE, libcloud.DriverType.COMPUTE.RACKSPACE) driver= cls('my username','my api key') pprint(driver.list_sizes()) pprint(driver.list_nodes()) You can find more examples with common patterns which can help you get started on the Compute Examples page. Where to go from here? The best thing to do after understanding the basic driver work-flow is to visit the documentation chapter for the API you are interested in (Compute, Object Storage, Load Balancer, DNS). Chapter for each API explains some basic terminology and things you need to know to make an effective use of that API. After you have a good grasp of those basic concepts, you are encouraged to check the driver specific documentation (if available) and usage examples. If the driver specific documentation for the provider you are interested in is not available yet, you are encouraged to check docstrings for that driver. 1.1.2 Supported Providers This pages lists supported providers and methods for all the APIs. Compute Provider Matrix Provider Documentation Provider Constant Supported Regions Module Class Name Abiquo ABIQUO single region driver libcloud.compute.drivers.abiquo AbiquoNodeDriver Aliyun ECS Click ALIYUN_ECS single region driver libcloud.compute.drivers.ecs ECSDriver PCextreme AuroraCompute Click AURORACOMPUTE single region driver libcloud.compute.drivers.auroracompute AuroraComputeNodeDriver Azure Virtual machines Click AZURE single region driver libcloud.compute.drivers.azure AzureNodeDriver Azure Virtual machines Click AZURE_ARM single region driver libcloud.compute.drivers.azure_arm AzureNodeDriver Bluebox Blocks BLUEBOX single region driver libcloud.compute.drivers.bluebox BlueboxNodeDriver Brightbox BRIGHTBOX single region driver libcloud.compute.drivers.brightbox BrightboxNodeDriver BSNL Click BSNL single region driver libcloud.compute.drivers.bsnl BSNLNodeDriver Continued on next page 4 Chapter 1. Documentation Apache Libcloud Documentation, Release 0.14.0-dev Table 1.1 – continued from previous page Provider Documentation Provider Constant Supported Regions Module Class Name Cloudscale Click CLOUDSCALE single region driver libcloud.compute.drivers.cloudscale CloudscaleNodeDriver CloudSigma (API v2.0) Click CLOUDSIGMA single region driver libcloud.compute.drivers.cloudsigma CloudSigmaNodeDriver CloudStack Click CLOUDSTACK single region driver libcloud.compute.drivers.cloudstack CloudStackNodeDriver Cloudwatt Click CLOUDWATT single region driver libcloud.compute.drivers.cloudwatt CloudwattNodeDriver DigitalOcean Click DIGITAL_OCEAN single region driver libcloud.compute.drivers.digitalocean DigitalOceanNodeDriver DimensionData Click DIMENSIONDATA single region driver libcloud.compute.drivers.dimensiondata DimensionDataNodeDriver Amazon EC2 Click EC2 ap-northeast-2, ap-southeast-1, us-gov-west-1, us-west-2, us-west-1, sa-east-1, us-east-1, us-east-2, eu-west-1, eu-central-1, ap-southeast-2, ap-northeast-1, ap-south-1 libcloud.compute.drivers.ec2 EC2NodeDriver Enomaly Elastic Computing Platform ECP single region driver libcloud.compute.drivers.ecp ECPNodeDriver ElasticHosts ELASTICHOSTS single region driver libcloud.compute.drivers.elastichosts ElasticHostsNodeDriver Eucalyptus EUCALYPTUS single region driver libcloud.compute.drivers.ec2 EucNodeDriver Exoscale Click EXOSCALE single region driver libcloud.compute.drivers.exoscale ExoscaleNodeDriver Gandi Click GANDI single region driver libcloud.compute.drivers.gandi GandiNodeDriver Google Compute Engine Click GCE single region driver libcloud.compute.drivers.gce GCENodeDriver GoGrid GOGRID single region driver libcloud.compute.drivers.gogrid GoGridNodeDriver HostVirtual HOSTVIRTUAL single region driver libcloud.compute.drivers.hostvirtual HostVirtualNodeDriver Ikoula Click IKOULA single region driver libcloud.compute.drivers.ikoula IkoulaNodeDriver Indosat Click INDOSAT single region driver libcloud.compute.drivers.indosat IndosatNodeDriver InternetSolutions Click INTERNETSOLUTIONS single region driver libcloud.compute.drivers.internetsolutions InternetSolutionsNodeDriver Joyent JOYENT single region driver libcloud.compute.drivers.joyent JoyentNodeDriver Kili Public Cloud Click KILI single region driver libcloud.compute.drivers.kili KiliCloudNodeDriver KTUCloud KTUCLOUD single region driver libcloud.compute.drivers.ktucloud KTUCloudNodeDriver Libvirt Click LIBVIRT single region driver libcloud.compute.drivers.libvirt_driver LibvirtNodeDriver Linode LINODE single region driver libcloud.compute.drivers.linode LinodeNodeDriver MedOne Click MEDONE single region driver libcloud.compute.drivers.medone MedOneNodeDriver NephoScale NEPHOSCALE single region driver libcloud.compute.drivers.nephoscale NephoscaleNodeDriver Nimbus Click NIMBUS single region driver libcloud.compute.drivers.ec2 NimbusNodeDriver NTTAmerica Click NTTA single region driver libcloud.compute.drivers.ntta NTTAmericaNodeDriver OnApp Click ONAPP single region driver libcloud.compute.drivers.onapp OnAppNodeDriver OpenNebula (v3.8) OPENNEBULA single region driver libcloud.compute.drivers.opennebula OpenNebulaNodeDriver OpenStack Click OPENSTACK single region driver libcloud.compute.drivers.openstack OpenStackNodeDriver Outscale INC Click OUTSCALE_INC single region driver