Skip to main content

getScanTasksList

This method returns the list of scan tasks.

Services

This method requires you to place the {service} name in the API URL. The allowed services are:

  • computers, for "Computers and Virtual Machines"

  • virtualmachines, for "Virtual Machines"

For example, the request URL for the virtual machines service is:

https://YOUR-HOSTNAME/api/v1.0/jsonrpc/network/virtualmachines

Parameters

Parameter

Type

Optional

Description

name

String

Yes

The name of the task. Filter the list of tasks by task name. Use the asterisk symbol (*) in front of the keyword to search its appearance anywhere in the name. If omitted, only results where the name starts with the keyword will be returned.

status

Number

Yes

The status of the task. Available options are: 1 - Pending; 2 - In progress; 3 - Finished.

page

Number

Yes

The results page number. Default page number is 1.

perPage

Number

Yes

The number of items displayed in a page. The upper limit is 100 items per page. Default value: 30 items per page.

Return value

This method returns an Object containing information about the tasks. The returned object contains:

  • page - the current page displayed

  • pagesCount - the total number of available pages

  • perPage - the total number of returned items per page

  • total - the total number of items

  • items - the list of tasks. Each entry in the list has the following fields:

    • id, the ID of the task,

    • name, the name of the task,

    • status, the status of the task (as defined above),

    • startDate, the start date of the task

Example

Request:

  {
       "params": {
           "status": 1,
           "page": 2,
           "perPage": 5
       },
       "jsonrpc": "2.0",
       "method": "getScanTasksList",
       "id": "787b5e36-89a8-4353-88b9-6b7a32e9c87f"
  }  

Response:

  {
      "id": "787b5e36-89a8-4353-88b9-6b7a32e9c87f",
      "jsonrpc":"2.0",
      "result": {
           page: 2,
           pagesCount: 11,
           perPage: 5,
           total: 54
           items[
               {
                   "id" : "21a295eeb1a43d8b497b23b7",
                   "name" : "task 1",
                   "status": 1,
                   "startDate": '2015-08-21T23:48:16'
               },
               {
                   "id" : "21a295eeb1a43d8b497b23b8",
                   "name" : "task 2",
                   "status": 1,
                   "startDate": '2015-08-21T10:21:15'
               },
           ]
      }
  }