A single API to manage your entire infrastructure


07/02/2013 - Laurent Eschenauer (@eschnou)

Just imagine what becomes possible when any resources from your infrastructure can be observed and manipulated through software.

Today we are releasing the first version of the ComodIT Python library. Making it really easy to automate complex infrastructure scenarios with a few lines of code. This library is open-source, with a friendly MIT license, so that you can integrate it inside your own applications, processes and workflow engines.

In a nutshell, the API enables you to script the deployment and management of complex infrastructure, taking care of dependencies between applications configurations. You can then write code that reacts to events and take actions within the infrastructure. Use cases include deployment, auto-scaling, self-healing infrastructure, migration, cloud bursting, etc.

Curious? We are presenting you two concrete use cases below. To learn more, browse our examples orchestrations scripts (we'll be adding more) and create your ComodIT account if you don't have one yet.

To install the library and command line client, follow this tutorial.

Example: Deploy Wordpress on EC2 and update its configuration

The following lines of code are sufficient to define a new host, deploy it on Amazon EC2, and then install Wordpress with some custom configuration settings.

from comodit_client.api import Client

# Connect to ComodIT
client = Client('https://my.comodit.com/api', 'demo', '******')

# Create host
env = client.get_organization('Demo').get_environment('Default')
host = env.hosts().create('my-new-host', '', 'Demo Platform', 'Demo Distribution')

# Deploy the host
host.provision()
host.wait_for_state('READY')

# Install an application
host.install('Wordpress', {'wp_admin_password': '*******', 'wp_admin_email': 'nobody@example.com'})
host.wait_for_pending_changes()

# Update the blog title
host.get_application('Wordpress').settings().create('wp_blog_title','The Infrastructure 2.0 Blog')

# Retrieve instance's hostname
hostname = host.get_instance().get_property('publicDnsName')
print "Wordpress available at http://" + hostname + "/"

A complex cloud bursting example

The following screencast shows a cloud bursting scenario where a web cluster is first deployed on a private Eucalyptus Cloud. Then it is scaled locally and finally it is being scaled out on the public cloud of Amazon. All this is done through some simple scripts available in our demo repository.


blog comments powered by Disqus