Commit a8a232c7 authored by Spiros Koulouzis's avatar Spiros Koulouzis

make params in plan optional

parent 012172a1
......@@ -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.04K</span></td>
<td><span class="downloadfile-size">18.03K</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">
......@@ -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.92K</span></td>
<td><span class="downloadfile-size">5.90K</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.58K</span></td>
<td><span class="downloadfile-size">6.57K</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">9.62K</span></td>
<td><span class="downloadfile-size">9.61K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......
......@@ -1147,69 +1147,69 @@ module Ansible
class BenchmarkResult < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
# (no documentation provided)
attr_accessor :start
attr_accessor :end
# (no documentation provided)
attr_accessor :delta
attr_accessor :host
# (no documentation provided)
attr_accessor :vmType
# (no documentation provided)
attr_accessor :end
# (no documentation provided)
attr_accessor :host
attr_accessor :start
# (no documentation provided)
attr_accessor :cloudDeploymentDomain
# (no documentation provided)
attr_accessor :delta
# the json hash for this BenchmarkResult
def to_jaxb_json_hash
_h = super
_h['start'] = start.to_jaxb_json_hash unless start.nil?
_h['delta'] = delta.to_jaxb_json_hash unless delta.nil?
_h['vmType'] = vmType.to_jaxb_json_hash unless vmType.nil?
_h['end'] = end.to_jaxb_json_hash unless end.nil?
_h['host'] = host.to_jaxb_json_hash unless host.nil?
_h['vmType'] = vmType.to_jaxb_json_hash unless vmType.nil?
_h['start'] = start.to_jaxb_json_hash unless start.nil?
_h['cloudDeploymentDomain'] = cloudDeploymentDomain.to_jaxb_json_hash unless cloudDeploymentDomain.nil?
_h['delta'] = delta.to_jaxb_json_hash unless delta.nil?
return _h
end
#initializes this BenchmarkResult with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['start'].nil?
_oa = _o['start']
if !_o['end'].nil?
_oa = _o['end']
if(_oa.is_a? Hash)
@start = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@start = Time.from_json(_oa) unless _oa['@class']
@end = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@end = Time.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@start = Array.new
@end = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@start.push Time.from_json(_item)
@end.push Time.from_json(_item)
else
@start.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@end.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@start = _oa
@end = _oa
end
end
if !_o['delta'].nil?
_oa = _o['delta']
if !_o['host'].nil?
_oa = _o['host']
if(_oa.is_a? Hash)
@delta = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@delta = Time.from_json(_oa) unless _oa['@class']
@host = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@host = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@delta = Array.new
@host = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@delta.push Time.from_json(_item)
@host.push String.from_json(_item)
else
@delta.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@host.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@delta = _oa
@host = _oa
end
end
if !_o['vmType'].nil?
......@@ -1231,61 +1231,61 @@ module Ansible
@vmType = _oa
end
end
if !_o['end'].nil?
_oa = _o['end']
if !_o['start'].nil?
_oa = _o['start']
if(_oa.is_a? Hash)
@end = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@end = Time.from_json(_oa) unless _oa['@class']
@start = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@start = Time.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@end = Array.new
@start = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@end.push Time.from_json(_item)
@start.push Time.from_json(_item)
else
@end.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@start.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@end = _oa
@start = _oa
end
end
if !_o['host'].nil?
_oa = _o['host']
if !_o['cloudDeploymentDomain'].nil?
_oa = _o['cloudDeploymentDomain']
if(_oa.is_a? Hash)
@host = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@host = String.from_json(_oa) unless _oa['@class']
@cloudDeploymentDomain = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@cloudDeploymentDomain = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@host = Array.new
@cloudDeploymentDomain = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@host.push String.from_json(_item)
@cloudDeploymentDomain.push String.from_json(_item)
else
@host.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@cloudDeploymentDomain.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@host = _oa
@cloudDeploymentDomain = _oa
end
end
if !_o['cloudDeploymentDomain'].nil?
_oa = _o['cloudDeploymentDomain']
if !_o['delta'].nil?
_oa = _o['delta']
if(_oa.is_a? Hash)
@cloudDeploymentDomain = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@cloudDeploymentDomain = String.from_json(_oa) unless _oa['@class']
@delta = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@delta = Time.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@cloudDeploymentDomain = Array.new
@delta = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@cloudDeploymentDomain.push String.from_json(_item)
@delta.push Time.from_json(_item)
else
@cloudDeploymentDomain.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@delta.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@cloudDeploymentDomain = _oa
@delta = _oa
end
end
end
......
......@@ -81,25 +81,25 @@ class</p>
</thead>
<tbody>
<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">end</span>
<td> <span class="property-name">host</span>
</td>
<td> <span class="datatype-reference">number
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
<tr>
<td> <span class="property-name">host</span>
<td> <span class="property-name">vmType</span>
</td>
<td> <span class="datatype-reference">string
</span>
......@@ -108,16 +108,16 @@ class</p>
</td>
</tr>
<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>
</td>
</tr>
<tr>
<td> <span class="property-name">start</span>
<td> <span class="property-name">end</span>
</td>
<td> <span class="datatype-reference">number
</span>
......@@ -126,9 +126,9 @@ class</p>
</td>
</tr>
<tr>
<td> <span class="property-name">cloudDeploymentDomain</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>
......@@ -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;delta&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;vmType&quot; : &quot;...&quot;,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;end&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;delta&quot; : 12345,
&quot;start&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&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_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_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_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_ProvisionResponse.html">ProvisionResponse</a>, <a href="json_MonitorringMessage.html">MonitorringMessage</a></dd>
</dl>
<table class="table datatype-properties">
......
......@@ -821,16 +821,16 @@ class]]>
<xs:complexContent>
<xs:extension base="ownedObject">
<xs:sequence>
<xs:element name="delta" type="xs:dateTime" minOccurs="0">
</xs:element>
<xs:element name="vmType" type="xs:string" minOccurs="0">
</xs:element>
<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>
<xs:element name="cloudDeploymentDomain" type="xs:string" 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>
</xs:sequence>
......
......@@ -144,12 +144,12 @@ Content-Type: application/json
<code class="prettyprint language-js">
[ {
&quot;delta&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;vmType&quot; : &quot;...&quot;,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;end&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;delta&quot; : 12345,
&quot;start&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&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;delta&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;vmType&quot; : &quot;...&quot;,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;end&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;delta&quot; : 12345,
&quot;start&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 1499793079011
......
......@@ -56,6 +56,7 @@
<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>
......@@ -527,6 +528,108 @@ 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,11 +220,11 @@ 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;delta&gt;...&lt;/delta&gt;
&lt;vmType&gt;...&lt;/vmType&gt;
&lt;start&gt;...&lt;/start&gt;
&lt;delta&gt;...&lt;/delta&gt;
&lt;end&gt;...&lt;/end&gt;
&lt;cloudDeploymentDomain&gt;us-east-1&lt;/cloudDeploymentDomain&gt;
&lt;vmType&gt;...&lt;/vmType&gt;
&lt;host&gt;147.228.242.58&lt;/host&gt;
&lt;owner&gt;user1&lt;/owner&gt;
&lt;/b-----&gt;
......
......@@ -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.04K</span></td>
<td><span class="downloadfile-size">18.03K</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">
......@@ -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.92K</span></td>
<td><span class="downloadfile-size">5.90K</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.58K</span></td>
<td><span class="downloadfile-size">6.57K</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">9.62K</span></td>
<td><span class="downloadfile-size">9.61K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......
......@@ -1147,69 +1147,69 @@ module Ansible
class BenchmarkResult < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
# (no documentation provided)
attr_accessor :start
attr_accessor :end
# (no documentation provided)
attr_accessor :delta
attr_accessor :host
# (no documentation provided)
attr_accessor :vmType
# (no documentation provided)
attr_accessor :end
# (no documentation provided)
attr_accessor :host
attr_accessor :start
# (no documentation provided)
attr_accessor :cloudDeploymentDomain
# (no documentation provided)
attr_accessor :delta
# the json hash for this BenchmarkResult
def to_jaxb_json_hash
_h = super
_h['start'] = start.to_jaxb_json_hash unless start.nil?
_h['delta'] = delta.to_jaxb_json_hash unless delta.nil?
_h['vmType'] = vmType.to_jaxb_json_hash unless vmType.nil?
_h['end'] = end.to_jaxb_json_hash unless end.nil?
_h['host'] = host.to_jaxb_json_hash unless host.nil?
_h['vmType'] = vmType.to_jaxb_json_hash unless vmType.nil?
_h['start'] = start.to_jaxb_json_hash unless start.nil?
_h['cloudDeploymentDomain'] = cloudDeploymentDomain.to_jaxb_json_hash unless cloudDeploymentDomain.nil?
_h['delta'] = delta.to_jaxb_json_hash unless delta.nil?
return _h
end
#initializes this BenchmarkResult with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['start'].nil?
_oa = _o['start']
if !_o['end'].nil?
_oa = _o['end']
if(_oa.is_a? Hash)
@start = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@start = Time.from_json(_oa) unless _oa['@class']
@end = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@end = Time.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@start = Array.new
@end = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@start.push Time.from_json(_item)
@end.push Time.from_json(_item)
else
@start.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@end.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@start = _oa
@end = _oa
end
end
if !_o['delta'].nil?
_oa = _o['delta']
if !_o['host'].nil?
_oa = _o['host']
if(_oa.is_a? Hash)
@delta = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@delta = Time.from_json(_oa) unless _oa['@class']
@host = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@host = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@delta = Array.new
@host = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@delta.push Time.from_json(_item)
@host.push String.from_json(_item)
else
@delta.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@host.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@delta = _oa
@host = _oa
end
end
if !_o['vmType'].nil?
......@@ -1231,61 +1231,61 @@ module Ansible
@vmType = _oa
end
end
if !_o['end'].nil?
_oa = _o['end']
if !_o['start'].nil?
_oa = _o['start']
if(_oa.is_a? Hash)
@end = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@end = Time.from_json(_oa) unless _oa['@class']
@start = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@start = Time.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@end = Array.new
@start = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@end.push Time.from_json(_item)
@start.push Time.from_json(_item)
else
@end.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@start.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@end = _oa
@start = _oa
end
end
if !_o['host'].nil?
_oa = _o['host']
if !_o['cloudDeploymentDomain'].nil?
_oa = _o['cloudDeploymentDomain']
if(_oa.is_a? Hash)
@host = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@host = String.from_json(_oa) unless _oa['@class']
@cloudDeploymentDomain = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@cloudDeploymentDomain = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@host = Array.new
@cloudDeploymentDomain = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@host.push String.from_json(_item)
@cloudDeploymentDomain.push String.from_json(_item)
else
@host.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@cloudDeploymentDomain.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@host = _oa
@cloudDeploymentDomain = _oa
end
end
if !_o['cloudDeploymentDomain'].nil?
_oa = _o['cloudDeploymentDomain']
if !_o['delta'].nil?
_oa = _o['delta']
if(_oa.is_a? Hash)
@cloudDeploymentDomain = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@cloudDeploymentDomain = String.from_json(_oa) unless _oa['@class']
@delta = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@delta = Time.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@cloudDeploymentDomain = Array.new
@delta = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@cloudDeploymentDomain.push String.from_json(_item)
@delta.push Time.from_json(_item)
else
@cloudDeploymentDomain.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@delta.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@cloudDeploymentDomain = _oa
@delta = _oa
end
end
end
......
......@@ -81,7 +81,7 @@ class</p>
</thead>
<tbody>
<tr>
<td> <span class="property-name">start</span>
<td> <span class="property-name">end</span>
</td>
<td> <span class="datatype-reference">number
</span>
......@@ -90,9 +90,9 @@ class</p>
</td>
</tr>
<tr>
<td> <span class="property-name">delta</span>
<td> <span class="property-name">host</span>
</td>
<td> <span class="datatype-reference">number
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description"></span>
......@@ -108,7 +108,7 @@ class</p>
</td>
</tr>
<tr>
<td> <span class="property-name">end</span>
<td> <span class="property-name">start</span>
</td>
<td> <span class="datatype-reference">number
</span>
......@@ -117,7 +117,7 @@ class</p>
</td>
</tr>
<tr>
<td> <span class="property-name">host</span>
<td> <span class="property-name">cloudDeploymentDomain</span>
</td>
<td> <span class="datatype-reference">string
</span>
......@@ -126,9 +126,9 @@ class</p>
</td>
</tr>
<tr>
<td> <span class="property-name">cloudDeploymentDomain</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>
......@@ -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;start&quot; : 12345,
&quot;delta&quot; : 12345,
&quot;vmType&quot; : &quot;...&quot;,
&quot;end&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;vmType&quot; : &quot;...&quot;,
&quot;start&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;delta&quot; : 12345,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 1499793079011
......
......@@ -821,18 +821,18 @@ class]]>
<xs:complexContent>
<xs:extension base="ownedObject">
<xs:sequence>
<xs:element name="delta" type="xs:dateTime" minOccurs="0">
<xs:element name="start" type="xs:dateTime" minOccurs="0">
</xs:element>
<xs:element name="cloudDeploymentDomain" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="start" type="xs:dateTime" minOccurs="0">
</xs:element>
<xs:element name="end" type="xs:dateTime" minOccurs="0">
<xs:element name="delta" 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>
<xs:element name="end" type="xs:dateTime" minOccurs="0">
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
......
......@@ -144,12 +144,12 @@ Content-Type: application/json
<code class="prettyprint language-js">
[ {
&quot;start&quot; : 12345,
&quot;delta&quot; : 12345,
&quot;vmType&quot; : &quot;...&quot;,
&quot;end&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;vmType&quot; : &quot;...&quot;,
&quot;start&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;delta&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;start&quot; : 12345,
&quot;delta&quot; : 12345,
&quot;vmType&quot; : &quot;...&quot;,
&quot;end&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;vmType&quot; : &quot;...&quot;,
&quot;start&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;delta&quot; : 12345,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 1499793079011
......
......@@ -56,6 +56,7 @@
<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>
......@@ -527,6 +528,108 @@ 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;delta&gt;...&lt;/delta&gt;
&lt;cloudDeploymentDomain&gt;us-east-1&lt;/cloudDeploymentDomain&gt;
&lt;start&gt;...&lt;/start&gt;
&lt;end&gt;...&lt;/end&gt;
&lt;cloudDeploymentDomain&gt;us-east-1&lt;/cloudDeploymentDomain&gt;
&lt;delta&gt;...&lt;/delta&gt;
&lt;vmType&gt;...&lt;/vmType&gt;
&lt;host&gt;147.228.242.58&lt;/host&gt;
&lt;end&gt;...&lt;/end&gt;
&lt;owner&gt;user1&lt;/owner&gt;
&lt;/b-----&gt;
</pre>
......
......@@ -74,6 +74,31 @@ 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).
*
......@@ -88,7 +113,6 @@ public class PlannerController {
String plan(@PathVariable("tosca_id") String toscaId,
@RequestParam(value = "preferred_provider", required = false) String preferredProvider,
@RequestParam(value = "max_vm", required = false) int maxVm) {
try {
PlanResponse plan = plannerService.getPlan(toscaId, preferredProvider, maxVm);
if (plan == null) {
......
File added
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