Skip to content
Get started

List worker schedules

client.Workers.Schedules.List(ctx, workerID) (*WorkerScheduleListResponse, error)
GET/api/workers/{workerId}/schedules

List scheduled tasks for a worker.

ParametersExpand Collapse
workerID string
ReturnsExpand Collapse
type WorkerScheduleListResponse struct{…}
One of the following:
type WorkerScheduleScheduled struct{…}
ID string
Budget string
One of the following:
const WorkerScheduleScheduledBudgetLow WorkerScheduleScheduledBudget = "low"
const WorkerScheduleScheduledBudgetStandard WorkerScheduleScheduledBudget = "standard"
const WorkerScheduleScheduledBudgetHigh WorkerScheduleScheduledBudget = "high"
const WorkerScheduleScheduledBudgetUnlimited WorkerScheduleScheduledBudget = "unlimited"
Input string
NextRunAt Time
formatdate-time
Type Scheduled
type WorkerScheduleDelayed struct{…}
ID string
Budget string
One of the following:
const WorkerScheduleDelayedBudgetLow WorkerScheduleDelayedBudget = "low"
const WorkerScheduleDelayedBudgetStandard WorkerScheduleDelayedBudget = "standard"
const WorkerScheduleDelayedBudgetHigh WorkerScheduleDelayedBudget = "high"
const WorkerScheduleDelayedBudgetUnlimited WorkerScheduleDelayedBudget = "unlimited"
DelayInSeconds int64
Input string
NextRunAt Time
formatdate-time
Type Delayed
type WorkerScheduleCron struct{…}
ID string
Budget string
One of the following:
const WorkerScheduleCronBudgetLow WorkerScheduleCronBudget = "low"
const WorkerScheduleCronBudgetStandard WorkerScheduleCronBudget = "standard"
const WorkerScheduleCronBudgetHigh WorkerScheduleCronBudget = "high"
const WorkerScheduleCronBudgetUnlimited WorkerScheduleCronBudget = "unlimited"
Cron string
Input string
NextRunAt Time
formatdate-time
Type Cron
type WorkerScheduleInterval struct{…}
ID string
Budget string
One of the following:
const WorkerScheduleIntervalBudgetLow WorkerScheduleIntervalBudget = "low"
const WorkerScheduleIntervalBudgetStandard WorkerScheduleIntervalBudget = "standard"
const WorkerScheduleIntervalBudgetHigh WorkerScheduleIntervalBudget = "high"
const WorkerScheduleIntervalBudgetUnlimited WorkerScheduleIntervalBudget = "unlimited"
Input string
IntervalSeconds int64
NextRunAt Time
formatdate-time
Type Interval
Timezone string
WorkerID string

List worker schedules

package main

import (
  "context"
  "fmt"

  "github.com/ramensoft/handinger-go"
  "github.com/ramensoft/handinger-go/option"
)

func main() {
  client := handinger.NewClient(
    option.WithAPIKey("My API Key"),
  )
  schedules, err := client.Workers.Schedules.List(context.TODO(), "t_org_123_w_01HZY2ZJQ8G7K42W2D7WF6V4GM")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", schedules.Schedules)
}
{
  "schedules": [
    {
      "id": "id",
      "budget": "low",
      "input": "input",
      "nextRunAt": "2019-12-27T18:11:19.117Z",
      "type": "scheduled"
    }
  ],
  "timezone": "timezone",
  "workerId": "workerId"
}
Returns Examples
{
  "schedules": [
    {
      "id": "id",
      "budget": "low",
      "input": "input",
      "nextRunAt": "2019-12-27T18:11:19.117Z",
      "type": "scheduled"
    }
  ],
  "timezone": "timezone",
  "workerId": "workerId"
}