stormtracker

0.1.8 • Public • Published
# StormTracker

Stormtracker is the module which keeps track of all the stormflash endpoints - basically the one who provides identification, authorization and activation of stormflash endpoints

Running Stormtracker

Step-1 You need to export NODE_PATH as below, say, if the stormtracker node dir is present in path "/lib/node_modules"

export NODE_PATH=$NODE_PATH:/lib/node_modules:/lib/node_modules/stormtracker/node_modules:/lib/node_modules/stormtracker/lib:/lib/node_modules/stormtracker/lib/:/lib/node_modules/stormtracker/node_modules/

Step-2 cd /lib/node_modules/stormtracker/

Step-3 Run stormtracker js file

nohup node lib/stormtracker.js >> /var/log/stormtracker.log 2>&1 &

(or)

nohup npm start >> /var/log/stormtracker.log 2>&1 &

List of Stormtracker APIs

Verb Uri Description Authorization
POST `/agents` Create an agent object No
POST `/agents/:id/csr` Sign the incoming CSR, returns the cert Yes
PUT `/agents/:id` Update the agent object Yes
PUT `/agents/:id/status/:status` Update the state field in agent object No
GET `/agents/:id` Retreive the agent Yes
GET `/agents/:id/bolt` Retreive the underlying bolt object Yes
GET `/agents/serialKey/:key` Retreive the agent by serial key Yes
DELETE `/agents/:id` Remove the agent from db No

POST /agents

Request JSON

{
  serialKey: "some serial key",
  stoken: "some token"
  password: "password",
  stormbolt: {
	state: "ACTIVE",
	servers: ["bolt://testserver"],
	beacon: {
	  interval: 2000,
	  retry: 2000
	},
	loadbalance: {
	  algorithm: "roundrobin"
	}
  }
}

Response JSON

{
  id :"uuid"
  serialKey: "some serial key",
  stoken: "some token"
  password: "password",
  stormbolt: {
	state: "ACTIVE",
	servers: ["bolt://testserver"],
	beacon: {
	  interval: 2000,
	  retry: 2000
	},
	loadbalance: {
	  algorithm: "roundrobin"
	},
	cabundle: {
	  encoding: "base64",
	  data: "base64 encoded certificate"
	}
  }
}

POST /agents/:id/csr

Request JSON

{
	encoding: "base64",
	data: "base64 encoded CSR"
}

Response JSON

{
	encoding: "base64",
	data: "base64 encoded signed certificate"
}

PUT /agents/:id

Request JSON

{
  id:"uuid",
  serialKey: "some serial key",
  stoken: "some token"
  password: "password",
  stormbolt: {
	state: "ACTIVE",
	servers: ["bolt://testserver"],
	beacon: {
	  interval: 2000,
	  retry: 2000
	},
	loadbalance: {
	  algorithm: "roundrobin"
	}
  }
}

Response JSON

{
  id:"uuid",
  serialKey: "some serial key",
  stoken: "some token"
  password: "password",
  stormbolt: {
	state: "ACTIVE",
	servers: ["bolt://testserver"],
	beacon: {
	  interval: 2000,
	  retry: 2000
	},
	loadbalance: {
	  algorithm: "roundrobin"
	}
  }
}

PUT /agents/:id/status/:status

Update the status valid values (ACTIVE | INACTIVE)

Returns Http Status code 204

GET /agents/:id

Response JSON

{
  id :"uuid"
  serialKey: "some serial key",
  stoken: "some token"
  password: "password",
  stormbolt: {
	state: "ACTIVE",
	servers: ["bolt://testserver"],
	beacon: {
	  interval: 2000,
	  retry: 2000
	},
	loadbalance: {
	  algorithm: "roundrobin"
	},
	cabundle: {
	  encoding: "base64",
	  data: "base64 encoded certificate"
	}
  }
}

GET /agents/:id/bolt

Response JSON

{
	state: "ACTIVE",
	servers: ["bolt://testserver"],
	beacon: {
	  interval: 2000,
	  retry: 2000
	},
	loadbalance: {
	  algorithm: "roundrobin"
	},
	cabundle: {
	  encoding: "base64",
	  data: "base64 encoded certificate"
	}
}

GET /agents/serialKey/:key

Response JSON

{
  id :"uuid"
  serialKey: "some serial key",
  stoken: "some token"
  password: "password",
  stormbolt: {
	state: "ACTIVE",
	servers: ["bolt://testserver"],
	beacon: {
	  interval: 2000,
	  retry: 2000
	},
	loadbalance: {
	  algorithm: "roundrobin"
	},
	cabundle: {
	  encoding: "base64",
	  data: "base64 encoded certificate"
	}
  }
}

DELETE /agents/:id

Returns Http status code 204

Readme

Keywords

none

Package Sidebar

Install

npm i stormtracker

Weekly Downloads

1

Version

0.1.8

License

none

Last publish

Collaborators

  • clearpath