Commit 504e1228 authored by Spiros Koulouzis's avatar Spiros Koulouzis

Fix EC2.conf mapping

Rename script service 
parent 5d404579
......@@ -81,6 +81,12 @@
</td>
<td> <span class="datatype-description">This class represents the cloud credentials. They are used by the provisoner
to request for resources.</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_DeployParameter.html">
<td> <span class="datatype-name">DeployParameter</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="json_DeployRequest.html">
......@@ -242,6 +248,12 @@ from the machine the keys correspond to.</span>
</td>
<td> <span class="datatype-description">This class represents the cloud credentials. They are used by the provisoner
to request for resources.</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_deployParameter.html">
<td> <span class="datatype-name">deployParameter</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_deployRequest.html">
......
......@@ -91,7 +91,7 @@
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-gwt-json-overlay.jar">
<td><span class="downloadfile-name">drip-api-gwt-json-overlay.jar</span></td>
<td><span class="downloadfile-size">8.25K</span></td>
<td><span class="downloadfile-size">8.98K</span></td>
<td><span class="downloadfile-description">The sources for the GWT JSON overlay.</span></td>
</tr>
</tbody>
......@@ -116,12 +116,12 @@
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-json-client.jar">
<td><span class="downloadfile-name">drip-api-json-client.jar</span></td>
<td><span class="downloadfile-size">10.75K</span></td>
<td><span class="downloadfile-size">11.77K</span></td>
<td><span class="downloadfile-description">The binaries for the Java JSON client library.</span></td>
</tr>
<tr class="clickable-row" data-href="drip-api-json-client-json-sources.jar">
<td><span class="downloadfile-name">drip-api-json-client-json-sources.jar</span></td>
<td><span class="downloadfile-size">8.50K</span></td>
<td><span class="downloadfile-size">9.29K</span></td>
<td><span class="downloadfile-description">The sources for the Java JSON client library.</span></td>
</tr>
</tbody>
......@@ -144,12 +144,12 @@
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-xml-client.jar">
<td><span class="downloadfile-name">drip-api-xml-client.jar</span></td>
<td><span class="downloadfile-size">18.93K</span></td>
<td><span class="downloadfile-size">19.85K</span></td>
<td><span class="downloadfile-description">The binaries for the Java XML client library.</span></td>
</tr>
<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-size">17.11K</span></td>
<td><span class="downloadfile-size">17.89K</span></td>
<td><span class="downloadfile-description">The sources for the Java XML client library.</span></td>
</tr>
</tbody>
......@@ -184,7 +184,7 @@
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-js.zip">
<td><span class="downloadfile-name">drip-api-js.zip</span></td>
<td><span class="downloadfile-size">3.26K</span></td>
<td><span class="downloadfile-size">3.53K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......@@ -213,7 +213,7 @@
<tbody data-link="row" class="rowlink">
<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-size">3.40K</span></td>
<td><span class="downloadfile-size">3.72K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......@@ -245,7 +245,7 @@
<tbody data-link="row" class="rowlink">
<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-size">7.16K</span></td>
<td><span class="downloadfile-size">7.58K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......@@ -276,7 +276,7 @@
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api.rb">
<td><span class="downloadfile-name">drip-api.rb</span></td>
<td><span class="downloadfile-size">42.59K</span></td>
<td><span class="downloadfile-size">47.03K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......
This diff is collapsed.
......@@ -208,11 +208,13 @@ provisopned based on a TOSCA description.</span>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/provisioner/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/ids</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/{id}</span>
</samp></li></ul></td>
<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">POST</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">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for obtaining resources from cloud providers
......@@ -230,6 +232,27 @@ based the plan generated by the planner</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for obtaining resources from cloud providers
based the plan generated by the planner and uploaded by the user</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_ScriptController.html">
<td> <span class="resource-name">ScriptController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/script</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><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>
</samp></li><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for handling user scripts. These user can be
used by the provisoner to run on the created VMs.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_ToscaController.html">
......@@ -289,23 +312,6 @@ used by the planner.</span>
<td> <span class="resource-description">This controller is responsible for handling user public keys. These keys can
be used by the provisoner to allow the user to login to the VMs from the
machine the keys correspond to.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_UserScriptController.html">
<td> <span class="resource-name">UserScriptController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/user_script/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/{id}</span>
</samp></li></ul></td>
<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">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for handling user scripts. These user can be
used by the provisoner to run on the created VMs.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_UserScriptController0.html">
......@@ -339,6 +345,12 @@ used by the provisoner to run on the created VMs.</span>
</td>
<td> <span class="datatype-description">This class represents the cloud credentials. They are used by the provisoner
to request for resources.</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_DeployParameter.html">
<td> <span class="datatype-name">DeployParameter</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="json_DeployRequest.html">
......@@ -500,6 +512,12 @@ from the machine the keys correspond to.</span>
</td>
<td> <span class="datatype-description">This class represents the cloud credentials. They are used by the provisoner
to request for resources.</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_deployParameter.html">
<td> <span class="datatype-name">deployParameter</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_deployRequest.html">
......
......@@ -68,7 +68,7 @@
<dl class="dl-horizontal">
<dt>Subtypes</dt>
<dd><a href="json_Script.html">Script</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_ToscaRepresentation.html">ToscaRepresentation</a>, <a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_PlanResponse.html">PlanResponse</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_Key.html">Key</a>, <a href="json_CloudCredentials.html">CloudCredentials</a></dd>
<dd><a href="json_Script.html">Script</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_ToscaRepresentation.html">ToscaRepresentation</a>, <a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_PlanResponse.html">PlanResponse</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a>, <a href="json_Key.html">Key</a>, <a href="json_CloudCredentials.html">CloudCredentials</a></dd>
</dl>
<table class="table datatype-properties">
......
......@@ -100,16 +100,7 @@
</td>
</tr>
<tr>
<td> <span class="property-name">scriptID</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
<tr>
<td> <span class="property-name">userKeyID</span>
<td> <span class="property-name">publicKeyID</span>
</td>
<td> <span class="datatype-reference">string
</span>
......@@ -153,8 +144,7 @@
<pre class="prettyprint language-js example">{
&quot;cloudCredentialsID&quot; : &quot;...&quot;,
&quot;planID&quot; : &quot;...&quot;,
&quot;scriptID&quot; : &quot;...&quot;,
&quot;userKeyID&quot; : &quot;...&quot;,
&quot;publicKeyID&quot; : &quot;...&quot;,
&quot;keyValue&quot; : {
&quot;property1&quot; : { },
&quot;property2&quot; : { }
......
......@@ -79,6 +79,15 @@
</tr>
</thead>
<tbody>
<tr>
<td> <span class="property-name">deployParameters</span>
</td>
<td> <span class="datatype-reference">array of <a href="json_DeployParameter.html">DeployParameter</a>
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
</tbody>
<tr>
<td colspan="3"><h5 class="text-muted">Properties inherited from <a href="json_ProvisionRequest.html">ProvisionRequest</a></h5></td>
......@@ -97,13 +106,7 @@
<td><span class="property-description"></span></td>
</tr>
<tr>
<td><span class="property-name">scriptID</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-description"></span></td>
</tr>
<tr>
<td><span class="property-name">userKeyID</span></td>
<td><span class="property-name">publicKeyID</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-description"></span></td>
......@@ -142,10 +145,20 @@
<p class="lead">Example</p>
<pre class="prettyprint language-js example">{
&quot;deployParameters&quot; : [ {
&quot;cloudCertificateName&quot; : &quot;...&quot;,
&quot;IP&quot; : &quot;...&quot;,
&quot;user&quot; : &quot;...&quot;,
&quot;role&quot; : &quot;...&quot;
}, {
&quot;cloudCertificateName&quot; : &quot;...&quot;,
&quot;IP&quot; : &quot;...&quot;,
&quot;user&quot; : &quot;...&quot;,
&quot;role&quot; : &quot;...&quot;
} ],
&quot;cloudCredentialsID&quot; : &quot;...&quot;,
&quot;planID&quot; : &quot;...&quot;,
&quot;scriptID&quot; : &quot;...&quot;,
&quot;userKeyID&quot; : &quot;...&quot;,
&quot;publicKeyID&quot; : &quot;...&quot;,
&quot;keyValue&quot; : {
&quot;property1&quot; : { },
&quot;property2&quot; : { }
......
......@@ -280,6 +280,19 @@ to request for resources.]]>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="deployParameter">
<xs:sequence>
<xs:element name="cloudCertificateName" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="IP" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="user" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="role" type="xs:string" minOccurs="0">
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="deployRequest">
<xs:complexContent>
<xs:extension base="ownedObject">
......@@ -422,9 +435,7 @@ to specify the domain name for ec2]]>
</xs:element>
<xs:element name="planID" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="scriptID" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="userKeyID" type="xs:string" minOccurs="0">
<xs:element name="publicKeyID" type="xs:string" minOccurs="0">
</xs:element>
</xs:sequence>
</xs:extension>
......@@ -434,6 +445,10 @@ to specify the domain name for ec2]]>
<xs:complexType name="provisionResponse">
<xs:complexContent>
<xs:extension base="provisionRequest">
<xs:sequence>
<xs:element name="deployParameters" type="deployParameter" minOccurs="0" maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
......
......@@ -54,6 +54,7 @@
<li><a href="#resource_ProvisionController_deleteAll_DELETE"><abbr title="DELETE /user/v1.0/provisioner/all">DELETE /user/v1.0/provisioner/...</abbr></a></li>
<li><a href="#resource_ProvisionController_getIds_GET">GET /user/v1.0/provisioner/ids</a></li>
<li><a href="#resource_ProvisionController_provision_POST"><abbr title="POST /user/v1.0/provisioner/provision">POST /user/v1.0/provisioner/pr...</abbr></a></li>
<li><a href="#resource_ProvisionController_provision_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_get_GET"><abbr title="GET /user/v1.0/provisioner/{id}">GET /user/v1.0/provisioner/{id...</abbr></a></li>
<li class="divider"></li>
......@@ -261,8 +262,7 @@ Accept: application/json
{
&quot;cloudCredentialsID&quot; : &quot;...&quot;,
&quot;planID&quot; : &quot;...&quot;,
&quot;scriptID&quot; : &quot;...&quot;,
&quot;userKeyID&quot; : &quot;...&quot;,
&quot;publicKeyID&quot; : &quot;...&quot;,
&quot;keyValue&quot; : {
&quot;property1&quot; : { },
&quot;property2&quot; : { }
......@@ -288,6 +288,74 @@ Content-Type: application/json
</div>
</div>
<div id="resource_ProvisionController_provision_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/provisioner/sample <a href="../user/v1.0/provisioner/sample" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p></p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN, USER</dd>
</dl>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference"><a href="json_ProvisionRequest.html">ProvisionRequest</a>
(JSON)</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference"><a href="xml_ns0_provisionRequest.html">provisionRequest</a>
(XML)</span></td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<div class="container-fluid example panel">
<div class="row panel-body">
<div class="col-md-6">
<h5>Request</h5>
<pre>
GET /user/v1.0/provisioner/sample
Accept: application/json
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 200 Looks Good
Content-Type: application/json
<code class="prettyprint language-js">
{
&quot;cloudCredentialsID&quot; : &quot;...&quot;,
&quot;planID&quot; : &quot;...&quot;,
&quot;publicKeyID&quot; : &quot;...&quot;,
&quot;keyValue&quot; : {
&quot;property1&quot; : { },
&quot;property2&quot; : { }
},
&quot;id&quot; : &quot;...&quot;,
&quot;owner&quot; : &quot;...&quot;
}
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_ProvisionController_delete_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/provisioner/{id} <a href="../user/v1.0/provisioner/{id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
......@@ -437,10 +505,20 @@ Content-Type: application/json
<code class="prettyprint language-js">
{
&quot;deployParameters&quot; : [ {
&quot;cloudCertificateName&quot; : &quot;...&quot;,
&quot;IP&quot; : &quot;...&quot;,
&quot;user&quot; : &quot;...&quot;,
&quot;role&quot; : &quot;...&quot;
}, {
&quot;cloudCertificateName&quot; : &quot;...&quot;,
&quot;IP&quot; : &quot;...&quot;,
&quot;user&quot; : &quot;...&quot;,
&quot;role&quot; : &quot;...&quot;
} ],
&quot;cloudCredentialsID&quot; : &quot;...&quot;,
&quot;planID&quot; : &quot;...&quot;,
&quot;scriptID&quot; : &quot;...&quot;,
&quot;userKeyID&quot; : &quot;...&quot;,
&quot;publicKeyID&quot; : &quot;...&quot;,
&quot;keyValue&quot; : {
&quot;property1&quot; : { },
&quot;property2&quot; : { }
......
This diff is collapsed.
......@@ -200,11 +200,13 @@ provisopned based on a TOSCA description.</span>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/provisioner/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/ids</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/{id}</span>
</samp></li></ul></td>
<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">POST</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">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for obtaining resources from cloud providers
......@@ -222,6 +224,27 @@ based the plan generated by the planner</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for obtaining resources from cloud providers
based the plan generated by the planner and uploaded by the user</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_ScriptController.html">
<td> <span class="resource-name">ScriptController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/script</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><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>
</samp></li><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for handling user scripts. These user can be
used by the provisoner to run on the created VMs.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_ToscaController.html">
......@@ -281,23 +304,6 @@ used by the planner.</span>
<td> <span class="resource-description">This controller is responsible for handling user public keys. These keys can
be used by the provisoner to allow the user to login to the VMs from the
machine the keys correspond to.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_UserScriptController.html">
<td> <span class="resource-name">UserScriptController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/user_script/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/{id}</span>
</samp></li></ul></td>
<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">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for handling user scripts. These user can be
used by the provisoner to run on the created VMs.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_UserScriptController0.html">
......
......@@ -76,6 +76,12 @@
</td>
<td> <span class="datatype-description">This class represents the cloud credentials. They are used by the provisoner
to request for resources.</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_DeployParameter.html">
<td> <span class="datatype-name">DeployParameter</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="json_DeployRequest.html">
......
......@@ -143,6 +143,12 @@
</td>
<td> <span class="datatype-description">This class represents the cloud credentials. They are used by the provisoner
to request for resources.</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_deployParameter.html">
<td> <span class="datatype-name">deployParameter</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_deployRequest.html">
......
......@@ -125,7 +125,7 @@
</td>
</tr>
<tr>
<td> <span class="property-name">scriptID</span>
<td> <span class="property-name">publicKeyID</span>
</td>
<td> <span class="datatype-reference">string
</span>
......@@ -139,25 +139,7 @@
<td> <span class="property-minMaxOccurs">0/1
</span>
</td>
<td> <span class="property-description">the scriptID</span>
</td>
</tr>
<tr>
<td> <span class="property-name">userKeyID</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-type">element
</span>
</td>
<td> <span class="property-namespaceInfo">
</span>
</td>
<td> <span class="property-minMaxOccurs">0/1
</span>
</td>
<td> <span class="property-description">the userKeyID</span>
<td> <span class="property-description">the publicKeyID</span>
</td>
</tr>
</tbody>
......@@ -202,8 +184,7 @@
<pre class="prettyprint language-xml example">&lt;p-----&gt;
&lt;cloudCredentialsID&gt;...&lt;/cloudCredentialsID&gt;
&lt;planID&gt;...&lt;/planID&gt;
&lt;scriptID&gt;...&lt;/scriptID&gt;
&lt;userKeyID&gt;...&lt;/userKeyID&gt;
&lt;publicKeyID&gt;...&lt;/publicKeyID&gt;
&lt;id&gt;...&lt;/id&gt;
&lt;owner&gt;...&lt;/owner&gt;
&lt;/p-----&gt;
......
......@@ -86,6 +86,24 @@
</tr>
</thead>
<tbody>
<tr>
<td> <span class="property-name">deployParameters</span>
</td>
<td> <span class="datatype-reference"><a href="xml_ns0_deployParameter.html">deployParameter</a>
</span>
</td>
<td> <span class="property-type">element
</span>
</td>
<td> <span class="property-namespaceInfo">
</span>
</td>
<td> <span class="property-minMaxOccurs">0/unbounded
</span>
</td>
<td> <span class="property-description">the deployParameters</span>
</td>
</tr>
</tbody>
<tr>
<td colspan="6"><h5 class="text-muted">Properties inherited from <a href="xml_ns0_provisionRequest.html">provisionRequest</a></h5></td>
......@@ -116,19 +134,7 @@
<td><span class="property-description">the planID</span></td>
</tr>
<tr>
<td><span class="property-name">scriptID</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-type">element
</span></td>
<td><span class="property-namespaceInfo">
</span></td>
<td><span class="property-minMaxOccurs">0/1
</span></td>
<td><span class="property-description">the scriptID</span></td>
</tr>
<tr>
<td><span class="property-name">userKeyID</span></td>
<td><span class="property-name">publicKeyID</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-type">element
......@@ -137,7 +143,7 @@
</span></td>
<td><span class="property-minMaxOccurs">0/1
</span></td>
<td><span class="property-description">the userKeyID</span></td>
<td><span class="property-description">the publicKeyID</span></td>
</tr>
</tbody>
<tr>
......@@ -179,10 +185,15 @@
<p class="lead">Example</p>
<pre class="prettyprint language-xml example">&lt;p-----&gt;
&lt;deployParameters&gt;
&lt;cloudCertificateName&gt;...&lt;/cloudCertificateName&gt;
&lt;IP&gt;...&lt;/IP&gt;
&lt;user&gt;...&lt;/user&gt;
&lt;role&gt;...&lt;/role&gt;
&lt;/deployParameters&gt;
&lt;cloudCredentialsID&gt;...&lt;/cloudCredentialsID&gt;
&lt;planID&gt;...&lt;/planID&gt;
&lt;scriptID&gt;...&lt;/scriptID&gt;
&lt;userKeyID&gt;...&lt;/userKeyID&gt;
&lt;publicKeyID&gt;...&lt;/publicKeyID&gt;
&lt;id&gt;...&lt;/id&gt;
&lt;/p-----&gt;
</pre>
......
......@@ -79,7 +79,7 @@ public class ProvisionService {
private SimplePlannerService planService;
@Autowired
private UserScriptService userScriptService;
private ScriptService userScriptService;
@Autowired
private KeyService userKeysService;
......@@ -186,13 +186,7 @@ public class ProvisionService {
List<MessageParameter> topologies = buildTopologyParams(pReq.getPlanID());
parameters.addAll(topologies);
String scriptID = pReq.getscriptID();
if (scriptID != null) {
List<MessageParameter> userScripts = buildScriptParams(scriptID);
parameters.addAll(userScripts);
}
String userKeyID = pReq.getUserKeyID();
String userKeyID = pReq.getPublicKeyID();
if (userKeyID != null) {
List<MessageParameter> userKeys = buildKeysParams(userKeyID);
parameters.addAll(userKeys);
......
......@@ -33,7 +33,7 @@ import org.springframework.security.core.context.SecurityContextHolder;
*/
@Service
@PreAuthorize("isAuthenticated()")
public class UserScriptService {
public class ScriptService {
@Autowired
ScriptDao dao;
......
......@@ -37,7 +37,7 @@ import nl.uva.sne.drip.api.service.CloudCredentialsService;
import nl.uva.sne.drip.api.service.PlannerService;
import nl.uva.sne.drip.api.service.ProvisionService;
import nl.uva.sne.drip.api.service.KeyService;
import nl.uva.sne.drip.api.service.UserScriptService;
import nl.uva.sne.drip.api.service.ScriptService;
import nl.uva.sne.drip.api.service.UserService;
import nl.uva.sne.drip.commons.v0.types.Execute;
import nl.uva.sne.drip.commons.v0.types.Attribute;
......@@ -65,7 +65,7 @@ import org.springframework.web.bind.annotation.RequestBody;
public class ProvisionController0 {
@Autowired
private UserScriptService userScriptService;
private ScriptService userScriptService;
@Autowired
private KeyService userKeysService;
......@@ -108,12 +108,7 @@ public class ProvisionController0 {
List<Key> allKeys = userKeysService.findAll();
if (allKeys != null && !allKeys.isEmpty()) {
String userKeyID = allKeys.get(0).getId();
resp.setUserKeyID(userKeyID);
}
List<Script> allScripts = userScriptService.findAll();
if (allScripts != null && !allScripts.isEmpty()) {
String scriptID = allScripts.get(0).getId();
resp.setScriptID(scriptID);
resp.setPublicKeyID(userKeyID);
}
resp = provisionService.save(resp);
return "Success: Infrastructure files are uploaded! Action number: "
......
......@@ -62,7 +62,7 @@ public class UserPublicKeysController0 {
upk = service.save(upk);
ProvisionResponse provPlan = provisionService.findOne(confUserKey.action);
provPlan.setUserKeyID(upk.getId());
provPlan.setPublicKeyID(upk.getId());
provisionService.save(provPlan);
return "Success: " + upk.getId();
......
......@@ -21,7 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import nl.uva.sne.drip.api.service.UserScriptService;
import nl.uva.sne.drip.api.service.ScriptService;
import nl.uva.sne.drip.api.service.UserService;
import nl.uva.sne.drip.commons.v0.types.ConfScript;
import nl.uva.sne.drip.commons.v1.types.ProvisionResponse;
......@@ -43,10 +43,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
public class UserScriptController0 {
@Autowired
private UserScriptService scriptService;
@Autowired
private ProvisionService provisionService;
private ScriptService scriptService;
@RequestMapping(value = "/confscript", method = RequestMethod.POST, consumes = MediaType.TEXT_XML_VALUE)
@RolesAllowed({UserService.USER, UserService.ADMIN})
......@@ -55,11 +52,6 @@ public class UserScriptController0 {
Script script = new Script();
script.setContents(confScript.script);
script = scriptService.save(script);
ProvisionResponse provPlan = provisionService.findOne(confScript.action);
provPlan.setScriptID(script.getId());
provisionService.save(provPlan);
return "Success: script for GUI is uploaded: " + script.getId();
}
......
......@@ -31,8 +31,12 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import nl.uva.sne.drip.api.exception.NotFoundException;
import nl.uva.sne.drip.api.service.CloudCredentialsService;
import nl.uva.sne.drip.api.service.PlannerService;
import nl.uva.sne.drip.api.service.ProvisionService;
import nl.uva.sne.drip.api.service.UserService;
import nl.uva.sne.drip.commons.v1.types.CloudCredentials;
import nl.uva.sne.drip.commons.v1.types.PlanResponse;
import nl.uva.sne.drip.commons.v1.types.ProvisionResponse;
import org.json.JSONException;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -52,6 +56,12 @@ public class ProvisionController {
@Autowired
private ProvisionService provisionService;
@Autowired
private CloudCredentialsService cloudCredentialService;
@Autowired
private PlannerService plannServcie;
/**
* Gets the ProvisionRequest
*
......@@ -137,4 +147,16 @@ public class ProvisionController {
return null;
}
@RequestMapping(value = "/sample", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
ProvisionRequest provision() {
ProvisionRequest r = new ProvisionRequest();
r.setCloudCredentialsID("Cloud_Credentials_ID");
r.setPlanID("Plan_ID");
r.setPublicKeyID("Public_Key_ID");
return r;
}
}
......@@ -32,8 +32,9 @@ import org.springframework.web.multipart.MultipartFile;
import nl.uva.sne.drip.api.exception.NotFoundException;
import nl.uva.sne.drip.commons.v1.types.Script;
import org.springframework.web.bind.annotation.PathVariable;
import nl.uva.sne.drip.api.service.UserScriptService;
import nl.uva.sne.drip.api.service.ScriptService;
import nl.uva.sne.drip.api.service.UserService;
import org.springframework.web.bind.annotation.RequestBody;
/**
* This controller is responsible for handling user scripts. These user can be
......@@ -42,12 +43,12 @@ import nl.uva.sne.drip.api.service.UserService;
* @author S. Koulouzis
*/
@RestController
@RequestMapping("/user/v1.0/user_script")
@RequestMapping("/user/v1.0/script")
@Component
public class UserScriptController {
public class ScriptController {
@Autowired
private UserScriptService userScriptService;
private ScriptService scriptService;
// curl -v -X POST -F "file=@script.sh" localhost:8080/drip-api/rest/user_script/upload
/**
......@@ -57,7 +58,7 @@ public class UserScriptController {
* @return the ID of the stopred script
*/
@RequestMapping(value = "/upload", method = RequestMethod.POST)
@RolesAllowed({UserService.USER, UserService.ADMIN})
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String uploadUserScript(@RequestParam("file") MultipartFile file) {
if (!file.isEmpty()) {
......@@ -71,16 +72,23 @@ public class UserScriptController {
us.setContents(conents);
us.setName(name);
userScriptService.save(us);
scriptService.save(us);
return us.getId();
} catch (IOException | IllegalStateException ex) {
Logger.getLogger(UserScriptController.class.getName()).log(Level.SEVERE, null, ex);
Logger.getLogger(ScriptController.class.getName()).log(Level.SEVERE, null, ex);
}
}
return null;
}
@RequestMapping(method = RequestMethod.POST)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String uploadUserScript(@RequestBody Script script) {
return null;
}
/**
* Gets a script
*
......@@ -88,31 +96,52 @@ public class UserScriptController {
* @return the script
*/
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
Script get(@PathVariable("id") String id) {
return userScriptService.findOne(id);
return scriptService.findOne(id);
}
@RequestMapping(value = "/sample", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
Script get() {
Script script = new Script();
script.setContents("#! /bin/bash\n"
+ " apt-get update\n"
+ " apt-get -y install linux-image-extra-$(uname -r) linux-image-extra-virtual\n"
+ " apt-get -y install apt-transport-https ca-certificates curl software-properties-common\n"
+ " curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -\n"
+ " apt-key fingerprint 0EBFCD88\n"
+ " add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\"\n"
+ " apt-get update\n"
+ " apt-get -y install docker-ce\n"
+ " service docker restart");
script.setName("setupDocker.sh");
return script;
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody String delete(@PathVariable("id") String id) {
Script script = userScriptService.findOne(id);
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String delete(@PathVariable("id") String id) {
Script script = scriptService.findOne(id);
if (script == null) {
throw new NotFoundException();
}
userScriptService.delete(id);
scriptService.delete(id);
return "Deleted: " + id;
}
@RequestMapping(value = "/all", method = RequestMethod.DELETE)
@RolesAllowed({UserService.ADMIN})
public @ResponseBody String deleteAll() {
userScriptService.deleteAll();
@RequestMapping(value = "/all", method = RequestMethod.DELETE)
@RolesAllowed({UserService.ADMIN})
public @ResponseBody
String deleteAll() {
scriptService.deleteAll();
return "Done";
}
/**
* Gets the IDs of all the stored scripts
*
......@@ -121,7 +150,7 @@ public class UserScriptController {
@RequestMapping(value = "/ids", method = RequestMethod.GET)
public @ResponseBody
List<String> getIds() {
List<Script> all = userScriptService.findAll();
List<Script> all = scriptService.findAll();
List<String> ids = new ArrayList<>();
for (Script us : all) {
ids.add(us.getId());
......
......@@ -141,8 +141,8 @@ public class Converter {
}
private static void initEC2_NAME_MAP() {
EC2_NAME_MAP.put("keyIdAlias", "AWSAccessKeyId");
EC2_NAME_MAP.put("key", "AWSSecretKey");
EC2_NAME_MAP.put(CloudCredentials.ACCESS_KEY_NAME, "AWSAccessKeyId");
EC2_NAME_MAP.put(CloudCredentials.SECRET_KEY_NAME, "AWSSecretKey");
}
public static Message string2Message(String clean) throws JSONException, IOException {
......
......@@ -29,6 +29,9 @@ import org.springframework.data.mongodb.core.mapping.Document;
@Document
public class CloudCredentials extends OwnedObject {
public static String ACCESS_KEY_NAME = "accessKeyId";
public static String SECRET_KEY_NAME = "secretKey";
@Id
private String id;
......
......@@ -15,7 +15,6 @@
*/
package nl.uva.sne.drip.commons.v1.types;
import java.util.List;
import org.springframework.data.mongodb.core.mapping.Document;
/**
......@@ -29,9 +28,7 @@ public class ProvisionRequest extends KeyValueHolder {
private String planID;
private String scriptID;
private String userKeyID;
private String publicKeyID;
/**
* @return the cloudCredentialsID
......@@ -62,34 +59,16 @@ public class ProvisionRequest extends KeyValueHolder {
}
/**
* @return the scriptID
*/
public String getscriptID() {
return scriptID;
}
/**
* @param scriptID the scriptID to set
* @return the publicKeyID
*/
public void setScriptID(String scriptID) {
this.scriptID = scriptID;
public String getPublicKeyID() {
return publicKeyID;
}
/**
* @return the userKeyID
* @param userKeyID the publicKeyID to set
*/
public String getUserKeyID() {
return userKeyID;
}
/**
* @param userKeyID the userKeyID to set
*/
public void setUserKeyID(String userKeyID) {
this.userKeyID = userKeyID;
}
public void setDeployParameters(List<DeployParameter> deployParameters) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
public void setPublicKeyID(String userKeyID) {
this.publicKeyID = userKeyID;
}
}
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