Git Product home page Git Product logo

discovery's Introduction

#discovery

This service provides a REST interface for querying for the list of hosts that belong to a given service in microservice infrastructure. Host information is written to and read from Dynamo. This project relies on the following libraries:

  • Flask (web-framework)
  • Flask-Cache (for caching and reusing results for GET requests)
  • Pynamodb (for reading/writing DynamoDB data)

##API ###GET /v1/registration/:service

  • Returns the list of hosts for :service

###GET /v1/registration/repo/:service_repo_name

  • Returns the list of hosts for :service_repo_name (queries a Dynamodb GSI for this info)

###POST /v1/registration/:service

  • Used to register a host with a service. The list of required parameters is as follows:
  • ip (the ip address of the host)
  • port (the port on which the host expects connections)
  • revision (the sha of the github revision the service is currently running)
  • tags (a JSON dictionary with the following fields)
    • az (Required: the AWS availability zone that the host is running in)
    • region (Required: the AWS region that the host is running in)
    • instance_id (Required: the AWS instance_id of the host)
    • canary (Optional: boolean string set to "true" if the host is a canary)
    • load_balancing_weight (Optional: may be used for load balancing)

###DELETE /v1/registration/:service/:ip_address

  • Deletes the host for the given :service and :ip_address

###POST /v1/loadbalancing/:service/:ip_address

  • Used to update the weight of hosts for load balancing purposes.
  • :ip_address is optional. If not given, all hosts for the given service will have their weights updated.
  • The list of required parameters is as follows:
  • load_balancing_weight (an integer between 1 and 100)

##Main Classes

##Unit Testing To run all unit tests, run make test_unit.

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.