blob: 2da04579e66cbfee73e400e82193483a27443356 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Python library for interacting with many of the popular cloud service providers using a unified API.">
<meta name="author" content="The Apache Software Foundation">
<meta name="keywords" content="python,libcloud,cloud,cloud computing,rackspace,amazon ec2,cloudfiles,openstack,cloudstack" />
<title>Apache Libcloud is a standard Python library that abstracts away differences among multiple cloud provider APIs | Apache Libcloud</title>
<!-- fav icons -->
<link rel="shortcut icon" href="/images/favicon.png" />
<link rel="apple-touch-icon" href="/images/apple-touch-icon.png" />
<link rel="apple-touch-icon-precomposed" href="/images/apple-touch-icon.png" />
<link href="/blog/atom.xml" type="application/atom+xml" rel="alternate" title="Apache Libcloud Blog Feed" />
<!-- Facebook OpenGraph tags -->
<meta content="Apache Libcloud" property="og:site_name">
<meta content="Apache Libcloud is a standard Python library that abstracts away differences among multiple cloud provider APIs" property="og:title">
<meta content="https://libcloud.apache.org/images/media/libcloud-logo-with-text-medium.png" property="og:image">
<meta content="Python library for interacting with many of the popular cloud service providers using a unified API." property="og:description">
<meta content="website" property="og:type">
<meta content="https://libcloud.apache.org/" property="og:url">
<link href='/assets/global-1768bfa479597eed443be67c5aec2edc.css' rel='stylesheet' type='text/css' />
</head>
<body data-spy="scroll" data-target=".sidebar-nav" data-offset="80">
<nav class="navbar navbar-fixed-top navbar-inverse" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/"><img src="/images/libcloud_logo.png" class="navbar-logo" /> Apache Libcloud</a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li ><a href="/" >Home</a></li>
<li ><a href="/about.html" >About</a></li>
<li ><a href="/getting-started.html" >Quick Start</a></li>
<li ><a href="https://libcloud.readthedocs.org/en/stable/" target="_blank">Documentation</a></li>
<li ><a href="/downloads.html" >Downloads</a></li>
<li ><a href="/community.html" >Community</a></li>
<li ><a href="/blog/" >Blog</a></li>
</ul>
<div class="material-switch pull-right">
<input id="theme-switch" name="theme-switch" type="checkbox" onclick="modeSwitcher()"/>
<label for="theme-switch" class="label-default"></label>
<span id="theme-toggle" class="theme-switch">Dark mode</span>
</div>
</div><!-- /.navbar-collapse -->
</div><!-- /.container -->
</nav>
<div class="container main-container">
<div class="row section">
<div class="col-lg-12">
<div class="main-content text-center">
<h1>One Interface To Rule Them All</h1>
<h2 class="tagline">Python library for interacting with many of the popular
cloud service providers using a unified API.</h2>
<p>Supports <a href="https://libcloud.readthedocs.org/en/stable/supported_providers.html" target="_blank">more than 50</a> providers such as</p>
<div id="carousel-provider-logos" class="carousel slide" data-ride="carousel" data-interval="3500">
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<a href="https://libcloud.readthedocs.org/en/stable/compute/drivers/rackspace.html" target="_blank">
<img src="/images/provider-logos/rackspace.png" class="provider-logo" /></a>
<a href="https://libcloud.readthedocs.org/en/stable/compute/drivers/ec2.html" target="_blank">
<img src="/images/provider-logos/aws.png" class="provider-logo" /></a>
<a href="https://libcloud.readthedocs.org/en/stable/compute/drivers/cloudstack.html" target="_blank">
<img src="/images/provider-logos/cloudstack.png" class="provider-logo" /></a>
</div>
<div class="item">
<a href="https://libcloud.readthedocs.org/en/stable/compute/drivers/openstack.html" target="_blank">
<img src="/images/provider-logos/openstack.png" class="provider-logo" /></a>
<a href="https://libcloud.readthedocs.org/en/stable/compute/drivers/digital_ocean.html" target="_blank">
<img src="/images/provider-logos/digitalocean.png" class="provider-logo" /></a>
<img src="/images/provider-logos/eucalyptus.png" class="provider-logo" />
</div>
<div class="item">
<img src="/images/provider-logos/joyent.png" class="provider-logo" />
<img src="/images/provider-logos/linode.png" class="provider-logo" />
<a href="https://libcloud.readthedocs.org/en/stable/compute/drivers/exoscale.html" target="_blank">
<img src="/images/provider-logos/exoscale.png" class="provider-logo" /></a>
</div>
<div class="item">
<img src="/images/provider-logos/nephoscale.png" class="provider-logo" />
<a href="https://libcloud.readthedocs.org/en/stable/compute/drivers/gce.html" target="_blank">
<img src="/images/provider-logos/gcp.png" class="provider-logo" /></a>
<img src="/images/provider-logos/zerigo.png" class="provider-logo" />
</div>
<div class="item">
<a href="https://libcloud.readthedocs.org/en/stable/compute/drivers/cloudsigma.html" target="_blank">
<img src="/images/provider-logos/cloudsigma.png" class="provider-logo" />
</a>
<a href="https://libcloud.readthedocs.org/en/stable/compute/drivers/ikoula.html" target="_blank">
<img src="/images/provider-logos/ikoula.png" class="provider-logo" />
</a>
<a href="https://libcloud.readthedocs.org/en/stable/compute/drivers/libvirt.html" target="_blank">
<img src="/images/provider-logos/libvirt.png" class="provider-logo" />
</a>
</div>
<div class="item">
<a href="https://libcloud.readthedocs.org/en/stable/compute/drivers/dimensiondata.html" target="_blank">
<img src="/images/provider-logos/dimensiondata.png" class="provider-logo" />
</a>
<a href="https://libcloud.readthedocs.org/en/stable/dns/drivers/cloudflare.html" target="_blank">
<img src="/images/provider-logos/cloudflare.png" class="provider-logo" />
</a>
<a href="https://libcloud.readthedocs.org/en/stable/storage/drivers/backblaze_b2.html" target="_blank">
<img src="/images/provider-logos/backblaze.png" class="provider-logo" />
</a>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-provider-logos" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-provider-logos" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</div>
<div class="row section row-2">
<div class="col-md-6">
<h3>Installation</h3>
<p>Latest stable version (Python 3.7+ only): <a href="https://pypi.python.org/pypi/apache-libcloud/3.8.0" target="_blank">3.8.0</a> (August 10th, 2023)</p>
<p><code>pip install apache-libcloud</code></p>
<p>Or <a href="downloads.html">download it from our servers</a> and install it manually.</p>
</div>
<div class="col-md-6">
<h3>Features</h3>
<ul>
<li>Avoid vendor lock-in</li>
<li>Use the same API to talk to many different providers</li>
<li>More than <a href="https://libcloud.readthedocs.org/en/stable/supported_providers.html">
30 supported providers</a> total</li>
<li>Six main APIs:
<a href="https://libcloud.readthedocs.org/en/stable/compute/index.html">Compute</a>,
<a href="https://libcloud.readthedocs.org/en/stable/storage/index.html">Storage</a>,
<a href="https://libcloud.readthedocs.org/en/stable/loadbalancer/index.html">Load Balancers</a>,
<a href="https://libcloud.readthedocs.org/en/stable/dns/index.html">DNS</a>,
<a href="https://libcloud.readthedocs.org/en/stable/container/index.html">Container</a>,
<a href="https://libcloud.readthedocs.org/en/stable/backup/index.html">Backup</a></li>
<li>Supports <a href="/about.html#supported-python-versions">Python 3.7+, PyPy 3.7+, Python 2.7 (v2.8.x release series)</a></li>
</ul>
</div>
</div>
<div class="row section row-3">
<div class="col-md-6 example" data-example="compute-1">
<h3>Compute Example - Create a node</h3>
<figure class="highlight"><pre><code class="language-python" data-lang="python"><div class="line-1"><span class="kn">from</span> <span class="nn">libcloud.compute.types</span> <span class="kn">import</span> <span class="n">Provider</span>
</div><div class="line-2"><span class="kn">from</span> <span class="nn">libcloud.compute.providers</span> <span class="kn">import</span> <span class="n">get_driver</span>
</div><div class="line-3">
</div><div class="line-4"><span class="n">cls</span> <span class="o">=</span> <span class="n">get_driver</span><span class="p">(</span><span class="n">Provider</span><span class="p">.</span><span class="n">RACKSPACE</span><span class="p">)</span>
</div><div class="line-5"><span class="n">driver</span> <span class="o">=</span> <span class="n">cls</span><span class="p">(</span><span class="s">'username'</span><span class="p">,</span> <span class="s">'api key'</span><span class="p">,</span> <span class="n">region</span><span class="o">=</span><span class="s">'iad'</span><span class="p">)</span>
</div><div class="line-6">
</div><div class="line-7"><span class="n">sizes</span> <span class="o">=</span> <span class="n">driver</span><span class="p">.</span><span class="n">list_sizes</span><span class="p">()</span>
</div><div class="line-8"><span class="n">images</span> <span class="o">=</span> <span class="n">driver</span><span class="p">.</span><span class="n">list_images</span><span class="p">()</span>
</div><div class="line-9">
</div><div class="line-10"><span class="n">size</span> <span class="o">=</span> <span class="p">[</span><span class="n">s</span> <span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="n">sizes</span> <span class="k">if</span> <span class="n">s</span><span class="p">.</span><span class="nb">id</span> <span class="o">==</span> <span class="s">'performance1-1'</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span>
</div><div class="line-11"><span class="n">image</span> <span class="o">=</span> <span class="p">[</span><span class="n">i</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">images</span> <span class="k">if</span> <span class="s">'Ubuntu 18.04'</span> <span class="ow">in</span> <span class="n">i</span><span class="p">.</span><span class="n">name</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span>
</div><div class="line-12">
</div><div class="line-13"><span class="n">node</span> <span class="o">=</span> <span class="n">driver</span><span class="p">.</span><span class="n">create_node</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">'libcloud'</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="n">size</span><span class="p">,</span> <span class="n">image</span><span class="o">=</span><span class="n">image</span><span class="p">)</span>
</div><div class="line-14"><span class="k">print</span><span class="p">(</span><span class="n">node</span><span class="p">)</span>
</div></code></pre></figure>
<p>For information on what the code does, click or hover over the line.</p>
<p>For more compute examples, see <a href="https://libcloud.readthedocs.org/en/stable/compute/examples.html">documentation</a>.</p>
</div>
<div class="col-md-6 example" data-example="dns-1">
<h3>DNS Example - Create a DNS record</h3>
<figure class="highlight"><pre><code class="language-python" data-lang="python"><div class="line-1"><span class="kn">from</span> <span class="nn">libcloud.dns.types</span> <span class="kn">import</span> <span class="n">Provider</span><span class="p">,</span> <span class="n">RecordType</span>
</div><div class="line-2"><span class="kn">from</span> <span class="nn">libcloud.dns.providers</span> <span class="kn">import</span> <span class="n">get_driver</span>
</div><div class="line-3">
</div><div class="line-4"><span class="n">cls</span> <span class="o">=</span> <span class="n">get_driver</span><span class="p">(</span><span class="n">Provider</span><span class="p">.</span><span class="n">ZERIGO</span><span class="p">)</span>
</div><div class="line-5"><span class="n">driver</span> <span class="o">=</span> <span class="n">cls</span><span class="p">(</span><span class="s">'email'</span><span class="p">,</span> <span class="s">'api key'</span><span class="p">)</span>
</div><div class="line-6">
</div><div class="line-7"><span class="n">zones</span> <span class="o">=</span> <span class="n">driver</span><span class="p">.</span><span class="n">list_zones</span><span class="p">()</span>
</div><div class="line-8"><span class="n">zone</span> <span class="o">=</span> <span class="p">[</span><span class="n">zone</span> <span class="k">for</span> <span class="n">zone</span> <span class="ow">in</span> <span class="n">zones</span> <span class="k">if</span> <span class="n">zone</span><span class="p">.</span><span class="n">domain</span> <span class="o">==</span> <span class="s">'mydomain.com'</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span>
</div><div class="line-9">
</div><div class="line-10"><span class="n">record</span> <span class="o">=</span> <span class="n">zone</span><span class="p">.</span><span class="n">create_record</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">'www'</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">RecordType</span><span class="p">.</span><span class="n">A</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="s">'127.0.0.1'</span><span class="p">)</span>
</div><div class="line-11"><span class="k">print</span><span class="p">(</span><span class="n">record</span><span class="p">)</span>
</div></code></pre></figure>
<p>For information on what the code does, click or hover over the line.</p>
<p>For more DNS examples, see <a href="https://libcloud.readthedocs.org/en/stable/dns/examples.html">documentation</a>.</p>
</div>
</div>
<div class="row section row-4">
<div class="col-md-4">
<h3>Latest Blog Posts</h3>
<p><a href="/blog/2023/08/10/libcloud-3-8-0-released.html">Libcloud 3.8.0 Released</a>
<p><a href="/blog/2023/01/08/libcloud-3-7-0-released.html">Libcloud 3.7.0 released</a>
<p><a href="/blog/2022/10/10/libcloud-3-6-1-released.html">Libcloud 3.6.1 released</a>
<p><a href="/blog/2022/05/26/libcloud-3-6-0-released.html">Libcloud 3.6.0 released</a>
<p>You can also subscribe and stay up to date using our
<a href="/blog/atom.xml">RSS / Atom feed.</a></p>
</div>
<div class="col-md-4">
<h3>Whois using Libcloud?</h3>
<div class="whos-using text-center">
<a href="http://www.saltstack.com/community/" alt="SaltStack" title="SaltStack - Central system and configuration manager" rel="tooltip" "target="_blank"><img src="/images/whois-using/saltstack.png" class="logo" /></a>
<a href="https://www.cloudcontrol.com" alt="CloudControl" title="cloudControl - Rock-solid European Platform as a Service" rel="tooltip" target="_blank"><img src="/images/whois-using/cloudcontrol.png" class="logo" /></a>
<a href="https://mist.io" alt="mist.io" title="mist.io - Cloud management in your pocket" rel="tooltip" target="_blank"><img src="/images/whois-using/mistio.png" class="logo" /></a>
</div>
<div class="whos-using text-center">
<a href="http://www.scalr.com" alt="Scalr" title="Scalr - Enterprise Cloud Management Platform" rel="tooltip" target="_blank"><img src="/images/whois-using/scalr.png" class="logo" /></a>
<a href="http://www.rackspace.com" alt="Rackspace" title="Rackspace - The Open Cloud Company" rel="tooltip" target="_blank"><img src="/images/whois-using/rackspace.png" class="logo" /></a>
<a href="http://www.divvycloud.com/" alt="DivvyCloud" title="DivvyCloud - Hybrid Cloud Management" rel="tooltip" target="_blank"><img src="/images/whois-using/divvycloud.png" class="logo" /></a>
</div>
<p>See <a href="/whois-using.html">more projects and companies</a> using Libcloud.</p>
</div>
<div class="col-md-4">
<h3>Get in Touch, Follow Us</h3>
<p>Users mailing list: <a href="mailto:users-subscribe@libcloud.apache.org">users@libcloud.apache.org</a></p>
<p>Developers mailing list: <a href="mailto:dev-subscribe@libcloud.apache.org">dev@libcloud.apache.org</a></p>
<p>IRC channel: <a href="https://web.libera.chat/?channel=#libcloud">#libcloud on Libera.Chat</a></p>
<div style="margin-top: 20px">
<a href="https://github.com/apache/libcloud" title="Libcloud on Github" rel="tooltip" target="_blank"><img src="/images/social-icons/github.jpg" alt="Libcloud on Github" class="social-icon" /></a>
<a href="https://www.openhub.net/p/libcloud/" title="Libcloud on Open Hub" rel="tooltip" target="_blank"><img src="/images/social-icons/openhub.png" alt="Libcloud on Open Hub" class="social-icon" /></a>
<a href="https://sourcegraph.com/github.com/apache/libcloud" title="Libcloud on SourceGraph" rel="tooltip" target="_blank"><img src="/images/social-icons/sourcegraph.png" alt="Libcloud on SourceGraph" class="social-icon" /></a>
</div>
</div>
</div>
<!--<div class="row section row-4">
<div class="col-md-12">
<h3>Events, Other</h3>
<div class="col-md-4">
<a href="http://events.linuxfoundation.org/events/apachecon-europe" target="_blank"><img src="/images/events/apachecon_europe_2014.png" class="img-inline"></a>
</div>
</div>
</div>-->
</div>
</div>
<hr />
<footer>
<div class="row">
<div class="col-lg-12 text-center">
<div class="footer-links">
<p><a href="http://www.apache.org/licenses/">License</a> | <a
href="/security.html">Security</a> | <a
href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a> |
<a href="http://www.apache.org/foundation/thanks.html">Thanks</a> |
<a href="https://www.apache.org/events/">Events</a> |
<a href="/credits.html">Credits</a> | <a href="/media.html">Media</a>
</div>
<div class="footer-text">
<p><a class="acevent" data-format="wide"></a></p>
<p class="">Copyright &copy; 2009-2023 <a href="https://www.apache.org/" target="_blank">The Apache Software Foundation</a></p>
<p class="">Apache Libcloud, Libcloud, Apache, the Apache feather, and the Apache Libcloud project logo are trademarks of the Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.</p>
<p class="">Site last updated on 2023-09-09 21:33:21 +0000</p>
</div>
</div>
</div>
</footer>
</div><!-- /.container -->
<!-- JavaScript -->
<script src='/assets/global-20157a00c0e17a775f45ed99ccdf79d7.js' type='text/javascript'></script>
<script src='/assets/index-0ab23b063fd476f72afe697a7f0bae9d.js' type='text/javascript'></script>
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before
"trackPageView" */
/* We explicitly disable cookie tracking to avoid privacy issues */
_paq.push(['disableCookies']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://analytics.apache.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '7']);
var d=document, g=d.createElement('script'),
s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<script src="https://www.apachecon.com/event-images/snippet.js"></script>
</body>
</html>