Commit f26a9370 authored by Spiros Koulouzis's avatar Spiros Koulouzis

make params in plan optional.

parent a8a232c7
......@@ -116,7 +116,7 @@
<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">18.03K</span></td>
<td><span class="downloadfile-size">18.04K</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">
......@@ -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">25.70K</span></td>
<td><span class="downloadfile-size">25.69K</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">23.28K</span></td>
<td><span class="downloadfile-size">23.27K</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">5.90K</span></td>
<td><span class="downloadfile-size">5.93K</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">6.57K</span></td>
<td><span class="downloadfile-size">6.77K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......
This diff is collapsed.
......@@ -81,9 +81,9 @@ class</p>
</thead>
<tbody>
<tr>
<td> <span class="property-name">delta</span>
<td> <span class="property-name">cloudDeploymentDomain</span>
</td>
<td> <span class="datatype-reference">number
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description"></span>
......@@ -99,16 +99,16 @@ class</p>
</td>
</tr>
<tr>
<td> <span class="property-name">vmType</span>
<td> <span class="property-name">delta</span>
</td>
<td> <span class="datatype-reference">string
<td> <span class="datatype-reference">number
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
<tr>
<td> <span class="property-name">cloudDeploymentDomain</span>
<td> <span class="property-name">vmType</span>
</td>
<td> <span class="datatype-reference">string
</span>
......@@ -167,10 +167,10 @@ No need to set during a POST</span></td>
<p class="lead">Example</p>
<pre class="prettyprint language-js example">{
&quot;delta&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;delta&quot; : 12345,
&quot;vmType&quot; : &quot;...&quot;,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;end&quot; : 12345,
&quot;start&quot; : 12345,
&quot;owner&quot; : &quot;user1&quot;,
......
......@@ -823,15 +823,15 @@ class]]>
<xs:sequence>
<xs:element name="start" type="xs:dateTime" minOccurs="0">
</xs:element>
<xs:element name="delta" type="xs:dateTime" minOccurs="0">
</xs:element>
<xs:element name="end" type="xs:dateTime" minOccurs="0">
<xs:element name="host" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="cloudDeploymentDomain" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="end" type="xs:dateTime" minOccurs="0">
</xs:element>
<xs:element name="vmType" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="host" type="xs:string" minOccurs="0">
<xs:element name="delta" type="xs:dateTime" minOccurs="0">
</xs:element>
</xs:sequence>
</xs:extension>
......
......@@ -144,10 +144,10 @@ Content-Type: application/json
<code class="prettyprint language-js">
[ {
&quot;delta&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;delta&quot; : 12345,
&quot;vmType&quot; : &quot;...&quot;,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;end&quot; : 12345,
&quot;start&quot; : 12345,
&quot;owner&quot; : &quot;user1&quot;,
......@@ -514,10 +514,10 @@ Content-Type: application/json
<code class="prettyprint language-js">
{
&quot;delta&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;delta&quot; : 12345,
&quot;vmType&quot; : &quot;...&quot;,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;end&quot; : 12345,
&quot;start&quot; : 12345,
&quot;owner&quot; : &quot;user1&quot;,
......
......@@ -56,7 +56,6 @@
<li><a href="#resource_PlannerController_verifyPlan_POST"><abbr title="POST /user/v1.0/planner/vereify_plan">POST /user/v1.0/planner/vereif...</abbr></a></li>
<li><a href="#resource_PlannerController_delete_DELETE">DELETE /user/v1.0/planner/{id}</a></li>
<li><a href="#resource_PlannerController_get_GET">GET /user/v1.0/planner/{id}</a></li>
<li><a href="#resource_PlannerController_planWithProvider_GET"><abbr title="GET /user/v1.0/planner/plan/{tosca_id}">GET /user/v1.0/planner/plan/{t...</abbr></a></li>
<li><a href="#resource_PlannerController_plan_GET"><abbr title="GET /user/v1.0/planner/plan/{tosca_id}">GET /user/v1.0/planner/plan/{t...</abbr></a></li>
<li><a href="#resource_PlannerController_postTop_POST"><abbr title="POST /user/v1.0/planner/post/{name}">POST /user/v1.0/planner/post/{...</abbr></a></li>
<li><a href="#resource_PlannerController_getToscaID_GET"><abbr title="GET /user/v1.0/planner/tosca/{id}">GET /user/v1.0/planner/tosca/{...</abbr></a></li>
......@@ -528,108 +527,6 @@ Content-Type: application/json
</div>
</div>
<div id="resource_PlannerController_planWithProvider_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/planner/plan/{tosca_id} <a href="../user/v1.0/planner/plan/{tosca_id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Plans resources (number, size of VMs etc).</p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN, USER</dd>
</dl>
<table class="table resource-parameters">
<caption>Request Parameters</caption>
<thead>
<tr>
<th>name</th>
<th>type</th>
<th>description</th>
<th>constraints</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parameter-name">tosca_id</span></td>
<td>path</td>
<td><span class="parameter-description">&nbsp;</span></td>
<td><span class="parameter-constraints">required</span></td>
</tr>
<tr>
<td><span class="parameter-name">preferred_provider</span></td>
<td>query</td>
<td><span class="parameter-description">&nbsp;</span></td>
<td><span class="parameter-constraints">&nbsp;</span></td>
</tr>
</tbody>
</table>
<table class="table resource-response-codes">
<caption>Response Codes</caption>
<thead>
<tr>
<th>code</th>
<th>condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="label label-warning response-code">401</span></td>
<td><span class="response-condition">Bad credentials</span></td>
</tr>
</tbody>
</table>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
<th>description</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">string
(JSON)</span></td>
<td rowspan="2" class="multi-row-description"><span class="response-description">the id of the created plan</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">string
(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/planner/plan/{tosca_id}
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-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_PlannerController_plan_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/planner/plan/{tosca_id} <a href="../user/v1.0/planner/plan/{tosca_id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
......
......@@ -221,11 +221,11 @@ It is created automatically. No need to set during a POST</span></td>
<pre class="prettyprint language-xml example">&lt;b-----&gt;
&lt;start&gt;...&lt;/start&gt;
&lt;delta&gt;...&lt;/delta&gt;
&lt;end&gt;...&lt;/end&gt;
&lt;host&gt;147.228.242.58&lt;/host&gt;
&lt;cloudDeploymentDomain&gt;us-east-1&lt;/cloudDeploymentDomain&gt;
&lt;end&gt;...&lt;/end&gt;
&lt;vmType&gt;...&lt;/vmType&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;/b-----&gt;
</pre>
......
......@@ -116,7 +116,7 @@
<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">18.03K</span></td>
<td><span class="downloadfile-size">18.04K</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">
......@@ -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">25.70K</span></td>
<td><span class="downloadfile-size">25.69K</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">23.28K</span></td>
<td><span class="downloadfile-size">23.27K</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">5.90K</span></td>
<td><span class="downloadfile-size">5.93K</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">6.57K</span></td>
<td><span class="downloadfile-size">6.77K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......
This diff is collapsed.
......@@ -81,9 +81,9 @@ class</p>
</thead>
<tbody>
<tr>
<td> <span class="property-name">end</span>
<td> <span class="property-name">vmType</span>
</td>
<td> <span class="datatype-reference">number
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description"></span>
......@@ -99,16 +99,16 @@ class</p>
</td>
</tr>
<tr>
<td> <span class="property-name">vmType</span>
<td> <span class="property-name">start</span>
</td>
<td> <span class="datatype-reference">string
<td> <span class="datatype-reference">number
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
<tr>
<td> <span class="property-name">start</span>
<td> <span class="property-name">delta</span>
</td>
<td> <span class="datatype-reference">number
</span>
......@@ -126,7 +126,7 @@ class</p>
</td>
</tr>
<tr>
<td> <span class="property-name">delta</span>
<td> <span class="property-name">end</span>
</td>
<td> <span class="datatype-reference">number
</span>
......@@ -167,12 +167,12 @@ No need to set during a POST</span></td>
<p class="lead">Example</p>
<pre class="prettyprint language-js example">{
&quot;end&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;vmType&quot; : &quot;...&quot;,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;start&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;delta&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;end&quot; : 12345,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 1499793079011
......
......@@ -69,7 +69,7 @@ class</p>
<dl class="dl-horizontal">
<dt>Subtypes</dt>
<dd><a href="json_KeyPair.html">KeyPair</a>, <a href="json_AnsibleOutput.html">AnsibleOutput</a>, <a href="json_ScaleRequest.html">ScaleRequest</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_DRIPLogRecord.html">DRIPLogRecord</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_MonitorringMessage.html">MonitorringMessage</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a></dd>
<dd><a href="json_KeyPair.html">KeyPair</a>, <a href="json_ScaleRequest.html">ScaleRequest</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_DRIPLogRecord.html">DRIPLogRecord</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>, <a href="json_MonitorringMessage.html">MonitorringMessage</a></dd>
</dl>
<table class="table datatype-properties">
......
......@@ -821,17 +821,17 @@ class]]>
<xs:complexContent>
<xs:extension base="ownedObject">
<xs:sequence>
<xs:element name="start" type="xs:dateTime" minOccurs="0">
<xs:element name="end" type="xs:dateTime" minOccurs="0">
</xs:element>
<xs:element name="cloudDeploymentDomain" type="xs:string" minOccurs="0">
<xs:element name="start" type="xs:dateTime" minOccurs="0">
</xs:element>
<xs:element name="delta" type="xs:dateTime" minOccurs="0">
</xs:element>
<xs:element name="vmType" type="xs:string" minOccurs="0">
<xs:element name="cloudDeploymentDomain" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="host" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="end" type="xs:dateTime" minOccurs="0">
<xs:element name="vmType" type="xs:string" minOccurs="0">
</xs:element>
</xs:sequence>
</xs:extension>
......
......@@ -144,12 +144,12 @@ Content-Type: application/json
<code class="prettyprint language-js">
[ {
&quot;end&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;vmType&quot; : &quot;...&quot;,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;start&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;delta&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;end&quot; : 12345,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 1499793079011
......@@ -514,12 +514,12 @@ Content-Type: application/json
<code class="prettyprint language-js">
{
&quot;end&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;vmType&quot; : &quot;...&quot;,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;start&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;delta&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;end&quot; : 12345,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 1499793079011
......
......@@ -56,7 +56,6 @@
<li><a href="#resource_PlannerController_verifyPlan_POST"><abbr title="POST /user/v1.0/planner/vereify_plan">POST /user/v1.0/planner/vereif...</abbr></a></li>
<li><a href="#resource_PlannerController_delete_DELETE">DELETE /user/v1.0/planner/{id}</a></li>
<li><a href="#resource_PlannerController_get_GET">GET /user/v1.0/planner/{id}</a></li>
<li><a href="#resource_PlannerController_planWithProvider_GET"><abbr title="GET /user/v1.0/planner/plan/{tosca_id}">GET /user/v1.0/planner/plan/{t...</abbr></a></li>
<li><a href="#resource_PlannerController_plan_GET"><abbr title="GET /user/v1.0/planner/plan/{tosca_id}">GET /user/v1.0/planner/plan/{t...</abbr></a></li>
<li><a href="#resource_PlannerController_postTop_POST"><abbr title="POST /user/v1.0/planner/post/{name}">POST /user/v1.0/planner/post/{...</abbr></a></li>
<li><a href="#resource_PlannerController_getToscaID_GET"><abbr title="GET /user/v1.0/planner/tosca/{id}">GET /user/v1.0/planner/tosca/{...</abbr></a></li>
......@@ -528,108 +527,6 @@ Content-Type: application/json
</div>
</div>
<div id="resource_PlannerController_planWithProvider_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/planner/plan/{tosca_id} <a href="./user/v1.0/planner/plan/{tosca_id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Plans resources (number, size of VMs etc).</p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN, USER</dd>
</dl>
<table class="table resource-parameters">
<caption>Request Parameters</caption>
<thead>
<tr>
<th>name</th>
<th>type</th>
<th>description</th>
<th>constraints</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parameter-name">tosca_id</span></td>
<td>path</td>
<td><span class="parameter-description">&nbsp;</span></td>
<td><span class="parameter-constraints">required</span></td>
</tr>
<tr>
<td><span class="parameter-name">preferred_provider</span></td>
<td>query</td>
<td><span class="parameter-description">&nbsp;</span></td>
<td><span class="parameter-constraints">&nbsp;</span></td>
</tr>
</tbody>
</table>
<table class="table resource-response-codes">
<caption>Response Codes</caption>
<thead>
<tr>
<th>code</th>
<th>condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="label label-warning response-code">401</span></td>
<td><span class="response-condition">Bad credentials</span></td>
</tr>
</tbody>
</table>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
<th>description</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">string
(JSON)</span></td>
<td rowspan="2" class="multi-row-description"><span class="response-description">the id of the created plan</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">string
(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/planner/plan/{tosca_id}
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-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_PlannerController_plan_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/planner/plan/{tosca_id} <a href="./user/v1.0/planner/plan/{tosca_id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
......
......@@ -220,12 +220,12 @@ It is created automatically. No need to set during a POST</span></td>
<p class="lead">Example</p>
<pre class="prettyprint language-xml example">&lt;b-----&gt;
&lt;end&gt;...&lt;/end&gt;
&lt;start&gt;...&lt;/start&gt;
&lt;cloudDeploymentDomain&gt;us-east-1&lt;/cloudDeploymentDomain&gt;
&lt;delta&gt;...&lt;/delta&gt;
&lt;vmType&gt;...&lt;/vmType&gt;
&lt;cloudDeploymentDomain&gt;us-east-1&lt;/cloudDeploymentDomain&gt;
&lt;host&gt;147.228.242.58&lt;/host&gt;
&lt;end&gt;...&lt;/end&gt;
&lt;vmType&gt;...&lt;/vmType&gt;
&lt;owner&gt;user1&lt;/owner&gt;
&lt;/b-----&gt;
</pre>
......
......@@ -79,9 +79,9 @@ public class PlannerService {
logger.addHandler(new DRIPLogHandler(messageBrokerHost));
}
public PlanResponse getPlan(String toscaId, String cloudProvider, int maxVM) throws JSONException, UnsupportedEncodingException, IOException, TimeoutException, InterruptedException {
public PlanResponse getPlan(String toscaId, String cloudProvider, Integer maxVM) throws JSONException, UnsupportedEncodingException, IOException, TimeoutException, InterruptedException {
try (DRIPCaller planner = new PlannerCaller(messageBrokerHost)) {
Message plannerInvokationMessage = buildPlannerMessage(toscaId,maxVM);
Message plannerInvokationMessage = buildPlannerMessage(toscaId, maxVM);
logger.log(Level.INFO, "Calling planner");
plannerInvokationMessage.setOwner(((User) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getUsername());
Message plannerReturnedMessage = (planner.call(plannerInvokationMessage));
......@@ -131,7 +131,7 @@ public class PlannerService {
}
}
private Message buildPlannerMessage(String toscaId, int maxVM) throws JSONException, UnsupportedEncodingException {
private Message buildPlannerMessage(String toscaId, Integer maxVM) throws JSONException, UnsupportedEncodingException {
ToscaRepresentation toscaRepresentation = toscaService.findOne(toscaId);
if (toscaRepresentation == null) {
throw new BadRequestException();
......@@ -152,12 +152,13 @@ public class PlannerService {
jsonArgument.setName("tosca_input");
parameters.add(jsonArgument);
if (maxVM != null) {
MessageParameter maxVMsArgument = new MessageParameter();
maxVMsArgument.setValue(String.valueOf(maxVM));
maxVMsArgument.setEncoding(charset);
maxVMsArgument.setName("max_vm");
parameters.add(maxVMsArgument);
}
invokationMessage.setParameters(parameters);
invokationMessage.setCreationDate((System.currentTimeMillis()));
......
......@@ -74,31 +74,6 @@ public class PlannerController {
return plannerService.verify(toscaContents);
}
/**
* Plans resources (number, size of VMs etc).
*
* @param toscaId. The id of the TOSCA description
* @param preferredProvider
*
* @return the id of the created plan
*/
@RequestMapping(value = "/plan/{tosca_id}", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String planWithProvider(@PathVariable("tosca_id") String toscaId,
@RequestParam(value = "preferred_provider", required = false) String preferredProvider) {
try {
PlanResponse plan = plannerService.getPlan(toscaId, preferredProvider, -1);
if (plan == null) {
throw new NotFoundException("Could not make plan");
}
return plan.getId();
} catch (JSONException | IOException | TimeoutException | InterruptedException ex) {
Logger.getLogger(PlannerController.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
}
/**
* Plans resources (number, size of VMs etc).
*
......@@ -107,12 +82,12 @@ public class PlannerController {
* @param maxVm
* @return the id of the created plan
*/
@RequestMapping(value = "/plan/{tosca_id}", method = RequestMethod.GET, params = {"preferred_provider", "max_vm"})
@RequestMapping(value = "/plan/{tosca_id}", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String plan(@PathVariable("tosca_id") String toscaId,
@RequestParam(value = "preferred_provider", required = false) String preferredProvider,
@RequestParam(value = "max_vm", required = false) int maxVm) {
@RequestParam(value = "max_vm", required = false) Integer maxVm) {
try {
PlanResponse plan = plannerService.getPlan(toscaId, preferredProvider, maxVm);
if (plan == null) {
......
......@@ -14,8 +14,6 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import nl.uva.sne.drip.commons.utils.Converter;
import nl.uva.sne.drip.drip.converter.provisionerIn.*;
import nl.uva.sne.drip.drip.converter.provisionerIn.EC2.*;
......@@ -142,12 +140,16 @@ public class P2PConverter {
return "t2.medium";
}
if (size > 4 && size <= 5) {
return "t2.large";
return "t2.medium";
}
if (size > 5 && size <= 6) {
return "t2.large";
}
if (size > 6 && size <= 7) {
return "t2.xlarge";
}
if (size > 6) {
if (size > 7) {
return "t2.2xlarge";
}
return "t2.medium";
......
File deleted
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