server

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2016 License: BSD-3-Clause, BSD-3-Clause Imports: 6 Imported by: 0

README

Directory for the Server

Dockmaster server. This server will store data received from the Agent in a mongodb collection.

The form of this data is as follows:

{
	"agentid": "007",
	"expireAfterSeconds": 300,
	"containers": [{
		"id": "cont1",
		"name": "bla",
		"command": "catalina.sh",
		"port": "3321"
	}, {
		"id": "cont2",
		"name": "bla2",
		"command": "catalina2.sh",
		"port": "3333"
	}]
}

This will create a record for agent 007 and with a list of containers defined in containers. Whenever the agent resends data, at the current version, all previous data for this agent is completely overwritten. This is so that avoid duplications and not have to deal with individual updates to containers.

In a next version perhaps the change will only be applied if there is actual change to one for the containers or information regarding the agent.

For now, the server provides these end-points:

GET    /api/1/list               --> main.listContainers (3 handlers)
POST   /api/1/add                --> main.addContainers (3 handlers)
POST   /api/1/delete             --> main.deleteContainers (3 handlers)

The delete however, is not used at the moment.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL