Scheduled Actions

Scheduled Actions

Scheduled Actions

Creating a schedule

Create a schedule to execute Remote Restart and Shutdown on devices in groups, at a specific date, time, week or day
oauthscope : MDMOnDemand.MDMDeviceMgmt.CREATE

POST - /api/mdm/actions/scheduled/{action_name}

Arguments

groups
string
(Required)
List of groups with devices that need to be restarted or shutdown
time_zone
string
(Required)
TimeZone for which the scheduled action is to be executed
schedule_params
object
(Required)
Parameters for the schedule
Show Sub-Attributes arrow
schedule_type
string
Schedule Type
  • Daily
  • Weekly
  • Monthly
monthly_perform
string
Type of monthly schedule (Exists only for Monthly schedule Type)
  • WeekDay
  • Day
daily_time
string
Execution time for daily type schedule (Exists only for Daily schedule Type)
monthly_week_day
string
Day of the week for monthly type schedule (Exists only for Monthly schedule Type)
days_of_week
string
Days of the week for Weekly type schedule (Exists only for Weekly schedule Type)
daily_interval_type
string
Type of schedule (Exists if the action is scheduled to be executed daily)
  • everyday
  • weekDays
  • alternativeDays
scheduler_disabled
string
Value to disable schedule
monthly_time
string
Execution Time for monthly type schedule (Exists only for Monthly schedule Type)
monthly_week_num
string
Execution Week for monthly type schedule (Exists only for Monthly schedule Type)
weekly_time
string
Execution Time for weekly type schedule (Exists only for Weekly schedule Type)
monthly_day
string
Day of the month on which the task for monthly schedule to be executed (Exists only for Monthly schedule Type)
months_list
string
List of months for monthly schedule (Exists only for Monthly schedule Type)
reason_message
string
(Required)
Reason for scheduling the action, to be used for auditing purposes..
execution_type
integer
(Required)
Type of execution
  1. Once
  2. Repeat
expiry
long
(Required)
Time at which the scheduled command expires.
schedule_once_time
long
(Required)
Current time in milliseconds when an action is scheduled to be executed once
action_name
string
Name of the action :
  • restart
  • shutdown

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.com.au") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/api/mdm/actions/scheduled/restart", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://www.mdm.manageengine.com.au/api/mdm/actions/scheduled/restart") .post(body) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
curl --request POST \ --url https://www.mdm.manageengine.com.au/api/mdm/actions/scheduled/restart \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "groups": [ "1", "2", "3" ], "time_zone": "Asia/Kolkata", "schedule_params": { "schedule_type": "Daily", "monthly_perform": "WeekDay", "daily_time": "10/25/2018, 15:30", "monthly_week_day": 1, "days_of_week": "1,2", "daily_interval_type": "everyDay", "scheduler_disabled": true, "monthly_time": 1342, "monthly_week_num": 1, "weekly_time": 1342, "monthly_day": 1, "months_list": "0,1,2" }, "reason_message": "Maintenance", "execution_type": 2, "expiry": 600000, "schedule_once_time": 1627970696000, "action_name": "restart" }

Response Example

HTTP/1.1 202 Accepted

Modifying a schedule

Modify an existing schedule.
oauthscope : MDMOnDemand.MDMDeviceMgmt.CREATE

PUT - /api/mdm/actions/scheduled/{action_name}

Arguments

group_action_id
long
(Required)
ID for the action scheduled to be executed on a group.
groups
string
(Required)
List of groups with devices that need to be restarted or shutdown
time_zone
string
(Required)
TimeZone for which the scheduled action is to be executed
schedule_params
object
(Required)
Parameters for the schedule
Show Sub-Attributes arrow
schedule_type
string
Schedule Type
  • Daily
  • Weekly
  • Monthly
monthly_perform
string
Type of monthly schedule (Exists only for Monthly schedule Type)
  • WeekDay
  • Day
