Giter Site home page Giter Site logo

fforbeck / vacuum Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 1.0 101 KB

REST API which allows you to understand the dependency graph of your microservices architecture

Shell 5.63% Java 94.37%
microservice dependency-graph swagger-spec neo4j rest-api java

vacuum's Introduction

About


Vacuum is a REST API which allows you to understand the dependency graph of your microservices architecture.

It is based on Swagger.io, you can just submit the URL of your swagger documentation and Vacuum will parse it and create the Service-Endpoint graph as you can see in the image bellow.

Service-Endpoint-Graph

The green node is the service host name, captured from Swagger document, it represents the main node and is labeled as Service. Blue nodes are the service paths, also captured from Swagger spec, the nodes labeled as Endpoint and have the propety path which descrives its path on that service. Basically, the graph is composed by host names and paths.

There is only one relationship between Service and Endpoint which is identified by the label EXPOSES. It represents all endpoints that are exposed for a given service swagger spec.

Once you have created the Service-Endpoint graph you can adjust your microservices to send a request to Vacuum API.

The request needs to inform the details about the call that your service A is sending to your service B. After that, Vacuum will create relationships between both services considering the path and http method in use.

The relatioship between the Service rely on a request event with these details:

  • origin_host: The service A host name which is firing the call to service B
  • method: The HTTP method
  • target_host: The service B host name
  • target_path: The endpoint that service A is calling from service B

Requirements:


Basic Usage


Creating a Service-Endpoint graph based on a Swagger URL

POST <host>:8090/v1/microservices -H 'Content-Type: application/json' -d '{"swagger_url": "<the_swagger_url>"}'

Registering a call from service A to service B

POST <host>:8090/v1/requests -H 'Content-Type: application/json' -d '{"origin_host": "api.uber.com", "method": "POST", "target_host": "petstore.swagger.io", "target_path": "/v2/user/login"}'

Registering another call from service A to service B

POST <host>:8090/v1/requests -H 'Content-Type: application/json' -d '{"origin_host": "api.uber.com", "method": "DELETE", "target_host": "petstore.swagger.io", "target_path": "/v2/pet"}'

Sample Data


Under scripts folder you will find the script fetch_db.sh, it will provide some sample data to populate Neo4J. It creates two graphs Service-Endpoint and add relatioships (GET,POST,DELETE,CALL) for Service nodes which represents call events between them.

After you have executed the script you can open the Neo4J dashboard http://localhost:7474/browser/ and execute this Cypher query to see all the entire graph: MATCH p=()-[r:EXPOSES]->() RETURN p

Basic Queries via Vacuum API


Get all microservice which contains term user in ther endpoints:

GET <host>:8090/v1/microservices?path_term=user -H 'Content-Type: application/json'

Get all services which rely on service id

GET <host>:8090/v1/microservices/b36e8649-e82e-4795-8ef6-c2d8eb3e6620/dependants -H 'Content-Type: application/json'

The service id is generate and returned when you send a POST /v1/microservices with swagger_url as body param or you can checkout the uuid param on Neo4j dashboard if you have executed the fetch_db.sh.

TODO


  • New queries
  • Document Vacuum API with Swagger.io
  • Authentication (API, Neo4J)
  • Unit & IT Tests
  • Improve DDD
  • Better DOCs

vacuum's People

Contributors

fforbeck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

umeshdangat

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.