Commit b03aaac5 authored by Spiros Koulouzis's avatar Spiros Koulouzis

composer works

parent 7843a1ed
# http://github.com/yeasy/docker-compose-files
# This compose file will start spark master node and the worker node.
# All nodes will become a cluster automatically.
# You can run: docker-compose scale worker=2
# After startup, try submit a pi calculation application.
# /urs/local/spark/bin/spark-submit --master spark://master:7077 --class org.apache.spark.examples.SparkPi /usr/local/spark/lib/spark-examples-1.4.0-hadoop2.6.0.jar 1000
master:
image: sequenceiq/spark:1.4.0
hostname: master
ports:
- "4040:4040"
- "8042:8042"
- "7077:7077"
- "8088:8088"
- "8080:8080"
restart: always
#mem_limit: 1024m
command: bash /usr/local/spark/sbin/start-master.sh && ping localhost > /dev/null
worker:
image: sequenceiq/spark:1.4.0
links:
- master:master
expose:
- "8081"
restart: always
command: bash /usr/local/spark/sbin/start-slave.sh spark://master:7077 && ping localhost >/dev/null
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<h1 class="page-header">Files and Libraries</h1> <h1 class="page-header">Files and Libraries</h1>
<h3 id="artifact_gwt_json_overlay">GWT JSON Overlay</h3> <h3 id="artifact_gwt_json_overlay">GWT JSON Overlay</h3>
<p class="lead">Created July 6, 2017</p> <p class="lead">Created July 7, 2017</p>
<p> <p> <p> <p>
The <a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a> JSON Overlay library provides the JSON Overlays that The <a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a> JSON Overlay library provides the JSON Overlays that
can be used to access the Web service API for this application. can be used to access the Web service API for this application.
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
</tbody> </tbody>
</table> </table>
<h3 id="artifact_java_json_client_library">Java JSON Client Library</h3> <h3 id="artifact_java_json_client_library">Java JSON Client Library</h3>
<p class="lead">Created July 6, 2017</p> <p class="lead">Created July 7, 2017</p>
<p><p> <p><p>
The Java client-side library is used to provide the set of Java objects that can be serialized The Java client-side library is used to provide the set of Java objects that can be serialized
to/from JSON using <a href="http://jackson.codehaus.org/">Jackson</a>. This is useful for accessing the to/from JSON using <a href="http://jackson.codehaus.org/">Jackson</a>. This is useful for accessing the
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
</tbody> </tbody>
</table> </table>
<h3 id="artifact_java_xml_client_library">Java XML Client Library</h3> <h3 id="artifact_java_xml_client_library">Java XML Client Library</h3>
<p class="lead">Created July 6, 2017</p> <p class="lead">Created July 7, 2017</p>
<p><p> <p><p>
The Java client-side library is used to access the Web service API for this application using Java. The Java client-side library is used to access the Web service API for this application using Java.
</p> </p>
...@@ -149,13 +149,13 @@ ...@@ -149,13 +149,13 @@
</tr> </tr>
<tr class="clickable-row" data-href="drip-api-xml-client-xml-sources.jar"> <tr class="clickable-row" data-href="drip-api-xml-client-xml-sources.jar">
<td><span class="downloadfile-name">drip-api-xml-client-xml-sources.jar</span></td> <td><span class="downloadfile-name">drip-api-xml-client-xml-sources.jar</span></td>
<td><span class="downloadfile-size">21.37K</span></td> <td><span class="downloadfile-size">21.38K</span></td>
<td><span class="downloadfile-description">The sources for the Java XML client library.</span></td> <td><span class="downloadfile-description">The sources for the Java XML client library.</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<h3 id="artifact_js_client_library">JavaScript Client Library</h3> <h3 id="artifact_js_client_library">JavaScript Client Library</h3>
<p class="lead">Created July 6, 2017</p> <p class="lead">Created July 7, 2017</p>
<p><p> <p><p>
The JavaScript client-side library defines classes that can be (de)serialized to/from JSON. The JavaScript client-side library defines classes that can be (de)serialized to/from JSON.
This is useful for accessing the resources that are published by this application, but only This is useful for accessing the resources that are published by this application, but only
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
</tbody> </tbody>
</table> </table>
<h3 id="artifact_php_json_client_library">PHP JSON Client Library</h3> <h3 id="artifact_php_json_client_library">PHP JSON Client Library</h3>
<p class="lead">Created July 6, 2017</p> <p class="lead">Created July 7, 2017</p>
<p><p> <p><p>
The PHP JSON client-side library defines the PHP classes that can be (de)serialized to/from JSON. The PHP JSON client-side library defines the PHP classes that can be (de)serialized to/from JSON.
This is useful for accessing the resources that are published by this application, but only This is useful for accessing the resources that are published by this application, but only
...@@ -213,13 +213,13 @@ ...@@ -213,13 +213,13 @@
<tbody data-link="row" class="rowlink"> <tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-php.zip"> <tr class="clickable-row" data-href="drip-api-php.zip">
<td><span class="downloadfile-name">drip-api-php.zip</span></td> <td><span class="downloadfile-name">drip-api-php.zip</span></td>
<td><span class="downloadfile-size">5.43K</span></td> <td><span class="downloadfile-size">5.44K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td> <td><span class="downloadfile-description">&nbsp;</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<h3 id="artifact_php_xml_client_library">PHP XML Client Library</h3> <h3 id="artifact_php_xml_client_library">PHP XML Client Library</h3>
<p class="lead">Created July 6, 2017</p> <p class="lead">Created July 7, 2017</p>
<p><p> <p><p>
The PHP client-side library defines the PHP classes that can be (de)serialized to/from XML. The PHP client-side library defines the PHP classes that can be (de)serialized to/from XML.
This is useful for accessing the resources that are published by this application, but only This is useful for accessing the resources that are published by this application, but only
...@@ -251,7 +251,7 @@ ...@@ -251,7 +251,7 @@
</tbody> </tbody>
</table> </table>
<h3 id="artifact_ruby_json_client_library">Ruby JSON Client Library</h3> <h3 id="artifact_ruby_json_client_library">Ruby JSON Client Library</h3>
<p class="lead">Created July 6, 2017</p> <p class="lead">Created July 7, 2017</p>
<p><p> <p><p>
The Ruby JSON client-side library defines the Ruby classes that can be (de)serialized to/from JSON. The Ruby JSON client-side library defines the Ruby classes that can be (de)serialized to/from JSON.
This is useful for accessing the REST endpoints that are published by this application, but only This is useful for accessing the REST endpoints that are published by this application, but only
......
This diff is collapsed.
...@@ -272,7 +272,7 @@ provisopned based on a TOSCA description.</span> ...@@ -272,7 +272,7 @@ provisopned based on a TOSCA description.</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/provision</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/provision</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/sample</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{id}</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{id}</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/post/provision/</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/post/provision</span>
</samp></li></ul></td> </samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span> <td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span> </samp></li><li><samp> <span class="label label-default resource-method">GET</span>
......
...@@ -81,9 +81,9 @@ class</p> ...@@ -81,9 +81,9 @@ class</p>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td> <span class="property-name">start</span> <td> <span class="property-name">cloudDeploymentDomain</span>
</td> </td>
<td> <span class="datatype-reference">number <td> <span class="datatype-reference">string
</span> </span>
</td> </td>
<td> <span class="property-description"></span> <td> <span class="property-description"></span>
...@@ -99,16 +99,16 @@ class</p> ...@@ -99,16 +99,16 @@ class</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <span class="property-name">host</span> <td> <span class="property-name">end</span>
</td> </td>
<td> <span class="datatype-reference">string <td> <span class="datatype-reference">number
</span> </span>
</td> </td>
<td> <span class="property-description"></span> <td> <span class="property-description"></span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <span class="property-name">end</span> <td> <span class="property-name">delta</span>
</td> </td>
<td> <span class="datatype-reference">number <td> <span class="datatype-reference">number
</span> </span>
...@@ -117,18 +117,18 @@ class</p> ...@@ -117,18 +117,18 @@ class</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <span class="property-name">cloudDeploymentDomain</span> <td> <span class="property-name">start</span>
</td> </td>
<td> <span class="datatype-reference">string <td> <span class="datatype-reference">number
</span> </span>
</td> </td>
<td> <span class="property-description"></span> <td> <span class="property-description"></span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <span class="property-name">delta</span> <td> <span class="property-name">host</span>
</td> </td>
<td> <span class="datatype-reference">number <td> <span class="datatype-reference">string
</span> </span>
</td> </td>
<td> <span class="property-description"></span> <td> <span class="property-description"></span>
...@@ -165,12 +165,12 @@ object is saved.</span></td> ...@@ -165,12 +165,12 @@ object is saved.</span></td>
<p class="lead">Example</p> <p class="lead">Example</p>
<pre class="prettyprint language-js example">{ <pre class="prettyprint language-js example">{
&quot;start&quot; : 12345, &quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;vmType&quot; : &quot;...&quot;, &quot;vmType&quot; : &quot;...&quot;,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;end&quot; : 12345, &quot;end&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;delta&quot; : 12345, &quot;delta&quot; : 12345,
&quot;start&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;owner&quot; : &quot;user1&quot;, &quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;, &quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 12345 &quot;timestamp&quot; : 12345
......
...@@ -755,15 +755,15 @@ class]]> ...@@ -755,15 +755,15 @@ class]]>
<xs:sequence> <xs:sequence>
<xs:element name="delta" type="xs:dateTime" minOccurs="0"> <xs:element name="delta" type="xs:dateTime" minOccurs="0">
</xs:element> </xs:element>
<xs:element name="end" type="xs:dateTime" minOccurs="0"> <xs:element name="cloudDeploymentDomain" type="xs:string" minOccurs="0">
</xs:element> </xs:element>
<xs:element name="host" type="xs:string" minOccurs="0"> <xs:element name="host" type="xs:string" minOccurs="0">
</xs:element> </xs:element>
<xs:element name="vmType" type="xs:string" minOccurs="0"> <xs:element name="start" type="xs:dateTime" minOccurs="0">
</xs:element> </xs:element>
<xs:element name="cloudDeploymentDomain" type="xs:string" minOccurs="0"> <xs:element name="end" type="xs:dateTime" minOccurs="0">
</xs:element> </xs:element>
<xs:element name="start" type="xs:dateTime" minOccurs="0"> <xs:element name="vmType" type="xs:string" minOccurs="0">
</xs:element> </xs:element>
</xs:sequence> </xs:sequence>
</xs:extension> </xs:extension>
......
...@@ -144,12 +144,12 @@ Content-Type: application/json ...@@ -144,12 +144,12 @@ Content-Type: application/json
<code class="prettyprint language-js"> <code class="prettyprint language-js">
[ { [ {
&quot;start&quot; : 12345, &quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;vmType&quot; : &quot;...&quot;, &quot;vmType&quot; : &quot;...&quot;,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;end&quot; : 12345, &quot;end&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;delta&quot; : 12345, &quot;delta&quot; : 12345,
&quot;start&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;owner&quot; : &quot;user1&quot;, &quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;, &quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 12345 &quot;timestamp&quot; : 12345
...@@ -514,12 +514,12 @@ Content-Type: application/json ...@@ -514,12 +514,12 @@ Content-Type: application/json
<code class="prettyprint language-js"> <code class="prettyprint language-js">
{ {
&quot;start&quot; : 12345, &quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;vmType&quot; : &quot;...&quot;, &quot;vmType&quot; : &quot;...&quot;,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;end&quot; : 12345, &quot;end&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;delta&quot; : 12345, &quot;delta&quot; : 12345,
&quot;start&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;owner&quot; : &quot;user1&quot;, &quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;, &quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 12345 &quot;timestamp&quot; : 12345
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<li><a href="#resource_ProvisionController_sample_GET"><abbr title="GET /user/v1.0/provisioner/sample">GET /user/v1.0/provisioner/sam...</abbr></a></li> <li><a href="#resource_ProvisionController_sample_GET"><abbr title="GET /user/v1.0/provisioner/sample">GET /user/v1.0/provisioner/sam...</abbr></a></li>
<li><a href="#resource_ProvisionController_delete_DELETE"><abbr title="DELETE /user/v1.0/provisioner/{id}">DELETE /user/v1.0/provisioner/...</abbr></a></li> <li><a href="#resource_ProvisionController_delete_DELETE"><abbr title="DELETE /user/v1.0/provisioner/{id}">DELETE /user/v1.0/provisioner/...</abbr></a></li>
<li><a href="#resource_ProvisionController_get_GET"><abbr title="GET /user/v1.0/provisioner/{id}">GET /user/v1.0/provisioner/{id...</abbr></a></li> <li><a href="#resource_ProvisionController_get_GET"><abbr title="GET /user/v1.0/provisioner/{id}">GET /user/v1.0/provisioner/{id...</abbr></a></li>
<li><a href="#resource_ProvisionController_postProvisionResponse_POST"><abbr title="POST /user/v1.0/provisioner/post/provision/">POST /user/v1.0/provisioner/po...</abbr></a></li> <li><a href="#resource_ProvisionController_postProvisionResponse_POST"><abbr title="POST /user/v1.0/provisioner/post/provision">POST /user/v1.0/provisioner/po...</abbr></a></li>
<li class="divider"></li> <li class="divider"></li>
<li class="text-right"><a href="#top"><small>Back to Top</small></a></li> <li class="text-right"><a href="#top"><small>Back to Top</small></a></li>
</ul> </ul>
...@@ -648,7 +648,7 @@ Content-Type: application/json ...@@ -648,7 +648,7 @@ Content-Type: application/json
</div> </div>
<div id="resource_ProvisionController_postProvisionResponse_POST"> <div id="resource_ProvisionController_postProvisionResponse_POST">
<h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/provisioner/post/provision/ <a href="../user/v1.0/provisioner/post/provision/" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3> <h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/provisioner/post/provision <a href="../user/v1.0/provisioner/post/provision" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Updates or creates a new ProvisionResponse.</p> <p>Updates or creates a new ProvisionResponse.</p>
...@@ -731,7 +731,7 @@ Content-Type: application/json ...@@ -731,7 +731,7 @@ Content-Type: application/json
<div class="col-md-6"> <div class="col-md-6">
<h5>Request</h5> <h5>Request</h5>
<pre> <pre>
POST /user/v1.0/provisioner/post/provision/ POST /user/v1.0/provisioner/post/provision
Content-Type: application/json Content-Type: application/json
Accept: application/json Accept: application/json
......
...@@ -264,7 +264,7 @@ provisopned based on a TOSCA description.</span> ...@@ -264,7 +264,7 @@ provisopned based on a TOSCA description.</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/provision</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/provision</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/sample</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{id}</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{id}</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/post/provision/</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/post/provision</span>
</samp></li></ul></td> </samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span> <td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span> </samp></li><li><samp> <span class="label label-default resource-method">GET</span>
......
...@@ -232,11 +232,11 @@ the DAO saves the object based on the principal how made the call</span></td> ...@@ -232,11 +232,11 @@ the DAO saves the object based on the principal how made the call</span></td>
<pre class="prettyprint language-xml example">&lt;b-----&gt; <pre class="prettyprint language-xml example">&lt;b-----&gt;
&lt;delta&gt;...&lt;/delta&gt; &lt;delta&gt;...&lt;/delta&gt;
&lt;end&gt;...&lt;/end&gt;
&lt;host&gt;147.228.242.58&lt;/host&gt;
&lt;vmType&gt;...&lt;/vmType&gt;
&lt;cloudDeploymentDomain&gt;us-east-1&lt;/cloudDeploymentDomain&gt; &lt;cloudDeploymentDomain&gt;us-east-1&lt;/cloudDeploymentDomain&gt;
&lt;host&gt;147.228.242.58&lt;/host&gt;
&lt;start&gt;...&lt;/start&gt; &lt;start&gt;...&lt;/start&gt;
&lt;end&gt;...&lt;/end&gt;
&lt;vmType&gt;...&lt;/vmType&gt;
&lt;owner&gt;user1&lt;/owner&gt; &lt;owner&gt;user1&lt;/owner&gt;
&lt;timestamp&gt;...&lt;/timestamp&gt; &lt;timestamp&gt;...&lt;/timestamp&gt;
&lt;/b-----&gt; &lt;/b-----&gt;
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<h1 class="page-header">Files and Libraries</h1> <h1 class="page-header">Files and Libraries</h1>
<h3 id="artifact_gwt_json_overlay">GWT JSON Overlay</h3> <h3 id="artifact_gwt_json_overlay">GWT JSON Overlay</h3>
<p class="lead">Created July 6, 2017</p> <p class="lead">Created July 7, 2017</p>
<p> <p> <p> <p>
The <a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a> JSON Overlay library provides the JSON Overlays that The <a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a> JSON Overlay library provides the JSON Overlays that
can be used to access the Web service API for this application. can be used to access the Web service API for this application.
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
</tbody> </tbody>
</table> </table>
<h3 id="artifact_java_json_client_library">Java JSON Client Library</h3> <h3 id="artifact_java_json_client_library">Java JSON Client Library</h3>
<p class="lead">Created July 6, 2017</p> <p class="lead">Created July 7, 2017</p>
<p><p> <p><p>
The Java client-side library is used to provide the set of Java objects that can be serialized The Java client-side library is used to provide the set of Java objects that can be serialized
to/from JSON using <a href="http://jackson.codehaus.org/">Jackson</a>. This is useful for accessing the to/from JSON using <a href="http://jackson.codehaus.org/">Jackson</a>. This is useful for accessing the
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
</tbody> </tbody>
</table> </table>
<h3 id="artifact_java_xml_client_library">Java XML Client Library</h3> <h3 id="artifact_java_xml_client_library">Java XML Client Library</h3>
<p class="lead">Created July 6, 2017</p> <p class="lead">Created July 7, 2017</p>
<p><p> <p><p>
The Java client-side library is used to access the Web service API for this application using Java. The Java client-side library is used to access the Web service API for this application using Java.
</p> </p>
...@@ -149,13 +149,13 @@ ...@@ -149,13 +149,13 @@
</tr> </tr>
<tr class="clickable-row" data-href="drip-api-xml-client-xml-sources.jar"> <tr class="clickable-row" data-href="drip-api-xml-client-xml-sources.jar">
<td><span class="downloadfile-name">drip-api-xml-client-xml-sources.jar</span></td> <td><span class="downloadfile-name">drip-api-xml-client-xml-sources.jar</span></td>
<td><span class="downloadfile-size">21.37K</span></td> <td><span class="downloadfile-size">21.38K</span></td>
<td><span class="downloadfile-description">The sources for the Java XML client library.</span></td> <td><span class="downloadfile-description">The sources for the Java XML client library.</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<h3 id="artifact_js_client_library">JavaScript Client Library</h3> <h3 id="artifact_js_client_library">JavaScript Client Library</h3>
<p class="lead">Created July 6, 2017</p> <p class="lead">Created July 7, 2017</p>
<p><p> <p><p>
The JavaScript client-side library defines classes that can be (de)serialized to/from JSON. The JavaScript client-side library defines classes that can be (de)serialized to/from JSON.
This is useful for accessing the resources that are published by this application, but only This is useful for accessing the resources that are published by this application, but only
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
</tbody> </tbody>
</table> </table>
<h3 id="artifact_php_json_client_library">PHP JSON Client Library</h3> <h3 id="artifact_php_json_client_library">PHP JSON Client Library</h3>
<p class="lead">Created July 6, 2017</p> <p class="lead">Created July 7, 2017</p>
<p><p> <p><p>
The PHP JSON client-side library defines the PHP classes that can be (de)serialized to/from JSON. The PHP JSON client-side library defines the PHP classes that can be (de)serialized to/from JSON.
This is useful for accessing the resources that are published by this application, but only This is useful for accessing the resources that are published by this application, but only
...@@ -213,13 +213,13 @@ ...@@ -213,13 +213,13 @@
<tbody data-link="row" class="rowlink"> <tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-php.zip"> <tr class="clickable-row" data-href="drip-api-php.zip">
<td><span class="downloadfile-name">drip-api-php.zip</span></td> <td><span class="downloadfile-name">drip-api-php.zip</span></td>
<td><span class="downloadfile-size">5.43K</span></td> <td><span class="downloadfile-size">5.44K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td> <td><span class="downloadfile-description">&nbsp;</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<h3 id="artifact_php_xml_client_library">PHP XML Client Library</h3> <h3 id="artifact_php_xml_client_library">PHP XML Client Library</h3>
<p class="lead">Created July 6, 2017</p> <p class="lead">Created July 7, 2017</p>
<p><p> <p><p>
The PHP client-side library defines the PHP classes that can be (de)serialized to/from XML. The PHP client-side library defines the PHP classes that can be (de)serialized to/from XML.
This is useful for accessing the resources that are published by this application, but only This is useful for accessing the resources that are published by this application, but only
...@@ -251,7 +251,7 @@ ...@@ -251,7 +251,7 @@
</tbody> </tbody>
</table> </table>
<h3 id="artifact_ruby_json_client_library">Ruby JSON Client Library</h3> <h3 id="artifact_ruby_json_client_library">Ruby JSON Client Library</h3>
<p class="lead">Created July 6, 2017</p> <p class="lead">Created July 7, 2017</p>
<p><p> <p><p>
The Ruby JSON client-side library defines the Ruby classes that can be (de)serialized to/from JSON. The Ruby JSON client-side library defines the Ruby classes that can be (de)serialized to/from JSON.
This is useful for accessing the REST endpoints that are published by this application, but only This is useful for accessing the REST endpoints that are published by this application, but only
......
This diff is collapsed.
...@@ -272,7 +272,7 @@ provisopned based on a TOSCA description.</span> ...@@ -272,7 +272,7 @@ provisopned based on a TOSCA description.</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/provision</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/provision</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/sample</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{id}</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{id}</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/post/provision/</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/post/provision</span>
</samp></li></ul></td> </samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span> <td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span> </samp></li><li><samp> <span class="label label-default resource-method">GET</span>
......
...@@ -81,54 +81,54 @@ class</p> ...@@ -81,54 +81,54 @@ class</p>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td> <span class="property-name">delta</span> <td> <span class="property-name">cloudDeploymentDomain</span>
</td> </td>
<td> <span class="datatype-reference">number <td> <span class="datatype-reference">string
</span> </span>
</td> </td>
<td> <span class="property-description"></span> <td> <span class="property-description"></span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <span class="property-name">cloudDeploymentDomain</span> <td> <span class="property-name">start</span>
</td> </td>
<td> <span class="datatype-reference">string <td> <span class="datatype-reference">number
</span> </span>
</td> </td>
<td> <span class="property-description"></span> <td> <span class="property-description"></span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <span class="property-name">vmType</span> <td> <span class="property-name">delta</span>
</td> </td>
<td> <span class="datatype-reference">string <td> <span class="datatype-reference">number
</span> </span>
</td> </td>
<td> <span class="property-description"></span> <td> <span class="property-description"></span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <span class="property-name">end</span> <td> <span class="property-name">vmType</span>
</td> </td>
<td> <span class="datatype-reference">number <td> <span class="datatype-reference">string
</span> </span>
</td> </td>
<td> <span class="property-description"></span> <td> <span class="property-description"></span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <span class="property-name">start</span> <td> <span class="property-name">host</span>
</td> </td>
<td> <span class="datatype-reference">number <td> <span class="datatype-reference">string
</span> </span>
</td> </td>
<td> <span class="property-description"></span> <td> <span class="property-description"></span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <span class="property-name">host</span> <td> <span class="property-name">end</span>
</td> </td>
<td> <span class="datatype-reference">string <td> <span class="datatype-reference">number
</span> </span>
</td> </td>
<td> <span class="property-description"></span> <td> <span class="property-description"></span>
...@@ -165,12 +165,12 @@ object is saved.</span></td> ...@@ -165,12 +165,12 @@ object is saved.</span></td>
<p class="lead">Example</p> <p class="lead">Example</p>
<pre class="prettyprint language-js example">{ <pre class="prettyprint language-js example">{
&quot;delta&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;, &quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;vmType&quot; : &quot;...&quot;,
&quot;end&quot; : 12345,
&quot;start&quot; : 12345, &quot;start&quot; : 12345,
&quot;delta&quot; : 12345,
&quot;vmType&quot; : &quot;...&quot;,
&quot;host&quot; : &quot;147.228.242.58&quot;, &quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;end&quot; : 12345,
&quot;owner&quot; : &quot;user1&quot;, &quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;, &quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 12345 &quot;timestamp&quot; : 12345
......
...@@ -69,7 +69,7 @@ class</p> ...@@ -69,7 +69,7 @@ class</p>
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>Subtypes</dt> <dt>Subtypes</dt>
<dd><a href="json_KeyPair.html">KeyPair</a>, <a href="json_AnsibleOutput.html">AnsibleOutput</a>, <a href="json_CloudCredentials.html">CloudCredentials</a>, <a href="json_BenchmarkResult.html">BenchmarkResult</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_Script.html">Script</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a></dd> <dd><a href="json_KeyPair.html">KeyPair</a>, <a href="json_AnsibleOutput.html">AnsibleOutput</a>, <a href="json_BenchmarkResult.html">BenchmarkResult</a>, <a href="json_CloudCredentials.html">CloudCredentials</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_Script.html">Script</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a></dd>
</dl> </dl>
<table class="table datatype-properties"> <table class="table datatype-properties">
......
...@@ -753,17 +753,17 @@ class]]> ...@@ -753,17 +753,17 @@ class]]>
<xs:complexContent> <xs:complexContent>
<xs:extension base="ownedObject"> <xs:extension base="ownedObject">
<xs:sequence> <xs:sequence>
<xs:element name="host" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="vmType" type="xs:string" minOccurs="0"> <xs:element name="vmType" type="xs:string" minOccurs="0">
</xs:element> </xs:element>
<xs:element name="end" type="xs:dateTime" minOccurs="0"> <xs:element name="end" type="xs:dateTime" minOccurs="0">
</xs:element> </xs:element>
<xs:element name="delta" type="xs:dateTime" minOccurs="0"> <xs:element name="cloudDeploymentDomain" type="xs:string" minOccurs="0">
</xs:element> </xs:element>
<xs:element name="start" type="xs:dateTime" minOccurs="0"> <xs:element name="start" type="xs:dateTime" minOccurs="0">
</xs:element> </xs:element>
<xs:element name="cloudDeploymentDomain" type="xs:string" minOccurs="0"> <xs:element name="host" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="delta" type="xs:dateTime" minOccurs="0">
</xs:element> </xs:element>
</xs:sequence> </xs:sequence>
</xs:extension> </xs:extension>
......
...@@ -144,12 +144,12 @@ Content-Type: application/json ...@@ -144,12 +144,12 @@ Content-Type: application/json
<code class="prettyprint language-js"> <code class="prettyprint language-js">
[ { [ {
&quot;delta&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;, &quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;vmType&quot; : &quot;...&quot;,
&quot;end&quot; : 12345,
&quot;start&quot; : 12345, &quot;start&quot; : 12345,
&quot;delta&quot; : 12345,
&quot;vmType&quot; : &quot;...&quot;,
&quot;host&quot; : &quot;147.228.242.58&quot;, &quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;end&quot; : 12345,
&quot;owner&quot; : &quot;user1&quot;, &quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;, &quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 12345 &quot;timestamp&quot; : 12345
...@@ -514,12 +514,12 @@ Content-Type: application/json ...@@ -514,12 +514,12 @@ Content-Type: application/json
<code class="prettyprint language-js"> <code class="prettyprint language-js">
{ {
&quot;delta&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;, &quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;vmType&quot; : &quot;...&quot;,
&quot;end&quot; : 12345,
&quot;start&quot; : 12345, &quot;start&quot; : 12345,
&quot;delta&quot; : 12345,
&quot;vmType&quot; : &quot;...&quot;,
&quot;host&quot; : &quot;147.228.242.58&quot;, &quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;end&quot; : 12345,
&quot;owner&quot; : &quot;user1&quot;, &quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;, &quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 12345 &quot;timestamp&quot; : 12345
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<li><a href="#resource_ProvisionController_sample_GET"><abbr title="GET /user/v1.0/provisioner/sample">GET /user/v1.0/provisioner/sam...</abbr></a></li> <li><a href="#resource_ProvisionController_sample_GET"><abbr title="GET /user/v1.0/provisioner/sample">GET /user/v1.0/provisioner/sam...</abbr></a></li>
<li><a href="#resource_ProvisionController_delete_DELETE"><abbr title="DELETE /user/v1.0/provisioner/{id}">DELETE /user/v1.0/provisioner/...</abbr></a></li> <li><a href="#resource_ProvisionController_delete_DELETE"><abbr title="DELETE /user/v1.0/provisioner/{id}">DELETE /user/v1.0/provisioner/...</abbr></a></li>
<li><a href="#resource_ProvisionController_get_GET"><abbr title="GET /user/v1.0/provisioner/{id}">GET /user/v1.0/provisioner/{id...</abbr></a></li> <li><a href="#resource_ProvisionController_get_GET"><abbr title="GET /user/v1.0/provisioner/{id}">GET /user/v1.0/provisioner/{id...</abbr></a></li>
<li><a href="#resource_ProvisionController_postProvisionResponse_POST"><abbr title="POST /user/v1.0/provisioner/post/provision/">POST /user/v1.0/provisioner/po...</abbr></a></li> <li><a href="#resource_ProvisionController_postProvisionResponse_POST"><abbr title="POST /user/v1.0/provisioner/post/provision">POST /user/v1.0/provisioner/po...</abbr></a></li>
<li class="divider"></li> <li class="divider"></li>
<li class="text-right"><a href="#top"><small>Back to Top</small></a></li> <li class="text-right"><a href="#top"><small>Back to Top</small></a></li>
</ul> </ul>
...@@ -648,7 +648,7 @@ Content-Type: application/json ...@@ -648,7 +648,7 @@ Content-Type: application/json
</div> </div>
<div id="resource_ProvisionController_postProvisionResponse_POST"> <div id="resource_ProvisionController_postProvisionResponse_POST">
<h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/provisioner/post/provision/ <a href="./user/v1.0/provisioner/post/provision/" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3> <h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/provisioner/post/provision <a href="./user/v1.0/provisioner/post/provision" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Updates or creates a new ProvisionResponse.</p> <p>Updates or creates a new ProvisionResponse.</p>
...@@ -731,7 +731,7 @@ Content-Type: application/json ...@@ -731,7 +731,7 @@ Content-Type: application/json
<div class="col-md-6"> <div class="col-md-6">
<h5>Request</h5> <h5>Request</h5>
<pre> <pre>
POST /user/v1.0/provisioner/post/provision/ POST /user/v1.0/provisioner/post/provision
Content-Type: application/json Content-Type: application/json
Accept: application/json Accept: application/json
......
...@@ -264,7 +264,7 @@ provisopned based on a TOSCA description.</span> ...@@ -264,7 +264,7 @@ provisopned based on a TOSCA description.</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/provision</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/provision</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/sample</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{id}</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{id}</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/post/provision/</span> </samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/post/provision</span>
</samp></li></ul></td> </samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span> <td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span> </samp></li><li><samp> <span class="label label-default resource-method">GET</span>
......
...@@ -231,12 +231,12 @@ the DAO saves the object based on the principal how made the call</span></td> ...@@ -231,12 +231,12 @@ the DAO saves the object based on the principal how made the call</span></td>
<p class="lead">Example</p> <p class="lead">Example</p>
<pre class="prettyprint language-xml example">&lt;b-----&gt; <pre class="prettyprint language-xml example">&lt;b-----&gt;
&lt;host&gt;147.228.242.58&lt;/host&gt;
&lt;vmType&gt;...&lt;/vmType&gt; &lt;vmType&gt;...&lt;/vmType&gt;
&lt;end&gt;...&lt;/end&gt; &lt;end&gt;...&lt;/end&gt;
&lt;delta&gt;...&lt;/delta&gt;
&lt;start&gt;...&lt;/start&gt;
&lt;cloudDeploymentDomain&gt;us-east-1&lt;/cloudDeploymentDomain&gt; &lt;cloudDeploymentDomain&gt;us-east-1&lt;/cloudDeploymentDomain&gt;
&lt;start&gt;...&lt;/start&gt;
&lt;host&gt;147.228.242.58&lt;/host&gt;
&lt;delta&gt;...&lt;/delta&gt;
&lt;owner&gt;user1&lt;/owner&gt; &lt;owner&gt;user1&lt;/owner&gt;
&lt;timestamp&gt;...&lt;/timestamp&gt; &lt;timestamp&gt;...&lt;/timestamp&gt;
&lt;/b-----&gt; &lt;/b-----&gt;
......
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
*/ */
package nl.uva.sne.drip.api.dao; package nl.uva.sne.drip.api.dao;
import nl.uva.sne.drip.drip.commons.data.v1.external.PlaybookRepresentation; import nl.uva.sne.drip.drip.commons.data.v1.external.ConfigurationRepresentation;
import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.data.mongodb.repository.MongoRepository;
/** /**
* *
* @author S. Koulouzis * @author S. Koulouzis
*/ */
public interface PlaybookDao extends MongoRepository<PlaybookRepresentation, String> { public interface ConfigurationDao extends MongoRepository<ConfigurationRepresentation, String> {
} }
...@@ -20,7 +20,7 @@ import java.util.List; ...@@ -20,7 +20,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import nl.uva.sne.drip.api.exception.NotFoundException; import nl.uva.sne.drip.api.exception.NotFoundException;
import nl.uva.sne.drip.commons.utils.Constants; import nl.uva.sne.drip.commons.utils.Constants;
import nl.uva.sne.drip.drip.commons.data.v1.external.PlaybookRepresentation; import nl.uva.sne.drip.drip.commons.data.v1.external.ConfigurationRepresentation;
import nl.uva.sne.drip.commons.utils.Converter; import nl.uva.sne.drip.commons.utils.Converter;
import nl.uva.sne.drip.drip.commons.data.v1.external.User; import nl.uva.sne.drip.drip.commons.data.v1.external.User;
import org.json.JSONException; import org.json.JSONException;
...@@ -31,7 +31,7 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -31,7 +31,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import nl.uva.sne.drip.api.dao.PlaybookDao; import nl.uva.sne.drip.api.dao.ConfigurationDao;
/** /**
* *
...@@ -39,18 +39,18 @@ import nl.uva.sne.drip.api.dao.PlaybookDao; ...@@ -39,18 +39,18 @@ import nl.uva.sne.drip.api.dao.PlaybookDao;
*/ */
@Service @Service
@PreAuthorize("isAuthenticated()") @PreAuthorize("isAuthenticated()")
public class PlaybookService { public class ConfigurationService {
@Autowired @Autowired
private PlaybookDao dao; private ConfigurationDao dao;
public String get(String id, String fromat) throws JSONException, NotFoundException { public String get(String id, String fromat) throws JSONException, NotFoundException {
PlaybookRepresentation playbook = findOne(id); ConfigurationRepresentation configuration = findOne(id);
if (playbook == null) { if (configuration == null) {
throw new NotFoundException(); throw new NotFoundException();
} }
Map<String, Object> map = playbook.getKeyValue(); Map<String, Object> map = configuration.getKeyValue();
if (fromat != null && fromat.toLowerCase().equals("yml")) { if (fromat != null && fromat.toLowerCase().equals("yml")) {
String ymlStr = Converter.map2YmlString(map); String ymlStr = Converter.map2YmlString(map);
...@@ -80,30 +80,30 @@ public class PlaybookService { ...@@ -80,30 +80,30 @@ public class PlaybookService {
public String saveYamlString(String yamlString, String name) throws IOException { public String saveYamlString(String yamlString, String name) throws IOException {
yamlString = yamlString.replaceAll("\\.", "\uff0E"); yamlString = yamlString.replaceAll("\\.", "\uff0E");
Map<String, Object> map = Converter.ymlString2Map(yamlString); Map<String, Object> map = Converter.ymlString2Map(yamlString);
PlaybookRepresentation t = new PlaybookRepresentation(); ConfigurationRepresentation t = new ConfigurationRepresentation();
t.setKvMap(map); t.setKvMap(map);
save(t); save(t);
return t.getId(); return t.getId();
} }
@PostAuthorize("(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))") @PostAuthorize("(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))")
public PlaybookRepresentation delete(String id) { public ConfigurationRepresentation delete(String id) {
PlaybookRepresentation tr = dao.findOne(id); ConfigurationRepresentation tr = dao.findOne(id);
dao.delete(tr); dao.delete(tr);
return tr; return tr;
} }
@PostFilter("(filterObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))") @PostFilter("(filterObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))")
public List<PlaybookRepresentation> findAll() { public List<ConfigurationRepresentation> findAll() {
return dao.findAll(); return dao.findAll();
} }
@PostAuthorize("(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))") @PostAuthorize("(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))")
public PlaybookRepresentation findOne(String id) { public ConfigurationRepresentation findOne(String id) {
return dao.findOne(id); return dao.findOne(id);
} }
private PlaybookRepresentation save(PlaybookRepresentation t) { private ConfigurationRepresentation save(ConfigurationRepresentation t) {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String owner = user.getUsername(); String owner = user.getUsername();
t.setOwner(owner); t.setOwner(owner);
...@@ -115,9 +115,9 @@ public class PlaybookService { ...@@ -115,9 +115,9 @@ public class PlaybookService {
dao.deleteAll(); dao.deleteAll();
} }
public String saveStringContents(String playbookContents) throws IOException { public String saveStringContents(String yamlContents) throws IOException {
Map<String, Object> map = Converter.cleanStringContents(playbookContents, false); Map<String, Object> map = Converter.cleanStringContents(yamlContents, false);
PlaybookRepresentation t = new PlaybookRepresentation(); ConfigurationRepresentation t = new ConfigurationRepresentation();
t.setKvMap(map); t.setKvMap(map);
save(t); save(t);
return t.getId(); return t.getId();
......
...@@ -78,14 +78,13 @@ public class DeployService { ...@@ -78,14 +78,13 @@ public class DeployService {
@Value("${message.broker.host}") @Value("${message.broker.host}")
private String messageBrokerHost; private String messageBrokerHost;
@Autowired // @Autowired
private CloudCredentialsService cloudCredentialsService; // private CloudCredentialsService cloudCredentialsService;
@Autowired @Autowired
private ProvisionService provisionService; private ProvisionService provisionService;
@Autowired @Autowired
private PlaybookService playbookService; private ConfigurationService configurationService;
@Autowired @Autowired
private BenchmarkResultService benchmarkResultService; private BenchmarkResultService benchmarkResultService;
...@@ -186,6 +185,11 @@ public class DeployService { ...@@ -186,6 +185,11 @@ public class DeployService {
parameters.add(ansibleParameter); parameters.add(ansibleParameter);
} }
if (managerType.toLowerCase().equals("swarm") && configurationID != null) {
MessageParameter composerParameter = createComposerParameter(configurationID);
parameters.add(composerParameter);
}
Message deployInvokationMessage = new Message(); Message deployInvokationMessage = new Message();
deployInvokationMessage.setParameters(parameters); deployInvokationMessage.setParameters(parameters);
deployInvokationMessage.setCreationDate(System.currentTimeMillis()); deployInvokationMessage.setCreationDate(System.currentTimeMillis());
...@@ -228,12 +232,24 @@ public class DeployService { ...@@ -228,12 +232,24 @@ public class DeployService {
} }
private MessageParameter createAnsibleParameter(String configurationID) throws JSONException { private MessageParameter createAnsibleParameter(String configurationID) throws JSONException {
String playbook = playbookService.get(configurationID, "yml"); return createConfigurationParameter(configurationID, "ansible");
MessageParameter ansibleParameter = new MessageParameter(); }
ansibleParameter.setName("playbook");
ansibleParameter.setEncoding("UTF-8"); private MessageParameter createComposerParameter(String configurationID) throws JSONException {
ansibleParameter.setValue(playbook); MessageParameter configurationParameter = createConfigurationParameter(configurationID, "composer");
return ansibleParameter; Map<String, String> attributes = new HashMap<>();
attributes.put("name", configurationID);
configurationParameter.setAttributes(attributes);
return configurationParameter;
}
private MessageParameter createConfigurationParameter(String configurationID, String confType) throws JSONException {
String configuration = configurationService.get(configurationID, "yml");
MessageParameter configurationParameter = new MessageParameter();
configurationParameter.setName(confType);
configurationParameter.setEncoding("UTF-8");
configurationParameter.setValue(configuration);
return configurationParameter;
} }
private DeployResponse handleResponse(List<MessageParameter> params, DeployRequest deployInfo) throws KeyException, IOException, Exception { private DeployResponse handleResponse(List<MessageParameter> params, DeployRequest deployInfo) throws KeyException, IOException, Exception {
......
...@@ -17,7 +17,7 @@ package nl.uva.sne.drip.api.v1.rest; ...@@ -17,7 +17,7 @@ package nl.uva.sne.drip.api.v1.rest;
import com.webcohesion.enunciate.metadata.rs.ResponseCode; import com.webcohesion.enunciate.metadata.rs.ResponseCode;
import com.webcohesion.enunciate.metadata.rs.StatusCodes; import com.webcohesion.enunciate.metadata.rs.StatusCodes;
import nl.uva.sne.drip.drip.commons.data.v1.external.PlaybookRepresentation; import nl.uva.sne.drip.drip.commons.data.v1.external.ConfigurationRepresentation;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -36,7 +36,7 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -36,7 +36,7 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import nl.uva.sne.drip.api.exception.BadRequestException; import nl.uva.sne.drip.api.exception.BadRequestException;
import nl.uva.sne.drip.api.exception.NotFoundException; import nl.uva.sne.drip.api.exception.NotFoundException;
import nl.uva.sne.drip.api.service.PlaybookService; import nl.uva.sne.drip.api.service.ConfigurationService;
import nl.uva.sne.drip.api.service.UserService; import nl.uva.sne.drip.api.service.UserService;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -55,7 +55,7 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -55,7 +55,7 @@ import org.springframework.web.bind.annotation.RequestBody;
public class ConfigurationController { public class ConfigurationController {
@Autowired @Autowired
private PlaybookService playbookService; private ConfigurationService configurationService;
/** /**
* Post a deployment configuration. * Post a deployment configuration.
...@@ -72,7 +72,7 @@ public class ConfigurationController { ...@@ -72,7 +72,7 @@ public class ConfigurationController {
public @ResponseBody public @ResponseBody
String post(@RequestBody String yamlContents) { String post(@RequestBody String yamlContents) {
try { try {
return playbookService.saveStringContents(yamlContents); return configurationService.saveStringContents(yamlContents);
} catch (IOException ex) { } catch (IOException ex) {
throw new BadRequestException("Not valid contents"); throw new BadRequestException("Not valid contents");
} }
...@@ -97,7 +97,7 @@ public class ConfigurationController { ...@@ -97,7 +97,7 @@ public class ConfigurationController {
throw new BadRequestException("Must uplaod a file"); throw new BadRequestException("Must uplaod a file");
} }
try { try {
return playbookService.saveFile(file); return configurationService.saveFile(file);
} catch (IOException | IllegalStateException ex) { } catch (IOException | IllegalStateException ex) {
throw new BadRequestException("Not valid contents"); throw new BadRequestException("Not valid contents");
} }
...@@ -120,7 +120,7 @@ public class ConfigurationController { ...@@ -120,7 +120,7 @@ public class ConfigurationController {
public @ResponseBody public @ResponseBody
String get(@PathVariable("id") String id, @RequestParam(value = "format") String format) { String get(@PathVariable("id") String id, @RequestParam(value = "format") String format) {
try { try {
return playbookService.get(id, format); return configurationService.get(id, format);
} catch (JSONException | NotFoundException ex) { } catch (JSONException | NotFoundException ex) {
throw new BadRequestException("Not valid contents"); throw new BadRequestException("Not valid contents");
} }
...@@ -139,7 +139,7 @@ public class ConfigurationController { ...@@ -139,7 +139,7 @@ public class ConfigurationController {
}) })
public @ResponseBody public @ResponseBody
String delete(@PathVariable("id") String id) { String delete(@PathVariable("id") String id) {
playbookService.delete(id); configurationService.delete(id);
return "Deleted : " + id; return "Deleted : " + id;
} }
...@@ -155,9 +155,9 @@ public class ConfigurationController { ...@@ -155,9 +155,9 @@ public class ConfigurationController {
}) })
public @ResponseBody public @ResponseBody
List<String> getIds() { List<String> getIds() {
List<PlaybookRepresentation> all = playbookService.findAll(); List<ConfigurationRepresentation> all = configurationService.findAll();
List<String> ids = new ArrayList<>(); List<String> ids = new ArrayList<>();
for (PlaybookRepresentation tr : all) { for (ConfigurationRepresentation tr : all) {
ids.add(tr.getId()); ids.add(tr.getId());
} }
return ids; return ids;
...@@ -175,7 +175,7 @@ public class ConfigurationController { ...@@ -175,7 +175,7 @@ public class ConfigurationController {
}) })
public @ResponseBody public @ResponseBody
String deleteAll() { String deleteAll() {
playbookService.deleteAll(); configurationService.deleteAll();
return "Done"; return "Done";
} }
......
...@@ -19,8 +19,6 @@ import com.webcohesion.enunciate.metadata.rs.ResponseCode; ...@@ -19,8 +19,6 @@ import com.webcohesion.enunciate.metadata.rs.ResponseCode;
import com.webcohesion.enunciate.metadata.rs.StatusCodes; import com.webcohesion.enunciate.metadata.rs.StatusCodes;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.security.RolesAllowed; import javax.annotation.security.RolesAllowed;
import nl.uva.sne.drip.api.exception.BadRequestException; import nl.uva.sne.drip.api.exception.BadRequestException;
import nl.uva.sne.drip.api.exception.InternalServerErrorException; import nl.uva.sne.drip.api.exception.InternalServerErrorException;
......
...@@ -19,11 +19,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; ...@@ -19,11 +19,12 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Document;
/** /**
* This class represents a playbook used by ansible manager to deploy software. * This class represents a configuration ( playbook used by ansible manager or
* composer for docker-composer) to deploy software.
* *
* @author S. Koulouzis * @author S. Koulouzis
*/ */
@Document @Document
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public class PlaybookRepresentation extends KeyValueHolder { public class ConfigurationRepresentation extends KeyValueHolder {
} }
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDpC46dDxO8UDSzzZLvcxgEGi4RRIBMQbxMsrOEtF9i8Dsq7Psb
F9n+KFCVCUU+oKjlOu+XdFobtpbMJYMKguJkrViOmaHeT1OTgZsaUIJDBupl359f
MEaUpHIGRYpu5NT/OglsQMHN0TtQD/Kbx5KPPDoBLAOymlSHAmfsopoYZwIDAQAB
AoGADU2AlYyPxtcZOw5IDe0W+Nz5tjifzjqOYh5tSuz06PPnnLqsVs6UvgJVHzzJ
PBr1qSglFxMoNZ7Fmt+lTEtOWu75NSpur12wOEr2pSTvJy7CQtDfD9HEaU53GdwT
n4YF48mGCnNA5e2lRiPX3WLZPnyfHjIqXZxZi8MIejauOaECQQD6lGpxOGkrw8Td
cQJPYA25vguHr0YN8EJZVi6VmkSbeqaffqIq3bHzWJsa1OaG3PAkoMeOAMfB7URd
+TSd2MsXAkEA7hYLIwQgDcK4mA5wuDv/qFx9KnCQa79tIHLLxKPBVnae/aRQ386K
afMlG5LqGd2y8kMmx4Kxc4aGjfiFkv4vMQJAbt+YsXwqXOkEhI7qXMC9kgAbDfBp
6OT0Fp9hgWR/EuSUMWJQ0vLBOFFuX9LwJaBAyZQyeAy0VoRricEonOc+BQJBANmR
WVIBZg1NIQULRSSG56UCB/tta/yarO2XGfCzOG177uSYcLNk+gXCBOoCwl0qxGkw
xlJRczm/+FvqfJ4MHDECQQCBWUmQEakOh+CMU4CRJIDFWAsBHKNxJ6e+ob/PgmSb
s0xX8vJVSP8E5ZknGPtGeuQCV4pWfZNdNEpm3GAUfLv9
-----END RSA PRIVATE KEY-----
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDpC46dDxO8UDSzzZLvcxgEGi4RRIBMQbxMsrOEtF9i8Dsq7Psb
F9n+KFCVCUU+oKjlOu+XdFobtpbMJYM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BOoCwl0qxGkw
xlJRczm/+FvqfJ4MHDECQQCBWUmQEakOh+CMU4CRJIDFWAsBHKNxJ6e+ob/PgmSb
s0xX8vJVSP8E5ZknGPtGeuQCV4pWfZNdNEpm3GAUfLv9
-----END RSA PRIVATE KEY-----
This diff is collapsed.
...@@ -14,6 +14,7 @@ import ansible_playbook ...@@ -14,6 +14,7 @@ import ansible_playbook
import sys, argparse import sys, argparse
from threading import Thread from threading import Thread
from time import sleep from time import sleep
import os.path
if len(sys.argv) > 1: if len(sys.argv) > 1:
...@@ -41,7 +42,12 @@ def handleDelivery(message): ...@@ -41,7 +42,12 @@ def handleDelivery(message):
node_num = 0 node_num = 0
vm_list = [] vm_list = []
current_milli_time = lambda: int(round(time.time() * 1000)) current_milli_time = lambda: int(round(time.time() * 1000))
path = os.path.dirname(os.path.abspath(__file__)) + "/"+ str(current_milli_time()) + "/" try:
path = os.path.dirname(os.path.abspath(__file__)) + "/"+ str(current_milli_time()) + "/"
except NameError:
import sys
path = os.path.dirname(os.path.abspath(sys.argv[0])) + "/"+ str(current_milli_time()) + "/"
if not os.path.exists(path): if not os.path.exists(path):
os.makedirs(path) os.makedirs(path)
...@@ -71,7 +77,11 @@ def handleDelivery(message): ...@@ -71,7 +77,11 @@ def handleDelivery(message):
elif name == "composer": elif name == "composer":
value = param["value"] value = param["value"]
compose_file = path + "docker-compose.yml" compose_file = path + "docker-compose.yml"
compose_name = param["attributes"]["name"] if not param["attributes"] == None and not param["attributes"]["name"] == None :
compose_name = param["attributes"]["name"]
else:
current_milli_time = lambda: int(round(time.time() * 1000))
compose_name = "service_"+str(current_milli_time())
fo = open(compose_file, "w") fo = open(compose_file, "w")
fo.write(value) fo.write(value)
fo.close() fo.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment