blob: 5a52222bbf13654223146e027541d870b10bcf6a [file] [log] [blame]
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07001<!-- Adapted from Swagger UI -->
2<!DOCTYPE html>
3<html>
4<head>
5 <title>ONOS API Docs</title>
6 <link rel="icon" type="image/png" href="images/onos-logo.png"/>
7
8 <link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
9 <link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
10 <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
11 <link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
12 <link href='css/print.css' media='print' rel='stylesheet' type='text/css'/>
13 <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
14 <script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
15 <script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
16 <script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
17 <script src='lib/handlebars-2.0.0.js' type='text/javascript'></script>
18 <script src='lib/underscore-min.js' type='text/javascript'></script>
19 <script src='lib/backbone-min.js' type='text/javascript'></script>
20 <script src='swagger-ui.js' type='text/javascript'></script>
21 <script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
22 <script src='lib/marked.js' type='text/javascript'></script>
23 <script src='lib/swagger-oauth.js' type='text/javascript'></script>
24
25 <script type="text/javascript">
26 $(function () {
27 var url = window.location.search.match(/url=([^&]+)/);
28 if (url && url.length > 1) {
29 url = decodeURIComponent(url[1]);
30 } else {
31 url = "/onos/v1/docs/apis/onos/v1/swagger.json";
32 }
33 window.swaggerUi = new SwaggerUi({
34 url: url,
Jonathan Hart345c0192016-04-20 09:00:58 -070035 validatorUrl : null,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070036 dom_id: "swagger-ui-container",
37 supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
38 onComplete: function(swaggerApi, swaggerUi){
39 if(typeof initOAuth == "function") {
40 initOAuth({
41 clientId: "your-client-id",
42 realm: "your-realms",
43 appName: "your-app-name"
44 });
45 }
46
47 $('pre code').each(function(i, e) {
48 hljs.highlightBlock(e)
49 });
50
51 addApiKeyAuthorization();
52 },
53 onFailure: function(data) {
54 log("Unable to Load SwaggerUI");
55 },
56 docExpansion: "none",
57 apisSorter: "alpha",
58 showRequestHeaders: false
59 });
60
61 function addApiKeyAuthorization(){
62 var key = encodeURIComponent($('#input_apiKey')[0].value);
63 if(key && key.trim() != "") {
64 var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
65 window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
66 log("added key " + key);
67 }
68 }
69
70 $('#input_apiKey').change(addApiKeyAuthorization);
71
72 // if you have an apiKey you would like to pre-populate on the page for demonstration purposes...
73 /*
74 var apiKey = "myApiKeyXXXX123456789";
75 $('#input_apiKey').val(apiKey);
76 */
77
78 window.swaggerUi.load();
79
80 function log() {
81 if ('console' in window) {
82 console.log.apply(console, arguments);
83 }
84 }
85 });
86
87 function selectApi() {
88 $('#input_baseUrl').val('/onos/v1/docs/apis' + $('select').val() + '/swagger.json');
89 $('#explore').click();
90 }
91 </script>
92</head>
93
94<body class="swagger-section">
95<div id='header'>
96 <div class="swagger-ui-wrap">
97 <a id="logo" href="#"></a>
98 <form id='api_selector'>
99 <div class='input' id='selector'>
100 <select onchange="selectApi()">
101 <!-- {API-START} -->
102 <option value="v1">ONOS v1 Core</option>
103 <option value="foo">ONOS Foo app</option>
104 <option value="bar">ONOS Bar app</option>
105 <!-- {API-END} -->
106 </select>
107 </div>
108 <div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
109 <div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
110 <div class='input'><a id="explore" href="#">Explore</a></div>
111 </form>
112 </div>
113</div>
114
115<div id="message-bar" class="swagger-ui-wrap">&nbsp;</div>
116<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
117<div id="footer" class="swagger-ui-wrap"><a href="http://swagger.io/swagger-ui/">Swagger UI</a> adaptation</div>
118</body>
119</html>