Handles interactions with Server Schedules

Constructors

Properties

Methods

  • Creates a new Schedule

    Parameters

    • name: string

      The name of the Schedule

    • minute: string

      The Cron minute string

    • hour: string

      The Cron hour string

    • dow: string

      The Cron day of week string

    • dom: string

      The Cron day of month string

    • active: boolean

      Whether to enable the Schedle on creation

    Returns Promise<Schedule>

    Example

    Creates a Schedule that runs at 12am every day

    await wisp.api.Schedules.Create("Example", "0", "0", "*", "*", true);
    
  • Creates a new Task for a Schedule

    Parameters

    • id: string

      The ID of the Schedule to create a Task for

    • action: ScheduleTaskAction

      The Task action. One of: ["command", "power", "backup"]

    • timeOffset: number

      The time offset of the Task

    • payload: null | string

      The payload to provide to the Task

    Returns Promise<ScheduleTask>

    Remarks

    ℹ️ Payload is not required for backup action!

  • Deletes the Schedule

    Parameters

    • id: string

      The ID of the Schedule

    Returns Promise<void>

  • Delete the Task

    Parameters

    • scheduleID: string

      The ID of the Schedule that contains the Task

    • taskID: string

      The ID of the Task

    Returns Promise<void>

  • Triggers the Schedule

    Parameters

    • id: string

      The ID of the Schedule

    Returns Promise<void>

  • Updates the values of the Schedule

    Parameters

    • id: string

      The ID of the Schedule

    • name: string

      The name of the Schedule

    • minute: string

      The Cron minute string

    • hour: string

      The Cron hour string

    • dow: string

      The Cron day of week string

    • dom: string

      The Cron day of month string

    • active: boolean

      Whether to enable the Schedle on creation

    Returns Promise<Schedule>

  • Update the Task

    Parameters

    • scheduleID: string

      The ID of the Schedule that contains the Task

    • taskID: string

      The ID of the Task

    • action: ScheduleTaskAction

      The Task action. One of: ["command", "power", "backup"]

    • timeOffset: number

      The time offset of the Task

    • payload: null | string

      The payload to provide to the Task

    Returns Promise<ScheduleTask>

    Remarks

    ℹ️ Payload is not required for backup action!

Generated using TypeDoc