Skip to content
Snippets Groups Projects
Commit 5d10fd9d authored by Release Webservice's avatar Release Webservice
Browse files

Finished release 0.6.

parents 05b9cd1a 27783320
No related branches found
No related tags found
No related merge requests found
...@@ -159,6 +159,88 @@ Any non-empty responses are JSON formatted messages. ...@@ -159,6 +159,88 @@ Any non-empty responses are JSON formatted messages.
} }
``` ```
* /jobs/interfaces/*`hostname`*
The response will be a list of information about
the interfaces present on the requested host
and will be formatted as follows:
```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {"type": "string"},
"description": {"type": "string"}
},
"required": ["name", "description"],
"additionalProperties": False
}
}
```
* /jobs/snmp/*`hostname`*
The response will be a list of information about
the interfaces discovered through snmp
queries on the requested host
and will be formatted as follows:
```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"index": {"type": "string"},
"name": {"type": "string"}
},
"required": ["index", "name"],
"additionalProperties": False
}
}
```
* /jobs/bgp/*`hostname`*
The response will be a list of information about
the bgp peerings configured for the requested host
and will be formatted as follows:
```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"description": {"type": "string"},
"as": {
"type": "object",
"properties": {
"peer": {
"type": "string",
"pattern": r'^\d+$'
},
"local": {
"type": "string",
"pattern": r'^\d+$'
},
},
"required": ["peer", "local"],
"additionalProperties": False
},
},
"required": ["description", "as"],
"additionalProperties": False
}
}
```
* /jobs/update * /jobs/update
This resource updates the inventory network data. This resource updates the inventory network data for juniper devices.
\ No newline at end of file
...@@ -4,4 +4,6 @@ ...@@ -4,4 +4,6 @@
0.4: added some further sample resources 0.4: added some further sample resources
0.5: added meaningful alarmsdb demo method 0.5: added meaningful alarmsdb demo method
added snmp index to interface data to support sensu, prometheus added snmp index to interface data to support sensu, prometheus
increased unit test coverage to 78% increased unit test coverage to 78%
\ No newline at end of file 0.6: added a static demo of juniper stuff
added some route docs to README
\ No newline at end of file
...@@ -7,16 +7,12 @@ import sys ...@@ -7,16 +7,12 @@ import sys
import inventory_provider import inventory_provider
from inventory_provider import constants from inventory_provider import constants
logging.basicConfig(level=logging.WARNING) logging.basicConfig(stream=sys.stderr, level=logging.WARNING)
logging.getLogger(constants.SNMP_LOGGER_NAME).setLevel(logging.DEBUG) logging.getLogger(constants.SNMP_LOGGER_NAME).setLevel(logging.DEBUG)
logging.getLogger(constants.TASK_LOGGER_NAME).setLevel(logging.INFO) logging.getLogger(constants.TASK_LOGGER_NAME).setLevel(logging.INFO)
logging.getLogger(constants.JUNIPER_LOGGER_NAME).setLevel(logging.DEBUG) logging.getLogger(constants.JUNIPER_LOGGER_NAME).setLevel(logging.DEBUG)
logging.getLogger(constants.DATABASE_LOGGER_NAME).setLevel(logging.DEBUG) logging.getLogger(constants.DATABASE_LOGGER_NAME).setLevel(logging.DEBUG)
logging.basicConfig(
stream=sys.stderr,
level=logging.DEBUG)
app = inventory_provider.create_app() app = inventory_provider.create_app()
if __name__ == "__main__": if __name__ == "__main__":
......
var myApp = angular.module('inventoryApp', []);
myApp.controller('inventoryProvider', function($scope, $http) {
$scope.routers = [];
$scope.router = '';
$scope.interfaces = 'not yet loaded';
$scope.bgp = 'not yet loaded';
$scope.snmp = 'not yet loaded';
$http({
method: 'GET',
url: window.location.origin + "/data/routers"
}).then(
function(rsp) {$scope.routers = rsp.data;},
function(rsp) {$scope.routers = ['error'];}
);
$scope.update_interface = function() {
$http({
method: 'GET',
url: window.location.origin + "/data/interfaces/" + $scope.router
}).then(
function(rsp) {$scope.interfaces = rsp.data;},
function(rsp) {$scope.interfaces = 'error';}
);
$http({
method: 'GET',
url: window.location.origin + "/data/bgp/" + $scope.router
}).then(
function(rsp) {$scope.bgp = rsp.data;},
function(rsp) {$scope.bgp = 'error';}
);
$http({
method: 'GET',
url: window.location.origin + "/data/snmp/" + $scope.router
}).then(
function(rsp) {$scope.snmp = rsp.data;},
function(rsp) {$scope.snmp = 'error';}
);
}
});
\ No newline at end of file
<!doctype html>
<html ng-app="inventoryApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.5/angular.min.js"></script>
<script src="inventoryProvider.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<!--
<h2>Routers</h2>
<div ng-controller="inventoryProvider">
<ul name="routers" class="unstyled">
<li ng-repeat="r in routers">{{r}}</li>
</ul>
</div>
-->
<div ng-controller="inventoryProvider">
<h2>Interfaces</h2>
<div>
<select
ng-options="r for r in routers"
ng-change="update_interface()"
ng-model="router"></select>
</div>
<div class="column">
<p><b>interfaces</b></p>
{{interfaces}}
</div>
<div class="column">
<p><b>bgp</b></p>
{{bgp}}
</div>
<div class="column">
<p><b>snmp</b></p>
{{snmp}}
</div>
</div>
</body>
</html>
\ No newline at end of file
.column {
float: left;
width: 33.33%;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
\ No newline at end of file
...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages ...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup( setup(
name='inventory-provider', name='inventory-provider',
version="0.5", version="0.6",
author='GEANT', author='GEANT',
author_email='swd@geant.org', author_email='swd@geant.org',
description='Dashboard inventory provider', description='Dashboard inventory provider',
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment