- 11 Jan 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
Maintenance Window API
- Updated on 11 Jan 2023
- 1 Minute 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 are sent as key/value pairs in a GET or POST request.
Resource
The resource accessed by this API is the collection of Netreo maintenance windows.
This resources offers the following endpoints:
- Maintenance Window
Resource URL
{your.netreo.ip.or.name}/api
Endpoints
Maintenance Window
GET or POST/maint_window_api.php
Either, creates a new maintenance window or closes all current maintenance windows, for a given device.
Parameters
The parameters for this endpoint can be included as query string parameters in a GET request, or as request body parameters in a POST request.
pwd
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.
action
String/Required
Must be the first parameter. One of two possible values:
new
creates a new maintenance window for the device specified in name below.close
closes all current maintenance windows for the device specified in name below.
name
String/Required
The name of the device, as set in Netreo.
start_time
String/Required for action=new
The start time of this maintenance window. Note: This should be in the local timezone of the Netreo server and supplied as a UNIX timestamp.
end_time
String/Required for action=new
The end time of this maintenance window. Note: This should be in the local timezone of the Netreo server and supplied as a UNIX timestamp.
comment
Optional for action=new
A descriptive comment to append to the maintenance window, to be displayed in the user interface. Limit of 255 characters.
Request Examples
Create a New Maintenance Window Using GET with API Authentication Disabled
http://38.2.11.62/api/maint_window_api.php?action=new&name=Test_router_01&start_time=11231234&end_time=123141515&comment=Testing
Create a New Maintenance Window Using GET with API Authentication Enabled
http://38.2.11.62/api/maint_window_api.php?action=new&name=Test_router_01&start_time=11231234&end_time=123141515&comment=Testing&pwd=Password1
Close All Current Maintenance Windows Using GET with API Authentication Disabled
http://38.2.11.62/api/maint_window_api.php?action=close&name=Test_router_01
Close All Current Maintenance Windows Using GET with API Authentication Enabled
http://38.2.11.62/api/maint_window_api.php?action=close&name=Test_router_01&pwd=Password1
Response
A successful or unsuccessful call to this API will return a standard JSON object.
Response Examples
Create
{"result":"completed","detail":"Maintenance window setting has been added"}
Close
{"result":"completed","detail":"All maintenance windows for this device are closed."}
Response Schema
Output | Type | Description |
---|---|---|
result | string | Returns "completed" if the call was successfully received by Netreo.Returns "error" if the call encountered an error. A description pair indicating the issue will follow. |
detail | string | Returns confirmation of the call made or explanation of errors. |