This is graph based system, the purpose of this system is to track the inventory like.
- Physical or virtual node/server details
- Nodes/Servers to service/application associations
- Node/Server to Hardware and installed operating system associations
- Team to Application/Service associations.
Since this is graph based application, all the components are well connected and it is easy to retrieve or traverse from any node.
Nodes
Department : Departments in company ex: technology
Team : Team within department
Application : Application, could be a logical name to group of servers serving same purpose, ex: User Service
Server : A Phisical/Victrual node, which hosts the one/many nodes of an application
Hardware : Hardware profile ( combination of Memory, CPU and Disk)
OperatingSystem: Installed operating system
Relations
ALLOCATED_HARDWARE : Association between Server and Hardware
INSTALLED_OS : Installed OS relation between Server and OperatingSystem
TEAM_OF : Department to Team association
OWNES : Team to application association
NODE_OF : Application to Server association
This application is springboot application with embedded jetty container, this can be deployed in jetty container.
1. Install neo4j (https://neo4j.com/docs/operations-manual/current/installation/)
2. Change neo4j server password
Ex: curl -H "Content-Type: application/json" -X POST -d '{"password":"blahblah"}' -u neo4j:neo4j http://localhost:7474/user/neo4j/password
3. Update neo4j configuration to enable http and bolt ports
Add below 3 lines at the bottom of the file {NEO4J_HOME}/conf/neo4j.conf
dbms.connector.http.address=0.0.0.0:7474
dbms.connector.https.address=0.0.0.0:7473
dbms.connector.bolt.address=0.0.0.0:7687
3. Update the connection information under "application.properties" to connect to neo4j instance
spring.data.neo4j.uri=bolt://host:7687
spring.data.neo4j.username=neo4j
spring.data.neo4j.password=blahblah
4. Java8
5. Maven3
http://host:7001/nventory/v1/teams
ex: http://localhost:7001/nventory/v1/teams
http://host:7001/nventory/v1/teams/{teamName}
ex: http://localhost:7001/nventory/v1/teams/Platform
http://host:7001/nventory/v1/teams/{teamName}/applications
ex: http://host:7001/nventory/v1/teams/Platform/applications
http://host:7001/nventory/v1/applications/{appName}
ex: http://host:7001/nventory/v1/applications/Arrow
http://localhost:7001/nventory/v1/teams/applications/{appName}/servers
ex: http://localhost:7001/nventory/v1/teams/applications/Arrow/servers
http://localhost:7001/nventory/v1/teams/{teamName}/applications/resources
Ex: http://localhost:7001/nventory/v1/teams/Platform/applications/resources
Path: http://host:port/nventory/v1/servers/file/{fileName}
Ex: curl -X POST http://localhost:7001/nventory/v1/servers/file/inventory-load-2017-Part1.xlsx
curl -H "Content-Type: application/json" -X POST -d '{"password":"your new password"}' -u neo4j:neo4j http://localhost:7474/user/neo4j/password
curl -X POST http://localhost:7001/nventory/v1/applications/Arrow/costByServer/3.5
Match(n:Team{name:'Front'}) return n
Match(n:Application{name:'Front'}) return n
Match(n:Application{name:'Arrow'})-[no: NODE_OF]-()-[r: ALLOCATED_HARDWARE]-(h: Hardware) return sum(h.memoryInGB)
Match(n:Application{name:'Arrow'})-[no: NODE_OF]-()-[r: ALLOCATED_HARDWARE]-(h: Hardware) return sum(h.numberOfCores)
Match(n:Application{name:'Arrow'})-[no: NODE_OF]-()-[r: ALLOCATED_HARDWARE]-(h: Hardware) return sum(h.allocatedSpaceInGB)
Match(a:Application {name: 'Arrow'})-[NODE_OF]-(n:Server)--[r: ALLOCATED_HARDWARE]-(h: Hardware) return a, h