Commit bf83e2b3 authored by Spiros Koulouzis's avatar Spiros Koulouzis

Added docker compose file

Created test module 
parent 15261762
...@@ -8,4 +8,5 @@ ...@@ -8,4 +8,5 @@
/drip-planner2provisioner/target/ /drip-planner2provisioner/target/
/drip-component_example/target/ /drip-component_example/target/
/deleteme/target/ /deleteme/target/
/drip-api/nbproject/ /drip-api/nbproject/
\ No newline at end of file /drip-tests/nbproject/
\ No newline at end of file
version: '2'
services:
mongo:
image: mongo:3
ports:
- "27017:27017"
command: "mongod --port 27017"
restart: always
rabbit:
image: rabbitmq:latest
ports:
- "5671-5672:5671-5672"
- "15671:15671"
restart: always
drip-planner:
depends_on:
- rabbit
build: planner/Dockerfile
image: drip-planner:latest
restart: always
environment:
RABBITMQ_HOST: rabbit
command: "python rpc_server.py $RABBITMQ_HOST"
\ No newline at end of file
...@@ -32,7 +32,7 @@ RUN ls ...@@ -32,7 +32,7 @@ RUN ls
# WORKDIR drip-planner # WORKDIR drip-planner
# ARG RABBITMQ_HOST=172.17.0.2 # ARG RABBITMQ_HOST=172.17.0.2
# RUN echo $RABBITMQ_HOST > hostFile # RUN echo $RABBITMQ_HOST > hostFile
# ENTRYPOINT python rpc_server.py 172.17.0.2 ENTRYPOINT python rpc_server.py $RABBITMQ_HOST
# docker build -t drip-planner . # docker build -t drip-planner .
# docker run --name drip-planner-inst -d drip-planner # docker run --name drip-planner-inst -d drip-planner
...@@ -69,7 +69,7 @@ class</p> ...@@ -69,7 +69,7 @@ class</p>
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>Subtypes</dt> <dt>Subtypes</dt>
<dd><a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_KeyPair.html">KeyPair</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_PlanResponse.html">PlanResponse</a>, <a href="json_PlaybookRepresentation.html">PlaybookRepresentation</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a>, <a href="json_Script.html">Script</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_ToscaRepresentation.html">ToscaRepresentation</a>, <a href="json_CloudCredentials.html">CloudCredentials</a></dd> <dd><a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_KeyPair.html">KeyPair</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_PlanResponse.html">PlanResponse</a>, <a href="json_PlaybookRepresentation.html">PlaybookRepresentation</a>, <a href="json_Script.html">Script</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_ToscaRepresentation.html">ToscaRepresentation</a>, <a href="json_CloudCredentials.html">CloudCredentials</a></dd>
</dl> </dl>
<table class="table datatype-properties"> <table class="table datatype-properties">
......
...@@ -120,6 +120,10 @@ provisoner to request for resources (VMs)</p> ...@@ -120,6 +120,10 @@ provisoner to request for resources (VMs)</p>
<td><span class="label label-success response-code">200</span></td> <td><span class="label label-success response-code">200</span></td>
<td><span class="response-condition">At least one key ID is posted</span></td> <td><span class="response-condition">At least one key ID is posted</span></td>
</tr> </tr>
<tr>
<td><span class="label label-warning response-code">401</span></td>
<td><span class="response-condition">Bad credentials</span></td>
</tr>
</tbody> </tbody>
</table> </table>
...@@ -194,6 +198,22 @@ Content-Type: application/json ...@@ -194,6 +198,22 @@ Content-Type: application/json
<dd>ADMIN</dd> <dd>ADMIN</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -252,6 +272,22 @@ Content-Type: application/json ...@@ -252,6 +272,22 @@ Content-Type: application/json
<dd>ADMIN, USER</dd> <dd>ADMIN, USER</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -312,6 +348,22 @@ Content-Type: application/json ...@@ -312,6 +348,22 @@ Content-Type: application/json
<dd>ADMIN, USER</dd> <dd>ADMIN, USER</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -395,6 +447,22 @@ Content-Type: application/json ...@@ -395,6 +447,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -473,6 +541,22 @@ Content-Type: application/json ...@@ -473,6 +541,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -564,6 +648,22 @@ be created</p> ...@@ -564,6 +648,22 @@ be created</p>
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
......
...@@ -84,6 +84,22 @@ used by the planner.</p> ...@@ -84,6 +84,22 @@ used by the planner.</p>
<dd>ADMIN</dd> <dd>ADMIN</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -144,6 +160,22 @@ Content-Type: application/json ...@@ -144,6 +160,22 @@ Content-Type: application/json
<dd>ADMIN, USER</dd> <dd>ADMIN, USER</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -226,6 +258,22 @@ Content-Type: application/json ...@@ -226,6 +258,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -306,6 +354,22 @@ Content-Type: application/json ...@@ -306,6 +354,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -384,6 +448,22 @@ Content-Type: application/json ...@@ -384,6 +448,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -467,6 +547,22 @@ Content-Type: application/json ...@@ -467,6 +547,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
......
...@@ -84,6 +84,22 @@ resources.</p> ...@@ -84,6 +84,22 @@ resources.</p>
<dd>ADMIN</dd> <dd>ADMIN</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -164,6 +180,22 @@ Content-Type: application/json ...@@ -164,6 +180,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -232,6 +264,22 @@ Content-Type: application/json ...@@ -232,6 +264,22 @@ Content-Type: application/json
<dd>ADMIN, USER</dd> <dd>ADMIN, USER</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -290,6 +338,22 @@ Content-Type: application/json ...@@ -290,6 +338,22 @@ Content-Type: application/json
<dd>ADMIN, USER</dd> <dd>ADMIN, USER</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -372,6 +436,22 @@ Content-Type: application/json ...@@ -372,6 +436,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -448,6 +528,22 @@ Content-Type: application/json ...@@ -448,6 +528,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
......
...@@ -122,6 +122,10 @@ new lines in the 'key' field have to be replaced with the '\n' character.</p> ...@@ -122,6 +122,10 @@ new lines in the 'key' field have to be replaced with the '\n' character.</p>
<td><span class="label label-warning response-code">400</span></td> <td><span class="label label-warning response-code">400</span></td>
<td><span class="response-condition">Key can't be empty</span></td> <td><span class="response-condition">Key can't be empty</span></td>
</tr> </tr>
<tr>
<td><span class="label label-warning response-code">401</span></td>
<td><span class="response-condition">Bad credentials</span></td>
</tr>
</tbody> </tbody>
</table> </table>
...@@ -210,6 +214,22 @@ Content-Type: application/json ...@@ -210,6 +214,22 @@ Content-Type: application/json
<dd>ADMIN</dd> <dd>ADMIN</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -268,6 +288,22 @@ Content-Type: application/json ...@@ -268,6 +288,22 @@ Content-Type: application/json
<dd>ADMIN, USER</dd> <dd>ADMIN, USER</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -328,6 +364,22 @@ Content-Type: application/json ...@@ -328,6 +364,22 @@ Content-Type: application/json
<dd>ADMIN, USER</dd> <dd>ADMIN, USER</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -425,6 +477,22 @@ Content-Type: application/json ...@@ -425,6 +477,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -503,6 +571,22 @@ Content-Type: application/json ...@@ -503,6 +571,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
......
...@@ -84,6 +84,22 @@ provisopned based on a TOSCA description.</p> ...@@ -84,6 +84,22 @@ provisopned based on a TOSCA description.</p>
<dd>ADMIN</dd> <dd>ADMIN</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -142,6 +158,22 @@ Content-Type: application/json ...@@ -142,6 +158,22 @@ Content-Type: application/json
<dd>ADMIN, USER</dd> <dd>ADMIN, USER</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -220,6 +252,22 @@ Content-Type: application/json ...@@ -220,6 +252,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -303,6 +351,22 @@ Content-Type: application/json ...@@ -303,6 +351,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -381,6 +445,22 @@ Content-Type: application/json ...@@ -381,6 +445,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -460,6 +540,22 @@ The plan is represented by its ID</p> ...@@ -460,6 +540,22 @@ The plan is represented by its ID</p>
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
......
...@@ -83,6 +83,22 @@ based the plan generated by the planner</p> ...@@ -83,6 +83,22 @@ based the plan generated by the planner</p>
<dd>ADMIN</dd> <dd>ADMIN</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -141,6 +157,22 @@ Content-Type: application/json ...@@ -141,6 +157,22 @@ Content-Type: application/json
<dd>ADMIN, USER</dd> <dd>ADMIN, USER</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -223,6 +255,22 @@ Content-Type: application/json ...@@ -223,6 +255,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -315,6 +363,22 @@ Content-Type: application/json ...@@ -315,6 +363,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -393,6 +457,22 @@ Content-Type: application/json ...@@ -393,6 +457,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
......
...@@ -107,6 +107,22 @@ used by the provisoner to run on the created VMs.</p> ...@@ -107,6 +107,22 @@ used by the provisoner to run on the created VMs.</p>
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -174,6 +190,22 @@ Content-Type: application/json ...@@ -174,6 +190,22 @@ Content-Type: application/json
<dd>ADMIN</dd> <dd>ADMIN</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -227,6 +259,22 @@ Content-Type: application/json ...@@ -227,6 +259,22 @@ Content-Type: application/json
<p>Gets the IDs of all the stored scripts</p> <p>Gets the IDs of all the stored scripts</p>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -287,6 +335,22 @@ Content-Type: application/json ...@@ -287,6 +335,22 @@ Content-Type: application/json
<dd>ADMIN, USER</dd> <dd>ADMIN, USER</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -368,6 +432,22 @@ Content-Type: application/json ...@@ -368,6 +432,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -446,6 +526,22 @@ Content-Type: application/json ...@@ -446,6 +526,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -522,6 +618,22 @@ Content-Type: application/json ...@@ -522,6 +618,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
......
...@@ -84,6 +84,22 @@ used by the planner.</p> ...@@ -84,6 +84,22 @@ used by the planner.</p>
<dd>ADMIN</dd> <dd>ADMIN</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -144,6 +160,22 @@ Content-Type: application/json ...@@ -144,6 +160,22 @@ Content-Type: application/json
<dd>ADMIN, USER</dd> <dd>ADMIN, USER</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -226,6 +258,22 @@ Content-Type: application/json ...@@ -226,6 +258,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -306,6 +354,22 @@ Content-Type: application/json ...@@ -306,6 +354,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -384,6 +448,22 @@ Content-Type: application/json ...@@ -384,6 +448,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -467,6 +547,22 @@ Content-Type: application/json ...@@ -467,6 +547,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
......
...@@ -83,6 +83,22 @@ ...@@ -83,6 +83,22 @@
<dd>ADMIN</dd> <dd>ADMIN</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -150,6 +166,22 @@ Content-Type: application/json ...@@ -150,6 +166,22 @@ Content-Type: application/json
<dd>ADMIN</dd> <dd>ADMIN</dd>
</dl> </dl>
<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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -232,6 +264,22 @@ Content-Type: application/json ...@@ -232,6 +264,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -326,6 +374,22 @@ with the 'ADMIN' role can do that.</p> ...@@ -326,6 +374,22 @@ with the 'ADMIN' role can do that.</p>
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -419,6 +483,22 @@ Content-Type: application/json ...@@ -419,6 +483,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
...@@ -497,6 +577,22 @@ Content-Type: application/json ...@@ -497,6 +577,22 @@ Content-Type: application/json
</tbody> </tbody>
</table> </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"> <table class="table resource-response-body">
<caption>Response Body</caption> <caption>Response Body</caption>
<thead> <thead>
......
...@@ -59,6 +59,9 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -59,6 +59,9 @@ import org.springframework.web.multipart.MultipartFile;
@RestController @RestController
@RequestMapping("/user/v1.0/credentials/cloud") @RequestMapping("/user/v1.0/credentials/cloud")
@Component @Component
@StatusCodes({
@ResponseCode(code = 401, condition = "Bad credentials")
})
public class CloudCredentialsController { public class CloudCredentialsController {
@Autowired @Autowired
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package nl.uva.sne.drip.api.v1.rest; package nl.uva.sne.drip.api.v1.rest;
import com.webcohesion.enunciate.metadata.rs.ResponseCode;
import com.webcohesion.enunciate.metadata.rs.StatusCodes;
import nl.uva.sne.drip.data.v1.external.PlaybookRepresentation; import nl.uva.sne.drip.data.v1.external.PlaybookRepresentation;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -46,6 +48,9 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -46,6 +48,9 @@ import org.springframework.web.bind.annotation.RequestBody;
@RestController @RestController
@RequestMapping("/user/v1.0/deployer/configuration") @RequestMapping("/user/v1.0/deployer/configuration")
@Component @Component
@StatusCodes({
@ResponseCode(code = 401, condition = "Bad credentials")
})
public class ConfigurationController { public class ConfigurationController {
@Autowired @Autowired
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package nl.uva.sne.drip.api.v1.rest; package nl.uva.sne.drip.api.v1.rest;
import com.webcohesion.enunciate.metadata.rs.ResponseCode;
import com.webcohesion.enunciate.metadata.rs.StatusCodes;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.annotation.security.RolesAllowed; import javax.annotation.security.RolesAllowed;
...@@ -42,6 +44,9 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -42,6 +44,9 @@ import org.springframework.web.bind.annotation.RequestBody;
@RestController @RestController
@RequestMapping("/user/v1.0/deployer") @RequestMapping("/user/v1.0/deployer")
@Controller @Controller
@StatusCodes({
@ResponseCode(code = 401, condition = "Bad credentials")
})
public class DeployController { public class DeployController {
@Autowired @Autowired
......
...@@ -33,6 +33,7 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -33,6 +33,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import nl.uva.sne.drip.api.exception.KeyException; import nl.uva.sne.drip.api.exception.KeyException;
import nl.uva.sne.drip.api.exception.NotFoundException; import nl.uva.sne.drip.api.exception.NotFoundException;
import nl.uva.sne.drip.api.exception.NullKeyException;
import nl.uva.sne.drip.api.service.KeyPairService; import nl.uva.sne.drip.api.service.KeyPairService;
import nl.uva.sne.drip.api.service.UserService; import nl.uva.sne.drip.api.service.UserService;
import nl.uva.sne.drip.data.v1.external.KeyPair; import nl.uva.sne.drip.data.v1.external.KeyPair;
...@@ -49,6 +50,9 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -49,6 +50,9 @@ import org.springframework.web.bind.annotation.RequestBody;
@RestController @RestController
@RequestMapping("/user/v1.0/keys") @RequestMapping("/user/v1.0/keys")
@Component @Component
@StatusCodes({
@ResponseCode(code = 401, condition = "Bad credentials")
})
public class KeyPairController { public class KeyPairController {
@Autowired @Autowired
...@@ -90,11 +94,12 @@ public class KeyPairController { ...@@ -90,11 +94,12 @@ public class KeyPairController {
// } // }
// curl -H "Content-KeyType: application/json" -X POST -d '{"key":"ssh-rsa AAAAB3NzaDWBqs75i849MytgwgQcRYMcsXIki0yeYTKABH6JqoiyFBHtYlyh/EV1t6cujb9LyNP4J5EN4fPbtwKYvxecd0LojSPxl4wjQlfrHyg6iKUYB7hVzGqACMvgYZHrtHPfrdEmOGPplPVPpoaX2j+u0BZ0yYhrWMKjzyYZKa68yy5N18+Gq+1p83HfUDwIU9wWaUYdgEvDujqF6b8p3z6LDx9Ob+RanSMZSt+b8eZRcd+F2Oy/gieJEJ8kc152VIOv8UY1xB3hVEwVnSRGgrAsa+9PChfF6efXUGWiKf8KBlWgBOYsSTsOY4ks9zkXMnbcTdC+o7xspOkyIcWjv us@u\n","name":"id_rsa.pub"}' localhost:8080/drip-api/user_key/ // curl -H "Content-KeyType: application/json" -X POST -d '{"key":"ssh-rsa AAAAB3NzaDWBqs75i849MytgwgQcRYMcsXIki0yeYTKABH6JqoiyFBHtYlyh/EV1t6cujb9LyNP4J5EN4fPbtwKYvxecd0LojSPxl4wjQlfrHyg6iKUYB7hVzGqACMvgYZHrtHPfrdEmOGPplPVPpoaX2j+u0BZ0yYhrWMKjzyYZKa68yy5N18+Gq+1p83HfUDwIU9wWaUYdgEvDujqF6b8p3z6LDx9Ob+RanSMZSt+b8eZRcd+F2Oy/gieJEJ8kc152VIOv8UY1xB3hVEwVnSRGgrAsa+9PChfF6efXUGWiKf8KBlWgBOYsSTsOY4ks9zkXMnbcTdC+o7xspOkyIcWjv us@u\n","name":"id_rsa.pub"}' localhost:8080/drip-api/user_key/
/** /**
* Posts the Key and stores it. The Key is a container for public key * Posts the Key and stores it. The Key is a container for public pair
* contents. The public key contents are represented in the 'key' field. All * contents. The public pair contents are represented in the 'pair' field.
* new lines in the 'key' field have to be replaced with the '\n' character. * All new lines in the 'pair' field have to be replaced with the '\n'
* character.
* *
* @param key. The Key * @param pair. The Key
* @return the ID of the Key * @return the ID of the Key
*/ */
@RequestMapping(method = RequestMethod.POST) @RequestMapping(method = RequestMethod.POST)
...@@ -103,9 +108,12 @@ public class KeyPairController { ...@@ -103,9 +108,12 @@ public class KeyPairController {
@ResponseCode(code = 400, condition = "Key can't be empty") @ResponseCode(code = 400, condition = "Key can't be empty")
}) })
public @ResponseBody public @ResponseBody
String postKey(@RequestBody KeyPair key) { String postKey(@RequestBody KeyPair pair) {
service.save(key); if (pair.getPrivateKey() == null && pair.getPublicKey() == null) {
return key.getId(); throw new NullKeyException();
}
service.save(pair);
return pair.getId();
} }
/** /**
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package nl.uva.sne.drip.api.v1.rest; package nl.uva.sne.drip.api.v1.rest;
import com.webcohesion.enunciate.metadata.rs.ResponseCode;
import com.webcohesion.enunciate.metadata.rs.StatusCodes;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -45,6 +47,9 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -45,6 +47,9 @@ import org.springframework.web.bind.annotation.RequestParam;
@RestController @RestController
@RequestMapping("/user/v1.0/planner") @RequestMapping("/user/v1.0/planner")
@Controller @Controller
@StatusCodes({
@ResponseCode(code = 401, condition = "Bad credentials")
})
public class PlannerController { public class PlannerController {
// @Autowired // @Autowired
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package nl.uva.sne.drip.api.v1.rest; package nl.uva.sne.drip.api.v1.rest;
import com.webcohesion.enunciate.metadata.rs.ResponseCode;
import com.webcohesion.enunciate.metadata.rs.StatusCodes;
import nl.uva.sne.drip.data.v1.external.ProvisionRequest; import nl.uva.sne.drip.data.v1.external.ProvisionRequest;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -47,6 +49,9 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -47,6 +49,9 @@ import org.springframework.web.bind.annotation.RequestBody;
@RestController @RestController
@RequestMapping("/user/v1.0/provisioner") @RequestMapping("/user/v1.0/provisioner")
@Component @Component
@StatusCodes({
@ResponseCode(code = 401, condition = "Bad credentials")
})
public class ProvisionController { public class ProvisionController {
@Autowired @Autowired
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package nl.uva.sne.drip.api.v1.rest; package nl.uva.sne.drip.api.v1.rest;
import com.webcohesion.enunciate.metadata.rs.ResponseCode;
import com.webcohesion.enunciate.metadata.rs.StatusCodes;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -45,6 +47,9 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -45,6 +47,9 @@ import org.springframework.web.bind.annotation.RequestBody;
@RestController @RestController
@RequestMapping("/user/v1.0/script") @RequestMapping("/user/v1.0/script")
@Component @Component
@StatusCodes({
@ResponseCode(code = 401, condition = "Bad credentials")
})
public class ScriptController { public class ScriptController {
@Autowired @Autowired
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package nl.uva.sne.drip.api.v1.rest; package nl.uva.sne.drip.api.v1.rest;
import com.webcohesion.enunciate.metadata.rs.ResponseCode;
import com.webcohesion.enunciate.metadata.rs.StatusCodes;
import nl.uva.sne.drip.data.v1.external.ToscaRepresentation; import nl.uva.sne.drip.data.v1.external.ToscaRepresentation;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -46,6 +48,9 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -46,6 +48,9 @@ import org.springframework.web.bind.annotation.RequestBody;
@RestController @RestController
@RequestMapping("/user/v1.0/tosca") @RequestMapping("/user/v1.0/tosca")
@Component @Component
@StatusCodes({
@ResponseCode(code = 401, condition = "Bad credentials")
})
public class ToscaController { public class ToscaController {
@Autowired @Autowired
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package nl.uva.sne.drip.api.v1.rest; package nl.uva.sne.drip.api.v1.rest;
import com.webcohesion.enunciate.metadata.rs.ResponseCode;
import com.webcohesion.enunciate.metadata.rs.StatusCodes;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
...@@ -45,6 +47,9 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -45,6 +47,9 @@ import org.springframework.web.bind.annotation.RequestBody;
@RestController @RestController
@RequestMapping("/manager/v1.0/user") @RequestMapping("/manager/v1.0/user")
@Component @Component
@StatusCodes({
@ResponseCode(code = 401, condition = "Bad credentials")
})
public class UserController { public class UserController {
@Autowired @Autowired
......
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<netbeans.hint.licensePath>${project.basedir}/../licenseheader.txt</netbeans.hint.licensePath>
</properties>
</project-shared-configuration>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>nl.uva.sne.drip</groupId>
<artifactId>drip</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>drip-tests</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
<scope>test</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>test</scope>
<type>jar</type>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
\ No newline at end of file
/*
* Copyright 2017 S. Koulouzis.
*
* 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.test.manager;
import org.junit.After;
import org.junit.AfterClass;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.BeforeClass;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.core.Response;
/**
*
* @author S. Koulouzis.
*/
public class CloudCredentialsController {
public CloudCredentialsController() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
// TODO add test methods here.
// The methods must be annotated with annotation @Test. For example:
//
// @Test
// public void hello() {}
private void post(String lcmId, String metadataId, String storageId, int expected) {
// String payload = "{\"local-storage-id\" : \"" + storageId + "\"}";
// Entity<String> entity = Entity.entity(payload, "application/json");
// Response resp = getWebTarget().path(TRIGGER_PATH).path(lcmId).path("metadata").path(metadataId)
// .request().header(AUTH_USER_HEADER, "admin")
// .header(BasicAuthenticationManager.BASIC_AUTHENTICATION_HEADER, basicAuthTokenAdmin)
// .post(entity);
// assertEquals(expected, resp.getStatus());
}
}
/*
* 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.test.manager;
import javax.net.ssl.SSLContext;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author alogo
*/
public class DRIPTest {
public DRIPTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
// TODO add test methods here.
// The methods must be annotated with annotation @Test. For example:
//
// @Test
// public void hello() {}
private Client create(String host) {
// SSLContext sc;
// ClientBuilder builder = ClientBuilder.newBuilder();
//
// try {
// builder.hostnameVerifier(new javax.net.ssl.HostnameVerifier() {
// public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) {
// if (hostname.equals(host)) {
// return true;
// }
// return false;
// }
// });
// builder = builder.sslContext(sc);
// if (basicAutorization != null) {
// builder.register(basicAutorization);
// }
// } catch (NullPointerException npe) {
// LOGGER.warn("Null SSL context, skipping client SSL configuration", npe);
// }
// return builder.build();
return null;
}
}
...@@ -12,5 +12,6 @@ ...@@ -12,5 +12,6 @@
<modules> <modules>
<module>drip-api</module> <module>drip-api</module>
<module>drip-planner2provisioner</module> <module>drip-planner2provisioner</module>
<module>drip-tests</module>
</modules> </modules>
</project> </project>
\ 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