Updating a time frame


The update API uses the PUT method to update a time frame. You must provide authentication credentials by using the login API before accessing the data. For information about the authentication process, see Web services authentication.

URL to update a time frame

The generic format of a URL for the update API is as follows:

http://<TSPShostname>:port#/tsws/10.0/api/unifiedadmin/Timeframe/<id>/update/idType=id
Example

http://tspspanna:80/tsws/10.0/api/unifiedadmin/Timeframe/timeframe1/update?&idType=name

Entry

Description

http|https

Type of protocol to send the request. Infrastructure Management support both HTTP and HTTPS protocols.

serverHost

Host name of the server that has Central Monitoring Administration

port

Port number through which communication is established. The default port number is 80 if you use the HTTP protocol and 443 if you use the HTTPS protocol.

identifier1, identifier2,...identifierN

Identifiers of the time frame. The supported identifier types are as follows:

  • Name of the time frame
  • Identifier of the time frame

You can provide multiple identifiers, separated by commas.

idType

Specifies the identifier type for the time frame that the web service request uses. The supported identifier types are as follows:

  • name
  • tId

The default value is name.

Input parameters in the JSON format to update 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:

content-type application/json

Sample input parameters in the JSON format are as follows:

Sample input parameters for the update API to update a time frame

{
   "timeframe": {
       "recurrencePattern": {
           "details": {
               "dates": "5,6,14"
           },
           "recurrence": "monthly"
       }
   }
}

 List of parameters that can be provided to access the update API

Attributes
Description
recurrence
Specifies how often the time frame reoccurs. The supported values are as follows:
  • once
  • daily
  • weekly
  • monthly
The default value is daily. Based on the recurrence value, the mandatory parameters you must provide are listed as follows:
  • once—datestartTime and endHour
  • daily—startTimeendHour, and days
  • weekly—daysOfWeekstartTime, and endHour
  • monthly—datesstartTime, and endHour
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:
  • time—Indicates the actual time. The syntax is hh:mm.
  • timeDuration—Indicates the time duration that you want the time frame to be active. The supported values are as follows:
    • 00:05
    • 00:10
    • 00:15
    • 00:30
    • 1:00
    • 2:00
    • 3:00
    • 4:00
    • 5:00
    • 6:00
    • 7:00
    • 8:00
    • 9:00
    • 10:00
    • 11:00
    • 12:00
    • 18:00
    • 24:00
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:
  • all
  • excludeWeekends
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:
  • 1—Indicates Monday
  • 2—Indicates Tuesday
  • 3—Indicates Wednesday
  • 4—Indicates Thursday
  • 5—Indicates Friday
  • 6—Indicates Saturday
  • 7—Indicates Sunday
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-10You 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 update API

A sample JSON response is as follows:

{
   "response": {
       "name": "timeframe2",
       "resultHandle": "0",
       "statusCode": "200",
       "statusMsg": "OK",
       "responseTimeStamp": "2012-06-20T08:38:25", 
}
}

Related topics

Performing-Central-Monitoring-Administration-functions-with-web-services

Managing-time-frames

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*