We use proprietary and third party's cookies to improve your experience and our services, identifying your Internet Browsing preferences on our website; develop analytic activities and display advertising based on your preferences. If you keep browsing, you accept its use. You can get more information on our Cookie Policy
Cookies Policy
PaaS Management - User and Programmers Guide - FIWARE Forge Wiki

PaaS Management - User and Programmers Guide

From FIWARE Forge Wiki

Jump to: navigation, search

Contents

Introduction

Welcome the User and Programmer Guide for the PaaS Manager GE. This generic enabler is built on a proprietary solution using standard interface to communicate with and so where possible this guide points to the appropriate online content that has been created for this specific API. The online documents are being continuously updated and improved, and so will be the most appropriate place to get the most up to date information on using this interface.

Background and Detail

This User and Programmers Guide relates to the Scalability Manager GE which is part of the Cloud Hosting Chapter. Please find more information about this Generic Enabler in the following Open Specification.

User Guide

This GE does not provide a GUI, it is for the use of developers who will invoke it programmatically. .

Programmer Guide

The PaaS API reference offers a [1] page, which describes how to use this API in detail. It includes a set of commands, which can be used to manipulate instance in the Cloud.

PaaS Manager API is based upon HTTP and therefore all devices, which can handle HTTP traffic, are possible clients. This also means that most programming languages can be used to access PaaS Manager through PaaS Manager API.

To give a feeling of how PaaS Manager work lets take a look at an HTTP request and the corresponding response:

* About to connect() to 130.206.80.112 port 8080 (#0)
*   Trying 130.206.80.112... connected
* Connected to 130.206.80.112 (130.206.80.112) port 8080 (#0)
> GET /paasmanager/rest/catalog/environment HTTP/1.1
> User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8r zlib/1.2.3
> Host: 130.206.80.112:8080
> Accept: */*
> Access-Control-Request-Method: GET
> X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
>
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Content-Type: application/xml
< Content-Length: 1659
< Date: Tue, 04 Dec 2012 08:21:08 GMT
<?xml version="1.0" encoding="UTF-8
 Connection #0 to host 130.206.80.112 left intact
* Closing connection #0

In this case the HTTP GET operation is used. PaaS Manager API uses the Create Retrieve Update Delete (CRUD) operations, which map almost to the HTTP verbs POST, GET, PUT and DELETE.

PaaS Manager API deals with two media types, application/xml and application/json, both Content-Type and Accept, which means that we can send a xml content and receive and json response and vice versa. For simplicy, only XML examples are going to be provided in this page.

Accessing Service Manager from the CLI

The access through the CLI is made using the curl program. Curl [2] is a client to get documents/files from or send documents to a server, using any of the supported protocols (HTTP, HTTPS, FTP, GOPHER, DICT, TELNET, LDAP or FILE) and therefore is also usable for OpenStack Compute API. Use the curl command line tool or use libcurl from within your own programs in C. Curl is free and open software that compiles and runs under a wide variety of operating systems.

The normal operations sequence to deploying an environment and an application on top of it could be summarized in the following list:

Some operations related to the management are the software can involve:

1.- Get the environment list from the catalogue

curl -v -H "Access-Control-Request-Method: GET" -H "Content-Type: application xml" -H "Accept: application/xml" -H "X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb" -X GET "http://{PaasManager_IP}:8080/paasmanager/rest/catalog/environment"

Obtaining:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<environmentDtoes>
   <environment>
       <environmentType>
          <id>24</id>
          <name>java_web_server</name>
          <description>An environment for Java applications deployed on a the web server</description>
       </environmentType>
       <name>java_tomat</name>
       <tiers>
          <initial_number_instances>1</initial_number_instances>
          <maximum_number_instances>1</maximum_number_instances>
          <minimum_number_instances>1</minimum_number_instances>
          <name>tomcat_tier</name>
          <productReleases>
             <product>tomcat</product>
             <version>7.0</version>
             <description>Tomcat 7.0</description>
             <productType>
                <id>6</id>
                <name>ApplicationWebServer</name>
                <description>Application Web Server description</description>
             </productType>
          </productReleases>
       </tiers>
    </environment>
</environmentDtoes>

2.- Deploying an environment

The following request URL for deploying an environment including hardware resources (servers) as well as the products required. The environment is composed by a set of tiers which correpond for server. The number of servers to be deployed in specified in the payload. In addition, the products to be installed in those servers The server and product features to be deployed are specified in the payload. In this case, information about the IP or its identification are specified in the server element. In addition, the product (in this case tomcat) and the version is indicated are specified in the payload request.

curl -v -H "Access-Control-Request-Method: POST" -H "Content-Type: application xml" -H "Accept: application/xml" -H "X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb" -X POST "http://{PaaSManager_IP}:8080/paasmanager/rest/org/{org-id}/vdc/{vdc-id}/environmentInstance/"

Obtaining:

<environmentDtoes>
   <environment>
       <environmentType>
          <id>24</id>
          <name>java_web_server</name>
          <description>An environment for Java applications deployed on a the web server</description>
       </environmentType>
       <name>java_tomat</name>
       <tiers>
          <initial_number_instances>1</initial_number_instances>
          <maximum_number_instances>1</maximum_number_instances>
          <minimum_number_instances>1</minimum_number_instances>
          <name>tomcat_tier</name>
          <productReleases>
             <product>tomcat</product>
             <version>7.0</version>
             <description>Tomcat 7.0</description>
             <productType>
                <id>6</id>
                <name>ApplicationWebServer</name>
                <description>Application Web Server description</description>
             </productType>
          </productReleases>
       </tiers>
    </environment>
</environmentDtoes>


The result for provisioning the environment is a Task indicating the operation status:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<task href="http:/130.206.80.112:8080/paasmanager/rest/org/{org-id}/vdc/{vdc-id}/task/{task-id}" startTime="2012-11-08T09:13:18.311+01:00" status="RUNNING">  
   <description>Deploy environment {environment-name}</description>
   <vdc>{vdc-id}</vdc>
 </task>

With the URL obtained in the href in the Task, it is possible to monitor the operation status. Once the environment has been deployed, the task status should be SUCCESS.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<task href="http:/130.206.80.112:8080/paasmanager/rest/org/{org-id}/vdc/{vdc-id}/task/{task-id}" startTime="2012-11-08T09:13:19.567+01:00" status="SUCCESS">
   <description>Deploy environment {environment-name}</description>
   <vdc>{vdc-id}</vdc> 
</task>

3.- Get information about the installed environment

 curl -v -H "Access-Control-Request-Method: GET" -H "Content-Type: application xml" -H "Accept: application/xml" -H "X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb" -X GET "http://{PaaSManager_IP}:8080/paasmanager/rest/org/{org-id}/vdc/{vdc-id}/environmentInstance/{environmentInstance-id}"

With the following result:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<environmentInstanceDtoes>
   <environmentInstance>
     <environmentInstanceName>java_tomat_instance</environmentInstanceName>
     <vdc>{vdc-id}</vdc>
     <environment>
        <name>java_tomat</name>
        <tiers>
           <initial_number_instances>1</initial_number_instances>
           <maximum_number_instances>1</maximum_number_instances>
           <minimum_number_instances>1</minimum_number_instances>
           <name>tomcat_tier</name>
           <productReleases>
              <product>tomcat</product>
              <version>7.0</version>
              <description>Tomcat 7.0</description>
              <productType>
                 <id>6</id>
                 <name>ApplicationWebServer</name>
                 <description>Application Web Server description</description>
              </productType>
           </productReleases>
        </tiers>
     </environment>
     <tierInstances>
         <id>138</id>
         <date>2012-11-29T13:03:36.056+01:00</date>
         <status>INSTALLED</status>
         <tier>
            <name>tomcat</name>
            <productReleases>
               <product>test</product>
               <version>0.1</version>
            </productReleases>
         </tier>
         <currentNumberInstances>1</currentNumberInstances>
         <fqn>4caast.customers.test4.services.testtomcatsap9.vees.tomcat.replicas.1</fqn>
         <name>java_tomat_instance_tomcat</name>
         <productInstances>
            <date>2012-11-29T13:03:27.834+01:00</date>
            <name>4caast.customers.test4.services.testtomcatsap9.vees.tomcat.replicas.1_tomcat_7.0</name>
            <status>INSTALLED</status>
            <productRelease>
                <product>tomcat</product>
                <version>7.0</version>
            </productRelease>
            <vm>
               <hostname>tomcat</hostname>
               <ip>130.206.80.114</ip>
            </vm>
         </productInstances>
      </tierInstance>
   </environmentInstance>
</environmentInstanceDtoes>


4.- Deploying an application in an environment already installed

From a environment instance already installed (called {environment-id}), it is possible to deploy an application (including all itsartefacts).

curl -v -H "Access-Control-Request-Method: POST" -H "Content-Type: application xml" -H "Accept: application/xml" -H "X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb" -X POST "http://{PaaSManager_IP}:8080/paasmanager/rest/org/{org-id}/vdc/{vdc-id}/environmentInstance/{environmentInstance-id}/applicationInstance"

Once installed, it is possible to query it, and check that the version has been updated.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<applicationReleaseDto>
   <applicationName>warapplication</applicationName>
   <version>1.0</version>
   <artifacts>
     <artifact>
       <name>thewarfile</name>
       <attributes>
          <key>webapps_url</key><value>http://Artefacts/WAR/tomcatFixedLocalPostgresDB/flipper.war</value>
          <key>webapps_name</key><value>flipper.war</value>
          <key>type</key><value>war</value>
          <productRelease>
             <version>7.0</version>
             <product>tomcat</product>
          </productRelease> 
       </artifact>
       <artifact>
          <name>the properties file</name>
          <attributes>
             <key>properties_url</key><value>http://configuration.prperties</value>
             <key>properties_name</key><value>flipper..prperties</value>
          </attributes>
          <productRelease>
             <version>7.0</version>
             <product>tomcat</product>
          </productRelease> 
       </artifact>
    </artifacts>
</applicationReleaseDto>

The result for provisioning the application is a Task indicating the operation status:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <task href="http:/130.206.80.112:8080/paasmanager/rest/org/{org-id}/vdc/{vdc-id}/task/{task-id}" startTime="2012-11-08T09:13:18.311+01:00" status="RUNNING">  
   <description>Deploy application {application-name}</description>
   <vdc>{vdc-id}</vdc>
</task>

With the URL obtained in the href in the Task, it is possible to monitor the operation status. Once the application has been deployed, the task status should be SUCCESS.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <task href="http:/130.206.80.112:8080/paasmanager/rest/org/{org-id}/vdc/{vdc-id}/task/{task-id}" startTime="2012-11-08T09:13:19.567+01:00" status="SUCCESS">
   <description>Deploy application {application-name}</description>
   <vdc>{vdc-id}</vdc> 
</task>


5.- Get information about an application already deployed

It obtains the information of the application already deployed.

curl -v -H "Access-Control-Request-Method: POST" -H "Content-Type: application xml" -H "Accept: application/xml" -H "X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb" -X POST "http://{PaaSManager_IP}:8080/paasmanager/rest/org/{org-id}/vdc/{vdc-id}/environmentInstance/{environmentInstance-id}/applicationInstance/{applicationInstance-id}"

Obtaining:

<applicationInstances>
<id>206</id>
   <date>2012-12-03T08:42:21.294+01:00</date>
   <name>warapplication_instance</name>
   <status>INSTALLED</status>    <vdc>{vdc-id}</vdc>    <applicationName>warapplication</applicationName>
   <version>1.0</version>
   <artifacts>
     <artifact>
       <name>thewarfile</name>
       <attributes>
          <key>webapps_url</key><value>http://Artefacts/WAR/tomcatFixedLocalPostgresDB/flipper.war</value>
          <key>webapps_name</key><value>flipper.war</value>
          <key>type</key><value>war</value>
          <productRelease>
             <version>7.0</version>
             <product>tomcat</product>
          </productRelease> 
       </artifact>
       <artifact>
          <name>the properties file</name>
          <attributes>
             <key>properties_url</key><value>http://configuration.prperties</value>
             <key>properties_name</key><value>flipper..prperties</value>
          </attributes>
          <productRelease>
             <version>7.0</version>
             <product>tomcat</product>
          </productRelease> 
       </artifact>
    </artifacts>
    <environmentInstance>
       <environmentInstanceName>java_tomat_instance</environmentInstanceName>
       <vdc>{vdc-id}</vdc>
       <environment>
          <name>java_tomat</name>
          <tiers>
             <initial_number_instances>1</initial_number_instances>
             <maximum_number_instances>1</maximum_number_instances>
             <minimum_number_instances>1</minimum_number_instances>
             <name>tomcat_tier</name>
             <productReleases>
                <product>tomcat</product>
                <version>7.0</version>
                <description>Tomcat 7.0</description>
                <productType>
                   <id>6</id>
                   <name>ApplicationWebServer</name>
                   <description>Application Web Server description</description>
                </productType>
             </productReleases>
          </tiers>
       </environment>
       <tierInstances>
          <id>138</id>
          <date>2012-11-29T13:03:36.056+01:00</date>
          <status>INSTALLED</status>
          <tier>
            <name>tomcat</name>
            <productReleases>
               <product>test</product>
               <version>0.1</version>
            </productReleases>
         </tier>
         <currentNumberInstances>1</currentNumberInstances>
         <fqn>4caast.customers.test4.services.testtomcatsap9.vees.tomcat.replicas.1</fqn>
         <name>java_tomat_instance_tomcat</name>
         <productInstances>
            <date>2012-11-29T13:03:27.834+01:00</date>
            <name>4caast.customers.test4.services.testtomcatsap9.vees.tomcat.replicas.1_tomcat_7.0</name>
            <status>INSTALLED</status>
            <productRelease>
                <product>tomcat</product>
                <version>7.0</version>
            </productRelease>
            <vm>
               <hostname>tomcat</hostname>
               <ip>130.206.80.114</ip>
            </vm>
         </productInstances>
      </tierInstance>
   </environmentInstance>
</applicationInstances>

Accessing Service Manager from a Browser

We are using the Chrome browser [3] with the Simple REST Client plugin[4] in order to send http commands to the PaaS Manager. You can use it also in Firefox through RESTClient add-ons [5].

We follow the same sequence that we take previously in order to deploy environments and applications:

1.- Deploying an environment

Deploying an environment

Tast result



With the URL obtained in the href in the Task, it is possible to monitor the operation status. Once the environment has been deployed, the task status should be SUCCESS.

The operation has been done correctly

2.- Get information about the installed environment

Get information about the installed environment


3.- Deploying an application in an environment already installed

Deploying an application


4.- Get information about an application already deployed

Get information about the application

Personal tools
Create a book