123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634 |
- <!DOCTYPE html>
- <html>
- <head lang="en">
- <title> API Documentation </title>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
- <link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
-
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
-
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
- <style type="text/css">
- body {
- font-family: 'Roboto', sans-serif;
- }
- .hidden {
- display:none;
- }
- pre {
- outline: 1px solid #ccc;
- padding: 5px; margin: 5px;
- }
- .string { color: green; }
- .number { color: darkorange; }
- .boolean { color: blue; }
- .null { color: magenta; }
- .key { color: red; }
- </style>
- <style type="text/css">
- pre.prettyprint {
- border: 1px solid #ccc;
- margin-bottom: 0;
- padding: 9.5px;
- }
- </style>
- <script>
-
- function syntaxHighlight(json) {
- json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
- return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
- var cls = 'number';
- if (/^"/.test(match)) {
- if (/:$/.test(match)) {
- cls = 'key';
- } else {
- cls = 'string';
- }
- } else if (/true|false/.test(match)) {
- cls = 'boolean';
- } else if (/null/.test(match)) {
- cls = 'null';
- }
- return '<span class="' + cls + '">' + match + '</span>';
- });
- }
- function spaceJson(json){
- var validJson = JSON.parse(json);
- return JSON.stringify(validJson, undefined, 4);
- }
- </script>
- </head>
- <body>
- <nav class="navbar navbar-default navbar-fixed-top">
- <div class="container-fluid">
-
- <div class="navbar-header">
- <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
- data-target="#bs-example-navbar-collapse-1">
- <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="#">Gin</a>
- <p class="navbar-text">Developed by Gophers at <a href="http://betacraft.co">Betacraft</a></p>
- </div>
-
-
- </div>
-
- </nav>
- <div class="container-fluid" style="margin-top: 70px;margin-bottom: 20px;">
- <div class="container-fluid">
- <div class="col-md-4">
- <div class="panel panel-default">
- <div class="panel-heading">Base Urls</div>
- <div class="panel-body">
-
- <p>Production : <strong>/api/v1</strong></p>
-
- <p>Staging : <strong>/api/v1</strong></p>
-
- </div>
- </div>
- <ul class="nav nav-pills nav-stacked" role="tablist">
-
- <li role="presentation"><a href="#0top" role="tab" data-toggle="tab">POST : /api/v1/aggregator</a></li>
-
- <li role="presentation"><a href="#1top" role="tab" data-toggle="tab">GET : /api/v1/hostgroup/343/aggregator</a></li>
-
- <li role="presentation"><a href="#2top" role="tab" data-toggle="tab">PUT : /api/v1/aggregator</a></li>
-
- <li role="presentation"><a href="#3top" role="tab" data-toggle="tab">GET : /api/v1/aggregator/16</a></li>
-
- <li role="presentation"><a href="#4top" role="tab" data-toggle="tab">DELETE : /api/v1/aggregator/16</a></li>
-
- <ul>
- </div>
- <div class="col-md-8 tab-content">
-
- <div id="0top" role="tabpanel" class="tab-pane col-md-10">
-
-
- <p> <H4> Request Headers </H4> </p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Apitoken</td>
- <td> {"name":"root","sig":"427d6803b78311e68afd0242ac130006"}</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json
- </td>
- </tr>
-
- <tr>
- <td>X-Forwarded-For</td>
- <td> 127.0.0.1
- </td>
- </tr>
-
- </table>
-
-
-
-
- <p> <H4> Request Body </H4> </p>
- <pre id="request-body-0-0" class="prettyprint">{"tags":"","step":60,"numerator":"$(cpu.idle)","metric":"test.idle","hostgroup_id":343,"endpoint":"testenp","denominator":"2"}</pre>
- <script>
-
- var requestHeader ={"Apitoken":"{\"name\":\"root\",\"sig\":\"427d6803b78311e68afd0242ac130006\"}","Content-Type":" application/json\r","X-Forwarded-For":" 127.0.0.1\r"};
- if (requestHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("{\"tags\":\"\",\"step\":60,\"numerator\":\"$(cpu.idle)\",\"metric\":\"test.idle\",\"hostgroup_id\":343,\"endpoint\":\"testenp\",\"denominator\":\"2\"}");
- document.getElementById('request-body0-0').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <p><h4> Response Code</h4></p>
- <pre class="prettyprint lang-json">200</pre>
-
- <p><h4> Response Headers</h4></p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Credentials</td>
- <td> true</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Headers</td>
- <td> Content-Type, Content-Length, Apitoken</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Methods</td>
- <td> POST, GET, OPTIONS, PUT, DELETE, UPDATE</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Origin</td>
- <td> *</td>
- </tr>
-
- <tr>
- <td>Access-Control-Expose-Headers</td>
- <td> Content-Length</td>
- </tr>
-
- <tr>
- <td>Access-Control-Max-Age</td>
- <td> 86400</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json; charset=utf-8</td>
- </tr>
-
- </table>
-
-
- <p> <H4> Response Body </H4> </p>
- <pre class="prettyprint" id="response-body-0-0">{"id":16,"grp_id":343,"numerator":"$(cpu.idle)","denominator":"2","endpoint":"testenp","metric":"test.idle","tags":"","ds_type":"GAUGE","step":60,"creator":"root"}</pre>
- <script>
-
- var responseHeader ={"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"Content-Type, Content-Length, Apitoken","Access-Control-Allow-Methods":"POST, GET, OPTIONS, PUT, DELETE, UPDATE","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":"Content-Length","Access-Control-Max-Age":"86400","Content-Type":"application/json; charset=utf-8"};
- if (responseHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("{\"id\":16,\"grp_id\":343,\"numerator\":\"$(cpu.idle)\",\"denominator\":\"2\",\"endpoint\":\"testenp\",\"metric\":\"test.idle\",\"tags\":\"\",\"ds_type\":\"GAUGE\",\"step\":60,\"creator\":\"root\"}");
- document.getElementById('response-body-0-0').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <hr>
-
- </div>
-
- <div id="1top" role="tabpanel" class="tab-pane col-md-10">
-
-
- <p> <H4> Request Headers </H4> </p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Apitoken</td>
- <td> {"name":"root","sig":"427d6803b78311e68afd0242ac130006"}</td>
- </tr>
-
- <tr>
- <td>X-Forwarded-For</td>
- <td> 127.0.0.1
- </td>
- </tr>
-
- </table>
-
-
-
-
- <p><h4> Response Code</h4></p>
- <pre class="prettyprint lang-json">200</pre>
-
- <p><h4> Response Headers</h4></p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Credentials</td>
- <td> true</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Headers</td>
- <td> Content-Type, Content-Length, Apitoken</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Methods</td>
- <td> POST, GET, OPTIONS, PUT, DELETE, UPDATE</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Origin</td>
- <td> *</td>
- </tr>
-
- <tr>
- <td>Access-Control-Expose-Headers</td>
- <td> Content-Length</td>
- </tr>
-
- <tr>
- <td>Access-Control-Max-Age</td>
- <td> 86400</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json; charset=utf-8</td>
- </tr>
-
- </table>
-
-
- <p> <H4> Response Body </H4> </p>
- <pre class="prettyprint" id="response-body-1-0">[{"id":13,"grp_id":343,"numerator":"$(cpu.idle)","denominator":"2","endpoint":"testenp","metric":"test.idle","tags":"","ds_type":"GAUGE","step":60,"creator":"root"},{"id":14,"grp_id":343,"numerator":"$(cpu.idle)","denominator":"2","endpoint":"testenp","metric":"test.idle","tags":"","ds_type":"GAUGE","step":60,"creator":"root"},{"id":15,"grp_id":343,"numerator":"$(cpu.idle)","denominator":"2","endpoint":"testenp","metric":"test.idle","tags":"","ds_type":"GAUGE","step":60,"creator":"root"},{"id":16,"grp_id":343,"numerator":"$(cpu.idle)","denominator":"2","endpoint":"testenp","metric":"test.idle","tags":"","ds_type":"GAUGE","step":60,"creator":"root"}]</pre>
- <script>
-
- var responseHeader ={"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"Content-Type, Content-Length, Apitoken","Access-Control-Allow-Methods":"POST, GET, OPTIONS, PUT, DELETE, UPDATE","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":"Content-Length","Access-Control-Max-Age":"86400","Content-Type":"application/json; charset=utf-8"};
- if (responseHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("[{\"id\":13,\"grp_id\":343,\"numerator\":\"$(cpu.idle)\",\"denominator\":\"2\",\"endpoint\":\"testenp\",\"metric\":\"test.idle\",\"tags\":\"\",\"ds_type\":\"GAUGE\",\"step\":60,\"creator\":\"root\"},{\"id\":14,\"grp_id\":343,\"numerator\":\"$(cpu.idle)\",\"denominator\":\"2\",\"endpoint\":\"testenp\",\"metric\":\"test.idle\",\"tags\":\"\",\"ds_type\":\"GAUGE\",\"step\":60,\"creator\":\"root\"},{\"id\":15,\"grp_id\":343,\"numerator\":\"$(cpu.idle)\",\"denominator\":\"2\",\"endpoint\":\"testenp\",\"metric\":\"test.idle\",\"tags\":\"\",\"ds_type\":\"GAUGE\",\"step\":60,\"creator\":\"root\"},{\"id\":16,\"grp_id\":343,\"numerator\":\"$(cpu.idle)\",\"denominator\":\"2\",\"endpoint\":\"testenp\",\"metric\":\"test.idle\",\"tags\":\"\",\"ds_type\":\"GAUGE\",\"step\":60,\"creator\":\"root\"}]");
- document.getElementById('response-body-1-0').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <hr>
-
- </div>
-
- <div id="2top" role="tabpanel" class="tab-pane col-md-10">
-
-
- <p> <H4> Request Headers </H4> </p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Apitoken</td>
- <td> {"name":"root","sig":"427d6803b78311e68afd0242ac130006"}</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json
- </td>
- </tr>
-
- <tr>
- <td>X-Forwarded-For</td>
- <td> 127.0.0.1
- </td>
- </tr>
-
- </table>
-
-
-
-
- <p> <H4> Request Body </H4> </p>
- <pre id="request-body-2-0" class="prettyprint">{"tags":"","step":60,"numerator":"$(cpu.idle)","metric":"test.idle","id":16,"endpoint":"testenp","denominator":"$#"}</pre>
- <script>
-
- var requestHeader ={"Apitoken":"{\"name\":\"root\",\"sig\":\"427d6803b78311e68afd0242ac130006\"}","Content-Type":" application/json\r","X-Forwarded-For":" 127.0.0.1\r"};
- if (requestHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("{\"tags\":\"\",\"step\":60,\"numerator\":\"$(cpu.idle)\",\"metric\":\"test.idle\",\"id\":16,\"endpoint\":\"testenp\",\"denominator\":\"$#\"}");
- document.getElementById('request-body2-0').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <p><h4> Response Code</h4></p>
- <pre class="prettyprint lang-json">200</pre>
-
- <p><h4> Response Headers</h4></p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Credentials</td>
- <td> true</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Headers</td>
- <td> Content-Type, Content-Length, Apitoken</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Methods</td>
- <td> POST, GET, OPTIONS, PUT, DELETE, UPDATE</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Origin</td>
- <td> *</td>
- </tr>
-
- <tr>
- <td>Access-Control-Expose-Headers</td>
- <td> Content-Length</td>
- </tr>
-
- <tr>
- <td>Access-Control-Max-Age</td>
- <td> 86400</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json; charset=utf-8</td>
- </tr>
-
- </table>
-
-
- <p> <H4> Response Body </H4> </p>
- <pre class="prettyprint" id="response-body-2-0">{"id":16,"grp_id":343,"numerator":"$(cpu.idle)","denominator":"$#","endpoint":"testenp","metric":"test.idle","tags":"","ds_type":"GAUGE","step":60,"creator":"root"}</pre>
- <script>
-
- var responseHeader ={"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"Content-Type, Content-Length, Apitoken","Access-Control-Allow-Methods":"POST, GET, OPTIONS, PUT, DELETE, UPDATE","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":"Content-Length","Access-Control-Max-Age":"86400","Content-Type":"application/json; charset=utf-8"};
- if (responseHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("{\"id\":16,\"grp_id\":343,\"numerator\":\"$(cpu.idle)\",\"denominator\":\"$#\",\"endpoint\":\"testenp\",\"metric\":\"test.idle\",\"tags\":\"\",\"ds_type\":\"GAUGE\",\"step\":60,\"creator\":\"root\"}");
- document.getElementById('response-body-2-0').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <hr>
-
- </div>
-
- <div id="3top" role="tabpanel" class="tab-pane col-md-10">
-
-
- <p> <H4> Request Headers </H4> </p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Apitoken</td>
- <td> {"name":"root","sig":"427d6803b78311e68afd0242ac130006"}</td>
- </tr>
-
- <tr>
- <td>X-Forwarded-For</td>
- <td> 127.0.0.1
- </td>
- </tr>
-
- </table>
-
-
-
-
- <p><h4> Response Code</h4></p>
- <pre class="prettyprint lang-json">200</pre>
-
- <p><h4> Response Headers</h4></p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Credentials</td>
- <td> true</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Headers</td>
- <td> Content-Type, Content-Length, Apitoken</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Methods</td>
- <td> POST, GET, OPTIONS, PUT, DELETE, UPDATE</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Origin</td>
- <td> *</td>
- </tr>
-
- <tr>
- <td>Access-Control-Expose-Headers</td>
- <td> Content-Length</td>
- </tr>
-
- <tr>
- <td>Access-Control-Max-Age</td>
- <td> 86400</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json; charset=utf-8</td>
- </tr>
-
- </table>
-
-
- <p> <H4> Response Body </H4> </p>
- <pre class="prettyprint" id="response-body-3-0">{"id":16,"grp_id":343,"numerator":"$(cpu.idle)","denominator":"$#","endpoint":"testenp","metric":"test.idle","tags":"","ds_type":"GAUGE","step":60,"creator":"root"}</pre>
- <script>
-
- var responseHeader ={"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"Content-Type, Content-Length, Apitoken","Access-Control-Allow-Methods":"POST, GET, OPTIONS, PUT, DELETE, UPDATE","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":"Content-Length","Access-Control-Max-Age":"86400","Content-Type":"application/json; charset=utf-8"};
- if (responseHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("{\"id\":16,\"grp_id\":343,\"numerator\":\"$(cpu.idle)\",\"denominator\":\"$#\",\"endpoint\":\"testenp\",\"metric\":\"test.idle\",\"tags\":\"\",\"ds_type\":\"GAUGE\",\"step\":60,\"creator\":\"root\"}");
- document.getElementById('response-body-3-0').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <hr>
-
- </div>
-
- <div id="4top" role="tabpanel" class="tab-pane col-md-10">
-
-
- <p> <H4> Request Headers </H4> </p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Apitoken</td>
- <td> {"name":"root","sig":"427d6803b78311e68afd0242ac130006"}</td>
- </tr>
-
- <tr>
- <td>X-Forwarded-For</td>
- <td> 127.0.0.1
- </td>
- </tr>
-
- </table>
-
-
-
-
- <p><h4> Response Code</h4></p>
- <pre class="prettyprint lang-json">200</pre>
-
- <p><h4> Response Headers</h4></p>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Credentials</td>
- <td> true</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Headers</td>
- <td> Content-Type, Content-Length, Apitoken</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Methods</td>
- <td> POST, GET, OPTIONS, PUT, DELETE, UPDATE</td>
- </tr>
-
- <tr>
- <td>Access-Control-Allow-Origin</td>
- <td> *</td>
- </tr>
-
- <tr>
- <td>Access-Control-Expose-Headers</td>
- <td> Content-Length</td>
- </tr>
-
- <tr>
- <td>Access-Control-Max-Age</td>
- <td> 86400</td>
- </tr>
-
- <tr>
- <td>Content-Type</td>
- <td> application/json; charset=utf-8</td>
- </tr>
-
- </table>
-
-
- <p> <H4> Response Body </H4> </p>
- <pre class="prettyprint" id="response-body-4-0">{"message":"aggregator:16 is deleted"}</pre>
- <script>
-
- var responseHeader ={"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"Content-Type, Content-Length, Apitoken","Access-Control-Allow-Methods":"POST, GET, OPTIONS, PUT, DELETE, UPDATE","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":"Content-Length","Access-Control-Max-Age":"86400","Content-Type":"application/json; charset=utf-8"};
- if (responseHeader["Content-Type"] === "application/json"){
- try {
- var jsonStr = spaceJson("{\"message\":\"aggregator:16 is deleted\"}");
- document.getElementById('response-body-4-0').innerHTML = syntaxHighlight(jsonStr);
- } catch (e) {
-
- }
- }
- </script>
-
- <hr>
-
- </div>
-
- </div>
- </div>
- </div>
- <hr>
- </body>
- </html>
|