Download this file
tester.html.svn-base
214 lines (206 with data), 8.1 kB
<!--
/**
* Copyright (c) 2013/2014, Intel Performance Learning Solutions Ltd, Intel Corporation.
*
* 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 (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.
*
**/
/**
* Contains markup for API Testing webpage
*
* Created by Sridhar Voorakkara (sridhar.voorakkara@intel.com)
*
*/
-->
<html>
<head>
<script type="text/javascript" src="scripts/js/common.js"></script>
<script type="text/javascript" src="scripts/js/tester.js"></script>
<link rel="stylesheet" type="text/css" href="resources/css/tester.css">
</head>
<body>
<div id="test">
<h2>DPES Service Tester</h2>
<table>
<tr>
<td>
<table>
<caption>User Authenticate</caption>
<tr>
<td>
<form id="auth" name="auth">
<b>Endpoint : </b><i>/api/user/[userid]/authorize</i>
<div class="descr">Authenticates a user and returns a
Authorization Key</div>
<b>Method : </b>POST
<br>
<div class="hdr">Inputs</div>
<ul class="ilist">
<li>userid : String</li>
<li>password : String</li>
</ul>
<div class="hdr">Try : </div>
<ul>
<li>userid : <input type="text" name="userid" id="userid"></li>
<li>password : <input type="password" name="password"
id="password"></li>
</ul>
<input type="button" value="Submit" onclick="authenticate()">
</form>
</td>
</tr>
</table>
</td>
<td><table>
<caption>Project Create</caption>
<tr>
<td>
<form id="proj_create" name="proj_create">
<b>Endpoint : </b><i>/api/project/create</i>
<div class="descr">Creates a new project and returns project id</div>
<b>Method : </b>POST
<br>
<div class="hdr">Inputs</div>
<ul class="ilist">
<li>authenticationKey : String (Thru request header)</li>
<li>projectname : String</li>
<li>projectdescr : String (optional)</li>
<li>riskdocument : String (optional)</li>
<li>ontologyUri : String (optional)</li>
</ul>
<div class="hdr">Try : </div>
<ul>
<li>authenticationKey : <input type="text" name="authenticationKey" id="authenticationKey"></li>
<li>projectname : <input type="text" name="projectname" id="projectname"></li>
<li>projectdescr : <input type="text" name="projectdescr"
id="projectdescr"></li>
<li>riskdocument : <textarea name="riskdocument" id="riskdocument"></textarea></li>
<li>ontologyUri : <textarea name="ontologyUri" id="ontologyUri"></textarea></li>
</ul>
<input type="button" value="Submit" onclick="createproject()">
</form>
</td>
</tr>
</table></td>
<td><table>
<caption>Project Update</caption>
<tr>
<td>
<form id="proj_update" name="proj_update">
<b>Endpoint : </b><i>/api/project/[projectid]/update</i>
<div class="descr">Updates risk/ontology documents for a project</div>
<b>Method : </b>POST
<br>
<div class="hdr">Inputs</div>
<ul class="ilist">
<li>authenticationKey : String(Thru request header)</li>
<li>projectid : String</li>
<li>riskdocument : String (optional)</li>
<li>ontologyUri : String (optional)</li>
</ul>
<div class="hdr">Try : </div>
<ul>
<li>authenticationKey : <input type="text" name="authenticationKey" id="authenticationKey"></li>
<li>projectid : <input type="text" name="projectid" id="projectid"></li>
<li>riskdocument : <textarea name="riskdocument" id="riskdocument"></textarea></li>
<li>ontologyUri : <textarea name="ontologyUri" id="ontologyUri"></textarea></li>
</ul>
<input type="button" value="Submit" onclick="updateproject()">
</form>
</td>
</tr>
</table></td>
</tr>
<tr>
<td><table><caption>Get Risk Alternatives</caption>
<tr>
<td>
<form id="risk_alternatives_get" name="risk_alternatives_get">
<b>Endpoint : </b><i>/api/project/[projectid]/riskalternatives</i>
<div class="descr">Gets risk document with URL for Alternatives and costing</div>
<b>Method : </b>POST
<br>
<div class="hdr">Inputs</div>
<ul class="ilist">
<li>authenticationKey : String(Thru request header)</li>
<li>projectid : String</li>
</ul>
<div class="hdr">Try : </div>
<ul>
<li>authenticationKey : <input type="text" name="authenticationKey" id="authenticationKey"></li>
<li>projectid : <input type="text" name="projectid" id="projectid"></li>
</ul>
<input type="button" value="Submit" onclick="getriskalternatives()">
</form>
</td>
</tr>
</table>
</td>
<td><table><caption>Recommendation</caption>
<tr>
<td>
<form id="recommendation_set" name="recommendation_set">
<b>Endpoint : </b><i>/api/project/[projectid]/recommendation</i>
<div class="descr">Send preservation recommendation of a project</div>
<b>Method : </b>POST
<br>
<div class="hdr">Inputs</div>
<ul class="ilist">
<li>authenticationKey : String(Thru request header)</li>
<li>projectid : String</li>
<li>preserve : boolean</li>
<li>alternateOntologyuri : String (required if preserve=true & <br>an alternate is recommended)</li>
</ul>
<div class="hdr">Try : </div>
<ul>
<li>authenticationKey : <input type="text" name="authenticationKey" id="authenticationKey"></li>
<li>projectid : <input type="text" name="projectid" id="projectid"></li>
<li>preserve : <select name="preserve" id="preserve"><option value="true">true</option><option value="false">false</option></select></li>
<li>alternateOntologyuri : <input type="text" name="ontologyuri" id="ontologyuri"></li>
</ul>
<input type="button" value="Submit" onclick="sendrecommendation()">
</form>
</td>
</tr>
</table>
</td>
<td><table><caption>Get Status</caption>
<tr>
<td>
<form id="status_get" name="status_get">
<b>Endpoint : </b><i>/api/project/[projectid]/status</i>
<div class="descr">Gets status of a project</div>
<b>Method : </b>POST
<br>
<div class="hdr">Inputs</div>
<ul class="ilist">
<li>authenticationKey : String(Thru request header)</li>
<li>projectid : String</li>
</ul>
<div class="hdr">Try : </div>
<ul>
<li>authenticationKey : <input type="text" name="authenticationKey" id="authenticationKey"></li>
<li>projectid : <input type="text" name="projectid" id="projectid"></li>
</ul>
<input type="button" value="Submit" onclick="getstatus()">
</form>
</td>
</tr>
</table>
</td>
</table>
<div class="hdr"> </div>
<div id="feedback"></div>
</div>
</body>
</html>