Git Product home page Git Product logo

opsclick-ansible-be's Introduction

Setting up the servers

Just use docker and docker-compose

$ git clone https://github.com/xyklex/django-mongoengine.git
$ docker build -t opsclick-api-deploy:latest -t opsclick-api-deploy:0.1 .
$ mkdir env
$ echo 'DEBUG=1' >> env/common
$ docker-compose up -d

And the app will be ready to accept requests

API endpoints:

For the cloud:

  • localhost:8000/digitalocean/regions [GET]
  • localhost:8000/digitalocean/sizes [GET]
  • localhost:8000/digitalocean/images [GET] (can receive parameters in the url like '?type=distribution' or '?type=application' just like the digitalocean API)

The requests to this endpoints must contain in the header and digitalocean 'access-key' key

{"access-key": "71b1eac1e0c4a233c917276cf2f6bd5cda4dd3433c07bdcb9924cc98bd917886"}

For services:

The idea is that the register of the available services depend from the modules that will be in app_dir/services/mysql, and will be registered automatically when the api start or reload, with that in mind we can retrieve the services and clouds we can setup

  • localhost:8000/service [GET] (retrieve all the services registered)
  • localhost:8000/service/<service_name> [GET,POST] (create a service in the database)

For setup:

  • localhost:8000/setup [POST]

The json to setup a service in a digitalocean cloud look like the next:

{
	"service":"mysql",
	"cloud":"digitalocean",
	"options":{
		"droplets":["uno"],
		"state": "absent",
		"size": "512mb",
		"image": "ubuntu-14-04-x64",
		"region": "sgp1",
		"access_key":"71b1eac1e0c4a233c917276cf2f6bd5cda4dd3433c07bdcb9924cc98bd917886"
	}
}

With the header => Content-Type': 'application/json

The state key can have two values, absent will delete any droplet in the droplets value, and present will create the droplets in the droplets value with the information in json.

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.