Skip to content

~crosstalk.api.worker.stop

tristanls edited this page Dec 2, 2012 · 1 revision

Stop a worker.

Since Version 0.1.0
Scope
accepts: public responds as: ~crosstalk

Parameters

All parameters are optional, unless otherwise indicated.

crosstalkToken 5uua22922ausllwibb1amms7a761n23n4nasAJFDUA17711 required Crosstalk authorization token
workerInstance crosstalk-drone-worker-e5c41eb9-8ab8-4a80-b862-465f60a7f372 required Worker instance to stop

Response fields

Response

stopping true Verification that the worker is stopping
workerInstance crosstalk-drone-worker-e5c41eb9-8ab8-4a80-b862-465f60a7f372 Instance ID of stopped worker

Error

errorCode 400 Error code compatible with HTTP status codes
message Missing 'workerInstance' Error message

Example

Request:

crosstalk.emit( 
  '~crosstalk.api.worker.stop',
  {
    crosstalkToken : "5uua22922ausllwibb1amms7a761n23n4nasAJFDUA17711",
    workerInstance : "crosstalk-drone-worker-e5c41eb9-8ab8-4a80-b862-465f60a7f372"
  },
  '~crosstalk',
  function ( error, response ) { /* ... */ }
);

Response:

{ 
  stopping : true,
  workerInstance : "crosstalk-drone-worker-e5c41eb9-8ab8-4a80-b862-465f60a7f372" 
}

Error:

{ 
  errorCode : 400, 
  message : "Missing 'workerInstance'" 
}