Creating a time frame
The create API uses the POST method to create a time frame. You must provide authentication credentials by using the login API before creating a time frame. For information about the authentication process, see Web services authentication.
URL to create a time frame
The generic format of a URL for the create API is as follows:
Input parameters in the JSON format to create a time frame
When you provide input parameters for any web service request, you must specify the content-type parameter in the header of the web service request as follows:
Sample input parameters in the JSON format are as follows:
Sample input parameters for the create API to create a time frame
"timeframe": {
"name": "TF-alwaysactive",
"description": "",
"startTime": "0:0",
"endHour": {
"time": "00:00",
"type": "timeDuration"
},
"recurrencePattern": {
"recurrence": "always_active",
"details": {
"date": "0"
}
}
}
}
List of parameters that must be provided to access the create API
Attributes | Description |
---|---|
recurrence | Specifies how often the time frame reoccurs. The supported values are as follows:
The default value is daily. Based on the recurrence value, the mandatory parameters you must provide are listed as follows:
|
date | Specifies the date for the time frame to be active. It is represented in epoch format. If you have selected once as the recurrence attribute value, you must specify the {{date parameter. |
endHour | Specifies the end time for the time frame |
type | Specifies the type of the end time for the time frame. The supported types are as follows:
|
startTime | Specifies the start time for the time frame to be active. The syntax for the start time is hh:mm. |
days | Specifies the days you want the time frame to be active. The supported values are as follows:
The default value is all. |
daysOfWeek | Specifies the specific days for which you want the time frame to be active. The supported values are as follows:
|
dates | Specifies the date for which you want the time frame to be active. You can also specify a range of dates. For example: 5-10 You can also provide multiple dates, separated by commas. For example: 5,9,13,17 |
name | Name of the time frame |
Description | A brief description for the time frame |
Response information for the create API
A sample JSON response is as follows:
"responseTimeStamp": "2015-04-12T09:37:11",
"statusCode": "200",
"statusMsg": "OK",
"response": [
{
"resourceId": "b3df23a2-96be-4c36-813a-da7dfd6d9a3e",
"resourceName": " TF-alwaysactive,
"resourceURI": null,
"statusCode": "200",
"statusMsg": "OK"
}
]
}
Related topics
Performing-Central-Monitoring-Administration-functions-with-web-services