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 WorkerScheduleObject struct{…}
ID string
Budget string
One of the following:
const WorkerScheduleObjectBudgetLow WorkerScheduleObjectBudget = "low"
const WorkerScheduleObjectBudgetStandard WorkerScheduleObjectBudget = "standard"
const WorkerScheduleObjectBudgetHigh WorkerScheduleObjectBudget = "high"
const WorkerScheduleObjectBudgetUnlimited WorkerScheduleObjectBudget = "unlimited"
Input string
NextRunAt Time
formatdate-time
Type string
type WorkerScheduleObject struct{…}
ID string
Budget string
One of the following:
const WorkerScheduleObjectBudgetLow WorkerScheduleObjectBudget = "low"
const WorkerScheduleObjectBudgetStandard WorkerScheduleObjectBudget = "standard"
const WorkerScheduleObjectBudgetHigh WorkerScheduleObjectBudget = "high"
const WorkerScheduleObjectBudgetUnlimited WorkerScheduleObjectBudget = "unlimited"
DelayInSeconds int64
Input string
NextRunAt Time
formatdate-time
Type string
type WorkerScheduleObject struct{…}
ID string
Budget string
One of the following:
const WorkerScheduleObjectBudgetLow WorkerScheduleObjectBudget = "low"
const WorkerScheduleObjectBudgetStandard WorkerScheduleObjectBudget = "standard"
const WorkerScheduleObjectBudgetHigh WorkerScheduleObjectBudget = "high"
const WorkerScheduleObjectBudgetUnlimited WorkerScheduleObjectBudget = "unlimited"
Cron string
Input string
NextRunAt Time
formatdate-time
Type string
type WorkerScheduleObject struct{…}
ID string
Budget string
One of the following:
const WorkerScheduleObjectBudgetLow WorkerScheduleObjectBudget = "low"
const WorkerScheduleObjectBudgetStandard WorkerScheduleObjectBudget = "standard"
const WorkerScheduleObjectBudgetHigh WorkerScheduleObjectBudget = "high"
const WorkerScheduleObjectBudgetUnlimited WorkerScheduleObjectBudget = "unlimited"
Input string
IntervalSeconds int64
NextRunAt Time
formatdate-time
Type string
WorkerID string

List worker schedules

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/handinger-go"
  "github.com/stainless-sdks/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"
    }
  ],
  "workerId": "workerId"
}
Returns Examples
{
  "schedules": [
    {
      "id": "id",
      "budget": "low",
      "input": "input",
      "nextRunAt": "2019-12-27T18:11:19.117Z",
      "type": "scheduled"
    }
  ],
  "workerId": "workerId"
}