1. Home
  2. API Reference
  3. Maintenance Window API

Maintenance Window API

OmniCenter’s API system must be enabled to use this API. See, How to Enable OmniCenter API Access.

Calls to this API are made using HTTP/HTTPS and are sent as key/value pairs in a GET or POST request.

Security

Netreo recommends always using POST for API calls if possible. If security is a concern we recommend the use of HTTPS and POST requests.

Resource

The resource accessed by this API is the collection of OmniCenter maintenance windows.

This resources offers the following endpoints:

  • Maintenance Window

Resource URL

{your.omnicenter.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 OmniCenter’s API Administration. Case-sensitive.

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 OmniCenter.

start_time
String/Required for action=new
The start time of this maintenance window. Note: This should be in the local timezone of the OmniCenter 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 OmniCenter 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 OmniCenter.
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.
Updated on July 1, 2019

Was this article helpful?

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support

Leave a Reply