Run a Job

Request Parameters

Parameter

Description

Valid values

Mandatory

action

Action under a newbie station

approve—approve the access of the stations to the Server,

cancelonconnect—cancel an action specified to execute at the next connection of a station to the Server,

reject—reject the station

no

group

Group to which a newbie station will be added

no

id

Identifier of a newbie station

no

task-id

Job identifier

newbies—set the action under the newbie stations.

update_repositories—the job to update the Server repository.

yes

 

The action, group and id parameters are set only if task-id=newbies.

If the action parameter is set to approve, the group parameters must be specified.

 

Request Examples

1.For task-id=newbies:

http://192.168.1.1:9080/api/server/task.ds?task-id=newbies&action=approve&group=_notfound_&id=001

http://192.168.1.1:9080/api/server/tasks.ds?task-id=newbies&action=approve&group=_notfound_&id=001

2.For task-id=update_repositories:

http://192.168.1.1:9080/api/server/task.ds?task-id=update_repositories

http://192.168.1.1:9080/api/server/tasks.ds?task-id=update_repositories

In Server repository update has already been initiated, the request task-id=update_repositories will return the success status.

XML and JSON response structure examples are described below.

 

XML Response

1.For task-id=newbies:

<drweb-es-api api_version="4.3.0" timestamp="1558521889" server="192.168.1.1" srv_version="12.00.0.201909260" status="true">
  <task id="newbies" status="failed" message="Group is not found"/>
</drweb-es-api>

2.For task-id=update_repositories:

<drweb-es-api api_version="4.3.0" timestamp="1558521889" server="192.168.1.1" srv_version="12.00.0.201909260" status="true">
  <task id="update_repositories" status="failed" message="Not enough privileges to perform the operation"/>
</drweb-es-api>

 

Description of XML Response Parameters

The <task /> element contains information on requested job.

The <task /> element attributes:

Attribute

Description

id

Job identifier. Can take the following values:

newbies—set an action under the newbie station.

update_repositories—the job to update the Server repository.

status

Job execution state:

success—job successfully executed,

failed—job failed.

message

Message on error occurred during job execution. If the job completed successfully, the message attribute contains the empty message string.

 

JSON Response Structure

1.For task-id=newbies:

{ "head": {
    "status": true,
    "timestamp": 1558522034,

    "api": {
      "version": 40300,
      "versionString": 4.3.0},

    "server": {
      "name": "192.168.1.1",

      "version": "12.00.0.201909260",
      "uuid": "27671337-e0b0-4f60-aeb0-ab1f2ca47f77"}},

"data": {
    "task": {
      "id": "newbies",

      "message": "Group is not found",
      "status": "failed"}}}

2.For task-id=update_repositories:

{ "head": {
    "status": true,

    "timestamp": 1558522034,

    "api": {
      "version": 40300,
      "versionString": 4.3.0},

    "server": {
      "name": "192.168.1.1",

      "version": "12.00.0.201909260",
      "uuid": "1023dcd7-d11d-b211-896d-8804c0842edb"}},

"data": {
    "task": {
      "id": "update_repositories",

      "message": "Not enough privileges to perform the operation",
      "status": "failed"}}}

 

Description of JSON Response Parameters

The task block contains information on requested job.

The task block elements:

Field name

Description

id

Job identifier. Can take the following values:

newbies—set an action under the newbie station.

update_repositories—the job to update the Server repository.

message

Message on error occurred during job execution. If the job completed successfully, the message element contains the empty message string.

status

Job execution state:

success—job successfully executed,

failed—job failed.