Commit a4b4b101 authored by Spiros Koulouzis's avatar Spiros Koulouzis

Added playbook controller, service , POJO, DAO

parent 0c81f034
......@@ -125,6 +125,12 @@ from the machine the keys correspond to.</span>
<td> <span class="datatype-name">PlanResponse</span>
</td>
<td> <span class="datatype-description">This class represents a plan generated by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_PlaybookRepresentation.html">
<td> <span class="datatype-name">PlaybookRepresentation</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="json_ProvisionRequest.html">
......@@ -298,6 +304,12 @@ from the machine the keys correspond to.</span>
<td> <span class="datatype-name">planResponse</span>
</td>
<td> <span class="datatype-description">This class represents a plan generated by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_playbookRepresentation.html">
<td> <span class="datatype-name">playbookRepresentation</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_provisionRequest.html">
......
......@@ -91,7 +91,7 @@
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-gwt-json-overlay.jar">
<td><span class="downloadfile-name">drip-api-gwt-json-overlay.jar</span></td>
<td><span class="downloadfile-size">8.98K</span></td>
<td><span class="downloadfile-size">9.53K</span></td>
<td><span class="downloadfile-description">The sources for the GWT JSON overlay.</span></td>
</tr>
</tbody>
......@@ -116,12 +116,12 @@
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-json-client.jar">
<td><span class="downloadfile-name">drip-api-json-client.jar</span></td>
<td><span class="downloadfile-size">11.77K</span></td>
<td><span class="downloadfile-size">12.49K</span></td>
<td><span class="downloadfile-description">The binaries for the Java JSON client library.</span></td>
</tr>
<tr class="clickable-row" data-href="drip-api-json-client-json-sources.jar">
<td><span class="downloadfile-name">drip-api-json-client-json-sources.jar</span></td>
<td><span class="downloadfile-size">9.29K</span></td>
<td><span class="downloadfile-size">9.87K</span></td>
<td><span class="downloadfile-description">The sources for the Java JSON client library.</span></td>
</tr>
</tbody>
......@@ -144,12 +144,12 @@
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-xml-client.jar">
<td><span class="downloadfile-name">drip-api-xml-client.jar</span></td>
<td><span class="downloadfile-size">19.85K</span></td>
<td><span class="downloadfile-size">20.45K</span></td>
<td><span class="downloadfile-description">The binaries for the Java XML client library.</span></td>
</tr>
<tr class="clickable-row" data-href="drip-api-xml-client-xml-sources.jar">
<td><span class="downloadfile-name">drip-api-xml-client-xml-sources.jar</span></td>
<td><span class="downloadfile-size">17.89K</span></td>
<td><span class="downloadfile-size">18.44K</span></td>
<td><span class="downloadfile-description">The sources for the Java XML client library.</span></td>
</tr>
</tbody>
......@@ -184,7 +184,7 @@
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-js.zip">
<td><span class="downloadfile-name">drip-api-js.zip</span></td>
<td><span class="downloadfile-size">3.53K</span></td>
<td><span class="downloadfile-size">3.57K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......@@ -213,7 +213,7 @@
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-php.zip">
<td><span class="downloadfile-name">drip-api-php.zip</span></td>
<td><span class="downloadfile-size">3.72K</span></td>
<td><span class="downloadfile-size">3.75K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......@@ -245,7 +245,7 @@
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-php.zip">
<td><span class="downloadfile-name">drip-api-php.zip</span></td>
<td><span class="downloadfile-size">7.58K</span></td>
<td><span class="downloadfile-size">7.62K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......@@ -276,7 +276,7 @@
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api.rb">
<td><span class="downloadfile-name">drip-api.rb</span></td>
<td><span class="downloadfile-size">47.03K</span></td>
<td><span class="downloadfile-size">48.54K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......
This diff is collapsed.
......@@ -200,6 +200,25 @@ provisopned based on a TOSCA description.</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for planing the type of resources to be
provisopned based on a TOSCA description.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_PlaybookController.html">
<td> <span class="resource-name">PlaybookController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/playbook/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/post</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for storing PlayBook descriptions that can be
used by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_ProvisionController.html">
......@@ -389,6 +408,12 @@ from the machine the keys correspond to.</span>
<td> <span class="datatype-name">PlanResponse</span>
</td>
<td> <span class="datatype-description">This class represents a plan generated by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_PlaybookRepresentation.html">
<td> <span class="datatype-name">PlaybookRepresentation</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="json_ProvisionRequest.html">
......@@ -562,6 +587,12 @@ from the machine the keys correspond to.</span>
<td> <span class="datatype-name">planResponse</span>
</td>
<td> <span class="datatype-description">This class represents a plan generated by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_playbookRepresentation.html">
<td> <span class="datatype-name">playbookRepresentation</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_provisionRequest.html">
......
......@@ -68,7 +68,7 @@
<dl class="dl-horizontal">
<dt>Subtypes</dt>
<dd><a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_ToscaRepresentation.html">ToscaRepresentation</a>, <a href="json_PlanResponse.html">PlanResponse</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a></dd>
<dd><a href="json_PlaybookRepresentation.html">PlaybookRepresentation</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_ToscaRepresentation.html">ToscaRepresentation</a>, <a href="json_PlanResponse.html">PlanResponse</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a></dd>
</dl>
<table class="table datatype-properties">
......
......@@ -68,7 +68,7 @@
<dl class="dl-horizontal">
<dt>Subtypes</dt>
<dd><a href="json_Script.html">Script</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_ToscaRepresentation.html">ToscaRepresentation</a>, <a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_PlanResponse.html">PlanResponse</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a>, <a href="json_Key.html">Key</a>, <a href="json_CloudCredentials.html">CloudCredentials</a></dd>
<dd><a href="json_PlaybookRepresentation.html">PlaybookRepresentation</a>, <a href="json_Script.html">Script</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_ToscaRepresentation.html">ToscaRepresentation</a>, <a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_PlanResponse.html">PlanResponse</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_Key.html">Key</a>, <a href="json_CloudCredentials.html">CloudCredentials</a></dd>
</dl>
<table class="table datatype-properties">
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>drip-api: PlayBookRepresentation</title>
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!--custom css for these pages-->
<link rel="stylesheet" href="css/style.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#apinav">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">drip-api: PlayBookRepresentation</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="resources.html">Resources</a></li>
<li><a href="data.html">Data Types</a></li>
<li><a href="downloads.html">Files and Libraries</a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar" id="apinav">
<ul class="nav nav-sidebar">
<li class="text-right"><a href="#top"><small>Back to Top</small></a></li>
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<ol class="breadcrumb" id="top">
<li class="active dropdown"><a href="index.html">Home</a></li>
<li class="active dropdown"><a href="syntax_json.html">JSON</a></li>
<li class="dropdown"><a href="json_PlayBookRepresentation.html">PlayBookRepresentation</a></li>
</ol>
<h1 class="page-header">PlayBookRepresentation <small>Data Type</small></h1>
<p></p>
<dl class="dl-horizontal">
</dl>
<table class="table datatype-properties">
<caption>Properties</caption>
<thead>
<tr>
<th>name</th>
<th>data type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td> <span class="property-name">name</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
</tbody>
<tr>
<td colspan="3"><h5 class="text-muted">Properties inherited from <a href="json_KeyValueHolder.html">KeyValueHolder</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">keyValue</span></td>
<td><span class="datatype-reference">map of object
</span></td>
<td><span class="property-description"></span></td>
</tr>
<tr>
<td><span class="property-name">id</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-description"></span></td>
</tr>
</tbody>
<tr>
<td colspan="3"><h5 class="text-muted">Properties inherited from <a href="json_OwnedObject.html">OwnedObject</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">owner</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-description"></span></td>
</tr>
</tbody>
</table>
<p class="lead">Example</p>
<pre class="prettyprint language-js example">{
&quot;name&quot; : &quot;...&quot;,
&quot;keyValue&quot; : {
&quot;property1&quot; : { },
&quot;property2&quot; : { }
},
&quot;id&quot; : &quot;...&quot;,
&quot;owner&quot; : &quot;...&quot;
}</pre>
<footer class="footer">
<div class="container">
<p class="text-muted">Generated by <a href="http://enunciate.webcohesion.com">Enunciate</a>.</p>
</div>
</footer>
</div>
</div>
</div>
<!-- JavaScript placed at the end of the document so the pages load faster. -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Bootstrap core JavaScript
================================================== -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!-- prettify code blocks. see http://code.google.com/p/google-code-prettify/ -->
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js" type="text/javascript"></script>
<script>
$(function() {
$(".clickable-row").click(function() {
window.document.location = $(this).data("href");
});
$('[data-toggle="tooltip"]').tooltip()
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>drip-api: PlaybookRepresentation</title>
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!--custom css for these pages-->
<link rel="stylesheet" href="css/style.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#apinav">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">drip-api: PlaybookRepresentation</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="resources.html">Resources</a></li>
<li><a href="data.html">Data Types</a></li>
<li><a href="downloads.html">Files and Libraries</a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar" id="apinav">
<ul class="nav nav-sidebar">
<li class="text-right"><a href="#top"><small>Back to Top</small></a></li>
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<ol class="breadcrumb" id="top">
<li class="active dropdown"><a href="index.html">Home</a></li>
<li class="active dropdown"><a href="syntax_json.html">JSON</a></li>
<li class="dropdown"><a href="json_PlaybookRepresentation.html">PlaybookRepresentation</a></li>
</ol>
<h1 class="page-header">PlaybookRepresentation <small>Data Type</small></h1>
<p></p>
<dl class="dl-horizontal">
</dl>
<table class="table datatype-properties">
<caption>Properties</caption>
<thead>
<tr>
<th>name</th>
<th>data type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td> <span class="property-name">name</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
</tbody>
<tr>
<td colspan="3"><h5 class="text-muted">Properties inherited from <a href="json_KeyValueHolder.html">KeyValueHolder</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">keyValue</span></td>
<td><span class="datatype-reference">map of object
</span></td>
<td><span class="property-description"></span></td>
</tr>
<tr>
<td><span class="property-name">id</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-description"></span></td>
</tr>
</tbody>
<tr>
<td colspan="3"><h5 class="text-muted">Properties inherited from <a href="json_OwnedObject.html">OwnedObject</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">owner</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-description"></span></td>
</tr>
</tbody>
</table>
<p class="lead">Example</p>
<pre class="prettyprint language-js example">{
&quot;name&quot; : &quot;...&quot;,
&quot;keyValue&quot; : {
&quot;property1&quot; : { },
&quot;property2&quot; : { }
},
&quot;id&quot; : &quot;...&quot;,
&quot;owner&quot; : &quot;...&quot;
}</pre>
<footer class="footer">
<div class="container">
<p class="text-muted">Generated by <a href="http://enunciate.webcohesion.com">Enunciate</a>.</p>
</div>
</footer>
</div>
</div>
</div>
<!-- JavaScript placed at the end of the document so the pages load faster. -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Bootstrap core JavaScript
================================================== -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!-- prettify code blocks. see http://code.google.com/p/google-code-prettify/ -->
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js" type="text/javascript"></script>
<script>
$(function() {
$(".clickable-row").click(function() {
window.document.location = $(this).data("href");
});
$('[data-toggle="tooltip"]').tooltip()
});
</script>
</body>
</html>
......@@ -427,6 +427,17 @@ to specify the domain name for ec2]]>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="playbookRepresentation">
<xs:complexContent>
<xs:extension base="keyValueHolder">
<xs:sequence>
<xs:element name="name" type="xs:string" minOccurs="0">
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="provisionRequest">
<xs:complexContent>
<xs:extension base="keyValueHolder">
......
This diff is collapsed.
This diff is collapsed.
......@@ -192,6 +192,25 @@ provisopned based on a TOSCA description.</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for planing the type of resources to be
provisopned based on a TOSCA description.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_PlaybookController.html">
<td> <span class="resource-name">PlaybookController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/playbook/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/post</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for storing PlayBook descriptions that can be
used by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_ProvisionController.html">
......
......@@ -120,6 +120,12 @@ from the machine the keys correspond to.</span>
<td> <span class="datatype-name">PlanResponse</span>
</td>
<td> <span class="datatype-description">This class represents a plan generated by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_PlaybookRepresentation.html">
<td> <span class="datatype-name">PlaybookRepresentation</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="json_ProvisionRequest.html">
......
......@@ -193,6 +193,12 @@ from the machine the keys correspond to.</span>
<td> <span class="datatype-name">planResponse</span>
</td>
<td> <span class="datatype-description">This class represents a plan generated by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_playbookRepresentation.html">
<td> <span class="datatype-name">playbookRepresentation</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_provisionRequest.html">
......
......@@ -72,7 +72,7 @@
<dt>Schema</dt>
<dd><a href="ns0.xsd">ns0.xsd</a></dd>
<dt>Subtypes</dt>
<dd><a href="xml_ns0_planResponse.html">planResponse</a>, <a href="xml_ns0_provisionRequest.html">provisionRequest</a>, <a href="xml_ns0_provisionResponse.html">provisionResponse</a>, <a href="xml_ns0_toscaRepresentation.html">toscaRepresentation</a></dd>
<dd><a href="xml_ns0_planResponse.html">planResponse</a>, <a href="xml_ns0_playbookRepresentation.html">playbookRepresentation</a>, <a href="xml_ns0_provisionRequest.html">provisionRequest</a>, <a href="xml_ns0_provisionResponse.html">provisionResponse</a>, <a href="xml_ns0_toscaRepresentation.html">toscaRepresentation</a></dd>
</dl>
<table class="table datatype-properties">
......
......@@ -72,7 +72,7 @@
<dt>Schema</dt>
<dd><a href="ns0.xsd">ns0.xsd</a></dd>
<dt>Subtypes</dt>
<dd><a href="xml_ns0_cloudCredentials.html">cloudCredentials</a>, <a href="xml_ns0_deployRequest.html">deployRequest</a>, <a href="xml_ns0_deployResponse.html">deployResponse</a>, <a href="xml_ns0_key.html">key</a>, <a href="xml_ns0_keyValueHolder.html">keyValueHolder</a>, <a href="xml_ns0_planResponse.html">planResponse</a>, <a href="xml_ns0_provisionRequest.html">provisionRequest</a>, <a href="xml_ns0_provisionResponse.html">provisionResponse</a>, <a href="xml_ns0_script.html">script</a>, <a href="xml_ns0_toscaRepresentation.html">toscaRepresentation</a></dd>
<dd><a href="xml_ns0_cloudCredentials.html">cloudCredentials</a>, <a href="xml_ns0_deployRequest.html">deployRequest</a>, <a href="xml_ns0_deployResponse.html">deployResponse</a>, <a href="xml_ns0_key.html">key</a>, <a href="xml_ns0_keyValueHolder.html">keyValueHolder</a>, <a href="xml_ns0_planResponse.html">planResponse</a>, <a href="xml_ns0_playbookRepresentation.html">playbookRepresentation</a>, <a href="xml_ns0_provisionRequest.html">provisionRequest</a>, <a href="xml_ns0_provisionResponse.html">provisionResponse</a>, <a href="xml_ns0_script.html">script</a>, <a href="xml_ns0_toscaRepresentation.html">toscaRepresentation</a></dd>
</dl>
<table class="table datatype-properties">
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>drip-api: playBookRepresentation</title>
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!--custom css for these pages-->
<link rel="stylesheet" href="css/style.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#apinav">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">drip-api: playBookRepresentation</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="resources.html">Resources</a></li>
<li><a href="data.html">Data Types</a></li>
<li><a href="downloads.html">Files and Libraries</a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar" id="apinav">
<ul class="nav nav-sidebar">
<li class="text-right"><a href="#top"><small>Back to Top</small></a></li>
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<ol class="breadcrumb" id="top">
<li class="active dropdown"><a href="index.html">Home</a></li>
<li class="active dropdown"><a href="syntax_xml.html">XML</a></li>
<li class="dropdown"><a href="xml_ns0_playBookRepresentation.html">playBookRepresentation</a></li>
</ol>
<h1 class="page-header">playBookRepresentation <small>Data Type</small></h1>
<p></p>
<dl class="dl-horizontal">
<dt>Namespace</dt>
<dd>(Default)</dd>
<dt>Schema</dt>
<dd><a href="ns0.xsd">ns0.xsd</a></dd>
</dl>
<table class="table datatype-properties">
<caption>Properties</caption>
<thead>
<tr>
<th>name</th>
<th>data type</th>
<th>type</th>
<th>namespace</th>
<th>min/max occurs</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td> <span class="property-name">name</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-type">element
</span>
</td>
<td> <span class="property-namespaceInfo">
</span>
</td>
<td> <span class="property-minMaxOccurs">0/1
</span>
</td>
<td> <span class="property-description">the name</span>
</td>
</tr>
</tbody>
<tr>
<td colspan="6"><h5 class="text-muted">Properties inherited from <a href="xml_ns0_keyValueHolder.html">keyValueHolder</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">id</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-type">element
</span></td>
<td><span class="property-namespaceInfo">
</span></td>
<td><span class="property-minMaxOccurs">0/1
</span></td>
<td><span class="property-description">the id</span></td>
</tr>
</tbody>
<tr>
<td colspan="6"><h5 class="text-muted">Properties inherited from <a href="xml_ns0_ownedObject.html">ownedObject</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">owner</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-type">element
</span></td>
<td><span class="property-namespaceInfo">
</span></td>
<td><span class="property-minMaxOccurs">0/1
</span></td>
<td><span class="property-description">the owner</span></td>
</tr>
</tbody>
</table>
<p class="lead">Example</p>
<pre class="prettyprint language-xml example">&lt;p-----&gt;
&lt;name&gt;...&lt;/name&gt;
&lt;id&gt;...&lt;/id&gt;
&lt;owner&gt;...&lt;/owner&gt;
&lt;/p-----&gt;
</pre>
<footer class="footer">
<div class="container">
<p class="text-muted">Generated by <a href="http://enunciate.webcohesion.com">Enunciate</a>.</p>
</div>
</footer>
</div>
</div>
</div>
<!-- JavaScript placed at the end of the document so the pages load faster. -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Bootstrap core JavaScript
================================================== -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!-- prettify code blocks. see http://code.google.com/p/google-code-prettify/ -->
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js" type="text/javascript"></script>
<script>
$(function() {
$(".clickable-row").click(function() {
window.document.location = $(this).data("href");
});
$('[data-toggle="tooltip"]').tooltip()
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>drip-api: playbookRepresentation</title>
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!--custom css for these pages-->
<link rel="stylesheet" href="css/style.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#apinav">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">drip-api: playbookRepresentation</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="resources.html">Resources</a></li>
<li><a href="data.html">Data Types</a></li>
<li><a href="downloads.html">Files and Libraries</a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar" id="apinav">
<ul class="nav nav-sidebar">
<li class="text-right"><a href="#top"><small>Back to Top</small></a></li>
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<ol class="breadcrumb" id="top">
<li class="active dropdown"><a href="index.html">Home</a></li>
<li class="active dropdown"><a href="syntax_xml.html">XML</a></li>
<li class="dropdown"><a href="xml_ns0_playbookRepresentation.html">playbookRepresentation</a></li>
</ol>
<h1 class="page-header">playbookRepresentation <small>Data Type</small></h1>
<p></p>
<dl class="dl-horizontal">
<dt>Namespace</dt>
<dd>(Default)</dd>
<dt>Schema</dt>
<dd><a href="ns0.xsd">ns0.xsd</a></dd>
</dl>
<table class="table datatype-properties">
<caption>Properties</caption>
<thead>
<tr>
<th>name</th>
<th>data type</th>
<th>type</th>
<th>namespace</th>
<th>min/max occurs</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td> <span class="property-name">name</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-type">element
</span>
</td>
<td> <span class="property-namespaceInfo">
</span>
</td>
<td> <span class="property-minMaxOccurs">0/1
</span>
</td>
<td> <span class="property-description">the name</span>
</td>
</tr>
</tbody>
<tr>
<td colspan="6"><h5 class="text-muted">Properties inherited from <a href="xml_ns0_keyValueHolder.html">keyValueHolder</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">id</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-type">element
</span></td>
<td><span class="property-namespaceInfo">
</span></td>
<td><span class="property-minMaxOccurs">0/1
</span></td>
<td><span class="property-description">the id</span></td>
</tr>
</tbody>
<tr>
<td colspan="6"><h5 class="text-muted">Properties inherited from <a href="xml_ns0_ownedObject.html">ownedObject</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">owner</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-type">element
</span></td>
<td><span class="property-namespaceInfo">
</span></td>
<td><span class="property-minMaxOccurs">0/1
</span></td>
<td><span class="property-description">the owner</span></td>
</tr>
</tbody>
</table>
<p class="lead">Example</p>
<pre class="prettyprint language-xml example">&lt;p-----&gt;
&lt;name&gt;...&lt;/name&gt;
&lt;id&gt;...&lt;/id&gt;
&lt;owner&gt;...&lt;/owner&gt;
&lt;/p-----&gt;
</pre>
<footer class="footer">
<div class="container">
<p class="text-muted">Generated by <a href="http://enunciate.webcohesion.com">Enunciate</a>.</p>
</div>
</footer>
</div>
</div>
</div>
<!-- JavaScript placed at the end of the document so the pages load faster. -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Bootstrap core JavaScript
================================================== -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!-- prettify code blocks. see http://code.google.com/p/google-code-prettify/ -->
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js" type="text/javascript"></script>
<script>
$(function() {
$(".clickable-row").click(function() {
window.document.location = $(this).data("href");
});
$('[data-toggle="tooltip"]').tooltip()
});
</script>
</body>
</html>
/*
* 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.api.dao;
import nl.uva.sne.drip.commons.v1.types.PlaybookRepresentation;
import org.springframework.data.mongodb.repository.MongoRepository;
/**
*
* @author S. Koulouzis
*/
public interface PlaybookDao extends MongoRepository<PlaybookRepresentation, String> {
}
/*
* 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.api.service;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import nl.uva.sne.drip.api.exception.NotFoundException;
import nl.uva.sne.drip.commons.utils.Constants;
import nl.uva.sne.drip.commons.v1.types.PlaybookRepresentation;
import nl.uva.sne.drip.commons.utils.Converter;
import nl.uva.sne.drip.commons.v1.types.User;
import org.json.JSONException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.security.access.prepost.PostFilter;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import nl.uva.sne.drip.api.dao.PlaybookDao;
/**
*
* @author S. Koulouzis
*/
@Service
@PreAuthorize("isAuthenticated()")
public class PlaybookService {
@Autowired
private PlaybookDao dao;
public String get(String id, String fromat) throws JSONException {
PlaybookRepresentation playbook = findOne(id);
if (playbook == null) {
throw new NotFoundException();
}
Map<String, Object> map = playbook.getKeyValue();
if (fromat != null && fromat.toLowerCase().equals("yml")) {
String ymlStr = Converter.map2YmlString(map);
ymlStr = ymlStr.replaceAll("\\uff0E", "\\.");
ymlStr = ymlStr.replaceAll("\'---':", "---");
return ymlStr;
}
if (fromat != null && fromat.toLowerCase().equals("json")) {
String jsonStr = Converter.map2JsonString(map);
jsonStr = jsonStr.replaceAll("\\uff0E", "\\.");
return jsonStr;
}
String ymlStr = Converter.map2YmlString(map);
ymlStr = ymlStr.replaceAll("\\uff0E", "\\.");
ymlStr = ymlStr.replaceAll("\'---':", "---");
return ymlStr;
}
public String saveFile(MultipartFile file) throws IOException {
String originalFileName = file.getOriginalFilename();
String name = System.currentTimeMillis() + "_" + originalFileName;
byte[] bytes = file.getBytes();
String str = new String(bytes, "UTF-8");
return saveStringContents(str, name);
}
public String saveYamlString(String yamlString, String name) throws IOException {
if (name == null) {
name = System.currentTimeMillis() + "_" + "playbook.yaml";
}
yamlString = yamlString.replaceAll("\\.", "\uff0E");
Map<String, Object> map = Converter.ymlString2Map(yamlString);
PlaybookRepresentation t = new PlaybookRepresentation();
t.setName(name);
t.setKvMap(map);
save(t);
return t.getId();
}
@PostAuthorize("(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))")
public PlaybookRepresentation delete(String id) {
PlaybookRepresentation tr = dao.findOne(id);
dao.delete(tr);
return tr;
}
@PostFilter("(filterObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))")
public List<PlaybookRepresentation> findAll() {
return dao.findAll();
}
@PostAuthorize("(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))")
public PlaybookRepresentation findOne(String id) {
return dao.findOne(id);
}
private PlaybookRepresentation save(PlaybookRepresentation t) {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String owner = user.getUsername();
t.setOwner(owner);
return dao.save(t);
}
@PostAuthorize("(hasRole('ROLE_ADMIN'))")
public void deleteAll() {
dao.deleteAll();
}
public String saveStringContents(String playbookContents, String name) throws IOException {
//Remove '\' and 'n' if they are together and replace them with '\n'
char[] array = playbookContents.toCharArray();
StringBuilder sb = new StringBuilder();
int prevChar = -1;
for (int i = 0; i < array.length; i++) {
int currentChar = (int) array[i];
if (prevChar > 0 && prevChar == 92 && currentChar == 110) {
sb.delete(sb.length() - 1, sb.length());
sb.append('\n');
} else {
sb.append((char) currentChar);
}
prevChar = (int) array[i];
}
playbookContents = sb.toString();
playbookContents = playbookContents.replaceAll("(?m)^[ \t]*\r?\n", "");
for (int i = 0; i < Constants.BAD_CHARS.length; i++) {
int hex = Constants.BAD_CHARS[i];
playbookContents = playbookContents.replaceAll(String.valueOf((char) hex), "");
}
playbookContents = playbookContents.replaceAll("\\.", "\uff0E");
Map<String, Object> map = Converter.ymlString2Map(playbookContents);
PlaybookRepresentation t = new PlaybookRepresentation();
t.setName(name);
t.setKvMap(map);
save(t);
return t.getId();
}
}
......@@ -20,6 +20,7 @@ import java.util.List;
import java.util.Map;
import nl.uva.sne.drip.api.dao.ToscaDao;
import nl.uva.sne.drip.api.exception.NotFoundException;
import nl.uva.sne.drip.commons.utils.Constants;
import nl.uva.sne.drip.commons.v1.types.ToscaRepresentation;
import nl.uva.sne.drip.commons.utils.Converter;
import nl.uva.sne.drip.commons.v1.types.User;
......@@ -40,8 +41,6 @@ import org.springframework.web.multipart.MultipartFile;
@PreAuthorize("isAuthenticated()")
public class ToscaService {
private static final int[] BAD_CHARS = {0x80};
@Autowired
private ToscaDao dao;
......@@ -137,8 +136,8 @@ public class ToscaService {
}
toscaContents = sb.toString();
toscaContents = toscaContents.replaceAll("(?m)^[ \t]*\r?\n", "");
for (int i = 0; i < BAD_CHARS.length; i++) {
int hex = BAD_CHARS[i];
for (int i = 0; i < Constants.BAD_CHARS.length; i++) {
int hex = Constants.BAD_CHARS[i];
toscaContents = toscaContents.replaceAll(String.valueOf((char) hex), "");
}
......
/*
* 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.api.v1.rest;
import nl.uva.sne.drip.commons.v1.types.PlaybookRepresentation;
import java.io.IOException;
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.json.JSONException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.PathVariable;
import nl.uva.sne.drip.api.exception.BadRequestException;
import nl.uva.sne.drip.api.service.PlaybookService;
import nl.uva.sne.drip.api.service.UserService;
import org.springframework.web.bind.annotation.RequestBody;
/**
* This controller is responsible for storing PlayBook descriptions that can be
* used by the planner.
*
* @author S. Koulouzis
*/
@RestController
@RequestMapping("/user/v1.0/playbook")
@Component
public class PlaybookController {
@Autowired
private PlaybookService playbookService;
@RequestMapping(value = "/post", method = RequestMethod.POST)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String post(@RequestBody String toscaContents) {
try {
return playbookService.saveStringContents(toscaContents, String.valueOf(System.currentTimeMillis()));
} catch (IOException ex) {
Logger.getLogger(PlaybookController.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
}
/**
* Uploads and stores a PlayBook description file
*
* @param file. The PlayBook description file
* @return the ID of the PlayBook description
*/
@RequestMapping(value = "/upload", method = RequestMethod.POST)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String toscaUpload(@RequestParam("file") MultipartFile file) {
if (file.isEmpty()) {
throw new BadRequestException("Must uplaod a file");
}
try {
return playbookService.saveFile(file);
} catch (IOException | IllegalStateException ex) {
Logger.getLogger(PlaybookController.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
}
/**
* Gets the PlayBook description.
*
* @param id the ID PlayBook description.
* @param format. the format to display the PlayBook description.
* @return the PlayBook description.
*/
@RequestMapping(value = "/{id}", method = RequestMethod.GET, params = {"format"})
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String get(@PathVariable("id") String id, @RequestParam(value = "format") String format) {
try {
return playbookService.get(id, format);
} catch (JSONException ex) {
Logger.getLogger(PlaybookController.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
}
/**
* Deletes the PlayBook description.
*
* @param id. The ID of PlayBook description to delete.
* @return The ID of the deleted PlayBook description.
*/
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String delete(@PathVariable("id") String id) {
playbookService.delete(id);
return "Deleted : " + id;
}
/**
* Gets the IDs of all the stored PlayBook descriptions.
*
* @return a list of all the IDs
*/
@RequestMapping(value = "/ids", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
List<String> getIds() {
List<PlaybookRepresentation> all = playbookService.findAll();
List<String> ids = new ArrayList<>();
for (PlaybookRepresentation tr : all) {
ids.add(tr.getId());
}
return ids;
}
/**
* Gets the IDs of all the stored PlayBook descriptions.
*
* @return a list of all the IDs
*/
@RequestMapping(value = "/all", method = RequestMethod.DELETE)
@RolesAllowed({UserService.ADMIN})
public @ResponseBody
String deleteAll() {
playbookService.deleteAll();
return "Done";
}
}
/*
* 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.utils;
/**
*
* @author S. Koulouzis
*/
public class Constants {
public static final int[] BAD_CHARS = {0x80};
}
......@@ -52,7 +52,13 @@ public class Converter {
public static Map<String, Object> ymlString2Map(String yamlString) {
Yaml yaml = new Yaml();
return (Map<String, Object>) yaml.load(yamlString);
Object object = yaml.load(yamlString);
if (object instanceof List) {
Map<String, Object> map = new HashMap<>();
map.put("---", object);
return map;
}
return (Map<String, Object>) object;
}
public static Map<String, Object> ymlString2Map(InputStream in) {
......
/*
* 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.data.mongodb.core.mapping.Document;
/**
*
* @author S. Koulouzis
*/
@Document
public class PlaybookRepresentation extends KeyValueHolder {
private String name;
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
}
---
- hosts: all
tasks:
- name: install sysbench
apt: name="{{ item }}" update_cache=yes state=latest
with_items:
- phoronix-test-suite
- sysbench
- expect
- git
- python-pexpect
- php-zip
become: true
- name: Phoronix-test-suite accept User Agreement
command: expect -c "spawn phoronix-test-suite; expect \"Do you agree to these terms and wish to proceed \(Y/n\):\"; send \"Y\n\"; expect \"Enable anonymous usage / statistics reporting \(Y/n\):\"; send \"n\n\"; expect \"Enable anonymous statistical reporting of installed software / hardware \(Y/n\):\"; send \"n\n\"; interact;"
become: true
- name: Install stream
command: phoronix-test-suite install-test stream
become: true
- name: Install iozone
command: phoronix-test-suite install-test iozone
become: true
- name: Count vCPU
command: nproc
register: vcpunumber
become: true
- debug: msg="{{ vcpunumber.stdout }}"
- name: Run sysbench
command: sysbench --test=cpu --cpu-max-prime=100000 --num-threads={{ vcpunumber.stdout }} run
register: sysbenchoutput
become: true
- debug: msg="{{ sysbenchoutput.stdout }}"
- name: Run stream
command: expect -c "spawn phoronix-test-suite run-test stream; expect \"Type:\"; send \"4\n\"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect \"Enter a name to save these results under:\"; send \"out\n\"; expect \"Enter a unique name to describe this test run / configuration:\"; send -- \"unique\r\"; expect \"New Description:\"; send \"\r\"; expect \"Would you like to upload the results to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"
register: streamoutput
become: true
- debug: msg="{{ streamoutput.stdout }}"
- name: Run iozone
command: expect -c "spawn phoronix-test-suite run-test iozone; expect \"Record Size:\"; send \"2\n\"; expect \"File Size:\"; send \"2\n\"; expect \"Disk Test:\"; send \"3\n\"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect \"Enter a name to save these results under:\"; send \"out\n\"; expect \"Enter a unique name to describe this test run / configuration:\"; send -- \"unique\r\"; expect \"New Description:\"; send \"\r\"; expect \"Would you like to upload the results to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"
register: iozoneoutput
become: true
- name: Get stream results
command: phoronix-test-suite result-file-to-csv out
register: streamoutput
become: true
- debug: msg="{{ streamoutput.stdout }}"
#- debug: msg="{{ iozoneoutput.stdout }}"
#- local_action: copy content="{{ iozoneoutput.stdout }}" dest="{{ resultslocation }}iozone"
\ No newline at end of file
- name: install sysbench
apt: name="{{ item }}" update_cache=yes state=latest
with_items: [phoronix-test-suite, sysbench, expect, git, python-pexpect, php-zip]
become: true
- {name: Phoronix-test-suite accept User Agreement, command: 'expect -c "spawn phoronix-test-suite;
expect \"Do you agree to these terms and wish to proceed \(Y/n\):\"; send \"Y
\"; expect \"Enable anonymous usage / statistics reporting \(Y/n\):\"; send
\"n \"; expect \"Enable anonymous statistical reporting of installed software
/ hardware \(Y/n\):\"; send \"n \"; interact;"', become: true}
- {name: Install stream, command: phoronix-test-suite install-test stream, become: true}
- {name: Install iozone, command: phoronix-test-suite install-test iozone, become: true}
- {name: Count vCPU, command: nproc, register: vcpunumber, become: true}
- {debug: 'msg="{{ vcpunumber.stdout }}"'}
- {name: Run sysbench, command: 'sysbench --test=cpu --cpu-max-prime=100000 --num-threads={{
vcpunumber.stdout }} run', register: sysbenchoutput, become: true}
- {debug: 'msg="{{ sysbenchoutput.stdout }}"'}
- {name: Run stream, command: 'expect -c "spawn phoronix-test-suite run-test stream;
expect \"Type:\"; send \"4 \"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect
\"Enter a name to save these results under:\"; send \"out \"; expect \"Enter
a unique name to describe this test run / configuration:\"; send -- \"unique\r\";
expect \"New Description:\"; send \"\r\"; expect \"Would you like to upload
the results to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"', register: streamoutput,
become: true}
- {debug: 'msg="{{ streamoutput.stdout }}"'}
- {name: Run iozone, command: 'expect -c "spawn phoronix-test-suite run-test iozone;
expect \"Record Size:\"; send \"2 \"; expect \"File Size:\"; send \"2 \"; expect
\"Disk Test:\"; send \"3 \"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect \"Enter
a name to save these results under:\"; send \"out \"; expect \"Enter a unique
name to describe this test run / configuration:\"; send -- \"unique\r\"; expect
\"New Description:\"; send \"\r\"; expect \"Would you like to upload the results
to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"', register: iozoneoutput,
become: true}
- {name: Get stream results, command: phoronix-test-suite result-file-to-csv out,
register: streamoutput, become: true}
- {debug: 'msg="{{ streamoutput.stdout }}"'}
\ No newline at end of file
---
- hosts: all
tasks:
- name: install sysbench
apt: name="{{ item }}" update_cache=yes state=latest
with_items:
- phoronix-test-suite
- sysbench
- expect
- git
- python-pexpect
- php-zip
become: true
- name: Phoronix-test-suite accept User Agreement
command: expect -c "spawn phoronix-test-suite; expect \"Do you agree to these terms and wish to proceed \(Y/n\):\"; send \"Y\n\"; expect \"Enable anonymous usage / statistics reporting \(Y/n\):\"; send \"n\n\"; expect \"Enable anonymous statistical reporting of installed software / hardware \(Y/n\):\"; send \"n\n\"; interact;"
become: true
- name: Install stream
command: phoronix-test-suite install-test stream
become: true
- name: Install iozone
command: phoronix-test-suite install-test iozone
become: true
- name: Count vCPU
command: nproc
register: vcpunumber
become: true
- debug: msg="{{ vcpunumber.stdout }}"
- name: Run sysbench
command: sysbench --test=cpu --cpu-max-prime=100000 --num-threads={{ vcpunumber.stdout }} run
register: sysbenchoutput
become: true
- debug: msg="{{ sysbenchoutput.stdout }}"
- name: Run stream
command: expect -c "spawn phoronix-test-suite run-test stream; expect \"Type:\"; send \"4\n\"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect \"Enter a name to save these results under:\"; send \"out\n\"; expect \"Enter a unique name to describe this test run / configuration:\"; send -- \"unique\r\"; expect \"New Description:\"; send \"\r\"; expect \"Would you like to upload the results to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"
register: streamoutput
become: true
- debug: msg="{{ streamoutput.stdout }}"
- name: Run iozone
command: expect -c "spawn phoronix-test-suite run-test iozone; expect \"Record Size:\"; send \"2\n\"; expect \"File Size:\"; send \"2\n\"; expect \"Disk Test:\"; send \"3\n\"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect \"Enter a name to save these results under:\"; send \"out\n\"; expect \"Enter a unique name to describe this test run / configuration:\"; send -- \"unique\r\"; expect \"New Description:\"; send \"\r\"; expect \"Would you like to upload the results to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"
register: iozoneoutput
become: true
- name: Get stream results
command: phoronix-test-suite result-file-to-csv out
register: streamoutput
become: true
- debug: msg="{{ streamoutput.stdout }}"
\ No newline at end of file
---
- hosts: all
tasks:
- name: install sysbench
apt: name="{{ item }}" update_cache=yes state=latest
with_items: [phoronix-test-suite, sysbench, expect, git, python-pexpect, php-zip]
become: true
- {name: Phoronix-test-suite accept User Agreement, command: 'expect -c "spawn phoronix-test-suite;
expect \"Do you agree to these terms and wish to proceed \(Y/n\):\"; send \"Y
\"; expect \"Enable anonymous usage / statistics reporting \(Y/n\):\"; send
\"n \"; expect \"Enable anonymous statistical reporting of installed software
/ hardware \(Y/n\):\"; send \"n \"; interact;"', become: true}
- {name: Install stream, command: phoronix-test-suite install-test stream, become: true}
- {name: Install iozone, command: phoronix-test-suite install-test iozone, become: true}
- {name: Count vCPU, command: nproc, register: vcpunumber, become: true}
- {debug: 'msg="{{ vcpunumber.stdout }}"'}
- {name: Run sysbench, command: 'sysbench --test=cpu --cpu-max-prime=100000 --num-threads={{
vcpunumber.stdout }} run', register: sysbenchoutput, become: true}
- {debug: 'msg="{{ sysbenchoutput.stdout }}"'}
- {name: Run stream, command: 'expect -c "spawn phoronix-test-suite run-test stream;
expect \"Type:\"; send \"4 \"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect
\"Enter a name to save these results under:\"; send \"out \"; expect \"Enter
a unique name to describe this test run / configuration:\"; send -- \"unique\r\";
expect \"New Description:\"; send \"\r\"; expect \"Would you like to upload
the results to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"', register: streamoutput,
become: true}
- {debug: 'msg="{{ streamoutput.stdout }}"'}
- {name: Run iozone, command: 'expect -c "spawn phoronix-test-suite run-test iozone;
expect \"Record Size:\"; send \"2 \"; expect \"File Size:\"; send \"2 \"; expect
\"Disk Test:\"; send \"3 \"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect \"Enter
a name to save these results under:\"; send \"out \"; expect \"Enter a unique
name to describe this test run / configuration:\"; send -- \"unique\r\"; expect
\"New Description:\"; send \"\r\"; expect \"Would you like to upload the results
to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"', register: iozoneoutput,
become: true}
- {name: Get stream results, command: phoronix-test-suite result-file-to-csv out,
register: streamoutput, become: true}
- {debug: 'msg="{{ streamoutput.stdout }}"'}
\ 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