Skip to content

~crosstalk.api.worker.list

tristanls edited this page Dec 2, 2012 · 1 revision

List available workers.

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
workerName myWorker If provided, only worker versions for this workerName will be returned

Response fields

Response

workers [ { WORKER }, { WORKER }, ... ] List of uploaded workers
workers/WORKER { "worker" : "myworker@1.2.3" } Each worker in workers list has name and version

Error

errorCode 400 Error code compatible with HTTP status codes
message Something happened Error message

Examples

Request:

crosstalk.emit( 
  '~crosstalk.api.worker.list',
  {
    crosstalkToken : "5uua22922ausllwibb1amms7a761n23n4nasAJFDUA17711",
  },
  '~crosstalk',
  function ( error, response ) { /* ... */ }
);

Response:

{ 
  workers : [
    { worker : "myWorker@1.2.1" },
    { worker : "myWorker@1.2.0" },
    { worker : "myWorker@1.1.0" },
    { worker : "myWorker@1.0.0" },
    { worker : "someWorker@1.1.4" },
    { worker : "someWorker@1.0.2" }
  ]
}

Request:

crosstalk.emit( 
  '~crosstalk.api.worker.list',
  {
    crosstalkToken : "5uua22922ausllwibb1amms7a761n23n4nasAJFDUA17711",
    workerName : "someWorker"
  },
  '~crosstalk', 
  function ( error, response ) { /* ... */ }
);

Response:

{ 
  workers : [
    { worker : "someWorker@1.1.4" },
    { worker : "someWorker@1.0.2" }
  ]
}

Error:

{ 
  errorCode : 400, 
  message : "Bad Request" 
}