Scan Zone REST Reference

/zone

Methods
GET

Gets the list of Zones

Fields Parameter
 Expand

The fields parameter should be specified along the query string, and it takes the syntax

    ?fields=<field>,...

Allowed Fields

*id
**name
**description
**ipList
**createdTime
**modifiedTime
**organizations
**activeScanners
**totalScanners
**scanners

Legend

* = always comes back

** = comes back if fields list not specified on GET all
Request Parameters

None

Example Response
 Expand
{
	"type" : "regular",
	"response" : [
		{
			"id" : "5",
			"name" : "Test Zone #1",
			"description" : "",
			"ipList" : "192.168.0.0\/24",
			"createdTime" : "1426871916",
			"modifiedTime" : "1426881426",
			"scanners" : [
				{
					"id" : "2",
					"name" : "Nessus 192.168.1.145:1234",
					"description" : "",
					"status" : "4"
				}
			],
			"organizations" : [
				{
					"id" : "38",
					"name" : "Test Org",
					"description" : ""
				}
			],
			"activeScanners" : 0,
			"totalScanners" : 1
		},
		{
			"id" : "6",
			"name" : "Test Zone #2",
			"description" : "",
			"ipList" : "192.168.0.0\/24",
			"createdTime" : "1426871931",
			"modifiedTime" : "1426871931",
			"scanners" : [],
			"organizations" : [],
			"activeScanners" : 0,
			"totalScanners" : 0
		}
	],
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1426882493
}

POST

Adds an Zone

Request Parameters
 Expand

Note: A default for organizations is being set to an empty array; however, there is no logic for utilizing the organizations in any fashion so it was ommitted.

{
	"name" : <string>,
	"description" : <string> DEFAULT "",
	"ipList" : <string> (valid IP list),
	"scanners" : [
		{
			"id" : <number>
		}...
	] DEFAULT []
}
Example Response
 Expand
{
	"type" : "regular",
	"response" : {
		"id" : "3",
		"name" : "TestDevformPost",
		"description" : "Test of a post through DevForm",
		"ipList" : "192.168.1.145",
		"createdTime" : "1408733617",
		"modifiedTime" : "1408733617",
		"scanners" : [
			{
				"id" : "11",
				"name" : "Cent5x64-NessC1",
				"description" : "",
				"status" : "1025"
			}
		],
		"organizations" : [],
		"activeScanners" : 1,
		"totalScanners" : 1
	},
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1408733617
}

/zone/{id}

Methods
GET

Gets the Zone associated with {id}.

Fields Parameter
 Expand

The fields parameter should be specified along the query string, and it takes the syntax

    ?fields=<field>,...

Allowed Fields

*id
**name
**description
**ipList
**createdTime
**modifiedTime
**organizations
**activeScanners
**totalScanners
**scanners

Legend

* = always comes back

** = comes back if fields list not specified on GET all

Request Parameters

None

Example Response
 Expand
{
	"type" : "regular",
	"response" : {
		"id" : "5",
		"name" : "Test Zone #1",
		"description" : "",
		"ipList" : "192.168.0.0\/24",
		"createdTime" : "1426871916",
		"modifiedTime" : "1426881426",
		"scanners" : [
			{
				"id" : "2",
				"name" : "Nessus 172.26.34.53:8834",
				"description" : "",
				"status" : "4"
			}
		],
		"organizations" : [
			{
				"id" : "38",
				"name" : "Test Org",
				"description" : ""
			}
		],
		"activeScanners" : 0,
		"totalScanners" : 1
	},
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1426882592
}

PATCH

Edits the Role associated with {id}, changing only the passed in fields.

Request Parameters

(All fields are optional)

Example Response

DELETE

Deletes the Zone associated with {id}, depending on access and permissions.

Request Parameters

None

Example Response
 Expand
{
	"type" : "regular",
	"response" : "",
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1408733643
}