Difference between revisions of "SmartJobCenter"

From RobotinoWiki
(GET methods)
(GET methods)
Line 8: Line 8:
 
==GET methods==
 
==GET methods==
 
===/jobs===
 
===/jobs===
====Query Params====
 
{|class="wikitable"
 
! KEY
 
! VALUE
 
! DESCRIPTION
 
|-
 
|robot
 
|
 
|Robot ID. Only return jobs assigned to the given robot.
 
|-
 
|job
 
|
 
|Job ID. Only return job with the given ID.
 
|}
 
 
====Response====
 
====Response====
 
;TYPE:JSON
 
;TYPE:JSON
Line 49: Line 35:
 
     }
 
     }
 
   ]
 
   ]
 +
}
 +
</pre>
 +
 +
===/jobs/:jobid===
 +
====Response====
 +
;TYPE:JSON
 +
;STATUS CODE: If jobid exists 200 OK, else 404 Not Found
 +
;Example
 +
:
 +
<pre>
 +
{
 +
  "robot" : 10,
 +
  "job" : 10,
 +
  "priority" : 1,
 +
  "fromstation" : 2,
 +
  "frombelt" : 1,
 +
  "tostation" : 3,
 +
  "tobelt" : 4,
 +
  "state" : "DRIVING",
 +
  "life-cycle-state" : "RUNNING"
 
}
 
}
 
</pre>
 
</pre>

Revision as of 13:52, 5 August 2021

Introduction

SmartJobCenter 64.png REST API to manage jobs and to read job status information.

GET methods

/jobs

Response

TYPE
JSON
STATUS CODE
200 OK
Example
{
  "jobs" : [
    {
      "robot" : 10,
      "job" : 10,
      "priority" : 1,
      "fromstation" : 2,
      "frombelt" : 1,
      "tostation" : 3,
      "tobelt" : 4,
      "state" : "DRIVING",
      "life-cycle-state" : "RUNNING"
    },
    {
      "robot" : 10,
      "job" : 11,
      "position" : 2,
      "state" : "DRIVING",
      "life-cycle-state" : "RUNNING"
    }
  ]
}

/jobs/:jobid

Response

TYPE
JSON
STATUS CODE
If jobid exists 200 OK, else 404 Not Found
Example
{
  "robot" : 10,
  "job" : 10,
  "priority" : 1,
  "fromstation" : 2,
  "frombelt" : 1,
  "tostation" : 3,
  "tobelt" : 4,
  "state" : "DRIVING",
  "life-cycle-state" : "RUNNING"
}

POST methods

/createjob