Apache Libcloud Documentation
repository·trunk·Indexed 24 days ago
https://github.com/apache/libcloudA standard Python library that provides a unified API to abstract away differences among multiple cloud provider APIs. It includes support for managing cloud services such as servers, storage, load balancers, and DNS, with specialized drivers for backup operations including Amazon EBS, Google Compute Engine, and Dimension Data.
What's inside Apache Libcloud
- Apache Libcloud is a Python library that provides a unified interface for managing various cloud provider APIs. It abstracts the differences between different cloud services, allowing you to manage diverse cloud resources through a consistent and easy-to-use API.
Overview of Libcloud resource categories
trunkApache Libcloud provides a unified API to manage various cloud resources across different providers. The managed resources are categorized into the following services:
- Cloud Servers and Block Storage: e.g., Amazon EC2, Rackspace CloudServers.
- Cloud Object Storage and CDN: e.g., Amazon S3, Rackspace CloudFiles.
- Load Balancers as a Service: e.g., Amazon Elastic Load Balancer.
- DNS as a Service: e.g., Amazon Route 53, Zerigo.
- Container Services: e.g., Docker, Rkt, and other container-based services.
- Backup as a Service: e.g., Amazon EBS, OpenStack Freezer.
AuroraDNS IPv6 Support
trunkAuroraDNS provides full support for IPv6, including:
- DNS queries over IPv6
- AAAA records
- Health checks over IPv6
Use the Azure ASM Compute Driver
trunkThe Azure driver integrates with Microsoft
Azure Virtual Machinesusing theAzure Service Management(ASM) API.Important Compatibility Note: This is the "Classic" API. It is incompatible with the newer
Azure Resource Management(ARM) API. If you need to use the ARM API, use theazure_armdriver instead.Understand the Container API
trunkThe Container API (available in Libcloud 1.0.0-pre1 and higher) allows users to install and deploy containers onto container-based virtualization platforms. It targets both on-premise software (like Docker) and Cloud Service Providers offering Container-as-a-Service (CaaS) APIs.
Note: The Container API is currently in an EXPERIMENTAL state.
Access provider-specific functionality via extension methods and arguments
trunkLibcloud provides a unified base API that acts as a 'lowest common denominator' across different cloud providers. To access functionality that is unique to a specific provider and not part of the standard Libcloud API, use extension methods and extension arguments. These are identified by the
ex_prefix.Warning: Using extension methods makes your code harder to switch between different cloud providers, as these methods are not part of the common interface.
Use Cluster Support for container orchestration
trunkIf a driver implements the class-level attribute
supports_clusters = True, it enables cluster-level management. This allows users to list, create, and destroy clusters, and specify a target cluster when deploying containers.Key abstractions for cluster support include:
ContainerCluster: Represents a deployed container environment/host.ClusterLocation: Represents a location where clusters can be deployed.
Retrieve metadata for Google Storage objects
trunkDue to limitations in the Google Storage API v1.0, metadata/tags are not returned when listing objects.
- To get metadata/tags, you must use the
get_objectmethod. - The
list_container_objectsmethod will not return metadata/tags.
- To get metadata/tags, you must use the
Understand Load Balancer API terminology
trunkThe Load Balancer API uses three primary abstractions to manage load balancing services:
LoadBalancer: Represents a specific load balancer instance.Member: Represents a member (e.g., a backend server or node) within a load balancer.Algorithm: Represents the load balancing algorithm used to distribute traffic (such asround-robin,random, orleast connections).
Manage SSH key pairs with NodeDriver
trunkLibcloud (version 0.14.0 and above) provides base API methods in
libcloud.compute.base.NodeDriverto manage SSH key pairs on your cloud account. Supported operations include:- List key pairs:
list_key_pairs() - Retrieve key pair info:
get_key_pair(name)(returns fingerprint and public key) - Create a new key pair:
create_key_pair(name) - Import a key pair:
import_key_pair_from_string(name, key_string)orimport_key_pair_from_file(name, file_path) - Delete a key pair:
delete_key_pair(name)
- List key pairs:
Proxy limitations and authentication
trunkWhen using proxies with Libcloud, be aware of the following:
- Authentication: Only HTTP basic access authentication proxy authorization method is supported.
- HTTPS Verification: Using an HTTPS proxy requires manual configuration of the CA cert bundle to avoid
SSLError.
Dimension Data Load Balancer non-standard extension methods
trunkIn addition to the standard
libcloudload balancer methods (creating balancers, adding members, and destroying members), the Dimension Data driver provides several non-standard extension methods to access provider-specific functionality:- list nodes: Retrieve available nodes.
- list pools: Retrieve available pools.
- set the network domain (zone): Configure the network domain/zone for the load balancer.