From 565c4809247cfaafcb477eb5dd906296b5cef7a9 Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com> Date: Thu, 16 Jul 2015 16:06:10 -0400 Subject: [PATCH] Added a details for the Discovery creation endpoint. --- dist/js/controllers/analyzer.endpoints.js | 5 ++ dist/json/newDiscovery.json | 7 ++- dist/views/analyzer.endpoints.html | 73 ++++++++++++++++------- scss/main.scss | 6 +- 4 files changed, 66 insertions(+), 25 deletions(-) diff --git a/dist/js/controllers/analyzer.endpoints.js b/dist/js/controllers/analyzer.endpoints.js index 2493163..949461e 100644 --- a/dist/js/controllers/analyzer.endpoints.js +++ b/dist/js/controllers/analyzer.endpoints.js @@ -108,6 +108,11 @@ app.controller('analyzer.endpoints', ['$scope', 'analyzerNav', '$parse', functio return toPrettyJSON(insightJson, 4); } + $scope.prettyDiscoveryCreation = function() { + var discoveryCreationJson = "{\"name\":\"highIncomeConservatives\",\"Description\":\"Customers with highest probability of being high-income conservatives.\",\"filter\":\"educationMax=(Masters|PhD)&&age>=18\",\"target\":\"personalIncome > 10000 && politicalParty == (Republican | Libertarian)\",\"capacity\":100,\"historyDepth\":1000}"; + return toPrettyJSON(discoveryCreationJson, 4); + } + $scope.prettySuccessResponseInsightExample = function() { var successJson = "{\"responseMessage\" : \"Ran in 0.032 seconds\", \"probability\": \"0.89\"}"; return toPrettyJSON(successJson, 4); diff --git a/dist/json/newDiscovery.json b/dist/json/newDiscovery.json index 81a1f3a..6594c14 100644 --- a/dist/json/newDiscovery.json +++ b/dist/json/newDiscovery.json @@ -1,5 +1,8 @@ { - "filter": "educationMax==(Masters|PhD)&&age>=18", + "title": "Some new fangled discover", + "Description": "This discovery discovers stuff which wasnt previously discovered.", + "filter": "educationMax=(Masters|PhD)&&age>=18", "target": "personalIncome > 10000 && politicalParty == (Republican | Libertarian)", - "capacity": 100 + "capacity": 100, + "historyDepth": 1000 } diff --git a/dist/views/analyzer.endpoints.html b/dist/views/analyzer.endpoints.html index caa5d11..6d488ed 100644 --- a/dist/views/analyzer.endpoints.html +++ b/dist/views/analyzer.endpoints.html @@ -9,7 +9,7 @@ <table> <tbody> <tr ng-repeat-start="datapoint in datapoints"> - <td><i class="datapoint-cell datapoint-required" ng-class="{require: datapoint.required == true, optional: datapoint.required == false}"></i></td> + <td><i class="datapoint-cell datapoint-requisite" ng-class="{required: datapoint.required == true, optional: datapoint.required == false}"></i></td> <td class="datapoint-cell">{{datapoint.key}}</td> <td class="datapoint-cell">{{datapoint.type}}</td> <td class="datapoint-cell">{{datapoint.description}}</td> @@ -44,7 +44,7 @@ <table> <tbody> <tr> - <td><i class="datapoint-cell datapoint-required require"></i></td> + <td><i class="datapoint-cell datapoint-requisite required"></i></td> <td class="datapoint-cell">given</td> <td class="datapoint-cell">Map</td> <td class="datapoint-cell">A map describing the known properties of the datapoint</td> @@ -55,7 +55,7 @@ <table> <tbody> <tr ng-repeat-start="datapoint in datapoints"> - <td><i class="datapoint-cell datapoint-required optional"></i></td> + <td><i class="datapoint-cell datapoint-requisite optional"></i></td> <td class="datapoint-cell">{{datapoint.key}}</td> <td class="datapoint-cell">{{datapoint.type}}</td> <td class="datapoint-cell">{{datapoint.description}}</td> @@ -70,10 +70,10 @@ </td> </tr> <tr> - <td><i class="datapoint-cell datapoint-required require"></i></td> + <td><i class="datapoint-cell datapoint-requisite required"></i></td> <td class="datapoint-cell">target</td> - <td class="datapoint-cell">String</td> - <td class="datapoint-cell">A string indicating the boolean logic for the fields being analyzed for.</td> + <td class="datapoint-cell">string</td> + <td class="datapoint-cell">A string specifying the boolean logic for the desired fields.</td> </tr> </tbody> </table> @@ -92,31 +92,64 @@ <div class="datapoint-container"> <div class="datapoint-title"> - <h1>Discovery example1</h1> + <h1>Discovery creation</h1> </div> <div class="datapoint-details"> - <div><span class="datapoint-http-method get-method">GET</span> https://aide.syncleus.com/robotek/customers/discovery/example1</div> + <div><span class="datapoint-http-method post-method">POST</span> https://aide.syncleus.com/robotek/customers/discovery</div> <hr/> Request parameters <table> <tbody> - <tr ng-repeat-start="datapoint in datapoints"> - <td><i class="datapoint-cell datapoint-required optional"></i></td> - <td class="datapoint-cell">{{datapoint.key}}</td> - <td class="datapoint-cell">{{datapoint.type}}</td> - <td class="datapoint-cell">{{datapoint.description}}</td> + <tr> + <td><i class="datapoint-cell datapoint-requisite required"></i></td> + <td class="datapoint-cell">name</td> + <td class="datapoint-cell">string</td> + <td class="datapoint-cell">Name for the discovery being created</td> </tr> - <tr ng-repeat-end=""> + <tr> + <td><i class="datapoint-cell datapoint-requisite optional"></i></td> + <td class="datapoint-cell">description</td> + <td class="datapoint-cell">string</td> + <td class="datapoint-cell">Description for the discovery being created</td> + </tr> + <tr> + <td><i class="datapoint-cell datapoint-requisite optional"></i></td> + <td class="datapoint-cell">filter</td> + <td class="datapoint-cell">string</td> + <td class="datapoint-cell">A string specifying the boolean logic for filtering datapoints being analyzed.</td> + </tr> + <tr> + <td><i class="datapoint-cell datapoint-requisite required"></i></td> + <td class="datapoint-cell">target</td> + <td class="datapoint-cell">string</td> + <td class="datapoint-cell">A string specifying the boolean logic for the desired fields.</td> + </tr> + <tr> + <td><i class="datapoint-cell datapoint-requisite required"></i></td> + <td class="datapoint-cell">capacity</td> + <td class="datapoint-cell">number</td> + <td class="datapoint-cell">The number of top matching datapoints to retain.</td> + </tr> + <tr> <td colspan="3"></td> - <td ng-if="datapoint.type == 'number'"><span ng-if="datapoint.rangeMin != null">{{datapoint.rangeMin}}</span><span ng-if="datapoint.rangeMin == null">-∞</span> to <span ng-if="datapoint.rangeMax != null">{{datapoint.rangeMax}}</span><span ng-if="datapoint.rangeMax == null">∞</span></td> - <td ng-if="datapoint.type == 'discrete'">{{datapoint.states}}</td> + <td>1 to ∞</td> + </tr> + <tr> + <td><i class="datapoint-cell datapoint-requisite optional"></i></td> + <td class="datapoint-cell">historyDepth</td> + <td class="datapoint-cell">number</td> + <td class="datapoint-cell">The maximum number of datapoints to learn from already stored in the datastore.</td> + </tr> + <tr> + <td colspan="3"></td> + <td>0 to ∞</td> </tr> </tbody> </table> <hr/> <div style="padding-bottom: 10px;">Request example</div> <div>Content-Type: application/json</div> - <div hljs source="prettyDatapointsReceiverExample()"></div> + <div hljs source="prettyDiscoveryCreation()"></div> <hr/> <div style="padding-bottom: 10px;">Response example</div> <div><span>201</span> Datapoint successfully recorded.</div> @@ -127,16 +160,16 @@ <div class="datapoint-container"> <div class="datapoint-title"> - <h1>Discovery example2</h1> + <h1>Discovery example1</h1> </div> <div class="datapoint-details"> - <div><span class="datapoint-http-method get-method">GET</span> https://aide.syncleus.com/robotek/customers/discovery/example2</div> + <div><span class="datapoint-http-method get-method">GET</span> https://aide.syncleus.com/robotek/customers/discovery/example1</div> <hr/> Request parameters <table> <tbody> <tr ng-repeat-start="datapoint in datapoints"> - <td><i class="datapoint-cell datapoint-required optional"></i></td> + <td><i class="datapoint-cell datapoint-require optional"></i></td> <td class="datapoint-cell">{{datapoint.key}}</td> <td class="datapoint-cell">{{datapoint.type}}</td> <td class="datapoint-cell">{{datapoint.description}}</td> diff --git a/scss/main.scss b/scss/main.scss index 8bc397c..d618e7b 100644 --- a/scss/main.scss +++ b/scss/main.scss @@ -499,16 +499,16 @@ footer div { color: #03a100; } -.datapoint-required { +.datapoint-requisite { @extend .fa; @extend .fa-circle; } -.datapoint-required.optional { +.datapoint-requisite.optional { color: #bbbbbb; } -.datapoint-required.require { +.datapoint-requisite.required { color: $important-alert-color; } -- GitLab