view mock-api/endpoints/ping.command.endpoint.js @ 273:84d4e3e9d77a

Use command channel version 0.0.1 rather than v1 Reviewed-by: jkang Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-October/025547.html
author Andrew Azores <aazores@redhat.com>
date Thu, 26 Oct 2017 10:41:29 -0400
parents 342dd7281bf1
children
line wrap: on
line source

function pingCommand (server) {
  server.init('ping-command');
  server.app.ws('/commands/0.0.1/actions/ping/systems/:systemId/agents/:agentId/jvms/:jvmId/sequence/:seqId', function (ws, req) {
    server.logRequest('ping-command', req);
    ws.on('message', function (msg) {
      ws.send(JSON.stringify(
        {
          payload: {
            respType: 'OK'
          }
        }
      ));
    });
  });
}

module.exports = pingCommand;