Source Types

ID Type
4 NODE BENCHMARKS
5 ENVIRONMENT BENCHMARKS
7 NODE_GROUP BENCHMARKS
11 NODE SCAN
12 ENVIRONMENT NODE SCAN
13 NODE_GROUP NODE SCAN
15 NODE VULN SCAN
16 NODE GROUP VULN SCAN

Index

This method returns a list of scheduled jobs for the organization.

Method URL
GET /api/v2/scheduled_jobs.json
GET /api/v2/scheduled_jobs.json?page=1&per_page=2

Parameters

Param Type Required Notes
page integer No Displays results based on specified page number (default 1, 1-indexed).
per_page integer No Number of results per page (defaults to 20 results, min. 1, max. 50).

Example Response

Code Status
200 OK

Example Response JSON

[
    {
        "id": 2,
        "organisation_id": 2,
        "source_id": 2,
        "source_name": "Default",
        "source_type": 12,
        "status": 2,
        "url": "/api/v2/scheduled_jobs/2",
        "data": {}
    },
    {
        "id": 3,
        "organisation_id": 2,
        "source_id": 3,
        "source_name": "Windows",
        "source_type": 12,
        "status": 2,
        "url": "/api/v2/scheduled_jobs/3",
        "data": {}
    }
]

Show

This method returns details of the scheduled job specified by the job ID in the URL.

Method URL
GET /api/v2/scheduled_jobs/[scheduled_job_id].json

Example Response

Code Status
200 OK

Example Response JSON

{
    "created_at": "2015-08-18T03:30:00-07:00",
    "created_by": 5,
    "creator": 2,
    "data": {},
    "failure_list": "",
    "id": 3,
    "last_run_at": "2016-06-07T03:30:11-07:00",
    "node_id": null,
    "notify_admins": true,
    "notify_analysts": false,
    "notify_members": false,
    "organisation_id": 3,
    "processing": false,
    "repeat_minutes": 1440,
    "source_id": 3,
    "source_type": 12,
    "status": 1,
    "updated_at": "2016-06-07T03:32:34-07:00",
    "updated_by": 5
}

A scheduled job’s status can be one of the following values:

Code Status Description
1 Enabled The scheduled job is enabled and will execute when the specified repeat interval has elapsed.
2 Disabled The scheduled job is disabled and will never execute.

A scheduled job’s source_type shows which type of object a scheduled job is based on. See Source Types for a complete list.

The scheduled job will run a node scan across all nodes in the environment given by source_id.

Create

Method URL
POST /api/v2/scheduled_jobs.json?source_type=5&type_id=123

Parameters

Param Type Required Notes
repeat_minutes int Yes How often to repeat the scheduled job in minutes.
source_type int Yes See Source Types.
type_id int Yes The id of the source object. For example, for an ENVIRONMENT NODE SCAN (12) source_type this will be the environment id.
failure_list string No A comma separated list of email addresses to send an email to upon failure.
notify_admins bool No Option to email account administrators upon failure.
notify_analysts bool No Option to email analysts upon failure.
output_format int No The output format for scheduled reports. 1 - PDF, 2 - CSV.
report_recipients string No A comma separated list of email addresses to send a scheduled report to.

Example Response

Code Status
201 Created

Example Response JSON

{
    "scheduled_job_id": 123
}

Delete

This method allows you to delete the specified scheduled job.

Method URL
DELETE /api/v2/scheduled_jobs/[scheduled_job_id].json

Example Response

Code Status
204 No Content

Update

This method allows you to update the specified scheduled job.

Method URL
PUT /api/v2/scheduled_jobs/[scheduled_job_id].json

Example Response

Code Status
204 No Content

Kill

This method allows you to stop running and pending jobs associated with the specified scheduled job.

Method URL
POST /api/v2/scheduled_jobs/[scheduled_job_id]/kill

Example Response

Code Status
200 OK