Difference between revisions of "SmartJobCenter"

From RobotinoWiki
(Created page with "==Introduction== {|class="wikitable" cellpadding="20" vertical-align="top" |- |Image:SmartJobCenter_64.png |REST API to manage jobs and to read job status information. |}")
 
(Response)
 
(15 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
|REST API to manage jobs and to read job status information.
 
|REST API to manage jobs and to read job status information.
 
|}
 
|}
 +
 +
==GET methods==
 +
===/jobs===
 +
====Response====
 +
;TYPE:JSON
 +
;STATUS CODE:200 OK
 +
;Example
 +
:
 +
<pre>
 +
{
 +
  "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"
 +
    }
 +
  ]
 +
}
 +
</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>
 +
 +
==POST methods==
 +
===/gotoposition===
 +
Create a new GotoPosition job.
 +
====Posted data====
 +
;TYPE:JSON
 +
;Example:
 +
<pre>
 +
{
 +
  "robot" : 1,
 +
  "position" : 2
 +
}
 +
</pre>
 +
====Response====
 +
;TYPE:JSON
 +
;STATUS CODE: 201 (Created) if a new job was created, 304 (Not Modified) if no job was created
 +
;Example (job created):
 +
<pre>
 +
{
 +
  "robot" : 1,
 +
  "job" : 1867,
 +
  "position" : 2,
 +
  "state" : "NIL",
 +
  "life-cycle-state" : "NOTSTARTED"
 +
}
 +
</pre>

Latest revision as of 14:23, 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

/gotoposition

Create a new GotoPosition job.

Posted data

TYPE
JSON
Example
{
  "robot" : 1,
  "position" : 2
}

Response

TYPE
JSON
STATUS CODE
201 (Created) if a new job was created, 304 (Not Modified) if no job was created
Example (job created)
{
  "robot" : 1,
  "job" : 1867,
  "position" : 2,
  "state" : "NIL",
  "life-cycle-state" : "NOTSTARTED"
}