Commit e9419be6 authored by Spiros Koulouzis's avatar Spiros Koulouzis

Added delete all

parent fd2b529b
......@@ -119,11 +119,13 @@ provisoner to request for resources (VMs)</span>
<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/ids</span>
<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/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/{id}</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/deploy/{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">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
......@@ -177,11 +179,13 @@ 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/provisioner/ids</span>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/provisionerall</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>
</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>
......
......@@ -429,7 +429,7 @@ Content-Type: application/json
}, {
&quot;name&quot; : &quot;...&quot;,
&quot;id&quot; : &quot;...&quot;,
&quot;type&quot; : &quot;PRIVATE&quot;,
&quot;type&quot; : &quot;PUBLIC&quot;,
&quot;attributes&quot; : {
&quot;property1&quot; : &quot;...&quot;,
&quot;property2&quot; : &quot;...&quot;
......
......@@ -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_DeployController_deleteAll_DELETE">DELETE /user/v1.0/deployer/all</a></li>
<li><a href="#resource_DeployController_getIds_GET">GET /user/v1.0/deployer/ids</a></li>
<li><a href="#resource_DeployController_delete_DELETE"><abbr title="DELETE /user/v1.0/deployer/{id}">DELETE /user/v1.0/deployer/{id...</abbr></a></li>
<li><a href="#resource_DeployController_get_GET">GET /user/v1.0/deployer/{id}</a></li>
......@@ -72,6 +73,64 @@
<p>This controller is responsible for deploying a cluster on provisoned
resources.</p>
<div id="resource_DeployController_deleteAll_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/deployer/all <a href="../user/v1.0/deployer/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/deployer/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_DeployController_getIds_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/deployer/ids <a href="../user/v1.0/deployer/ids" 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_ProvisionController_deleteAll_DELETE"><abbr title="DELETE /user/v1.0/provisionerall">DELETE /user/v1.0/provisionera...</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>
......@@ -72,6 +73,64 @@
<p>This controller is responsible for obtaining resources from cloud providers
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>
<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/provisionerall
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_ProvisionController_getIds_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/provisioner/ids <a href="../user/v1.0/provisioner/ids" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
......
......@@ -111,11 +111,13 @@ provisoner to request for resources (VMs)</span>
<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/ids</span>
<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/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/{id}</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/deploy/{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">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
......@@ -169,11 +171,13 @@ 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/provisioner/ids</span>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/provisionerall</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>
</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>
......
......@@ -195,4 +195,9 @@ public class DeployClusterService {
return mapper.readValue(strResponse, Message.class);
}
@PostAuthorize("(hasRole('ROLE_ADMIN'))")
public void deleteAll() {
dao.deleteAll();
}
}
......@@ -334,4 +334,9 @@ public class ProvisionService {
return mapper.readValue(strResponse, Message.class);
}
@PostFilter("(hasRole('ROLE_ADMIN'))")
public void deleteAll() {
dao.deleteAll();
}
}
......@@ -115,6 +115,14 @@ public class DeployController {
}
throw new NotFoundException();
}
@RequestMapping(value = "/all", method = RequestMethod.DELETE)
@RolesAllowed({UserService.ADMIN})
public @ResponseBody
String deleteAll() {
deployService.deleteAll();
return "Done";
}
......
......@@ -81,6 +81,16 @@ public class ProvisionController {
}
throw new NotFoundException();
}
@RequestMapping(value = "all", method = RequestMethod.DELETE)
@RolesAllowed({UserService.ADMIN})
public @ResponseBody
String deleteAll() {
provisionService.deleteAll();
return "Done";
}
/**
* Gets the IDs of all the stored ProvisionInfo
......
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