- 11 Jan 2023
- 4 Minutes to read
- Print
- DarkLight
- PDF
Strategic Group API
- Updated on 11 Jan 2023
- 4 Minutes to read
- Print
- DarkLight
- PDF
Netreo's API system must be enabled to use this API. See How to Enable Netreo API Access
Calls to this API are made using HTTP/HTTPS and must be sent as key/value pairs in a POST request.
Resource
The resource accessed by this API is the list of Netreo strategic groups.
This resource offers the following endpoints:
- Strategic Group ID List
- Strategic Group Device List
Resource URL
{your.netreo.ip.or.name}/fw/index.php?r=restful
Endpoints
Strategic Group ID List
POST/strategic-group/list
Retrieves the current list of Netreo strategic groups and their ID numbers.
Parameters
The parameters for this endpoint must be included as request body parameters in a POST request.
password
String/Required if authentication is enabled.
The API key set in Netreo’s API Administration. Case-sensitive.
pin
String/Required when using Netreo SaaS-based APIs. Not applicable to on-premise deployments.
The pin number supplied in Netreo’s API Administration.
Request Examples
Curl using POST with API Authentication Disabled
curl -X POST \ 'http://38.2.11.62/fw/index.php?r=restful/strategic-group/list' \
Curl using POST with API Authentication Enabled
curl -X POST \ 'http://38.2.11.62/fw/index.php?r=restful/strategic-group/list' \ -F password=pass123
Response
Supplying an incorrect password, or no password with API authentication enabled, will return an "Incorrect password" error.
A successful call to this API will return a standard JSON object array.
Note: The output will be returned as standard JSON without indentation or line breaks. It is formatted here to make the example easier to read.
Response Examples
Successful list retrieval.
[ { "id": "10006", "name": "Database", "business_workflow": "1", "function_group": "1", "Impact": 100 }, { "id": "10001", "name": "Infrastructure", "business_workflow": "1", "function_group": "1", "Impact": 98.303333333333 }, { "id": "10016", "name": "New SG test Points", "business_workflow": "1", "function_group": "1", "Impact": 96.12 }, { "id": "10015", "name": "Router Devices", "business_workflow": "1", "function_group": "1", "Impact": 98.749866666667 }, { "id": "10021", "name": "Routers", "business_workflow": "0", "function_group": "1", "Impact": 98.383333333333 }, { "id": "10019", "name": "Test Add New SG ", "business_workflow": "1", "function_group": "1", "Impact": 96.24 }, { "id": "10020", "name": "Test Add New SG 2", "business_workflow": "1", "function_group": "0", "Impact": 82.043277777778 }, { "id": "10014", "name": "Test Host Devices", "business_workflow": "1", "function_group": "1", "Impact": 100 }, { "id": "10011", "name": "Unix/Linux Servers", "business_workflow": "1", "function_group": "1", "Impact": 71.98 }, { "id": "10010", "name": "Windows Servers", "business_workflow": "1", "function_group": "1", "Impact": 100 }, { "id": "10007", "name": "Wireless", "business_workflow": "1", "function_group": "1", "Impact": 100 } ]
Response Schema
Output | Type | Description |
---|---|---|
id | string | The Netreo internal identification number for the strategic group name returned below. |
name | string | The name of the strategic group as seen in the Netreo UI. |
business_workflow | string | Indicates if this strategic group is set as a business workflow. 0 = no, 1 = yes. |
function_group | string | Indicates if this strategic group is set as a functional group. 0 = no, 1 = yes. |
Impact | string | The current health score for this group at the time of retrieval. |
Strategic Group Device List
POST/strategic-group/strategic-group-devices
Retrieves the list of devices and associated information from the strategic group specified in the parameters.
Parameters
The parameters for this endpoint must be included as request body parameters in a POST request.
password
String/Required if authentication is enabled.
The API key set in Netreo’s API Administration. Case-sensitive.
pin
String/Required when using Netreo SaaS-based APIs. Not applicable to on-premise deployments.
The pin number supplied in Netreo’s API Administration.
strategic_group_id
The ID number of an Netreo strategic group. Retrieve the list of strategic group IDs using the "Strategic Group List" endpoint.
Request Examples
Curl using POST with API Authentication Disabled
curl -X POST \ 'http://38.2.11.62/fw/index.php?r=restful/strategic-group/strategic-group-devices' \ -F strategic_group_id=10001
Curl using POST with API Authentication Enabled
curl -X POST \ 'http://38.2.11.62/fw/index.php?r=restful/strategic-group/strategic-group-devices' \ -F password=test123 \ -F strategic_group_id=10001
Response
A successful call to this API will return a standard JSON object array.
Supplying an incorrect password, or no password with API authentication enabled, will return an "Incorrect password" error. Failing to specify a correct strategic group ID will return an empty array.
Note: The output will be returned as standard JSON without indentation or line breaks. It is formatted here to make the example easier to read.
Response Examples
Successful list retrieval.
[ { "dev_index": "19", "name": "Austin-R1.austinr1.netreo.net", "ip": "10.200.37.1", "description": "", "category": "6", "site": "4", "model": "", "poll": "1", "report": "1", "monitor": "1", "poll_intvl": "5", "template_persist": "0", "template": "0", "create_time": "1513113802", "snmp_version": null, "auto_config": "0" }, { "dev_index": "69", "name": "Houston-R1.netreo.net", "ip": "10.200.38.1", "description": "", "category": "6", "site": "7", "model": "", "poll": "1", "report": "1", "monitor": "1", "poll_intvl": "5", "template_persist": "1", "template": "26", "create_time": "1521216743", "snmp_version": null, "auto_config": "0" } ]
Response Schema
Output | Type | Description |
---|---|---|
dev_index | string | The Netreo internal identification number for the device. |
name | string | The name of the device as seen in the Netreo UI. |
ip | string | The IP address of the device. |
description | string | This is the contents of the "Note" field seen in the HOST INFORMATION section of the device dashboard for this device. |
category | string | The ID number of the category to which this device belongs. |
site | string | The ID number of the site to which this device belongs. |
model | string | The device model designation as supplied by the device. This information is not found in the Netreo UI. |
poll | string | Indicates if the device is currently being polled for performance data. Treat as a boolean. |
report | string | Indicates whether or not the device will be included in reports. Treat as a boolean. |
monitor | string | Indicates if the device is being monitored for host and service alarms. Treat as a boolean. |
poll_intvl | string | The delay between performance polls for the device, in minutes. |
template_persist | string | Indicates if the device is set to use device templates. Treat as a boolean. |
template | string | The ID number of the device template assigned directly to this device in its "Main" device administration page. |
create_time | string | The time this device was added to Netreo, as a UNIX timestamp. |
snmp_version | string | The version of SNMP being used to communicate with this device, as set in its "Authentication" administration page. |
auto_config | string | Indicates whether or not autoconfiguration rules will be run on the device during a repoll. If set to 1, the rules will be run on the next repoll and the flag set back to 0. |