Commit 75c1139b authored by Spiros Koulouzis's avatar Spiros Koulouzis

Added ansible output service

parent 49db29e8
......@@ -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">16.50K</span></td>
<td><span class="downloadfile-size">16.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">21.73K</span></td>
<td><span class="downloadfile-size">21.78K</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">17.44K</span></td>
<td><span class="downloadfile-size">17.48K</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">29.20K</span></td>
<td><span class="downloadfile-size">29.26K</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">26.37K</span></td>
<td><span class="downloadfile-size">26.41K</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">7.52K</span></td>
<td><span class="downloadfile-size">7.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">8.44K</span></td>
<td><span class="downloadfile-size">8.47K</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">12.23K</span></td>
<td><span class="downloadfile-size">12.25K</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">112.80K</span></td>
<td><span class="downloadfile-size">113.71K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -85,6 +85,24 @@
</tr>
</thead>
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="resource_AnsibleOutputController.html">
<td> <span class="resource-name">AnsibleOutputController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/deployer/ansible</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/ansible/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/ansible/commands</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/ansible/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/ansible/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
<td> <span class="resource-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_CloudConfigurationController0.html">
<td> <span class="resource-name">CloudConfigurationController0</span>
</td>
......@@ -146,14 +164,12 @@ used by the planner.</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/deploy</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/sysbench</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for deploying a cluster on provisoned
......
......@@ -112,6 +112,15 @@ class</p>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
<tr>
<td> <span class="property-name">provisionID</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description"></span>
</td>
......@@ -174,6 +183,7 @@ object is saved.</span></td>
},
&quot;vmType&quot; : &quot;...&quot;,
&quot;cloudDeploymentDomain&quot; : &quot;...&quot;,
&quot;provisionID&quot; : &quot;...&quot;,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;
}</pre>
......
......@@ -69,7 +69,7 @@ class</p>
<dl class="dl-horizontal">
<dt>Subtypes</dt>
<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_AnsibleOutput.html">AnsibleOutput</a>, <a href="json_SysbenchCPUBenchmark.html">SysbenchCPUBenchmark</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_BenchmarkResult.html">BenchmarkResult</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_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_KeyPair.html">KeyPair</a>, <a href="json_AnsibleOutput.html">AnsibleOutput</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_PlanResponse.html">PlanResponse</a>, <a href="json_SysbenchCPUBenchmark.html">SysbenchCPUBenchmark</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_BenchmarkResult.html">BenchmarkResult</a>, <a href="json_ToscaRepresentation.html">ToscaRepresentation</a>, <a href="json_CloudCredentials.html">CloudCredentials</a></dd>
</dl>
<table class="table datatype-properties">
......
......@@ -731,6 +731,8 @@ class]]>
</xs:element>
<xs:element name="vmType" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="provisionID" type="xs:string" minOccurs="0">
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
......
This diff is collapsed.
......@@ -55,7 +55,6 @@
<li><a href="#resource_DeployController_deploy_POST"><abbr title="POST /user/v1.0/deployer/deploy">POST /user/v1.0/deployer/deplo...</abbr></a></li>
<li><a href="#resource_DeployController_getIds_GET">GET /user/v1.0/deployer/ids</a></li>
<li><a href="#resource_DeployController_sample_GET">GET /user/v1.0/deployer/sample</a></li>
<li><a href="#resource_DeployController_getSysbenchOutputs_GET"><abbr title="GET /user/v1.0/deployer/sysbench">GET /user/v1.0/deployer/sysben...</abbr></a></li>
<li><a href="#resource_DeployController_delete_DELETE"><abbr title="DELETE /user/v1.0/deployer/{id}">DELETE /user/v1.0/deployer/{id...</abbr></a></li>
<li><a href="#resource_DeployController_get_GET">GET /user/v1.0/deployer/{id}</a></li>
<li class="divider"></li>
......@@ -409,109 +408,6 @@ Content-Type: application/json
</div>
</div>
<div id="resource_DeployController_getSysbenchOutputs_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/deployer/sysbench <a href="../user/v1.0/deployer/sysbench" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p></p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN, USER</dd>
</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">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">array of <a href="json_DeployResponse.html">DeployResponse</a>
(JSON)</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">list of <a href="xml_ns0_deployResponse.html">deployResponse</a>
(XML)</span></td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<div class="container-fluid example panel">
<div class="row panel-body">
<div class="col-md-6">
<h5>Request</h5>
<pre>
GET /user/v1.0/deployer/sysbench
Accept: application/json
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 200 Looks Good
Content-Type: application/json
<code class="prettyprint language-js">
[ {
&quot;ansibleOutputList&quot; : [ &quot;...&quot;, &quot;...&quot; ],
&quot;keyPair&quot; : {
&quot;privateKey&quot; : {
&quot;name&quot; : &quot;id_dsa.pub&quot;,
&quot;type&quot; : &quot;PRIVATE&quot;,
&quot;attributes&quot; : {
&quot;property1&quot; : &quot;domain_name:Virginia&quot;,
&quot;property2&quot; : &quot;domain_name:Virginia&quot;
},
&quot;key&quot; : &quot;-----BEGIN RSA PRIVATE KEY-----\\nMIIEogIBAAKCAQEAm6AALYxkJFNzD3bfVJ4+hMY5j0/kqM9CURLKXMlYuAysnvoG8wZKx9Bedefm\\neNSse4zTg798ZA2kDMZFIrwp1AseTwtj8DDu5fhG5DjyI3g6iJltS5zFQdMXneDlHXBX8cncSzNY\\nRx0NdjEMAe7YttvI8FNlxL0VnMFli/HB/ftzYMe5+AmkSROncVGHiwoiUpj+vtobCFOYtXsCf6ri\\nd4lgWA5wv6DZT/JKCYymiBqgSXu3ueFcEzw5SAukARWVjn1xccjZkokFfBbO/FpYY00TrUTBw9S6\\nD3iM+gj8RT6EKILOmhrt71D21S95WAWIT7h2YBsy1KAvMixhNf9VaQIDAQABAoIBAHhVYK3Xl3tr\\nN1Xm0ctJTQg3ijxhR2qsUBgGUokqezpdOoD2zbbOz7XvTYsX1GLr967U9pwxzUpELexexwiTvDgk\\nnLv8D7ui6qbRsmc4DSsWBRSophVIVFKQmftO8Xow6x+fuYJAYmsicM1KIYHBILtL+PSzV8anenWq\\nKQ3r0tfCiQhEzKEk4b1uT3SJWQyHE++JAhVkO7lIeb6S9Dg1jAaAeMnJ/NiMxTarpPRnxe6hsTsH\\ngG1iKWo+Skcl4SknOc+CMEfyDjG4FL7MGhKduahsO8vMUrgGsDD7EH3NiX/FweB8La6qpDYAwFpC\\nycrooyhiyzw8Wb5gGaYnmvr9l70CgYEAx74O8JleXaHpxEAmh4h7VbLmJ3mOylfBmOdzcHeedJQw\\nack2SAv65WBI9S9MEQ7J/vFuyw5HNk3C/mcWgzDQXSNIhHLvl/Z9sux/Qpm3SQWLzBxKV3dJ4r\\nwcAxzVA93+/L1Nee+VOKnlyRumvVa6+XLsLagpap2AVcTqlerMcCgYEAx3T2pXtqkCE9eU/ov22r\\npdaKjgHoGOUg1CMEfWi/Ch6sYIIRyrHz6dhy+yR1pXNgPbLWdrn8l88F3+IsmbaMupMgRmqwEC3G\\n9Y2FglGIVvRdZaagvRxLzRCcvcN4v6OYs9ST4o1xlv7Qxphld+0XDKv7VSCv/rASuK8BqlFL3E8C\\ngYArMXJRnRjG7qh6g9TRIjZphdI3XxX9s5Rt2D8iZvuhAhqmBZjzY4PR7kxYmO2+EpCjzNnEl0XW\\n/GHaWbiIjhnAykx4N9KP7gGom3O5lzwHUme1XnFKcO2wDjQwJbufRmba8iQF1srN577mF+Z7ha4V\\nJ1duCTzvWF1KFX6sk/uhKQKBgAcDFai7rgNjJ8YcCRKxyFcMM9LKPl6hr4XFtWKzTAQPEABUkkuN\\n9gVClsg9f+VRKRECOIf0Ae1UWeCFEwxUXp4wjfHrzkTDVztKvmbWdvSXorDwKrZ7SC7tZpVFSfly\\nxuuLjadpUZT9YFmbAfY1X5oSccOMYqORjRbxEB3svb4BAoGAGTgFuq9Zojh/KIqY8b4HpEfmh6CQ\\nhLVfD98Nqd6GDbxgvIM0v4mFXE92x2jn35Ia0JdFyh3B8Vkl7sqQZfxDFXI9O9pte2mxY9ICaY\\n55+X/SN1pd53BH+gaPZJy/R+Vpvs5MN48hoUKy5UKpoFeUWrS5QArjtvNCm4SGlXw=\\n-----END RSA PRIVATE KEY-----\\n&quot;
},
&quot;publicKey&quot; : {
&quot;name&quot; : &quot;id_dsa.pub&quot;,
&quot;type&quot; : &quot;PRIVATE&quot;,
&quot;attributes&quot; : {
&quot;property1&quot; : &quot;domain_name:Virginia&quot;,
&quot;property2&quot; : &quot;domain_name:Virginia&quot;
},
&quot;key&quot; : &quot;-----BEGIN RSA PRIVATE KEY-----\\nMIIEogIBAAKCAQEAm6AALYxkJFNzD3bfVJ4+hMY5j0/kqM9CURLKXMlYuAysnvoG8wZKx9Bedefm\\neNSse4zTg798ZA2kDMZFIrwp1AseTwtj8DDu5fhG5DjyI3g6iJltS5zFQdMXneDlHXBX8cncSzNY\\nRx0NdjEMAe7YttvI8FNlxL0VnMFli/HB/ftzYMe5+AmkSROncVGHiwoiUpj+vtobCFOYtXsCf6ri\\nd4lgWA5wv6DZT/JKCYymiBqgSXu3ueFcEzw5SAukARWVjn1xccjZkokFfBbO/FpYY00TrUTBw9S6\\nD3iM+gj8RT6EKILOmhrt71D21S95WAWIT7h2YBsy1KAvMixhNf9VaQIDAQABAoIBAHhVYK3Xl3tr\\nN1Xm0ctJTQg3ijxhR2qsUBgGUokqezpdOoD2zbbOz7XvTYsX1GLr967U9pwxzUpELexexwiTvDgk\\nnLv8D7ui6qbRsmc4DSsWBRSophVIVFKQmftO8Xow6x+fuYJAYmsicM1KIYHBILtL+PSzV8anenWq\\nKQ3r0tfCiQhEzKEk4b1uT3SJWQyHE++JAhVkO7lIeb6S9Dg1jAaAeMnJ/NiMxTarpPRnxe6hsTsH\\ngG1iKWo+Skcl4SknOc+CMEfyDjG4FL7MGhKduahsO8vMUrgGsDD7EH3NiX/FweB8La6qpDYAwFpC\\nycrooyhiyzw8Wb5gGaYnmvr9l70CgYEAx74O8JleXaHpxEAmh4h7VbLmJ3mOylfBmOdzcHeedJQw\\nack2SAv65WBI9S9MEQ7J/vFuyw5HNk3C/mcWgzDQXSNIhHLvl/Z9sux/Qpm3SQWLzBxKV3dJ4r\\nwcAxzVA93+/L1Nee+VOKnlyRumvVa6+XLsLagpap2AVcTqlerMcCgYEAx3T2pXtqkCE9eU/ov22r\\npdaKjgHoGOUg1CMEfWi/Ch6sYIIRyrHz6dhy+yR1pXNgPbLWdrn8l88F3+IsmbaMupMgRmqwEC3G\\n9Y2FglGIVvRdZaagvRxLzRCcvcN4v6OYs9ST4o1xlv7Qxphld+0XDKv7VSCv/rASuK8BqlFL3E8C\\ngYArMXJRnRjG7qh6g9TRIjZphdI3XxX9s5Rt2D8iZvuhAhqmBZjzY4PR7kxYmO2+EpCjzNnEl0XW\\n/GHaWbiIjhnAykx4N9KP7gGom3O5lzwHUme1XnFKcO2wDjQwJbufRmba8iQF1srN577mF+Z7ha4V\\nJ1duCTzvWF1KFX6sk/uhKQKBgAcDFai7rgNjJ8YcCRKxyFcMM9LKPl6hr4XFtWKzTAQPEABUkkuN\\n9gVClsg9f+VRKRECOIf0Ae1UWeCFEwxUXp4wjfHrzkTDVztKvmbWdvSXorDwKrZ7SC7tZpVFSfly\\nxuuLjadpUZT9YFmbAfY1X5oSccOMYqORjRbxEB3svb4BAoGAGTgFuq9Zojh/KIqY8b4HpEfmh6CQ\\nhLVfD98Nqd6GDbxgvIM0v4mFXE92x2jn35Ia0JdFyh3B8Vkl7sqQZfxDFXI9O9pte2mxY9ICaY\\n55+X/SN1pd53BH+gaPZJy/R+Vpvs5MN48hoUKy5UKpoFeUWrS5QArjtvNCm4SGlXw=\\n-----END RSA PRIVATE KEY-----\\n&quot;
},
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;
},
&quot;provisionID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;managerType&quot; : &quot;ansible&quot;,
&quot;configurationID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;
} ]
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_DeployController_delete_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/deployer/{id} <a href="../user/v1.0/deployer/{id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
......
......@@ -77,6 +77,24 @@
</tr>
</thead>
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="resource_AnsibleOutputController.html">
<td> <span class="resource-name">AnsibleOutputController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/deployer/ansible</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/ansible/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/ansible/commands</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/ansible/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/ansible/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
<td> <span class="resource-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_CloudConfigurationController0.html">
<td> <span class="resource-name">CloudConfigurationController0</span>
</td>
......@@ -138,14 +156,12 @@ used by the planner.</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/deploy</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/sysbench</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/deployer/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for deploying a cluster on provisoned
......
......@@ -137,6 +137,24 @@ class</p>
</td>
<td> <span class="property-minMaxOccurs">0/1
</span>
</td>
<td> <span class="property-description">&nbsp;</span>
</td>
</tr>
<tr>
<td> <span class="property-name">provisionID</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">&nbsp;</span>
</td>
......@@ -207,6 +225,7 @@ the DAO saves the object based on the principal how made the call</span></td>
&lt;/ansiibleResult&gt;
&lt;cloudDeploymentDomain&gt;...&lt;/cloudDeploymentDomain&gt;
&lt;vmType&gt;...&lt;/vmType&gt;
&lt;provisionID&gt;...&lt;/provisionID&gt;
&lt;owner&gt;user1&lt;/owner&gt;
&lt;/a-----&gt;
</pre>
......
/*
* 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.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import nl.uva.sne.drip.api.dao.AnsibleOutputDao;
import nl.uva.sne.drip.api.exception.NotFoundException;
import nl.uva.sne.drip.data.v1.external.User;
import nl.uva.sne.drip.data.v1.external.ansible.AnsibleOutput;
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;
/**
*
* @author S. Koulouzis
*/
@Service
@PreAuthorize("isAuthenticated()")
public class AnsibleOutputService {
@Autowired
private AnsibleOutputDao ansibleOutputDao;
@PostAuthorize("(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))")
public AnsibleOutput findOne(String id) {
AnsibleOutput creds = ansibleOutputDao.findOne(id);
if (creds == null) {
throw new NotFoundException();
}
return creds;
}
@PostFilter("(filterObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))")
public List<AnsibleOutput> findAll() {
return ansibleOutputDao.findAll();
}
@PostAuthorize("(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))")
public AnsibleOutput delete(String id) {
AnsibleOutput creds = ansibleOutputDao.findOne(id);
if (creds == null) {
throw new NotFoundException();
}
ansibleOutputDao.delete(creds);
return creds;
}
public AnsibleOutput save(AnsibleOutput clusterCred) {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String owner = user.getUsername();
clusterCred.setOwner(owner);
return ansibleOutputDao.save(clusterCred);
}
@PostAuthorize("(hasRole('ROLE_ADMIN'))")
public void deleteAll() {
ansibleOutputDao.deleteAll();
}
public List<String> findAllCommands() {
List<AnsibleOutput> all = findAll();
Set<String> hashset = new HashSet<>();
for (AnsibleOutput ans : all) {
hashset.add(ans.getAnsiibleResult().getCmd().get(0));
}
return new ArrayList<>(hashset);
}
}
......@@ -66,7 +66,7 @@ public class DeployService {
private DeployDao deployDao;
@Autowired
private AnsibleOutputDao ansibleOutputDao;
private AnsibleOutputService ansibleOutputService;
@Autowired
KeyPairDao keyDao;
......@@ -92,11 +92,6 @@ public class DeployService {
return creds;
}
@PostAuthorize("(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))")
public List<DeployResponse> findSysbench() {
return deployDao.findAll();
}
@PostFilter("(filterObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))")
public List<DeployResponse> findAll() {
return deployDao.findAll();
......@@ -252,21 +247,35 @@ public class DeployService {
});
List<String> outputListIds = new ArrayList<>();
Map<String, String> nodeTypeCahche = new HashMap<>();
Map<String, String> domainCahche = new HashMap<>();
for (AnsibleOutput ansOut : outputList) {
Map<String, Object> map = provisionService.findOne(deployInfo.getProvisionID()).getKeyValue();
String nodeType = nodeTypeCahche.get(ansOut.getHost());
String domain = domainCahche.get(ansOut.getHost());
if (nodeType == null) {
List<Map<String, Object>> components = (List<Map<String, Object>>) map.get("components");
for (Map<String, Object> component : components) {
String publicAddress = (String) component.get("public_address");
if (publicAddress.equals(ansOut.getHost())) {
ansOut.setVmType((String) component.get("nodeType"));
ansOut.setCloudDeploymentDomain((String) component.get("domain"));
nodeType = (String) component.get("nodeType");
domain = (String) component.get("domain");
nodeTypeCahche.put(ansOut.getHost(), nodeType);
domainCahche.put(ansOut.getHost(), value);
// ansOut.setCloudProviderName("");
break;
}
}
ansOut = ansibleOutputDao.save(ansOut);
}
ansOut.setVmType(nodeType);
ansOut.setCloudDeploymentDomain(domain);
ansOut.setProvisionID(deployInfo.getProvisionID());
ansOut = ansibleOutputService.save(ansOut);
outputListIds.add(ansOut.getId());
}
deployResponse.setAnsibleOutputList(outputListIds);
......
/*
* 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.v1.rest;
import com.webcohesion.enunciate.metadata.rs.ResponseCode;
import com.webcohesion.enunciate.metadata.rs.StatusCodes;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.security.RolesAllowed;
import nl.uva.sne.drip.api.exception.NotFoundException;
import nl.uva.sne.drip.api.service.AnsibleOutputService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import nl.uva.sne.drip.api.service.UserService;
import nl.uva.sne.drip.data.v1.external.ansible.AnsibleOutput;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
@RestController
@RequestMapping("/user/v1.0/deployer/ansible")
@Controller
@StatusCodes({
@ResponseCode(code = 401, condition = "Bad credentials")
})
public class AnsibleOutputController {
@Autowired
private AnsibleOutputService ansibleOutputService;
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
AnsibleOutput get(@PathVariable("id") String id) {
AnsibleOutput resp = ansibleOutputService.findOne(id);
if (resp == null) {
throw new NotFoundException();
}
return resp;
}
@RequestMapping(method = RequestMethod.GET, params = {"command"})
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
AnsibleOutput getByCommand(@RequestParam(value = "command") String command) {
return null;
}
@RequestMapping(value = "/ids", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
List<String> getIds() {
List<AnsibleOutput> all = ansibleOutputService.findAll();
List<String> ids = new ArrayList<>(all.size());
for (AnsibleOutput pi : all) {
ids.add(pi.getId());
}
return ids;
}
@RequestMapping(value = "/commands", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
List<String> getCommands() {
return ansibleOutputService.findAllCommands();
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String delete(@PathVariable("id") String id) {
AnsibleOutput Key = ansibleOutputService.findOne(id);
if (Key != null) {
ansibleOutputService.delete(id);
return "Deleted : " + id;
}
throw new NotFoundException();
}
@RequestMapping(value = "/all", method = RequestMethod.DELETE)
@RolesAllowed({UserService.ADMIN})
public @ResponseBody
String deleteAll() {
ansibleOutputService.deleteAll();
return "Done";
}
}
......@@ -88,17 +88,6 @@ public class DeployController {
return resp;
}
@RequestMapping(value = "/sysbench", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
List<DeployResponse> getSysbenchOutputs() {
List<DeployResponse> resp = deployService.findSysbench();
if (resp == null) {
throw new NotFoundException();
}
return resp;
}
@RequestMapping(value = "/ids", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
......
......@@ -49,6 +49,9 @@ public class AnsibleOutput extends OwnedObject {
@JsonProperty("result")
private AnsibleResult result;
@JsonProperty("provisionID")
private String provisionID;
@JsonProperty("host")
public String getHost() {
return host;
......@@ -88,4 +91,14 @@ public class AnsibleOutput extends OwnedObject {
public void setVmType(String vmType) {
this.vmType = vmType;
}
@JsonProperty("provisionID")
public void setProvisionID(String provisionID) {
this.provisionID = provisionID;
}
@JsonProperty("provisionID")
public String getProvisionID() {
return provisionID;
}
}
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