Commit 8991bf18 authored by Spiros Koulouzis's avatar Spiros Koulouzis

changed controller name to configure controller

fixed bug of missing ids in provision response 
parent a7d5e9ad
......@@ -72,7 +72,7 @@
<h1 class="page-header">Files and Libraries</h1>
<h3 id="artifact_gwt_json_overlay">GWT JSON Overlay</h3>
<p class="lead">Created April 3, 2017</p>
<p class="lead">Created April 4, 2017</p>
<p> <p>
The <a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a> JSON Overlay library provides the JSON Overlays that
can be used to access the Web service API for this application.
......@@ -97,7 +97,7 @@
</tbody>
</table>
<h3 id="artifact_java_json_client_library">Java JSON Client Library</h3>
<p class="lead">Created April 3, 2017</p>
<p class="lead">Created April 4, 2017</p>
<p><p>
The Java client-side library is used to provide the set of Java objects that can be serialized
to/from JSON using <a href="http://jackson.codehaus.org/">Jackson</a>. This is useful for accessing the
......@@ -127,7 +127,7 @@
</tbody>
</table>
<h3 id="artifact_java_xml_client_library">Java XML Client Library</h3>
<p class="lead">Created April 3, 2017</p>
<p class="lead">Created April 4, 2017</p>
<p><p>
The Java client-side library is used to access the Web service API for this application using Java.
</p>
......@@ -155,7 +155,7 @@
</tbody>
</table>
<h3 id="artifact_js_client_library">JavaScript Client Library</h3>
<p class="lead">Created April 3, 2017</p>
<p class="lead">Created April 4, 2017</p>
<p><p>
The JavaScript client-side library defines classes that can be (de)serialized to/from JSON.
This is useful for accessing the resources that are published by this application, but only
......@@ -190,7 +190,7 @@
</tbody>
</table>
<h3 id="artifact_php_json_client_library">PHP JSON Client Library</h3>
<p class="lead">Created April 3, 2017</p>
<p class="lead">Created April 4, 2017</p>
<p><p>
The PHP JSON client-side library defines the PHP classes that can be (de)serialized to/from JSON.
This is useful for accessing the resources that are published by this application, but only
......@@ -213,13 +213,13 @@
<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.75K</span></td>
<td><span class="downloadfile-size">3.76K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
</table>
<h3 id="artifact_php_xml_client_library">PHP XML Client Library</h3>
<p class="lead">Created April 3, 2017</p>
<p class="lead">Created April 4, 2017</p>
<p><p>
The PHP client-side library defines the PHP classes that can be (de)serialized to/from XML.
This is useful for accessing the resources that are published by this application, but only
......@@ -251,7 +251,7 @@
</tbody>
</table>
<h3 id="artifact_ruby_json_client_library">Ruby JSON Client Library</h3>
<p class="lead">Created April 3, 2017</p>
<p class="lead">Created April 4, 2017</p>
<p><p>
The Ruby JSON client-side library defines the Ruby classes that can be (de)serialized to/from JSON.
This is useful for accessing the REST endpoints that are published by this application, but only
......
......@@ -599,8 +599,8 @@ module Types
# the provisionID
attr_accessor :provisionID
# the clusterType
attr_accessor :clusterType
# the managerType
attr_accessor :managerType
# the configurationID
attr_accessor :configurationID
......@@ -608,7 +608,7 @@ module Types
def to_jaxb_json_hash
_h = super
_h['provisionID'] = provisionID.to_jaxb_json_hash unless provisionID.nil?
_h['clusterType'] = clusterType.to_jaxb_json_hash unless clusterType.nil?
_h['managerType'] = managerType.to_jaxb_json_hash unless managerType.nil?
_h['configurationID'] = configurationID.to_jaxb_json_hash unless configurationID.nil?
return _h
end
......@@ -635,23 +635,23 @@ module Types
@provisionID = _oa
end
end
if !_o['clusterType'].nil?
_oa = _o['clusterType']
if !_o['managerType'].nil?
_oa = _o['managerType']
if(_oa.is_a? Hash)
@clusterType = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@clusterType = String.from_json(_oa) unless _oa['@class']
@managerType = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@managerType = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@clusterType = Array.new
@managerType = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@clusterType.push String.from_json(_item)
@managerType.push String.from_json(_item)
else
@clusterType.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@managerType.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@clusterType = _oa
@managerType = _oa
end
end
if !_o['configurationID'].nil?
......@@ -1417,43 +1417,65 @@ module V1
module Types
# (no documentation provided)
class ToscaRepresentation < Nl::Uva::Sne::Drip::Commons::V1::Types::KeyValueHolder
class DeployResponse < Nl::Uva::Sne::Drip::Commons::V1::Types::DeployRequest
# the name
attr_accessor :name
# (no documentation provided)
attr_accessor :key
# the id
attr_accessor :id
# the json hash for this ToscaRepresentation
# the json hash for this DeployResponse
def to_jaxb_json_hash
_h = super
_h['name'] = name.to_jaxb_json_hash unless name.nil?
_h['key'] = key.to_jaxb_json_hash unless key.nil?
_h['id'] = id.to_jaxb_json_hash unless id.nil?
return _h
end
#initializes this ToscaRepresentation with a json hash
#initializes this DeployResponse with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['name'].nil?
_oa = _o['name']
if !_o['key'].nil?
_oa = _o['key']
if(_oa.is_a? Hash)
@name = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@name = String.from_json(_oa) unless _oa['@class']
@key = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@key = Nl::Uva::Sne::Drip::Commons::V1::Types::Key.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@name = Array.new
@key = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@name.push String.from_json(_item)
@key.push Nl::Uva::Sne::Drip::Commons::V1::Types::Key.from_json(_item)
else
@name.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@key.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@name = _oa
@key = _oa
end
end
if !_o['id'].nil?
_oa = _o['id']
if(_oa.is_a? Hash)
@id = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@id = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@id = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@id.push String.from_json(_item)
else
@id.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@id = _oa
end
end
end
# constructs a ToscaRepresentation from a (parsed) JSON hash
# constructs a DeployResponse from a (parsed) JSON hash
def self.from_json(o)
if o.nil?
return nil
......@@ -1494,65 +1516,43 @@ module V1
module Types
# (no documentation provided)
class DeployResponse < Nl::Uva::Sne::Drip::Commons::V1::Types::DeployRequest
class ToscaRepresentation < Nl::Uva::Sne::Drip::Commons::V1::Types::KeyValueHolder
# (no documentation provided)
attr_accessor :key
# the id
attr_accessor :id
# the name
attr_accessor :name
# the json hash for this DeployResponse
# the json hash for this ToscaRepresentation
def to_jaxb_json_hash
_h = super
_h['key'] = key.to_jaxb_json_hash unless key.nil?
_h['id'] = id.to_jaxb_json_hash unless id.nil?
_h['name'] = name.to_jaxb_json_hash unless name.nil?
return _h
end
#initializes this DeployResponse with a json hash
#initializes this ToscaRepresentation with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['key'].nil?
_oa = _o['key']
if(_oa.is_a? Hash)
@key = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@key = Nl::Uva::Sne::Drip::Commons::V1::Types::Key.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@key = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@key.push Nl::Uva::Sne::Drip::Commons::V1::Types::Key.from_json(_item)
else
@key.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@key = _oa
end
end
if !_o['id'].nil?
_oa = _o['id']
if !_o['name'].nil?
_oa = _o['name']
if(_oa.is_a? Hash)
@id = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@id = String.from_json(_oa) unless _oa['@class']
@name = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@name = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@id = Array.new
@name = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@id.push String.from_json(_item)
@name.push String.from_json(_item)
else
@id.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@name.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@id = _oa
@name = _oa
end
end
end
# constructs a DeployResponse from a (parsed) JSON hash
# constructs a ToscaRepresentation from a (parsed) JSON hash
def self.from_json(o)
if o.nil?
return nil
......
......@@ -118,19 +118,40 @@ provisoner to request for resources (VMs).</span>
<td> <span class="resource-description">This controller is responsible for handling CloudCredentials.
CloudCredentials are a represntation of the credentials that are used by the
provisoner to request for resources (VMs)</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_ConfigurationController.html">
<td> <span class="resource-name">ConfigurationController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/deployer/configuration/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/configuration/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/configuration/post</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/configuration/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/configuration/{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">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 storing PlayBook descriptions that can be
used by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_DeployController.html">
<td> <span class="resource-name">DeployController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/deployer/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/deploy/</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/deploy</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/{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">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">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 deploying a cluster on provisoned
......@@ -153,12 +174,12 @@ resources.</span>
<tr class="clickable-row" data-href="resource_KeysController.html">
<td> <span class="resource-name">KeysController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/key</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/key/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/key/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/key/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/key/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/key/{id}</span>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/keys</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/keys/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/keys/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/keys/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/keys/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/keys/{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>
......@@ -200,25 +221,6 @@ provisopned based on a TOSCA description.</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for planing the type of resources to be
provisopned based on a TOSCA description.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_PlaybookController.html">
<td> <span class="resource-name">PlaybookController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/playbook/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/post</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/{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">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 storing PlayBook descriptions that can be
used by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_ProvisionController.html">
......
......@@ -91,7 +91,7 @@
</td>
</tr>
<tr>
<td> <span class="property-name">clusterType</span>
<td> <span class="property-name">managerType</span>
</td>
<td> <span class="datatype-reference">string
</span>
......@@ -126,7 +126,7 @@
<pre class="prettyprint language-js example">{
&quot;provisionID&quot; : &quot;...&quot;,
&quot;clusterType&quot; : &quot;...&quot;,
&quot;managerType&quot; : &quot;...&quot;,
&quot;configurationID&quot; : &quot;...&quot;,
&quot;owner&quot; : &quot;...&quot;
}</pre>
......
......@@ -109,7 +109,7 @@
<td><span class="property-description"></span></td>
</tr>
<tr>
<td><span class="property-name">clusterType</span></td>
<td><span class="property-name">managerType</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-description"></span></td>
......@@ -150,7 +150,7 @@
},
&quot;id&quot; : &quot;...&quot;,
&quot;provisionID&quot; : &quot;...&quot;,
&quot;clusterType&quot; : &quot;...&quot;,
&quot;managerType&quot; : &quot;...&quot;,
&quot;configurationID&quot; : &quot;...&quot;,
&quot;owner&quot; : &quot;...&quot;
}</pre>
......
......@@ -68,7 +68,7 @@
<dl class="dl-horizontal">
<dt>Subtypes</dt>
<dd><a href="json_PlaybookRepresentation.html">PlaybookRepresentation</a>, <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_PlaybookRepresentation.html">PlaybookRepresentation</a>, <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">
......
......@@ -299,7 +299,7 @@ to request for resources.]]>
<xs:sequence>
<xs:element name="provisionID" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="clusterType" type="xs:string" minOccurs="0">
<xs:element name="managerType" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="configurationID" type="xs:string" minOccurs="0">
</xs:element>
......
This diff is collapsed.
This diff is collapsed.
......@@ -51,13 +51,13 @@
<div class="row">
<div class="col-sm-3 col-md-2 sidebar" id="apinav">
<ul class="nav nav-sidebar">
<li><a href="#resource_KeysController_postKey_POST">POST /user/v1.0/key</a></li>
<li><a href="#resource_KeysController_deleteAll_DELETE">DELETE /user/v1.0/key/all</a></li>
<li><a href="#resource_KeysController_getIds_GET">GET /user/v1.0/key/ids</a></li>
<li><a href="#resource_KeysController_geta_GET">GET /user/v1.0/key/sample</a></li>
<li><a href="#resource_KeysController_upload_POST">POST /user/v1.0/key/upload</a></li>
<li><a href="#resource_KeysController_delete_DELETE">DELETE /user/v1.0/key/{id}</a></li>
<li><a href="#resource_KeysController_get_GET">GET /user/v1.0/key/{id}</a></li>
<li><a href="#resource_KeysController_postKey_POST">POST /user/v1.0/keys</a></li>
<li><a href="#resource_KeysController_deleteAll_DELETE">DELETE /user/v1.0/keys/all</a></li>
<li><a href="#resource_KeysController_getIds_GET">GET /user/v1.0/keys/ids</a></li>
<li><a href="#resource_KeysController_geta_GET">GET /user/v1.0/keys/sample</a></li>
<li><a href="#resource_KeysController_upload_POST">POST /user/v1.0/keys/upload</a></li>
<li><a href="#resource_KeysController_delete_DELETE">DELETE /user/v1.0/keys/{id}</a></li>
<li><a href="#resource_KeysController_get_GET">GET /user/v1.0/keys/{id}</a></li>
<li class="divider"></li>
<li class="text-right"><a href="#top"><small>Back to Top</small></a></li>
</ul>
......@@ -77,7 +77,7 @@ be used by the provisoner to allow the user to login to the VMs from the
machine the keys correspond to.</p>
<div id="resource_KeysController_postKey_POST">
<h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/key <a href="../user/v1.0/key" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/keys <a href="../user/v1.0/keys" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Posts the Key and stores it. The Key is a container for public key
contents. The public key contents are represented in the 'key' field. All
......@@ -156,7 +156,7 @@ new lines in the 'key' field have to be replaced with the '\n' character.</p>
<div class="col-md-6">
<h5>Request</h5>
<pre>
POST /user/v1.0/key
POST /user/v1.0/keys
Content-Type: application/json
Accept: application/json
......@@ -191,7 +191,7 @@ Content-Type: application/json
</div>
<div id="resource_KeysController_deleteAll_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/key/all <a href="../user/v1.0/key/all" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/keys/all <a href="../user/v1.0/keys/all" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p></p>
......@@ -228,7 +228,7 @@ Content-Type: application/json
<div class="col-md-6">
<h5>Request</h5>
<pre>
DELETE /user/v1.0/key/all
DELETE /user/v1.0/keys/all
Accept: application/json
</pre>
......@@ -249,7 +249,7 @@ Content-Type: application/json
</div>
<div id="resource_KeysController_getIds_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/key/ids <a href="../user/v1.0/key/ids" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/keys/ids <a href="../user/v1.0/keys/ids" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Gets the IDs of all the stored Key</p>
......@@ -288,7 +288,7 @@ Content-Type: application/json
<div class="col-md-6">
<h5>Request</h5>
<pre>
GET /user/v1.0/key/ids
GET /user/v1.0/keys/ids
Accept: application/json
</pre>
......@@ -309,7 +309,7 @@ Content-Type: application/json
</div>
<div id="resource_KeysController_geta_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/key/sample <a href="../user/v1.0/key/sample" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/keys/sample <a href="../user/v1.0/keys/sample" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p></p>
......@@ -346,7 +346,7 @@ Content-Type: application/json
<div class="col-md-6">
<h5>Request</h5>
<pre>
GET /user/v1.0/key/sample
GET /user/v1.0/keys/sample
Accept: application/json
</pre>
......@@ -377,7 +377,7 @@ Content-Type: application/json
</div>
<div id="resource_KeysController_upload_POST">
<h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/key/upload <a href="../user/v1.0/key/upload" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/keys/upload <a href="../user/v1.0/keys/upload" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Uploads a public key (id_dsa.pub,id_rsa.pub)</p>
......@@ -434,7 +434,7 @@ Content-Type: application/json
<div class="col-md-6">
<h5>Request</h5>
<pre>
POST /user/v1.0/key/upload
POST /user/v1.0/keys/upload
Accept: application/json
</pre>
......@@ -455,7 +455,7 @@ Content-Type: application/json
</div>
<div id="resource_KeysController_delete_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/key/{id} <a href="../user/v1.0/key/{id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/keys/{id} <a href="../user/v1.0/keys/{id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Deletes a Key</p>
......@@ -512,7 +512,7 @@ Content-Type: application/json
<div class="col-md-6">
<h5>Request</h5>
<pre>
DELETE /user/v1.0/key/{id}
DELETE /user/v1.0/keys/{id}
Accept: application/json
</pre>
......@@ -533,7 +533,7 @@ Content-Type: application/json
</div>
<div id="resource_KeysController_get_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/key/{id} <a href="../user/v1.0/key/{id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/keys/{id} <a href="../user/v1.0/keys/{id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Gets the Key.</p>
......@@ -590,7 +590,7 @@ Content-Type: application/json
<div class="col-md-6">
<h5>Request</h5>
<pre>
GET /user/v1.0/key/{id}
GET /user/v1.0/keys/{id}
Accept: application/json
</pre>
......
......@@ -110,19 +110,40 @@ provisoner to request for resources (VMs).</span>
<td> <span class="resource-description">This controller is responsible for handling CloudCredentials.
CloudCredentials are a represntation of the credentials that are used by the
provisoner to request for resources (VMs)</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_ConfigurationController.html">
<td> <span class="resource-name">ConfigurationController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/deployer/configuration/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/configuration/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/configuration/post</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/configuration/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/configuration/{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">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 storing PlayBook descriptions that can be
used by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_DeployController.html">
<td> <span class="resource-name">DeployController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/deployer/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/deploy/</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/deploy</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/{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">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">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 deploying a cluster on provisoned
......@@ -145,12 +166,12 @@ resources.</span>
<tr class="clickable-row" data-href="resource_KeysController.html">
<td> <span class="resource-name">KeysController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/key</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/key/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/key/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/key/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/key/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/key/{id}</span>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/keys</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/keys/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/keys/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/keys/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/keys/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/keys/{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>
......@@ -192,25 +213,6 @@ provisopned based on a TOSCA description.</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for planing the type of resources to be
provisopned based on a TOSCA description.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_PlaybookController.html">
<td> <span class="resource-name">PlaybookController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/playbook/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/post</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/{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">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 storing PlayBook descriptions that can be
used by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_ProvisionController.html">
......
......@@ -89,7 +89,7 @@
</thead>
<tbody>
<tr>
<td> <span class="property-name">clusterType</span>
<td> <span class="property-name">configurationID</span>
</td>
<td> <span class="datatype-reference">string
</span>
......@@ -103,11 +103,11 @@
<td> <span class="property-minMaxOccurs">0/1
</span>
</td>
<td> <span class="property-description">the clusterType</span>
<td> <span class="property-description">the configurationID</span>
</td>
</tr>
<tr>
<td> <span class="property-name">configurationID</span>
<td> <span class="property-name">managerType</span>
</td>
<td> <span class="datatype-reference">string
</span>
......@@ -121,7 +121,7 @@
<td> <span class="property-minMaxOccurs">0/1
</span>
</td>
<td> <span class="property-description">the configurationID</span>
<td> <span class="property-description">the managerType</span>
</td>
</tr>
<tr>
......@@ -166,7 +166,7 @@
<pre class="prettyprint language-xml example">&lt;d-----&gt;
&lt;provisionID&gt;...&lt;/provisionID&gt;
&lt;clusterType&gt;...&lt;/clusterType&gt;
&lt;managerType&gt;...&lt;/managerType&gt;
&lt;configurationID&gt;...&lt;/configurationID&gt;
&lt;owner&gt;...&lt;/owner&gt;
&lt;/d-----&gt;
......
......@@ -128,7 +128,7 @@
</tr>
<tbody>
<tr>
<td><span class="property-name">clusterType</span></td>
<td><span class="property-name">configurationID</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-type">element
......@@ -137,10 +137,10 @@
</span></td>
<td><span class="property-minMaxOccurs">0/1
</span></td>
<td><span class="property-description">the clusterType</span></td>
<td><span class="property-description">the configurationID</span></td>
</tr>
<tr>
<td><span class="property-name">configurationID</span></td>
<td><span class="property-name">managerType</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-type">element
......@@ -149,7 +149,7 @@
</span></td>
<td><span class="property-minMaxOccurs">0/1
</span></td>
<td><span class="property-description">the configurationID</span></td>
<td><span class="property-description">the managerType</span></td>
</tr>
<tr>
<td><span class="property-name">provisionID</span></td>
......@@ -196,7 +196,7 @@
&lt;/key&gt;
&lt;id&gt;...&lt;/id&gt;
&lt;provisionID&gt;...&lt;/provisionID&gt;
&lt;clusterType&gt;...&lt;/clusterType&gt;
&lt;managerType&gt;...&lt;/managerType&gt;
&lt;configurationID&gt;...&lt;/configurationID&gt;
&lt;owner&gt;...&lt;/owner&gt;
&lt;/d-----&gt;
......
......@@ -165,6 +165,9 @@ public class ProvisionService {
provisionResponse.setDeployParameters(deployParameters);
}
}
provisionResponse.setCloudCredentialsID(provisionRequest.getCloudCredentialsID());
provisionResponse.setPublicKeyID(provisionRequest.getPublicKeyID());
provisionResponse = save(provisionResponse);
return provisionResponse;
}
......
......@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
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.service.DeployClusterService;
import nl.uva.sne.drip.api.service.DeployService;
import nl.uva.sne.drip.api.service.UserService;
import nl.uva.sne.drip.commons.v0.types.Deploy;
import nl.uva.sne.drip.commons.v0.types.Attribute;
......@@ -49,14 +49,14 @@ import org.springframework.web.bind.annotation.RequestBody;
public class DeployController0 {
@Autowired
private DeployClusterService deployService;
private DeployService deployService;
@RequestMapping(value = "/kubernetes", method = RequestMethod.POST, consumes = MediaType.TEXT_XML_VALUE, produces = MediaType.TEXT_XML_VALUE)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
Result deployKubernetes(@RequestBody Deploy deploy) {
DeployRequest deployReq = new DeployRequest();
deployReq.setClusterType("kubernetes");
deployReq.setManagerType("kubernetes");
deployReq.setProvisionID(deploy.action);
return deploy(deployReq);
}
......@@ -66,7 +66,7 @@ public class DeployController0 {
public @ResponseBody
Result deploySwarm(@RequestBody Deploy deploy) {
DeployRequest deployReq = new DeployRequest();
deployReq.setClusterType("swarm");
deployReq.setManagerType("swarm");
deployReq.setProvisionID(deploy.action);
return deploy(deployReq);
}
......
......@@ -44,9 +44,9 @@ import org.springframework.web.bind.annotation.RequestBody;
* @author S. Koulouzis
*/
@RestController
@RequestMapping("/user/v1.0/playbook")
@RequestMapping("/user/v1.0/deployer/configuration")
@Component
public class PlaybookController {
public class ConfigurationController {
@Autowired
private PlaybookService playbookService;
......@@ -59,7 +59,7 @@ public class PlaybookController {
return playbookService.saveStringContents(toscaContents, String.valueOf(System.currentTimeMillis()));
} catch (IOException ex) {
Logger.getLogger(PlaybookController.class.getName()).log(Level.SEVERE, null, ex);
Logger.getLogger(ConfigurationController.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
}
......@@ -80,7 +80,7 @@ public class PlaybookController {
try {
return playbookService.saveFile(file);
} catch (IOException | IllegalStateException ex) {
Logger.getLogger(PlaybookController.class.getName()).log(Level.SEVERE, null, ex);
Logger.getLogger(ConfigurationController.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
}
......@@ -99,7 +99,7 @@ public class PlaybookController {
try {
return playbookService.get(id, format);
} catch (JSONException ex) {
Logger.getLogger(PlaybookController.class.getName()).log(Level.SEVERE, null, ex);
Logger.getLogger(ConfigurationController.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
}
......
......@@ -18,18 +18,20 @@ package nl.uva.sne.drip.api.v1.rest;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.security.RolesAllowed;
import nl.uva.sne.drip.api.exception.BadRequestException;
import nl.uva.sne.drip.api.exception.NotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.service.DeployClusterService;
import nl.uva.sne.drip.api.service.DeployService;
import nl.uva.sne.drip.api.service.UserService;
import nl.uva.sne.drip.commons.v1.types.DeployRequest;
import nl.uva.sne.drip.commons.v1.types.DeployResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
/**
* This controller is responsible for deploying a cluster on provisoned
......@@ -43,22 +45,33 @@ import org.springframework.web.bind.annotation.PathVariable;
public class DeployController {
@Autowired
private DeployClusterService deployService;
private DeployService deployService;
@RequestMapping(value = "/deploy/", method = RequestMethod.POST)
@RequestMapping(value = "/deploy", method = RequestMethod.POST)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String deploy(DeployRequest deployRequest) {
String deploy(@RequestBody DeployRequest deployRequest) {
if (deployRequest.getManagerType() == null) {
throw new BadRequestException("Must provide manager type. Aveliable: ansible, swarm ,kubernetes");
}
if (deployRequest.getProvisionID() == null) {
throw new BadRequestException("Must provide provision ID");
}
DeployResponse key = deployService.deployCluster(deployRequest);
return key.getId();
}
/**
* Gets the cluster credentials.
*
* @param id
* @return the cluster credentials
*/
@RequestMapping(value = "/sample", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
DeployRequest sample() {
DeployRequest req = new DeployRequest();
req.setManagerType("ansible");
req.setConfigurationID("Configuration_ID");
req.setProvisionID("Provision_ID");
return req;
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
......@@ -70,11 +83,6 @@ public class DeployController {
return resp;
}
/**
* Gets the IDs of all the stored cluster credentials
*
* @return a list of all the IDs
*/
@RequestMapping(value = "/ids", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
......@@ -87,12 +95,6 @@ public class DeployController {
return ids;
}
/**
* Deletes a cluster credential
*
* @param id. The id of the cluster credential
* @return the id f the deleted cluster credential
*/
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
......
......@@ -49,7 +49,7 @@ import org.springframework.web.bind.annotation.RequestBody;
* @author S. Koulouzis
*/
@RestController
@RequestMapping("/user/v1.0/key")
@RequestMapping("/user/v1.0/keys")
@Component
public class KeysController {
......
......@@ -31,8 +31,6 @@ 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.ProvisionResponse;
......@@ -54,12 +52,11 @@ public class ProvisionController {
@Autowired
private ProvisionService provisionService;
@Autowired
private CloudCredentialsService cloudCredentialService;
@Autowired
private PlannerService plannServcie;
// @Autowired
// private CloudCredentialsService cloudCredentialService;
//
// @Autowired
// private PlannerService plannServcie;
/**
* Gets the ProvisionRequest
*
......
......@@ -22,7 +22,7 @@ package nl.uva.sne.drip.commons.v1.types;
public class DeployRequest extends OwnedObject {
private String provisionID;
private String clusterType;
private String managerType;
private String configurationID;
/**
......@@ -40,17 +40,17 @@ public class DeployRequest extends OwnedObject {
}
/**
* @return the clusterType
* @return the managerType
*/
public String getClusterType() {
return clusterType;
public String getManagerType() {
return managerType;
}
/**
* @param clusterType the clusterType to set
* @param managerType the managerType to set
*/
public void setClusterType(String clusterType) {
this.clusterType = clusterType;
public void setManagerType(String managerType) {
this.managerType = managerType;
}
/**
......
#!/usr/bin/env python
import pika
import json
import os
import time
from vm_info import VmInfo
import docker_kubernetes
import docker_engine
import docker_swarm
import control_agent
import sys, argparse
from threading import Thread
from time import sleep
print sys.argv
if len(sys.argv) > 1:
rabbitmq_host = sys.argv[1]
else:
rabbitmq_host = '127.0.0.1'
connection = pika.BlockingConnection(pika.ConnectionParameters(host=rabbitmq_host))
channel = connection.channel()
channel.queue_declare(queue='profiler_queue')
path = os.path.dirname(os.path.abspath(__file__)) + "/"
def threaded_function(args):
while True:
#print "processing data events"
connection.process_data_events()
sleep(30)
def handleDelivery(message):
def on_request(ch, method, props, body):
ret = handleDelivery(body)
ch.basic_publish(exchange='',
routing_key=props.reply_to,
properties=pika.BasicProperties(correlation_id = \
props.correlation_id),
body=str(response))
ch.basic_ack(delivery_tag = method.delivery_tag)
channel.basic_qos(prefetch_count=1)
channel.basic_consume(on_request, queue='deployer_queue')
thread = Thread(target = threaded_function, args = (1, ))
thread.start()
print("[x] Awaiting RPC requests")
channel.start_consuming()
thread.stop()
\ No newline at end of file
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