Author: tomaz
Date: Sun Oct 30 21:06:43 2011
New Revision: 1195245

URL: http://svn.apache.org/viewvc?rev=1195245&view=rev
Log:
Add some initial documentation.

Added:
    libcloud/site/trunk/content/docs/
    libcloud/site/trunk/content/docs/compute-base-api.mdtext
    libcloud/site/trunk/content/docs/compute-deployment.mdtext
    libcloud/site/trunk/content/docs/compute-overview.mdtext
    libcloud/site/trunk/content/docs/index.mdtext

Added: libcloud/site/trunk/content/docs/compute-base-api.mdtext
URL: 
http://svn.apache.org/viewvc/libcloud/site/trunk/content/docs/compute-base-api.mdtext?rev=1195245&view=auto
==============================================================================
--- libcloud/site/trunk/content/docs/compute-base-api.mdtext (added)
+++ libcloud/site/trunk/content/docs/compute-base-api.mdtext Sun Oct 30 
21:06:43 2011
@@ -0,0 +1,69 @@
+title: Compute -> Base API
+
+## Base API ##
+
+* [list_nodes](#list_nodes)
+* [list_images](#list_images)
+* [list_sizes](#list_sizes)
+* [list_locations](#list_locations)
+* [create_node](#create_node)
+* [deploy_node](#deploy_node)
+* [reboot_node](#reboot_node)
+* [destroy_node](#destroy_node)
+
+<h3 id="list_nodes">list_nodes</h3>
+
+**Method signature**:
+[driver.list_nodes()](http://localhost:8000/apidocs/current/libcloud.compute.base.NodeDriver.html#list_nodes)
  
+**Description**: Return a list of all the nodes belonging to your account.  
+
+<h3 id="list_images">list_images</h3>
+
+**Method signature**:
+[driver.list_images()](http://localhost:8000/apidocs/current/libcloud.compute.base.NodeDriver.html#list_images)
  
+**Description**: Return a list of all the available images.
+
+<h3 id="list_sizes">list_sizes</h3>
+
+**Method signature**:
+[driver.list_sizes()](http://localhost:8000/apidocs/current/libcloud.compute.base.NodeDriver.html#list_sizes)
  
+**Description**: Return a list of all the available sizes.
+
+<h3 id="list_locations">list_locations</h3>
+
+**Method signature**:
+[driver.list_locations()](http://localhost:8000/apidocs/current/libcloud.compute.base.NodeDriver.html#list_locations)
  
+**Description**: Return a list of all the available locations.
+
+<h3 id="create_node">create_node</h3>
+
+**Method signature**:
+[driver.create_node(name, size, 
image)](http://localhost:8000/apidocs/current/libcloud.compute.base.NodeDriver.html#create_node)
  
+**Description**: Create a new node instance.
+
+Keep in mind that a lot drivers also take additional optional keyword arguments
+which are documented in the each driver API docs page.
+
+<h3 id="deploy_node">deploy_node</h3>
+
+**Method signature**: [driver.deploy_node(name, size, image,
+deploy)](http://localhost:8000/apidocs/current/libcloud.compute.base.NodeDriver.html#deploy_node)
  
+**Description**: Create a new node instance and run a deployment script on it.
+More about deployment functionality can be found on the [Deployment
+page](/docs/compute-deployment.html).
+
+<h3 id="reboot_node">reboot_node</h3>
+
+**Method signature**:
+[driver.reboot_node(node)](http://localhost:8000/apidocs/current/libcloud.compute.base.NodeDriver.html#reboot_node),
 
+[node.reboot()](http://localhost:8000/apidocs/current/libcloud.compute.base.Node.html#reboot)
  
+**Description**: Restart a node.
+
+<h3 id="destroy_node">destroy_node</h3>
+
+**Method signature**:
+[driver.destroy_node(node)](http://localhost:8000/apidocs/current/libcloud.compute.base.NodeDriver.html#destroy_node),
+[node.destroy()](http://localhost:8000/apidocs/current/libcloud.compute.base.Node.html#destroy)
  
+**Description**: Destroy a running or stopped node. This operation will in 
most cases also
+destroy all the data (disk, snapshots, etc.) associated with this node so
+be careful when you use it.

Added: libcloud/site/trunk/content/docs/compute-deployment.mdtext
URL: 
http://svn.apache.org/viewvc/libcloud/site/trunk/content/docs/compute-deployment.mdtext?rev=1195245&view=auto
==============================================================================
--- libcloud/site/trunk/content/docs/compute-deployment.mdtext (added)
+++ libcloud/site/trunk/content/docs/compute-deployment.mdtext Sun Oct 30 
21:06:43 2011
@@ -0,0 +1,47 @@
+title: Compute -> Deployment
+
+## Deployment ##
+
+Deployment functionality allows you to create a node and after it has been
+started install an SSH key and / or run arbitrary shell commands on it. It
+works by first calling `create_node` and then after the node has been
+fully started SSHing into the node and running a shell script on it.
+
+We assume that a node has been fully started when a returned state is
+`NodeState.RUNNING` and when it has a public IP address assigned.
+
+Keep in mind that Libcloud is not a replacement for a configuration management
+tool so it shouldn't be used as such.
+
+*Note: Deployment functionality depends on the `paramiko` library which can be 
installed using pip - `pip install paramiko`.*
+
+### Example 1 - Deploying a Node and installing your SSH key and Puppet on it 
###
+
+    ::python
+    from libcloud.compute.types import Provider
+    from libcloud.compute.providers import get_driver
+    from libcloud.compute.deployment import MultiStepDeployment, 
ScriptDeployment, SSHKeyDeployment
+    import os
+
+    RACKSPACE_USER = 'your username'
+    RACKSPACE_KEY = 'your key'
+
+    Driver = get_driver(Provider.RACKSPACE)
+    conn = Driver(RACKSPACE_USER, RACKSPACE_KEY)
+
+    # read your public key in
+    # Note: This key will be added to the authorized keys for the root user
+    # (/root/.ssh/authorized_keys)
+    sd = SSHKeyDeployment(open(os.path.expanduser("~/.ssh/id_rsa.pub")).read())
+    # a simple script to install puppet post boot, can be much more 
complicated.
+    script = ScriptDeployment("apt-get -y install puppet")
+    # a task that first installs the ssh key, and then runs the script
+    msd = MultiStepDeployment([sd, script])
+
+    images = conn.list_images()
+    sizes = conn.list_sizes()
+
+    # deploy_node takes the same base keyword arguments as create_node.
+    node = conn.deploy_node(name='test', image=images[0], size=sizes[0], 
deploy=msd)
+    # <Node: uuid=..., name=test, state=3, public_ip=['1.1.1.1'], 
provider=Rackspace ...>
+    # the node is now booted, with your ssh key and puppet installed.

Added: libcloud/site/trunk/content/docs/compute-overview.mdtext
URL: 
http://svn.apache.org/viewvc/libcloud/site/trunk/content/docs/compute-overview.mdtext?rev=1195245&view=auto
==============================================================================
--- libcloud/site/trunk/content/docs/compute-overview.mdtext (added)
+++ libcloud/site/trunk/content/docs/compute-overview.mdtext Sun Oct 30 
21:06:43 2011
@@ -0,0 +1,24 @@
+title: Compute -> Overview
+
+## Overview ##
+
+Compute component is the oldest one and allows you to manage cloud and virtual
+servers offered by different providers such as Amazon, Rackspace, Linode and
+more than <a href="/supported_providers.html">20 others</a>.
+
+Besides managing the servers this component also allows you to run deployment
+scripts on the newly created servers. Deployment or so called "bootstrap"
+scripts allow you to execute arbitrary shell command. This functionality is 
usually
+used to prepare your freshly created server and install your SSH key and some
+kind of configuration management tool (Puppet / Chef / cfengine) on it.
+
+### Terminology ###
+
+* **Node** - represents a cloud or virtual server.
+* **NodeSize** - represents node hardware configuration. Usually this is amount
+of the available RAM, bandwidth, CPU speed and disk size. Most of the drivers
+also expose hourly price (in dollars) for the Node of this size.
+* **NodeImage** - represents an operating system image.
+* **NodeLocation** - represents a server physical location.
+* **NodeState** - represents a node state. Standard states are: running,
+rebooting, terminated, pending and unknown.

Added: libcloud/site/trunk/content/docs/index.mdtext
URL: 
http://svn.apache.org/viewvc/libcloud/site/trunk/content/docs/index.mdtext?rev=1195245&view=auto
==============================================================================
--- libcloud/site/trunk/content/docs/index.mdtext (added)
+++ libcloud/site/trunk/content/docs/index.mdtext Sun Oct 30 21:06:43 2011
@@ -0,0 +1,11 @@
+title: Home
+
+## Welcome ##
+
+Welcome to the Apache Libcloud documentation.
+
+Documentation is logically organized and grouped by components. To begin
+browsing the documentation, click on the component in the menu on the left.
+
+If you have questions, suggestions or corrections, feel free to
+[contact us](/devinfo.html).


Reply via email to