Viewing docs for incident.io v0.4.0
published on Saturday, Oct 17, 2026 by incident-io
published on Saturday, Oct 17, 2026 by incident-io
Viewing docs for incident.io v0.4.0
published on Saturday, Oct 17, 2026 by incident-io
published on Saturday, Oct 17, 2026 by incident-io
Look up a rotation on a schedule by id or name. Exactly one lookup field should be set.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as incident from "@incident-io/pulumi";
// Look up a rotation by name. Names are unique within a schedule, so this is
// unambiguous.
const primary = incident.getScheduleRotation({
scheduleId: platformIncidentSchedule.id,
name: "Primary",
});
// ...or by ID.
const primaryById = incident.getScheduleRotation({
scheduleId: platformIncidentSchedule.id,
id: "01MNO456PQR789STU012VWX",
});
// Useful for pointing an escalation path at one rotation rather than the whole
// schedule, when the rotation itself isn't managed here.
const platform = new incident.EscalationPath("platform", {
name: "Platform",
path: [{
type: "level",
level: {
targets: [{
type: "schedule",
id: platformIncidentSchedule.id,
urgency: "high",
scheduleMode: "all_users_for_rota",
selectedRotaId: primary.then(primary => primary.id),
}],
},
}],
});
import pulumi
import pulumi_incident as incident
# Look up a rotation by name. Names are unique within a schedule, so this is
# unambiguous.
primary = incident.get_schedule_rotation(schedule_id=platform_incident_schedule["id"],
name="Primary")
# ...or by ID.
primary_by_id = incident.get_schedule_rotation(schedule_id=platform_incident_schedule["id"],
id="01MNO456PQR789STU012VWX")
# Useful for pointing an escalation path at one rotation rather than the whole
# schedule, when the rotation itself isn't managed here.
platform = incident.EscalationPath("platform",
name="Platform",
path=[{
"type": "level",
"level": {
"targets": [{
"type": "schedule",
"id": platform_incident_schedule["id"],
"urgency": "high",
"scheduleMode": "all_users_for_rota",
"selectedRotaId": primary.id,
}],
},
}])
package main
import (
"github.com/incident-io/pulumi-incident/sdk/go/incident"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Look up a rotation by name. Names are unique within a schedule, so this is
// unambiguous.
primary, err := incident.GetScheduleRotation(ctx, &incident.LookupScheduleRotationArgs{
ScheduleId: platformIncidentSchedule.Id,
Name: pulumi.StringRef("Primary"),
}, nil)
if err != nil {
return err
}
// ...or by ID.
_, err = incident.GetScheduleRotation(ctx, &incident.LookupScheduleRotationArgs{
ScheduleId: platformIncidentSchedule.Id,
Id: pulumi.StringRef("01MNO456PQR789STU012VWX"),
}, nil)
if err != nil {
return err
}
// Useful for pointing an escalation path at one rotation rather than the whole
// schedule, when the rotation itself isn't managed here.
_, err = incident.NewEscalationPath(ctx, "platform", &incident.EscalationPathArgs{
Name: pulumi.String("Platform"),
Path: []map[string]interface{}{
map[string]interface{}{
"type": "level",
"level": map[string][]map[string]interface{}{
"targets": []map[string]interface{}{
map[string]interface{}{
"type": "schedule",
"id": platformIncidentSchedule.Id,
"urgency": "high",
"scheduleMode": "all_users_for_rota",
"selectedRotaId": primary.Id,
},
},
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Incident = Pulumi.Incident;
return await Deployment.RunAsync(() =>
{
// Look up a rotation by name. Names are unique within a schedule, so this is
// unambiguous.
var primary = Incident.GetScheduleRotation.Invoke(new()
{
ScheduleId = platformIncidentSchedule.Id,
Name = "Primary",
});
// ...or by ID.
var primaryById = Incident.GetScheduleRotation.Invoke(new()
{
ScheduleId = platformIncidentSchedule.Id,
Id = "01MNO456PQR789STU012VWX",
});
// Useful for pointing an escalation path at one rotation rather than the whole
// schedule, when the rotation itself isn't managed here.
var platform = new Incident.EscalationPath("platform", new()
{
Name = "Platform",
Path = new[]
{
{
{ "type", "level" },
{ "level",
{
{ "targets", new[]
{
{
{ "type", "schedule" },
{ "id", platformIncidentSchedule.Id },
{ "urgency", "high" },
{ "scheduleMode", "all_users_for_rota" },
{ "selectedRotaId", primary.Apply(getScheduleRotationResult => getScheduleRotationResult.Id) },
},
} },
} },
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.incident.IncidentFunctions;
import com.pulumi.incident.inputs.GetScheduleRotationArgs;
import com.pulumi.incident.EscalationPath;
import com.pulumi.incident.EscalationPathArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// Look up a rotation by name. Names are unique within a schedule, so this is
// unambiguous.
final var primary = IncidentFunctions.getScheduleRotation(GetScheduleRotationArgs.builder()
.scheduleId(platformIncidentSchedule.id())
.name("Primary")
.build());
// ...or by ID.
final var primaryById = IncidentFunctions.getScheduleRotation(GetScheduleRotationArgs.builder()
.scheduleId(platformIncidentSchedule.id())
.id("01MNO456PQR789STU012VWX")
.build());
// Useful for pointing an escalation path at one rotation rather than the whole
// schedule, when the rotation itself isn't managed here.
var platform = new EscalationPath("platform", EscalationPathArgs.builder()
.name("Platform")
.path(Arrays.asList(Map.ofEntries(
Map.entry("type", "level"),
Map.entry("level", Map.of("targets", Arrays.asList(Map.ofEntries(
Map.entry("type", "schedule"),
Map.entry("id", platformIncidentSchedule.id()),
Map.entry("urgency", "high"),
Map.entry("scheduleMode", "all_users_for_rota"),
Map.entry("selectedRotaId", primary.id())
))))
)))
.build());
}
}
resources:
# Useful for pointing an escalation path at one rotation rather than the whole
# schedule, when the rotation itself isn't managed here.
platform:
type: incident:EscalationPath
properties:
name: Platform
path:
- type: level
level:
targets:
- type: schedule
id: ${platformIncidentSchedule.id}
urgency: high
scheduleMode: all_users_for_rota
selectedRotaId: ${primary.id}
variables:
# Look up a rotation by name. Names are unique within a schedule, so this is
# unambiguous.
primary:
fn::invoke:
function: incident:getScheduleRotation
arguments:
scheduleId: ${platformIncidentSchedule.id}
name: Primary
# ...or by ID.
primaryById:
fn::invoke:
function: incident:getScheduleRotation
arguments:
scheduleId: ${platformIncidentSchedule.id}
id: 01MNO456PQR789STU012VWX
pulumi {
required_providers {
incident = {
source = "pulumi/incident"
}
}
}
data "incident_getschedulerotation" "primary" {
schedule_id = platformIncidentSchedule.id
name = "Primary"
}
data "incident_getschedulerotation" "primaryById" {
schedule_id = platformIncidentSchedule.id
id = "01MNO456PQR789STU012VWX"
}
# Useful for pointing an escalation path at one rotation rather than the whole
# schedule, when the rotation itself isn't managed here.
resource "incident_escalationpath" "platform" {
name = "Platform"
path = [{
"type" = "level"
"level" = {
"targets" = [{
"type" = "schedule"
"id" = platformIncidentSchedule.id
"urgency" = "high"
"scheduleMode" = "all_users_for_rota"
"selectedRotaId" = data.incident_getschedulerotation.primary.id
}]
}
}]
}
# Look up a rotation by name. Names are unique within a schedule, so this is
# unambiguous.
# ...or by ID.
Using getScheduleRotation
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getScheduleRotation(args: GetScheduleRotationArgs, opts?: InvokeOptions): Promise<GetScheduleRotationResult>
function getScheduleRotationOutput(args: GetScheduleRotationOutputArgs, opts?: InvokeOutputOptions): Output<GetScheduleRotationResult>def get_schedule_rotation(id: Optional[str] = None,
name: Optional[str] = None,
schedule_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetScheduleRotationResult
def get_schedule_rotation_output(id: pulumi.Input[Optional[str]] = None,
name: pulumi.Input[Optional[str]] = None,
schedule_id: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetScheduleRotationResult]func LookupScheduleRotation(ctx *Context, args *LookupScheduleRotationArgs, opts ...InvokeOption) (*LookupScheduleRotationResult, error)
func LookupScheduleRotationOutput(ctx *Context, args *LookupScheduleRotationOutputArgs, opts ...InvokeOption) LookupScheduleRotationResultOutput> Note: This function is named LookupScheduleRotation in the Go SDK.
public static class GetScheduleRotation
{
public static Task<GetScheduleRotationResult> InvokeAsync(GetScheduleRotationArgs args, InvokeOptions? opts = null)
public static Output<GetScheduleRotationResult> Invoke(GetScheduleRotationInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetScheduleRotationResult> Invoke(GetScheduleRotationInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetScheduleRotationResult> getScheduleRotation(GetScheduleRotationArgs args, InvokeOptions options)
public static Output<GetScheduleRotationResult> getScheduleRotation(GetScheduleRotationArgs args, InvokeOptions options)
public static Output<GetScheduleRotationResult> getScheduleRotation(GetScheduleRotationArgs args, InvokeOutputOptions options)
fn::invoke:
function: incident:index/getScheduleRotation:getScheduleRotation
arguments:
# arguments dictionarydata "incident_get_schedule_rotation" "name" {
# arguments
}The following arguments are supported:
- Schedule
Id string - ID of the schedule this rotation belongs to
- Id string
- Look up the rotation by ID.
- Name string
- Look up the rotation by name, which is unique within the schedule.
- Schedule
Id string - ID of the schedule this rotation belongs to
- Id string
- Look up the rotation by ID.
- Name string
- Look up the rotation by name, which is unique within the schedule.
- schedule_
id string - ID of the schedule this rotation belongs to
- id string
- Look up the rotation by ID.
- name string
- Look up the rotation by name, which is unique within the schedule.
- schedule
Id String - ID of the schedule this rotation belongs to
- id String
- Look up the rotation by ID.
- name String
- Look up the rotation by name, which is unique within the schedule.
- schedule
Id string - ID of the schedule this rotation belongs to
- id string
- Look up the rotation by ID.
- name string
- Look up the rotation by name, which is unique within the schedule.
- schedule_
id str - ID of the schedule this rotation belongs to
- id str
- Look up the rotation by ID.
- name str
- Look up the rotation by name, which is unique within the schedule.
- schedule
Id String - ID of the schedule this rotation belongs to
- id String
- Look up the rotation by ID.
- name String
- Look up the rotation by name, which is unique within the schedule.
getScheduleRotation Result
The following output properties are available:
- Concurrent
Shifts int - How many shifts run at the same time, which is how many people are on call at once
- Effective
From string - When this shape of the rotation took over. Unset when the rotation has only ever had one.
- First
Interval stringStarts At - When the first handover interval starts being counted from, which fixes the time of day and day of week shifts change hands. The dashboard calls this the handover time.
- Handovers
List<Get
Schedule Rotation Handover> - The cadence shifts hand over on, applied in turn
- Id string
- Look up the rotation by ID.
- Name string
- Look up the rotation by name, which is unique within the schedule.
- Rank int
- Where this rotation sits in the schedule's running order, lowest first. Unset when it has never been ordered.
- Schedule
Id string - ID of the schedule this rotation belongs to
- Scheduling
Mode string - How users are allocated across shifts of differing length. Possible values are:
fair,sequential. - Users List<string>
- IDs of the people in the rotation, in the order they take shifts.
- Working
Intervals List<GetSchedule Rotation Working Interval> - Weekday intervals the rotation is on call for, if it's restricted to any.
- Concurrent
Shifts int - How many shifts run at the same time, which is how many people are on call at once
- Effective
From string - When this shape of the rotation took over. Unset when the rotation has only ever had one.
- First
Interval stringStarts At - When the first handover interval starts being counted from, which fixes the time of day and day of week shifts change hands. The dashboard calls this the handover time.
- Handovers
[]Get
Schedule Rotation Handover - The cadence shifts hand over on, applied in turn
- Id string
- Look up the rotation by ID.
- Name string
- Look up the rotation by name, which is unique within the schedule.
- Rank int
- Where this rotation sits in the schedule's running order, lowest first. Unset when it has never been ordered.
- Schedule
Id string - ID of the schedule this rotation belongs to
- Scheduling
Mode string - How users are allocated across shifts of differing length. Possible values are:
fair,sequential. - Users []string
- IDs of the people in the rotation, in the order they take shifts.
- Working
Intervals []GetSchedule Rotation Working Interval - Weekday intervals the rotation is on call for, if it's restricted to any.
- concurrent_
shifts number - How many shifts run at the same time, which is how many people are on call at once
- effective_
from string - When this shape of the rotation took over. Unset when the rotation has only ever had one.
- first_
interval_ stringstarts_ at - When the first handover interval starts being counted from, which fixes the time of day and day of week shifts change hands. The dashboard calls this the handover time.
- handovers list(object)
- The cadence shifts hand over on, applied in turn
- id string
- Look up the rotation by ID.
- name string
- Look up the rotation by name, which is unique within the schedule.
- rank number
- Where this rotation sits in the schedule's running order, lowest first. Unset when it has never been ordered.
- schedule_
id string - ID of the schedule this rotation belongs to
- scheduling_
mode string - How users are allocated across shifts of differing length. Possible values are:
fair,sequential. - users list(string)
- IDs of the people in the rotation, in the order they take shifts.
- working_
intervals list(object) - Weekday intervals the rotation is on call for, if it's restricted to any.
- concurrent
Shifts Integer - How many shifts run at the same time, which is how many people are on call at once
- effective
From String - When this shape of the rotation took over. Unset when the rotation has only ever had one.
- first
Interval StringStarts At - When the first handover interval starts being counted from, which fixes the time of day and day of week shifts change hands. The dashboard calls this the handover time.
- handovers
List<Get
Schedule Rotation Handover> - The cadence shifts hand over on, applied in turn
- id String
- Look up the rotation by ID.
- name String
- Look up the rotation by name, which is unique within the schedule.
- rank Integer
- Where this rotation sits in the schedule's running order, lowest first. Unset when it has never been ordered.
- schedule
Id String - ID of the schedule this rotation belongs to
- scheduling
Mode String - How users are allocated across shifts of differing length. Possible values are:
fair,sequential. - users List<String>
- IDs of the people in the rotation, in the order they take shifts.
- working
Intervals List<GetSchedule Rotation Working Interval> - Weekday intervals the rotation is on call for, if it's restricted to any.
- concurrent
Shifts number - How many shifts run at the same time, which is how many people are on call at once
- effective
From string - When this shape of the rotation took over. Unset when the rotation has only ever had one.
- first
Interval stringStarts At - When the first handover interval starts being counted from, which fixes the time of day and day of week shifts change hands. The dashboard calls this the handover time.
- handovers
Get
Schedule Rotation Handover[] - The cadence shifts hand over on, applied in turn
- id string
- Look up the rotation by ID.
- name string
- Look up the rotation by name, which is unique within the schedule.
- rank number
- Where this rotation sits in the schedule's running order, lowest first. Unset when it has never been ordered.
- schedule
Id string - ID of the schedule this rotation belongs to
- scheduling
Mode string - How users are allocated across shifts of differing length. Possible values are:
fair,sequential. - users string[]
- IDs of the people in the rotation, in the order they take shifts.
- working
Intervals GetSchedule Rotation Working Interval[] - Weekday intervals the rotation is on call for, if it's restricted to any.
- concurrent_
shifts int - How many shifts run at the same time, which is how many people are on call at once
- effective_
from str - When this shape of the rotation took over. Unset when the rotation has only ever had one.
- first_
interval_ strstarts_ at - When the first handover interval starts being counted from, which fixes the time of day and day of week shifts change hands. The dashboard calls this the handover time.
- handovers
Sequence[Get
Schedule Rotation Handover] - The cadence shifts hand over on, applied in turn
- id str
- Look up the rotation by ID.
- name str
- Look up the rotation by name, which is unique within the schedule.
- rank int
- Where this rotation sits in the schedule's running order, lowest first. Unset when it has never been ordered.
- schedule_
id str - ID of the schedule this rotation belongs to
- scheduling_
mode str - How users are allocated across shifts of differing length. Possible values are:
fair,sequential. - users Sequence[str]
- IDs of the people in the rotation, in the order they take shifts.
- working_
intervals Sequence[GetSchedule Rotation Working Interval] - Weekday intervals the rotation is on call for, if it's restricted to any.
- concurrent
Shifts Number - How many shifts run at the same time, which is how many people are on call at once
- effective
From String - When this shape of the rotation took over. Unset when the rotation has only ever had one.
- first
Interval StringStarts At - When the first handover interval starts being counted from, which fixes the time of day and day of week shifts change hands. The dashboard calls this the handover time.
- handovers List<Property Map>
- The cadence shifts hand over on, applied in turn
- id String
- Look up the rotation by ID.
- name String
- Look up the rotation by name, which is unique within the schedule.
- rank Number
- Where this rotation sits in the schedule's running order, lowest first. Unset when it has never been ordered.
- schedule
Id String - ID of the schedule this rotation belongs to
- scheduling
Mode String - How users are allocated across shifts of differing length. Possible values are:
fair,sequential. - users List<String>
- IDs of the people in the rotation, in the order they take shifts.
- working
Intervals List<Property Map> - Weekday intervals the rotation is on call for, if it's restricted to any.
Supporting Types
GetScheduleRotationHandover
- Interval int
- How many of the interval type to wait between handovers.
- Interval
Type string - How often a handover occurs. Possible values are:
hourly,daily,weekly.
- Interval int
- How many of the interval type to wait between handovers.
- Interval
Type string - How often a handover occurs. Possible values are:
hourly,daily,weekly.
- interval number
- How many of the interval type to wait between handovers.
- interval_
type string - How often a handover occurs. Possible values are:
hourly,daily,weekly.
- interval Integer
- How many of the interval type to wait between handovers.
- interval
Type String - How often a handover occurs. Possible values are:
hourly,daily,weekly.
- interval number
- How many of the interval type to wait between handovers.
- interval
Type string - How often a handover occurs. Possible values are:
hourly,daily,weekly.
- interval int
- How many of the interval type to wait between handovers.
- interval_
type str - How often a handover occurs. Possible values are:
hourly,daily,weekly.
- interval Number
- How many of the interval type to wait between handovers.
- interval
Type String - How often a handover occurs. Possible values are:
hourly,daily,weekly.
GetScheduleRotationWorkingInterval
- end_
time string - Time of day this window closes, as HH:MM.
- start_
time string - Time of day this window opens, as HH:MM.
- weekday string
- Day of the week, lowercase. Possible values are:
monday,tuesday,wednesday,thursday,friday,saturday,sunday.
- end_
time str - Time of day this window closes, as HH:MM.
- start_
time str - Time of day this window opens, as HH:MM.
- weekday str
- Day of the week, lowercase. Possible values are:
monday,tuesday,wednesday,thursday,friday,saturday,sunday.
Package Details
- Repository
- incident incident-io/pulumi-incident
- License
- MIT
- Notes
- This Pulumi package is based on the
incidentTerraform Provider.
Viewing docs for incident.io v0.4.0
published on Saturday, Oct 17, 2026 by incident-io
published on Saturday, Oct 17, 2026 by incident-io