cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seb...@apache.org
Subject [2/2] git commit: updated refs/heads/ACS101 to 7ddf787
Date Sun, 23 Jun 2013 15:09:54 GMT
more cleanup of docs


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7ddf787f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7ddf787f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7ddf787f

Branch: refs/heads/ACS101
Commit: 7ddf787f695ab303e2fb50d9d2fa8ba432dcfefc
Parents: c30152c
Author: Sebastien Goasguen <runseb@gmail.com>
Authored: Sat Jun 22 15:45:49 2013 -0400
Committer: Sebastien Goasguen <runseb@gmail.com>
Committed: Sat Jun 22 15:45:49 2013 -0400

----------------------------------------------------------------------
 docs/acs101/en-US/Clientsandshells.xml |   4 +-
 docs/acs101/en-US/clostack.xml         |  36 +++++-----
 docs/acs101/en-US/cloudstackapi.xml    |  33 ++++++---
 docs/acs101/en-US/jcloudscli.xml       |   7 ++
 docs/acs101/en-US/libcloud.xml         | 105 +++++++++++++++++++++++++---
 5 files changed, 147 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ddf787f/docs/acs101/en-US/Clientsandshells.xml
----------------------------------------------------------------------
diff --git a/docs/acs101/en-US/Clientsandshells.xml b/docs/acs101/en-US/Clientsandshells.xml
index b4d3dd3..0372fda 100644
--- a/docs/acs101/en-US/Clientsandshells.xml
+++ b/docs/acs101/en-US/Clientsandshells.xml
@@ -26,15 +26,15 @@
 <chapter id="Clientsandshells">
   <title>Clients and Shells</title>
   <para>
-    This is a test paragraph
+    Clients and Shells are critical to the ease of use of any API, even more so Cloud APIs.
In this chapter we present the basis of the &PRODUCT; API. We illustrate how to sign requests
for the sake of completeness and because it is a very nice exercise for beginners. We then
introduce CloudMonkey the &PRODUCT; CLI and shell which boasts a 100% coverage of the
API. While jclouds is a java library, it can also be used as a cli or interactive shell, we
present jclouds-cli to contrast it to CloudMonkey and introduce jclouds. Apache libcloud is
a Python based API wrapper, once installed, a developer can use libcloud to talk to multiple
cloud providers and cloud APIs, it serves a similar role as jclouds but in Python. Clostack
is a clojure client. Clojure is receiving lots of attention recently for its clean functional
programming style, clojure is the basis of Pallet which we will talk about in the next chapter.
Clostack serves as a teaser for Clojure. Finally we cover Boto, the well-kn
 own Python Amazon Web Service interface, and show how it can be used with a &PRODUCT;
cloud.
   </para>
 
     <xi:include href="cloudstackapi.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
     <xi:include href="cloudmonkey.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
     <xi:include href="jcloudscli.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
     <xi:include href="libcloud.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-    <xi:include href="clostack.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
     <xi:include href="boto.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+    <xi:include href="clostack.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
 
 </chapter>
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ddf787f/docs/acs101/en-US/clostack.xml
----------------------------------------------------------------------
diff --git a/docs/acs101/en-US/clostack.xml b/docs/acs101/en-US/clostack.xml
index c5ea05d..a1c19fd 100644
--- a/docs/acs101/en-US/clostack.xml
+++ b/docs/acs101/en-US/clostack.xml
@@ -24,9 +24,16 @@
 
 <section id="clostack">
     <title>Clostack, a Clojure client</title>
-    <para>There are many tools available to interface with the &PRODUCT; API. Apache
Libcloud is one of those. In this section
-          we provide a basic.</para>
+    <para>There are many tools available to interface with the &PRODUCT; API. </para>
 
+
+    <section id="clojure-intro">
+    <title>Clojure</title>
+        <para>A quick intro to clojure</para>
+    </section>
+
+    <section id="clostack-install">
+    <title>Installation and configuration</title>
     <para>To install Libcloud refer to the libcloud website. If you are familiar with
Pypi simply do:</para>
     <programlisting>pip install apache-libcloud</programlisting>
 
@@ -36,8 +43,11 @@
 pip install apache-libcloud
 Downloading/unpacking apache-libcloud
     </programlisting>
-    
-    <para>You can then open a Python interactive shell, create an instance of a &PRODUCT;
driver and call the available methods via the libcloud API.</para>
+    </section>   
+
+    <section id="clostask-usage">
+    <title>Using clostack</title>
+    <para>With lein install you can start a REPL within the clostack project</para>
 
     <programlisting>
  <![CDATA[
@@ -84,20 +94,6 @@ list-tags                           list-template-permissions         
 list-tem
 list-volumes                        list-vp-cs                          list-vpc-offerings
                 list-vpn-connections                
 list-vpn-customer-gateways          list-vpn-gateways                   list-vpn-users  
                   list-zones                          
 list?                               
-user=> (list
-list                                list*                               list-accounts   
                   list-async-jobs                     
-list-capabilities                   list-disk-offerings                 list-event-types
                   list-events                         
-list-firewall-rules                 list-hypervisors                    list-instance-groups
               list-ip-forwarding-rules            
-list-iso-permissions                list-isos                           list-lb-stickiness-policies
        list-load-balancer-rule-instances   
-list-load-balancer-rules            list-network-ac-ls                  list-network-offerings
             list-networks                       
-list-os-categories                  list-os-types                       list-port-forwarding-rules
         list-private-gateways               
-list-project-accounts               list-project-invitations            list-projects   
                   list-public-ip-addresses            
-list-remote-access-vpns             list-resource-limits                list-security-groups
               list-service-offerings              
-list-snapshot-policies              list-snapshots                      list-ssh-key-pairs
                 list-static-routes                  
-list-tags                           list-template-permissions           list-templates  
                   list-virtual-machines               
-list-volumes                        list-vp-cs                          list-vpc-offerings
                 list-vpn-connections                
-list-vpn-customer-gateways          list-vpn-gateways                   list-vpn-users  
                   list-zones                          
-list?                               
 user=> (def cs (http-client))
 #'user/cs
 user=> cs
@@ -110,11 +106,15 @@ user=> (def cs (http-client :api-secret "Hv97W5UKHG-268UN_UKIzPgw7B0zgnJKdReeUmt
 user=> (list-templates cs :templatefilter "featured")
 ]]>
     </programlisting>
+    </section>
 
+    <section id="clostack-future">
+    <title>Trend</title>
     <para>Clojure seems to be getting a lot of attention these days, mostly for its
functional programming aspect.
           It offers a very clean syntax with the strength of java and the rapid prototyping
characteristics of scripting languages.
           Frameworks like Pallet are making use of clojure to build advanced cloud services.
In the next chapter we will have a quick look at pallet-exoscale
           which lets you create <emphasis>crates</emphasis> in the cloud, defining
node dependencies and software packages that need to be configured.
     </para>
+    </section>
 
  </section>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ddf787f/docs/acs101/en-US/cloudstackapi.xml
----------------------------------------------------------------------
diff --git a/docs/acs101/en-US/cloudstackapi.xml b/docs/acs101/en-US/cloudstackapi.xml
index 6d6155c..3707ed7 100644
--- a/docs/acs101/en-US/cloudstackapi.xml
+++ b/docs/acs101/en-US/cloudstackapi.xml
@@ -23,14 +23,22 @@
 -->
 
 <section id="cloudstackapi">
+	<title>The &PRODUCT; API</title>
+	<para>All functionalities of the &PRODUCT; data center orchestrator are exposed
via an API server. Github currently has over fifteen clients for this API, in various languages.
In this section we introduce this API and the signing mechanism. The follow on sections will
introduce clients that already contain a signing method. The signing process is only highlighted
for completeness.</para>
+
+    <section id="intro-api">
+    <title>Basics of the API</title>
+    <para>The API is <emphasis>http</emphasis> based, meaning that calls
to the API server are made using the http protocol, the reponses are either in XML or JSON
format. The request is made out of a set of key value pairs that correspond to input parameters
of each call. The key/value pairs are passed within a url string. All calls used the http
GET method. As such, the &PRODUCT; API is not a RESTfull API and more a Query API or RESTlike.</para>
+    <para>In isolated testing, one may wish to use the so-called integration port (e.g
8096 by default), this port makes the API directly accessible without signing requests. In
production mode, the integration port should never be used and certainly not open to the public
internet.</para>
+	</section>
+
+	<section id="signing-request">
     <title>How to sign an API call with Python</title>
-    <para>To illustrate the procedure used to sign API calls we present a step by step
interactive session
-          using Python.</para>
+    <para>To illustrate the procedure used to sign API calls we present a step by step
interactive session using Python.</para>
     
     <para>First import the required modules:</para>
     <programlisting>
-
- <![CDATA[
+<![CDATA[
 $python
 Python 2.7.3 (default, Nov 17 2012, 19:54:34) 
 [GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
@@ -43,7 +51,7 @@ Type "help", "copyright", "credits" or "license" for more information.
  ]]>
     </programlisting>
    
-    <para>Define the endpoint of the Cloud, the command that you want to execute and
the keys of the user.</para>
+    <para>Define the endpoint of the Cloud, the command that you want to execute, the
response type and the keys of the user.</para>
     <programlisting>
  <![CDATA[
 
@@ -55,7 +63,7 @@ Type "help", "copyright", "credits" or "license" for more information.
 >>> secretkey='VDaACYb0LV9eNjTetIOElcVQkvJck_J_QljX_FcHRj87ZKiy0z0ty0ZsYBkoXkY9b7eq1EhwJaw7FF3akA3KBQ'
   ]]>
     </programlisting>
-    <para>Build the request string:</para>
+    <para>Build the request string. The key/value pairs are join with the equal sign
and all the pairs are joined with ampersand. </para>
     <programlisting>
  <![CDATA[
 >>> request_str='&'.join(['='.join([k,urllib.quote_plus(request[k])]) for k
in request.keys()])
@@ -64,7 +72,7 @@ Type "help", "copyright", "credits" or "license" for more information.
   ]]>
     </programlisting>
 
-    <para>Compute the signature with hmac, do a 64 bit encoding and a url encoding:
</para>
+    <para>Create the signature request similarly to the request string, but lower case
everything, sort the keys and replace the plus sign with %20. Compute the hmac of the resulting
string using the secret key and the sha1 algorithm, do a 64 bit encoding, strip the return
carriage, and do a url encoding: </para>
     <programlisting>
   <![CDATA[
 >>> sig_str='&'.join(['='.join([k.lower(),urllib.quote_plus(request[k].lower().replace('+','%20'))])for
k in sorted(request.iterkeys())]) 
@@ -93,9 +101,16 @@ Type "help", "copyright", "credits" or "license" for more information.
 >>> req
 'http://localhost:8080/client/api?apikey=plgWJfZK4gyS3mOMTVmjUVg-X-jlWlnfaUJ9GAbBbf9EdM-kAYMmAiLqzzq1ElZLYq_u38zCm0bewzGUdP66mg&command=listUsers&response=json&signature=TTpdDq%2F7j%2FJ58XCRHomKoQXEQds%3D'
 >>> res=urllib2.urlopen(req)
+]]>
+    </programlisting>
+    <para>In this particular example, the response is in json format. The first key
is <emphasis>listusersresponse</emphasis> which contains <emphasis>count</emphasis>
and a list of the users in <emphasis>user</emphasis></para>
+    <programlisting>
+<![CDATA[
 >>> res.read()
 '{ "listusersresponse" : { "count":3 ,"user" : [  {"id":"7ed6d5da-93b2-4545-a502-23d20b48ef2a","username":"admin","firstname":"admin","lastname":"cloud","created":"2012-07-05T12:18:27-0700","state":"enabled","account":"admin","accounttype":1,"domainid":"8a111e58-e155-4482-93ce-84efff3c7c77","domain":"ROOT","apikey":"plgWJfZK4gyS3mOMTVmjUVg-X-jlWlnfaUJ9GAbBbf9EdM-kAYMmAiLqzzq1ElZLYq_u38zCm0bewzGUdP66mg","secretkey":"VDaACYb0LV9eNjTetIOElcVQkvJck_J_QljX_FcHRj87ZKiy0z0ty0ZsYBkoXkY9b7eq1EhwJaw7FF3akA3KBQ","accountid":"7548ac03-af1d-4c1c-9064-2f3e2c0eda0d"},
{"id":"1fea6418-5576-4989-a21e-4790787bbee3","username":"runseb","firstname":"foobar","lastname":"goa","email":"joe@smith.com","created":"2013-04-10T16:52:06-0700","state":"enabled","account":"admin","accounttype":1,"domainid":"8a111e58-e155-4482-93ce-84efff3c7c77","domain":"ROOT","apikey":"Xhsb3MewjJQaXXMszRcLvQI9_NPy_UcbDj1QXikkVbDC9MDSPwWdtZ1bUY1H7JBEYTtDDLY3yuchCeW778GkBA","secretkey":"gIsgmi8C5YwxMHjX5o51pSe0kqs6JnKriw0jJBLceY5b
 gnfzKjL4aM6ctJX-i1ddQIHJLbLJDK9MRzsKk6xZ_w","accountid":"7548ac03-af1d-4c1c-9064-2f3e2c0eda0d"},
{"id":"52f65396-183c-4473-883f-a37e7bb93967","username":"toto","firstname":"john","lastname":"smith","email":"john@smith.com","created":"2013-04-23T04:27:22-0700","state":"enabled","account":"admin","accounttype":1,"domainid":"8a111e58-e155-4482-93ce-84efff3c7c77","domain":"ROOT","apikey":"THaA6fFWS_OmvU8od201omxFC8yKNL_Hc5ZCS77LFCJsRzSx48JyZucbUul6XYbEg-ZyXMl_wuEpECzK-wKnow","secretkey":"O5ywpqJorAsEBKR_5jEvrtGHfWL1Y_j1E4Z_iCr8OKCYcsPIOdVcfzjJQ8YqK0a5EzSpoRrjOFiLsG0hQrYnDA","accountid":"7548ac03-af1d-4c1c-9064-2f3e2c0eda0d"}
] } }'
   ]]>
     </programlisting>
-    
- </section>
+    <para>To epxlore further the &PRODUCT; API, use CloudMonkey and/or read the
API <ulink url="http://cloudstack.apache.org/apidocumentation">documentation</ulink>,
which contains the entire parameters list for each API call.</para>
+    </section>
+
+</section>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ddf787f/docs/acs101/en-US/jcloudscli.xml
----------------------------------------------------------------------
diff --git a/docs/acs101/en-US/jcloudscli.xml b/docs/acs101/en-US/jcloudscli.xml
index 3d2d704..5bda6d5 100644
--- a/docs/acs101/en-US/jcloudscli.xml
+++ b/docs/acs101/en-US/jcloudscli.xml
@@ -30,6 +30,8 @@
         <para>jclouds is under going incubation at the Apache Software Foundation,
jclouds-cli is available on github. Changes may occur in the sofware from the time of this
writing to the time of you reading it.</para>
     </warning>
 
+    <section id="installation">
+    <title>Installation and Configuration</title>
     <para>
         First install jclouds-cli via github and build it with maven:
     </para>
@@ -104,6 +106,10 @@ State         Version          Name                                 
  Repositor
     <note>
         <para>I edited the output of jclouds-cli to gain some space, there a lot more
providers available</para>
     </note>
+    </section>
+
+    <section id="jclouds-cli-usage">
+    <title>Using jclouds CLI</title>
     <para>The &PRODUCT; API driver is not installed by default. Install it with:</para>
 
     <programlisting>
@@ -202,5 +208,6 @@ $ jclouds node info 4e733609-4c4a-4de1-9063-6fe5800ccb10
     </programlisting>
 
     <para>With this short intro, you are well on your way to using jclouds-cli. Check
out the interactive shell, the blobstore and chef facility and commit back to this section.</para>
+    </section>
 
 </section>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ddf787f/docs/acs101/en-US/libcloud.xml
----------------------------------------------------------------------
diff --git a/docs/acs101/en-US/libcloud.xml b/docs/acs101/en-US/libcloud.xml
index e7bc353..3cf2652 100644
--- a/docs/acs101/en-US/libcloud.xml
+++ b/docs/acs101/en-US/libcloud.xml
@@ -26,41 +26,82 @@
     <title>Apache Libcloud</title>
     <para>There are many tools available to interface with the &PRODUCT; API. Apache
Libcloud is one of those. In this section
           we provide a basic example of how to use Libcloud with &PRODUCT;. It assumes
that you have access to a &PRODUCT; endpoint and that you have the API access key and
secret key of a user.</para>
-    <para>To install Libcloud refer to the libcloud website. If you are familiar with
Pypi simply do:</para>
+
+    <section id="libcloud-installation">
+    <title>Installation</title>
+    <para>To install Libcloud refer to the libcloud <ulink url="http://libcloud.apache.org">website</ulink>.
If you are familiar with Pypi simply do:</para>
     <programlisting>pip install apache-libcloud</programlisting>
     <para>You should see the following output:</para>
     <programlisting>
 pip install apache-libcloud
 Downloading/unpacking apache-libcloud
-  Downloading apache-libcloud-0.12.4.tar.bz2 (376kB): 376kB downloaded
-  Running setup.py egg_info for package apache-libcloud
+Downloading apache-libcloud-0.12.4.tar.bz2 (376kB): 376kB downloaded
+Running setup.py egg_info for package apache-libcloud
     
 Installing collected packages: apache-libcloud
-  Running setup.py install for apache-libcloud
+Running setup.py install for apache-libcloud
     
 Successfully installed apache-libcloud
 Cleaning up...
     </programlisting>
-    
-    <para>You can then open a Python interactive shell, create an instance of a &PRODUCT;
driver and call the available methods via the libcloud API.</para>
+    <para>
+        Developers will want to clone the repository, for example from the github mirror:
+    </para>
+    <programlisting>
+git clone https://github.com/apache/libcloud.git
+    </programlisting>
+    <para>
+         To install libcloud from the cloned repo, simply do the following from within the
clone repository directory:
+    </para>
+    <programlisting>
+sudo python ./setup.py install
+    </programlisting>
+    <note>
+        <para>
+            The &PRODUCT; driver is located in <emphasis>/path/to/libcloud/source/libcloud/compute/drivers/cloudstack.py</emphasis>.
file bugs on the libcloud JIRA and submit your patches as an attached file to the JIRA entry.
+        </para>
+    </note>
+    </section>    
+
+    <section id="libcloud-usage">
+    <title>Using Libcloud</title>
+    <para>With libcloud installed either via PyPi or via the source, you can now open
a Python interactive shell, create an instance of a &PRODUCT; driver and call the available
methods via the libcloud API.</para>
+    <para>First you need to import the libcloud modules and create a &PRODUCT;
driver.</para>
 
     <programlisting>
- <![CDATA[
+<![CDATA[
 >>> from libcloud.compute.types import Provider
 >>> from libcloud.compute.providers import get_driver
 >>> Driver = get_driver(Provider.CLOUDSTACK)
+]]>
+    </programlisting>
+
+    <para>Then, using your keys and endpoint, create a connection object. Note that
this is a localtest and thus not secured.  If you use a production public cloud, make sure
to use SSL properly.</para>
+    <programlisting>   
+<![CDATA[
 >>> apikey='plgWJfZK4gyS3mOMTVmjUVg-X-jlWlnfaUJ9GAbBbf9EdM-kAYMmAiLqzzq1ElZLYq_u38zCm0bewzGUdP66mg'
 >>> secretkey='VDaACYb0LV9eNjTetIOElcVQkvJck_J_QljX_FcHRj87ZKiy0z0ty0ZsYBkoXkY9b7eq1EhwJaw7FF3akA3KBQ'
 >>> host='http://localhost:8080'
 >>> path='/client/api'
->>> conn=Driver(apikey,secretkey,secure='False',host='localhost:8080',path=path)
 >>> conn=Driver(key=apikey,secret=secretkey,secure=False,host='localhost',port='8080',path=path)
+]]>
+    </programlisting>
+
+    <para>With the connection image in hand, you now use the libcloud base api to list
such things as the templates (i.e images), the service offerings (i.e sizes) and the zones
(i.e locations)</para>
+    <programlisting>
+<![CDATA[
 >>> conn.list_images()
 [<NodeImage: id=13ccff62-132b-4caf-b456-e8ef20cbff0e, name=tiny Linux, driver=CloudStack
 ...>]
 >>> conn.list_sizes()
 [<NodeSize: id=ef2537ad-c70f-11e1-821b-0800277e749c, name=tinyOffering, ram=100 disk=0
bandwidth=0 price=0 driver=CloudStack ...>, <NodeSize: id=c66c2557-12a7-4b32-94f4-48837da3fa84,
name=Small Instance, ram=512 disk=0 bandwidth=0 price=0 driver=CloudStack ...>, <NodeSize:
id=3d8b82e5-d8e7-48d5-a554-cf853111bc50, name=Medium Instance, ram=1024 disk=0 bandwidth=0
price=0 driver=CloudStack ...>]
 >>> images=conn.list_images()
 >>> offerings=conn.list_sizes()
+]]>
+    </programlisting>
+
+    <para>The create_node method will take an instance name, a template and an instance
type as arguments. It will return an instance of a <emphasis>CloudStackNode</emphasis>
that has additional extensions methods, such as ex_stop and ex_start.</para>
+    <programlisting>
+<![CDATA[
 >>> node=conn.create_node(name='toto',image=images[0],size=offerings[0])
 >>> help(node)
 >>> node.get_uuid()
@@ -69,7 +110,10 @@ Cleaning up...
 u'toto'
 ]]>
     </programlisting>
+    </section>
 
+    <section id="libcloud-basic-zone">
+    <title>Keypairs and Security Groups</title>
     <para>
         I recently added support for keypair management in libcloud. For instace, given a
conn object obtained from the previous interactive session:
     </para>
@@ -90,8 +134,51 @@ conn.ex_create_security_group(name='libcloud')
 conn.ex_authorize_security_group_ingress(securitygroupname='llibcloud',protocol='TCP',startport=22,cidrlist='0.0.0.0/0')
 conn.ex_delete_security_group('llibcloud')
     </programlisting>   
+    </section>
+    
+    <section id="libcloud-multi">
+    <title>Multiple Clouds</title>
+    <para>One of the interesting use cases of Libcloud is that you can use multiple
Cloud Providers, such as AWS, Rackspace, OpenNebula, vCloud and so on. You can then create
Driver instances to each of these clouds and create your own multi cloud application. In the
example below we instantiate to libcloud &PRODUCT; driver, one on <ulink url="http://exoscale.ch">Exoscale</ulink>
and the other on one <ulink url="http://ikoula.com">Ikoula</ulink>.</para>
+    <programlisting>
+ <![CDATA[
+import libcloud.security as sec
+
+Driver = get_driver(Provider.CLOUDSTACK)
 
+apikey=os.getenv('EXOSCALE_API_KEY')
+secretkey=os.getenv('EXOSCALE_SECRET_KEY')
+endpoint=os.getenv('EXOSCALE_ENDPOINT')
+host=urlparse.urlparse(endpoint).netloc
+path=urlparse.urlparse(endpoint).path
 
-    <para>One of the interesting use cases of Libcloud is that you can use multiple
Cloud Providers, such as AWS, Rackspace, OpenNebula, vCloud and so on. You can then create
Driver instances to each of these clouds and create your own multi cloud application.</para>
+exoconn=Driver(key=apikey,secret=secretkey,secure=True,host=host,path=path)
+
+Driver = get_driver(Provider.CLOUDSTACK)
+
+apikey=os.getenv('IKOULA_API_KEY')
+secretkey=os.getenv('IKOULA_SECRET_KEY')
+endpoint=os.getenv('IKOULA_ENDPOINT')
+host=urlparse.urlparse(endpoint).netloc
+print host
+path=urlparse.urlparse(endpoint).path
+print path
+
+sec.VERIFY_SSL_CERT = False
+
+ikoulaconn=Driver(key=apikey,secret=secretkey,secure=True,host=host,path=path)
+
+drivers = [exoconn, ikoulaconn]
+
+		for driver in drivers:
+		    print driver.list_locations()
+]]>
+    </programlisting>
+    <note>
+        <para>
+            In the example above, I set my access and secret keys as well as the endpoints
as environment variable. Also note the libcloud security module and the VERIFY_SSL_CERT. In
the case of iKoula the SSL certificate used was not verifiable by the CERTS that libcloud
checks. Especially if you use a self-signed SSL certificate for testing, you might have to
disable this check as well.
+        </para>
+    </note>
+    <para>From this basic setup you can imagine how you would write an application
that would manage instances in different Cloud Providers. Providing more resiliency to your
overall infrastructure.</para>
+    </section>
 
  </section>


Mime
View raw message