daily_time
string
Execution time for daily type schedule (Exists only for Daily schedule Type)
monthly_week_day
string
Day of the week for monthly type schedule (Exists only for Monthly schedule Type)
days_of_week
string
Days of the week for Weekly type schedule (Exists only for Weekly schedule Type)
daily_interval_type
string
Type of schedule (Exists if the action is scheduled to be executed daily)
  • everyday
  • weekDays
  • alternativeDays
scheduler_disabled
string
Value to disable schedule
monthly_time
string
Execution Time for monthly type schedule (Exists only for Monthly schedule Type)
monthly_week_num
string
Execution Week for monthly type schedule (Exists only for Monthly schedule Type)
weekly_time
string
Execution Time for weekly type schedule (Exists only for Weekly schedule Type)
monthly_day
string
Day of the month on which the task for monthly schedule to be executed (Exists only for Monthly schedule Type)
months_list
string
List of months for monthly schedule (Exists only for Monthly schedule Type)
reason_message
string
(Required)
Reason for scheduling the action, to be used for auditing purposes..
execution_type
integer
(Required)
Type of execution
  1. Once
  2. Repeat
expiry
long
(Required)
Time at which the scheduled command expires.
schedule_once_time
long
(Required)
Current time in milliseconds when an action is scheduled to be executed once
action_name
string
Name of the action :
  • restart
  • shutdown

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.com.au") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("PUT", "/api/mdm/actions/scheduled/restart", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://www.mdm.manageengine.com.au/api/mdm/actions/scheduled/restart") .put(body) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
curl --request PUT \ --url https://www.mdm.manageengine.com.au/api/mdm/actions/scheduled/restart \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "group_action_id": 123452312, "groups": [ "1", "2", "3" ], "time_zone": "Asia/Kolkata", "schedule_params": { "schedule_type": "Daily", "monthly_perform": "WeekDay", "daily_time": "10/25/2018, 15:30", "monthly_week_day": 1, "days_of_week": "1,2", "daily_interval_type": "everyDay", "scheduler_disabled": true, "monthly_time": 1342, "monthly_week_num": 1, "weekly_time": 1342, "monthly_day": 1, "months_list": "0,1,2" }, "reason_message": "Maintenance", "execution_type": 2, "expiry": 600000, "schedule_once_time": 1627970696000, "action_name": "restart" }

Response Example

HTTP/1.1 202 Accepted

Suspending a scheduled action

This will stop an action from being executed on devices in groups.
oauthscope : MDMOnDemand.MDMDeviceMgmt.DELETE

DELETE - /api/mdm/actions/scheduled/{action_name}

Arguments

group_action_id
long
(Required)
ID for the action scheduled to be executed on a group.
action_name
string
Name of the action :
  • restart
  • shutdown

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.com.au") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("DELETE", "/api/mdm/actions/scheduled/restart", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://www.mdm.manageengine.com.au/api/mdm/actions/scheduled/restart") .delete(body) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
curl --request DELETE \ --url https://www.mdm.manageengine.com.au/api/mdm/actions/scheduled/restart \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "group_action_id": 123452312, "action_name": "restart" }

Response Example

HTTP/1.1 202 Accepted

Validate Group Scheduled Action

Validating groups on which a scheduled action needs to be executed.
oauthscope : MDMOnDemand.MDMDeviceMgmt.CREATE

POST - /api/mdm/actions/scheduled/{action_name}/validate

Arguments

groups
string
(Required)
List of groups with devices that need to be restarted or shutdown
action_name
string
Name of the action :
  • restart
  • shutdown

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.com.au") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/api/mdm/actions/scheduled/restart/validate", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://www.mdm.manageengine.com.au/api/mdm/actions/scheduled/restart/validate") .post(body) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
curl --request POST \ --url https://www.mdm.manageengine.com.au/api/mdm/actions/scheduled/restart/validate \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "groups": [ "1", "2", "3" ], "action_name": "restart" }

Response Example

HTTP/1.1 202 Accepted