Get Stations List by a State

Request Parameters

Parameter

Description

Note

group-id

Identifier of a group stations of which will be given in the response

Required parameter: no.

Response contains information on all stations of this group (without nesting).

page

Number of the page which must be returned in response in paged view (may be used to display information about the large number of stations)

Required parameter: no.

The default value is 1

per-page

Number of records on one page

Required parameter: no.

The default value is 100

server-id

Identifier of the Server to which stations are connected

Required parameter: no

state

Station status. May take the following values:

online—stations are online,

offline—stations are offline,

activated—stations are activated,

unactivated—stations are not activated,

deinstalled—antivirus software in uninstalled from stations,

new—new stations, antivirus software is not installed,

newbies—newbies,

with_update_errors—stations with errors of antivirus software updates,

deleted—stations are deleted.

Required parameter: no

The page and per-page parameters operate with the state attribute only.

 

Request Example

http://192.168.1.1:9080/api/stations/list-by-state.ds?page=1&per-page=3&state=newbies

XML and JSON response structure examples are described below.

 

XML Response

<drweb-es-api api_version="4.3.0" timestamp="1558521951" server="192.168.1.1" srv_version="12.00.0.201909260" status="true">
  <stations>
     <newbies total="5">
        <station id="1001" name="DRWEB-1001" last_seen_time="1489574768" last_seen_addr="tcp://192.168.1.2:1921" os="35850247" os_name="Windows 7 Professional x64" onconnect="0" state="1"/>

        <station id="1002" name="DRWEB-1002" last_seen_time="1489574584" last_seen_addr="tcp://192.168.1.2:1038" os="" os_name="" onconnect="2" state="0"/>

        <station id="1003" name="DRWEB-1003" last_seen_time="1489574768" last_seen_addr="tcp://192.168.1.2:1189" os="" os_name="" onconnect="0" state="0"/>
     </newbies>
  </stations>

  <pages total="2" current="1" objects-per-page="3"/>
</drweb-es-api>

Description of XML Response Parameters

The <stations /> element contains information on all stations with requested state. The nested block names correspond to the requested state.

The attribute of each nested element:

Attribute

Description

total

Total number of stations with the requested status

The <station /> element contains information on a specific station.

The <station /> element attributes:

Attribute

Description

id

Station ID

name

Station name

last_seen_time

Time of last connection to the Server

last_seen_addr

Network address of last connection of a station to the Server

os

Operating system code

os_name

Operating system name

onconnect

Action that will be performed on the next connection of a station to the Server. Can take the following values:

0—perform nothing,

1—access to the Server for a newbie will be denied,

2—access to the Server for a newbie will be granted.

state

Station status. Can take the following values:

0—station is offline,

1—station is online,

2—access to the Server for a newbie is granted,

3—access to the Server for a newbie is denied.

The <pages /> element contains information on displayed pages.

The <pages /> element attributes:

Attribute

Description

total

Total number of pages

current

Number of the current page

objects-per-page

Number of records on one page

 

JSON Response

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

    "timestamp": 1558522039,

    "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": {
    "pages": {
      "current": 1,

      "objects_per_page": 3,
      "total": 2},

    "stations": {
      "newbies": {
          "total": 5,

"list": [
   {"id": "1001",

    "last_seen_addr": "tcp://192.168.10.124:1921",

    "last_seen_time": 1489574768,

    "name": "DRWEB-1001",

  "onconnect": 0,

    "os": 35850247,

    "os_name": "Windows 7 Professional x64",
    "state": 1},

  {"id": "1002",
    "last_seen_time": 1489574584,

    "last_seen_addr": "tcp://192.168.10.124:1038",

    "name": "DRWEB-1002",

    "onconnect": 2,

    "os": 0,

    "os_name": "unknown",
    "state": 0},

   {"id": "1003",
    "last_seen_time": 1489574768,

    "last_seen_addr": "tcp://192.168.10.124:1189",

    "name": "DRWEB-1003",

    "onconnect": 0,

    "os": 0,

    "os_name": "unknown",
    "state": 0}]}}}}

Description of JSON Response Parameters

The pages block contains information on the number of displayed objects.

The pages block elements:

Field name

Description

current

Number of the current page

objects_per_page

Number of records on one page

total

Total number of pages

The stations block contains information on all stations with requested state, the nested block names correspond to the requested state.

Elements of each nested block:

Field name

Description

total

Total number of stations with the requested status

The list array contains information about specific stations.

Elements in the list array:

Field name

Description

id

Station identifier

last_seen_addr

Network address of last connection of a station to the Server

last_seen_time

Time of last connection to the Server

name

Station name

onconnect

Action that will be performed on the next connection of a station to the Server. Can take the following values:

0—perform nothing,

1—access to the Server for a newbie will be denied,

2—access to the Server for a newbie will be granted.

os

Operating system code

os_name

Operating system name

state

Station status. Can take the following values:

0—station is offline,

1—station is online,

2—access to the Server for a newbie is granted,

3—access to the Server for a newbie is denied.