Commit 03b53d27 authored by skoulouzis's avatar skoulouzis Committed by GitHub

Merge pull request #42 from skoulouzis/DRIP_0.1

Drip 0.1
parents 9bbf46f7 065e01c8
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -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 March 14, 2017</p>
<p class="lead">Created March 22, 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 March 14, 2017</p>
<p class="lead">Created March 22, 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 March 14, 2017</p>
<p class="lead">Created March 22, 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 March 14, 2017</p>
<p class="lead">Created March 22, 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 March 14, 2017</p>
<p class="lead">Created March 22, 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
......@@ -219,7 +219,7 @@
</tbody>
</table>
<h3 id="artifact_php_xml_client_library">PHP XML Client Library</h3>
<p class="lead">Created March 14, 2017</p>
<p class="lead">Created March 22, 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 March 14, 2017</p>
<p class="lead">Created March 22, 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
......
......@@ -656,74 +656,13 @@ module V1
module Types
# (no documentation provided)
class KeyValueHolder < Nl::Uva::Sne::Drip::Commons::V1::Types::OwnedObject
# the keyValue
attr_accessor :keyValue
# the id
attr_accessor :id
# the json hash for this KeyValueHolder
def to_jaxb_json_hash
_h = super
_h['keyValue'] = keyValue.to_jaxb_json_hash unless keyValue.nil?
_h['id'] = id.to_jaxb_json_hash unless id.nil?
return _h
end
class Type
#initializes this KeyValueHolder with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['keyValue'].nil?
_oa = _o['keyValue']
if(_oa.is_a? Hash)
@keyValue = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@keyValue = Hash.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@keyValue = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@keyValue.push Hash.from_json(_item)
else
@keyValue.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@keyValue = _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
#
PRIVATE = "PRIVATE"
# constructs a KeyValueHolder from a (parsed) JSON hash
def self.from_json(o)
if o.nil?
return nil
else
inst = new
inst.init_jaxb_json_hash o
return inst
end
end
#
PUBLIC = "PUBLIC"
end
end
......@@ -946,13 +885,74 @@ module V1
module Types
# (no documentation provided)
class Type
class KeyValueHolder < Nl::Uva::Sne::Drip::Commons::V1::Types::OwnedObject
#
PRIVATE = "PRIVATE"
# the keyValue
attr_accessor :keyValue
# the id
attr_accessor :id
#
PUBLIC = "PUBLIC"
# the json hash for this KeyValueHolder
def to_jaxb_json_hash
_h = super
_h['keyValue'] = keyValue.to_jaxb_json_hash unless keyValue.nil?
_h['id'] = id.to_jaxb_json_hash unless id.nil?
return _h
end
#initializes this KeyValueHolder with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['keyValue'].nil?
_oa = _o['keyValue']
if(_oa.is_a? Hash)
@keyValue = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@keyValue = Hash.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@keyValue = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@keyValue.push Hash.from_json(_item)
else
@keyValue.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@keyValue = _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 KeyValueHolder from a (parsed) JSON hash
def self.from_json(o)
if o.nil?
return nil
else
inst = new
inst.init_jaxb_json_hash o
return inst
end
end
end
end
......@@ -1350,7 +1350,7 @@ module Types
class ProvisionInfo < Nl::Uva::Sne::Drip::Commons::V1::Types::KeyValueHolder
# the cloudCredentialsID
attr_accessor :cloudcloudCredentialsID
attr_accessor :cloudCredentialsID
# the planID
attr_accessor :planID
# the scriptID
......@@ -1363,7 +1363,7 @@ module Types
# the json hash for this ProvisionInfo
def to_jaxb_json_hash
_h = super
_h['cloudcloudCredentialsID'] = cloudcloudCredentialsID.to_jaxb_json_hash unless cloudcloudCredentialsID.nil?
_h['cloudCredentialsID'] = cloudCredentialsID.to_jaxb_json_hash unless cloudCredentialsID.nil?
_h['planID'] = planID.to_jaxb_json_hash unless planID.nil?
_h['scriptID'] = scriptID.to_jaxb_json_hash unless scriptID.nil?
_h['userKeyID'] = userKeyID.to_jaxb_json_hash unless userKeyID.nil?
......@@ -1378,23 +1378,23 @@ module Types
#initializes this ProvisionInfo with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['cloudcloudCredentialsID'].nil?
_oa = _o['cloudcloudCredentialsID']
if !_o['cloudCredentialsID'].nil?
_oa = _o['cloudCredentialsID']
if(_oa.is_a? Hash)
@cloudcloudCredentialsID = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@cloudcloudCredentialsID = String.from_json(_oa) unless _oa['@class']
@cloudCredentialsID = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@cloudCredentialsID = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@cloudcloudCredentialsID = Array.new
@cloudCredentialsID = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@cloudcloudCredentialsID.push String.from_json(_item)
@cloudCredentialsID.push String.from_json(_item)
else
@cloudcloudCredentialsID.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@cloudCredentialsID.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@cloudcloudCredentialsID = _oa
@cloudCredentialsID = _oa
end
end
if !_o['planID'].nil?
......
......@@ -102,11 +102,13 @@ provisoner to request for resources (VMs).</span>
<td> <span class="resource-name">CloudCredentialsController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/credentials/cloud</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/credentials/cloud/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/credentials/cloud/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/credentials/cloud/{id}</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/credentials/cloud/upload/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">POST</span>
......@@ -179,7 +181,7 @@ provisopned based on a TOSCA description.</span>
<tr class="clickable-row" data-href="resource_ProvisionController.html">
<td> <span class="resource-name">ProvisionController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/provisionerall</span>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/provisioner/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/provision</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{id}</span>
......@@ -284,11 +286,13 @@ machine the keys correspond to.</span>
<tr class="clickable-row" data-href="resource_UserScriptController.html">
<td> <span class="resource-name">UserScriptController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/user_script/ids</span>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/user_script/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">GET</span>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">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>
......
......@@ -167,7 +167,7 @@ provisoner to request for resources.</p>
}, {
&quot;name&quot; : &quot;...&quot;,
&quot;id&quot; : &quot;...&quot;,
&quot;type&quot; : &quot;PUBLIC&quot;,
&quot;type&quot; : &quot;PRIVATE&quot;,
&quot;attributes&quot; : {
&quot;property1&quot; : &quot;...&quot;,
&quot;property2&quot; : &quot;...&quot;
......
......@@ -52,6 +52,7 @@
<div class="col-sm-3 col-md-2 sidebar" id="apinav">
<ul class="nav nav-sidebar">
<li><a href="#resource_CloudCredentialsController_postConf_POST"><abbr title="POST /user/v1.0/credentials/cloud">POST /user/v1.0/credentials/cl...</abbr></a></li>
<li><a href="#resource_CloudCredentialsController_deleteAll_DELETE"><abbr title="DELETE /user/v1.0/credentials/cloud/all">DELETE /user/v1.0/credentials/...</abbr></a></li>
<li><a href="#resource_CloudCredentialsController_getIds_GET"><abbr title="GET /user/v1.0/credentials/cloud/ids">GET /user/v1.0/credentials/clo...</abbr></a></li>
<li><a href="#resource_CloudCredentialsController_delete_DELETE"><abbr title="DELETE /user/v1.0/credentials/cloud/{id}">DELETE /user/v1.0/credentials/...</abbr></a></li>
<li><a href="#resource_CloudCredentialsController_get_GET"><abbr title="GET /user/v1.0/credentials/cloud/{id}">GET /user/v1.0/credentials/clo...</abbr></a></li>
......@@ -204,6 +205,64 @@ Content-Type: application/json
</div>
</div>
<div id="resource_CloudCredentialsController_deleteAll_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/credentials/cloud/all <a href="../user/v1.0/credentials/cloud/all" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p></p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN</dd>
</dl>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">string
(JSON)</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">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>
DELETE /user/v1.0/credentials/cloud/all
Accept: application/json
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 204 Looks Good
Content-Type: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_CloudCredentialsController_getIds_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/credentials/cloud/ids <a href="../user/v1.0/credentials/cloud/ids" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
......
......@@ -51,7 +51,7 @@
<div class="row">
<div class="col-sm-3 col-md-2 sidebar" id="apinav">
<ul class="nav nav-sidebar">
<li><a href="#resource_ProvisionController_deleteAll_DELETE"><abbr title="DELETE /user/v1.0/provisionerall">DELETE /user/v1.0/provisionera...</abbr></a></li>
<li><a href="#resource_ProvisionController_deleteAll_DELETE"><abbr title="DELETE /user/v1.0/provisioner/all">DELETE /user/v1.0/provisioner/...</abbr></a></li>
<li><a href="#resource_ProvisionController_getIds_GET">GET /user/v1.0/provisioner/ids</a></li>
<li><a href="#resource_ProvisionController_provision_POST"><abbr title="POST /user/v1.0/provisioner/provision">POST /user/v1.0/provisioner/pr...</abbr></a></li>
<li><a href="#resource_ProvisionController_delete_DELETE"><abbr title="DELETE /user/v1.0/provisioner/{id}">DELETE /user/v1.0/provisioner/...</abbr></a></li>
......@@ -74,7 +74,7 @@
based the plan generated by the planner</p>
<div id="resource_ProvisionController_deleteAll_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/provisionerall <a href="../user/v1.0/provisionerall" 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/provisioner/all <a href="../user/v1.0/provisioner/all" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p></p>
......@@ -111,7 +111,7 @@ based the plan generated by the planner</p>
<div class="col-md-6">
<h5>Request</h5>
<pre>
DELETE /user/v1.0/provisionerall
DELETE /user/v1.0/provisioner/all
Accept: application/json
</pre>
......
......@@ -55,6 +55,7 @@
<li><a href="#resource_UserPublicKeysController_getIds_GET">GET /user/v1.0/user_key/ids</a></li>
<li><a href="#resource_UserPublicKeysController_uploadUserPublicKeys_POST"><abbr title="POST /user/v1.0/user_key/upload">POST /user/v1.0/user_key/uploa...</abbr></a></li>
<li><a href="#resource_UserPublicKeysController_delete_DELETE"><abbr title="DELETE /user/v1.0/user_key/{id}">DELETE /user/v1.0/user_key/{id...</abbr></a></li>
<li><a href="#resource_UserPublicKeysController_deleteAll_DELETE"><abbr title="DELETE /user/v1.0/user_key/{id}">DELETE /user/v1.0/user_key/{id...</abbr></a></li>
<li><a href="#resource_UserPublicKeysController_get_GET">GET /user/v1.0/user_key/{id}</a></li>
<li class="divider"></li>
<li class="text-right"><a href="#top"><small>Back to Top</small></a></li>
......@@ -405,6 +406,64 @@ Content-Type: application/json
</div>
</div>
<div id="resource_UserPublicKeysController_deleteAll_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/user_key/{id} <a href="../user/v1.0/user_key/{id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p></p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN</dd>
</dl>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">string
(JSON)</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">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>
DELETE /user/v1.0/user_key/{id}
Accept: application/json
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 204 Looks Good
Content-Type: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_UserPublicKeysController_get_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/user_key/{id} <a href="../user/v1.0/user_key/{id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
......
......@@ -51,6 +51,7 @@
<div class="row">
<div class="col-sm-3 col-md-2 sidebar" id="apinav">
<ul class="nav nav-sidebar">
<li><a href="#resource_UserScriptController_deleteAll_DELETE"><abbr title="DELETE /user/v1.0/user_script/all">DELETE /user/v1.0/user_script/...</abbr></a></li>
<li><a href="#resource_UserScriptController_getIds_GET">GET /user/v1.0/user_script/ids</a></li>
<li><a href="#resource_UserScriptController_uploadUserScript_POST"><abbr title="POST /user/v1.0/user_script/upload">POST /user/v1.0/user_script/up...</abbr></a></li>
<li><a href="#resource_UserScriptController_delete_DELETE"><abbr title="DELETE /user/v1.0/user_script/{id}">DELETE /user/v1.0/user_script/...</abbr></a></li>
......@@ -72,6 +73,64 @@
<p>This controller is responsible for handling user scripts. These user can be
used by the provisoner to run on the created VMs.</p>
<div id="resource_UserScriptController_deleteAll_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/user_script/all <a href="../user/v1.0/user_script/all" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p></p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN</dd>
</dl>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">string
(JSON)</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">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>
DELETE /user/v1.0/user_script/all
Accept: application/json
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 204 Looks Good
Content-Type: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_UserScriptController_getIds_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/user_script/ids <a href="../user/v1.0/user_script/ids" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
......@@ -132,6 +191,11 @@ Content-Type: application/json
<p>Uploads a script</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>
......@@ -205,6 +269,11 @@ Content-Type: application/json
<p></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>
......@@ -276,6 +345,11 @@ Content-Type: application/json
<p>Gets a script</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>
......
......@@ -94,11 +94,13 @@ provisoner to request for resources (VMs).</span>
<td> <span class="resource-name">CloudCredentialsController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/credentials/cloud</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/credentials/cloud/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/credentials/cloud/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/credentials/cloud/{id}</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/credentials/cloud/upload/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">POST</span>
......@@ -171,7 +173,7 @@ provisopned based on a TOSCA description.</span>
<tr class="clickable-row" data-href="resource_ProvisionController.html">
<td> <span class="resource-name">ProvisionController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/provisionerall</span>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/provisioner/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/provision</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{id}</span>
......@@ -276,11 +278,13 @@ machine the keys correspond to.</span>
<tr class="clickable-row" data-href="resource_UserScriptController.html">
<td> <span class="resource-name">UserScriptController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/user_script/ids</span>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/user_script/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">GET</span>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">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>
......
......@@ -201,7 +201,7 @@
<goal>docs</goal>
</goals>
<configuration>
<docsDir>${project.basedir}/doc</docsDir>
<docsDir>${project.basedir}/../doc</docsDir>
<configFile>enunciate.xml</configFile>
</configuration>
</execution>
......
......@@ -70,4 +70,9 @@ public class CloudCredentialsService {
public List<CloudCredentials> findAll() {
return dao.findAll();
}
@PostFilter("(hasRole('ROLE_ADMIN'))")
public void deleteAll() {
dao.deleteAll();
}
}
......@@ -93,4 +93,9 @@ public class UserKeyService {
upk.setOwner(owner);
return dao.save(upk);
}
@PostAuthorize("(hasRole('ROLE_ADMIN'))")
public void deleteAll() {
dao.deleteAll();
}
}
......@@ -70,4 +70,9 @@ public class UserScriptService {
public List<Script> findAll() {
return dao.findAll();
}
@PostFilter("(hasRole('ROLE_ADMIN'))")
public void deleteAll() {
dao.deleteAll();
}
}
......@@ -162,6 +162,14 @@ public class CloudCredentialsController {
return "Deleted :" + id;
}
@RequestMapping(value = "/all", method = RequestMethod.DELETE)
@RolesAllowed({UserService.ADMIN})
public @ResponseBody
String deleteAll() {
cloudCredentialsService.deleteAll();
return "Done";
}
/**
* Gets all the IDs of the stored cloud credentials
*
......
......@@ -43,8 +43,6 @@ import org.springframework.web.bind.annotation.RequestParam;
@Controller
public class DeployController {
@Autowired
private DeployClusterService deployService;
......@@ -124,8 +122,6 @@ public class DeployController {
return "Done";
}
private void checkClusterType(String clusterType) {
switch (clusterType.toLowerCase()) {
case "kubernetes":
......
......@@ -82,7 +82,7 @@ public class ProvisionController {
throw new NotFoundException();
}
@RequestMapping(value = "all", method = RequestMethod.DELETE)
@RequestMapping(value = "/all", method = RequestMethod.DELETE)
@RolesAllowed({UserService.ADMIN})
public @ResponseBody
String deleteAll() {
......@@ -91,7 +91,6 @@ public class ProvisionController {
}
/**
* Gets the IDs of all the stored ProvisionInfo
*
......@@ -137,5 +136,4 @@ public class ProvisionController {
return null;
}
}
......@@ -169,7 +169,15 @@ public class UserPublicKeysController {
public @ResponseBody
String delete(@PathVariable("id") String id) {
service.delete(id, LoginKey.Type.PUBLIC);
return "Deleteed: " + id;
return "Deleted: " + id;
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@RolesAllowed({UserService.ADMIN})
public @ResponseBody
String deleteAll() {
service.deleteAll();
return "Done";
}
}
......@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.security.RolesAllowed;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -32,6 +33,7 @@ import nl.uva.sne.drip.api.exception.NotFoundException;
import nl.uva.sne.drip.commons.v1.types.Script;
import org.springframework.web.bind.annotation.PathVariable;
import nl.uva.sne.drip.api.service.UserScriptService;
import nl.uva.sne.drip.api.service.UserService;
/**
* This controller is responsible for handling user scripts. These user can be
......@@ -55,6 +57,7 @@ public class UserScriptController {
* @return the ID of the stopred script
*/
@RequestMapping(value = "/upload", method = RequestMethod.POST)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String uploadUserScript(@RequestParam("file") MultipartFile file) {
if (!file.isEmpty()) {
......@@ -85,13 +88,15 @@ public class UserScriptController {
* @return the script
*/
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
Script get(@PathVariable("id") String id) {
return userScriptService.findOne(id);
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public String delete(@PathVariable("id") String id) {
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody String delete(@PathVariable("id") String id) {
Script script = userScriptService.findOne(id);
if (script == null) {
throw new NotFoundException();
......@@ -100,6 +105,14 @@ public class UserScriptController {
return "Deleted: " + id;
}
@RequestMapping(value = "/all", method = RequestMethod.DELETE)
@RolesAllowed({UserService.ADMIN})
public @ResponseBody String deleteAll() {
userScriptService.deleteAll();
return "Done";
}
/**
* Gets the IDs of all the stored scripts
*
......
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.commons.v1.types;
import org.springframework.stereotype.Component;
/**
*
* @author S. Koulouzis
*/
@Component
public class TestBean {
public boolean getTestBoolean() {
return false;
}
}
......@@ -22,8 +22,6 @@ if len(sys.argv) > 1:
else:
rabbitmq_host = '127.0.0.1'
print "Trying to connect to: %s" %rabbitmq_host
connection = pika.BlockingConnection(pika.ConnectionParameters(host=rabbitmq_host))
channel = connection.channel()
channel.queue_declare(queue='planner_queue')
......
......@@ -65,7 +65,7 @@ public class RPCServer {
factory.setPassword("guest");
factory.setUsername("guest");
factory.setPort(AMQP.PROTOCOL.PORT);
Logger.getLogger(RPCServer.class.getName()).log(Level.INFO, "Trying to connect to: {0}", HOST);
Logger.getLogger(RPCServer.class.getName()).log(Level.INFO, "Connected to: {0}", HOST);
try (Connection connection = factory.newConnection()) {
Channel channel = connection.createChannel();
//We define the queue name
......
This diff is collapsed.
This diff is collapsed.
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