POST /v2/schedules/
Request format:
{
"name": "string",
"start_time": "14:20",
"duration": 123,
"timezone": "UTC-2",
"repeat": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]
}
Parameters:
Curl example
curl -H "Content-Type: application/json" -X POST -d \
'{"name": "Mute on weekends", "start_time": "00:00", "duration": 1440, "timezone": "UTC+2", "repeat": ["sat", "sun"]}' \
"https://YOUR-API-KEY@api.hostedgraphite.com/v2/schedules/"
Creates a scheduled mute named “Mute on weekends” that starts at 12AM in timezone UTC+2, with a mute duration of 24 hours, and repeats every Saturday and Sunday.
Response format:
HTTP/1.1 201
Content-Type: application/json
{
"id": "<scheduled_mute_id>",
"url": "/v2/schedules/<scheduled_mute_id>"
}
Parameters:
Status Codes:
GET /v2/schedules/? - Returns a JSON object containing information on scheduled mutes matching the search query. Returns all scheduled mutes if the parameter is left empty.
Curl example:
curl -X GET "https://YOUR-API-KEY@api.hostedgraphite.com/v2/schedules/?"
Parameters:
Available Parameters (default values in brackets):
Specifying multiple fields performs an OR operation and returns scheduled mutes that match either criteria.
Response format:
HTTP/1.1 200
Content-Type: application/json
{
"scheduled_mutes": [
{
"name": "name of scheduled mute",
"id": "scheduled mute ID",
"duration": 123,
"alerts" : ["alert_id1", "alert_id2", "alert_id3"],
"start_time": "20:20",
"timezone": "UTC+4",
"repeat": ["mon", "wed", "fri"]
},
...
],
"next_page": False | <page_number>
}
Parameters:
Status Codes:
GET /v2/schedules/<scheduled_mute_id>/ - Returns information on a single scheduled mute identified by <scheduled_mute_id>.
Curl example:
curl -X GET "https://YOUR-API-KEY@api.hostedgraphite.com/v2/schedules/123-456-789/"
Obtain information on the scheduled mute identified by the ID 123-456-789.
Response format:
HTTP/1.1 200
Content-Type: application/json
{
"name": "name of scheduled mute",
"id": "scheduled mute ID",
"duration": 123,
"alerts" : ["alert_id1", "alert_id2", "alert_id3"],
"start_time": "20:20",
"timezone": "UTC+4",
"repeat": ["mon", "wed", "fri"]
}
Status Codes:
PUT /v2/schedules/<scheduled_mute_id>/ - Updates the attributes of a scheduled mute identified by <scheduled_mute_id>.
Curl example:
curl -H "Content-Type: application/json" -X PUT \
-d '{"start_time": "14:50", "timezone": "UTC+12"}' \
"https://YOUR-API-KEY@api.hostedgraphite.com/v2/schedules/123-456-789/"
Updates the start time and timezone of the scheduled mute with id 123-456-789.
Request format:
{
"name": "string",
"start_time": "14:20",
"duration": 123,
"timezone": "UTC-2",
"repeat": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]
}
Each field is optional and only the specified fields are updated.
Status Codes:
DELETE /v2/schedules/<scheduled_mute_id>/ - Deletes a scheduled mute identified by <scheduled_mute_id>.
Curl example:
curl -X DELETE "https://YOUR-API-KEY@api.hostedgraphite.com/v2/schedules/123-456-789/"
Delete the scheduled mute identified by the ID 123-456-789.
Status Codes: