Fix the security issue.
[aai/esr-server.git] / esr-mgr / src / main / resources / api-doc / index.html
1 <!--
2
3     Copyright 2016-2017 ZTE Corporation.
4
5     Licensed under the Apache License, Version 2.0 (the "License");
6     you may not use this file except in compliance with the License.
7     You may obtain a copy of the License at
8
9         http://www.apache.org/licenses/LICENSE-2.0
10
11     Unless required by applicable law or agreed to in writing, software
12     distributed under the License is distributed on an "AS IS" BASIS,
13     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14     See the License for the specific language governing permissions and
15     limitations under the License.
16
17 -->
18 <!DOCTYPE html>
19 <html>
20 <head>
21   <title>Swagger UI</title>
22   <link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
23   <link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
24   <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
25   <link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
26   <link href='css/screen.css' media='print' rel='stylesheet' type='text/css'/>
27   <script type="text/javascript" src="lib/shred.bundle.js"></script>
28   <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
29   <script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
30   <script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
31   <script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
32   <script src='lib/handlebars-2.0.0.js' type='text/javascript'></script>
33   <script src='lib/underscore-min.js' type='text/javascript'></script>
34   <script src='lib/backbone-min.js' type='text/javascript'></script>
35   <script src='lib/swagger-client.js' type='text/javascript'></script>
36   <script src='swagger-ui.js' type='text/javascript'></script>
37   <script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
38   <script src='lib/marked.js' type='text/javascript'></script>
39
40   <!-- enabling this will enable oauth2 implicit scope support -->
41   <script src='lib/swagger-oauth.js' type='text/javascript'></script>
42   <script type="text/javascript">
43     $(function () {
44       var url = window.location.search.match(/url=([^&]+)/);
45       if (url && url.length > 1) {
46         url = decodeURIComponent(url[1]);
47       } else {
48         url = "/onapapi/aai/esr/v1/swagger.json";
49       }
50       window.swaggerUi = new SwaggerUi({
51         url: url,
52         dom_id: "swagger-ui-container",
53         supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
54         onComplete: function(swaggerApi, swaggerUi){
55           if(typeof initOAuth == "function") {
56             /*
57             initOAuth({
58               clientId: "your-client-id",
59               realm: "your-realms",
60               appName: "your-app-name"
61             });
62             */
63           }
64           $('pre code').each(function(i, e) {
65             hljs.highlightBlock(e)
66           });
67         },
68         onFailure: function(data) {
69           log("Unable to Load SwaggerUI");
70         },
71         docExpansion: "none",
72         sorter : "alpha"
73       });
74
75       function addApiKeyAuthorization() {
76         var key = $('#input_apiKey')[0].value;
77         log("key: " + key);
78         if(key && key.trim() != "") {
79             log("added key " + key);
80             window.authorizations.add("api_key", new ApiKeyAuthorization("api_key", key, "query"));
81         }
82       }
83
84       $('#input_apiKey').change(function() {
85         addApiKeyAuthorization();
86       });
87
88       // if you have an apiKey you would like to pre-populate on the page for demonstration purposes...
89       /*
90         var apiKey = "myApiKeyXXXX123456789";
91         $('#input_apiKey').val(apiKey);
92         addApiKeyAuthorization();
93       */
94
95       window.swaggerUi.load();
96   });
97   </script>
98 </head>
99
100 <body class="swagger-section">
101 <div id='header'>
102   <div class="swagger-ui-wrap">
103     <a id="logo" >OPEN-O extsys</a>
104     <form id='api_selector'>
105       <div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
106       <div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
107       <div class='input'><a id="explore" href="#">Explore</a></div>
108     </form>
109   </div>
110 </div>
111
112 <div id="message-bar" class="swagger-ui-wrap">&nbsp;</div>
113 <div id="swagger-ui-container" class="swagger-ui-wrap"></div>
114 </body>
115 </html>