stormtracker

A new nexus in the sleeves of a node.js.

# 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"
}

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"
    }
  }
}
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"
    }
  }
}

Response JSON

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

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"
    }
  }
}

Returns Http status code 204