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
Software Deployment And Configuration - User and Programmers Guide - FIWARE Forge Wiki

Software Deployment And Configuration - User and Programmers Guide

From FIWARE Forge Wiki

Jump to: navigation, search

Contents

Introduction

Welcome the User and Programmer Guide for the SDC Manager Generic Enabler. 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 SDC API reference offers a [1] page, which describes how to use this API in details. It includes a bunch of commands, which can be used to manage software in the Cloud. Since SDC API is based on the HTTP protocol there are a rich variety of tools, which can be used to access the PaaS Manager interface.

SDC 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 SDC through SDC API.

To give a feeling of how it 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 /sdc/rest/catalog/product 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
> Access-Control-Request-Method: GET
> Origin: http://130.206.80.93
> Content-Type: application/xml
> Accept: application/xml
>
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Content-Type: application/xml
< Content-Length: 1674
< Date: Fri, 09 Nov 2012 15:05:10 GMT

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

SDC API deal 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.

Accessing Service Deployment and Configuration 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 SDC 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.

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

1.- Get the product list from the catalogue

curl -v -H "Access-Control-Request-Method: GET" -H "Content-Type: application xml" -H "Accept: application/xml" -X GET "http://{SDC_IP}:8080/sdc/rest/catalog/product"

Obtaining:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<products>
  <product>
    <name>tomcat</name>
    <description>tomcat J2EE container</description>
  </product>
</products>

2.- Installing a product in a VM

The following request URL for deploying software. The VM 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 VM 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" -X POST "http://{SDC_IP}:8080/sdc/rest/vdc/{VDC_ID}/product"
><productInstanceDto>
>  <vm>
>    <ip>{NODE_IP}</ip>
>    <fqn>fqn</fqn>
>  </vm>
>  <product>
>    <productDescription/>
>    <productName>tomcat</productName>
>    <version>6</version>
> </product>
></productInstanceDto>


After that, it is possible to check that the product has been deployed, concretely in this case by http://{NODE_IP}:8080.

3.- Get information about the product installed

 curl -v -H "Access-Control-Request-Method: GET" -H "Content-Type: application xml" -H "Accept: application/xml" -X POST "http://{SDC_IP}:8080/sdc/rest/vdc/{VDC_ID}/product/{PRODUCT_ID}"

With the following result:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<productInstance>
  <id>{PRODUCT_ID}</id>
  <date>2012-11-07T15:56:30.590+01:00</date>
  <status>INSTALLED</status>
  <vm> 
    <ip>130.206.80.114</ip>
    <hostname>rhel-5200ee66c6</hostname>
    <fqn>fqn</fqn>
    <osType>95</osType>
  </vm>
  <vdc>{vdc-id}</vdc>
  <product>
    <releaseNotes>Tomcat server 6</releaseNotes>
    <version>6</version>
    <product>
      <name>tomcat</name>
      <description>tomcat J2EE container</description>
      <attributes>
         <key>port</key>
         <value>8080</value>  
      </attributes>        
    </product>           
   </product>
</productInstance>


4.- Updating the product version in the VM

From a product instance already installed (called {PRODUCT_ID}), it is possible to update the product version (in this case to update Tomcat from version 6 to 7).

 curl -v -H "Access-Control-Request-Method: PUT" -H "Content-Type: application xml" -H "Accept: application/xml" -X PUT http://{SDC_IP}:8080/sdc/rest/catalog/product/{PRODUCT_ID}/7">

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"?>
<productInstance>
  <id>{PRODUCT_ID}</id>
  <date>2012-11-07T15:56:30.590+01:00</date>
  <status>INSTALLED</status>
  <vm> 
    <ip>130.206.80.114</ip>
    <hostname>rhel-5200ee66c6</hostname>
    <fqn>fqn</fqn>
    <osType>95</osType>
  </vm>
  <vdc>{vdc-id}</vdc>
  <product>
    <releaseNotes>Tomcat server 7</releaseNotes>
    <version>7</version>
    <product>
      <name>tomcat</name>
      <description>tomcat J2EE container</description>
      <attributes>
         <key>port</key>
         <value>8080</value>  
      </attributes>        
    </product>           
   </product>
</productInstance>

5.- Reconfigure a product already installed

From a product instance already installed (called {PRODUCT_ID}), it is possible to update its attributes (like the port where the tomcat is deployed).

 curl -v -H "Access-Control-Request-Method: PUT" -H "Content-Type: application xml" -H "Accept: application/xml"-X PUT http://{SDC_IP}:8080/sdc/rest/catalog/product/{PRODUCT_ID}">
><attributes>
>  <key>port</key>
>  <value>8082</value>
>  <description>The listen port</description>
></attributes>

After that, it is possible to check that the product has been deployed, concretely in this case by http://{NODE_IP}:8082

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 SDC. You can use it also in Firefox through RESTClient add-ons [5].

We follow the same sequence that we take previously in order to install software:

1.- Deploying an environment

Deploy a product


Deploy a product


Deploy a product


2.- Get information about the product installed

Get information about the product

3.- Updating the product version in the VM

Update product

4.- Reconfigure a product already installed

Configure product

5.- Uninstall product

Uninstall product

Personal tools
Create a book