Schedules

A Schedule is a named, reusable weekday-and-time schedule shared by scheduled resources across a Site.

List Schedules

SDK Function

Schedule.list()

Return Object

ListIterator<Schedule>

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

import com.files.ListIterator;
import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.Schedule;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  ListIterator<Schedule> schedules = Schedule.list(parameters);
  for (Schedule schedule : schedules.listAutoPaging()) {
    // Operate on schedule
  }
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Show Schedule

SDK Function

Schedule.find()

Return Object

Schedule

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Function Arguments

ArgumentDescription
id
int64
Required
Schedule ID.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.Schedule;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  Schedule schedule = Schedule.find(id, parameters);
  // Operate on schedule
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Create Schedule

SDK Function

Schedule.create()

Return Object

Schedule

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Function Arguments

ArgumentDescription
name
string
Required
Schedule name.
schedule_days_of_week
array(int64)
Required
0-based weekdays used by the Schedule. 0 is Sunday.
schedule_times_of_day
array(string)
Required
Times of day in HH:MM format (24-hour).
schedule_time_zone
string
Time zone for scheduled times. If not set, times are interpreted as UTC.
holiday_region
string
Optional holiday region on which linked resources do not run.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.Schedule;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("name", "Weekday overnight");
  parameters.put("schedule_days_of_week", [1, 2, 3, 4, 5]);
  parameters.put("schedule_times_of_day", ["01:00"]);
  
  Schedule schedule = Schedule.create(parameters);
  // Operate on schedule
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Update Schedule

SDK Function

schedule.update();

Return Object

Schedule

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Attribute Setters

SetterDescription
setName
string
Schedule name.
setScheduleDaysOfWeek
array(int64)
0-based weekdays used by the Schedule. 0 is Sunday.
setScheduleTimesOfDay
array(string)
Times of day in HH:MM format (24-hour).
setScheduleTimeZone
string
Time zone for scheduled times. If not set, times are interpreted as UTC.
setHolidayRegion
string
Optional holiday region on which linked resources do not run.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.Schedule;

try {
  // Find the schedule object by its id.
  Schedule schedule = Schedule.find(id, null);
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("name", "Weekday overnight");
  schedule.update(parameters);
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Delete Schedule

SDK Function

schedule.delete();

Return Object

No return value.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.Schedule;

try {
  // Find the schedule object by its id.
  Schedule schedule = Schedule.find(id, null);
  schedule.delete(null);
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

The Schedule Object

Some of the functions above return a Schedule object. The attributes of this object are listed below.

AttributeDescription
id
int64
Schedule ID.
name
string
Schedule name.
schedule_days_of_week
array(int64)
0-based weekdays used by the Schedule. 0 is Sunday.
schedule_times_of_day
array(string)
Times of day in HH:MM format (24-hour).
schedule_time_zone
string
Time zone for scheduled times. If not set, times are interpreted as UTC.
holiday_region
string
Optional holiday region on which linked resources do not run.
human_readable_schedule
string
Human-readable Schedule description.
created_at
date-time
Creation time.
updated_at
date-time
Last update time.