Schedule
A schedule determines the time periods that users are on call. Only on-call users are eligible to receive notifications from incidents.
Example Usage
using Pulumi;
using Pagerduty = Pulumi.Pagerduty;
class MyStack : Stack
{
public MyStack()
{
var example = new Pagerduty.User("example", new Pagerduty.UserArgs
{
Email = "125.greenholt.earline@graham.name",
Teams =
{
pagerduty_team.Example.Id,
},
});
var foo = new Pagerduty.Schedule("foo", new Pagerduty.ScheduleArgs
{
Layers =
{
new Pagerduty.Inputs.ScheduleLayerArgs
{
Name = "Night Shift",
Restriction =
{
{
{ "durationSeconds", 32400 },
{ "startTimeOfDay", "08:00:00" },
{ "type", "daily_restriction" },
},
},
RotationTurnLengthSeconds = 86400,
RotationVirtualStart = "2015-11-06T20:00:00-05:00",
Start = "2015-11-06T20:00:00-05:00",
Users =
{
pagerduty_user.Foo.Id,
},
},
},
TimeZone = "America/New_York",
});
}
}
Coming soon!
import pulumi
import pulumi_pagerduty as pagerduty
example = pagerduty.User("example",
email="125.greenholt.earline@graham.name",
teams=[pagerduty_team["example"]["id"]])
foo = pagerduty.Schedule("foo",
layers=[{
"name": "Night Shift",
"restriction": [{
"durationSeconds": 32400,
"startTimeOfDay": "08:00:00",
"type": "daily_restriction",
}],
"rotationTurnLengthSeconds": 86400,
"rotationVirtualStart": "2015-11-06T20:00:00-05:00",
"start": "2015-11-06T20:00:00-05:00",
"users": [pagerduty_user["foo"]["id"]],
}],
time_zone="America/New_York")import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";
const example = new pagerduty.User("example", {
email: "125.greenholt.earline@graham.name",
teams: [pagerduty_team_example.id],
});
const foo = new pagerduty.Schedule("foo", {
layers: [{
name: "Night Shift",
restrictions: [{
durationSeconds: 32400,
startTimeOfDay: "08:00:00",
type: "daily_restriction",
}],
rotationTurnLengthSeconds: 86400,
rotationVirtualStart: "2015-11-06T20:00:00-05:00",
start: "2015-11-06T20:00:00-05:00",
users: [pagerduty_user_foo.id],
}],
timeZone: "America/New_York",
});Create a Schedule Resource
new Schedule(name: string, args: ScheduleArgs, opts?: CustomResourceOptions);def Schedule(resource_name, opts=None, description=None, layers=None, name=None, overflow=None, time_zone=None, __props__=None);func NewSchedule(ctx *Context, name string, args ScheduleArgs, opts ...ResourceOption) (*Schedule, error)public Schedule(string name, ScheduleArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args ScheduleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ScheduleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ScheduleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Schedule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Schedule resource accepts the following input properties:
- Layers
List<Schedule
Layer Args> A schedule layer block. Schedule layers documented below.
- Time
Zone string The time zone of the schedule (e.g Europe/Berlin).
- Description string
The description of the schedule
- Name string
The name of the schedule.
- Overflow bool
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter
overflowis passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from2011-06-01T10:00:00Zto2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of2011-06-01T10:00:00Zand end of2011-06-01T14:00:00Z. If you do pass theoverflowparameter, you will get one schedule entry returned with a start of2011-06-01T00:00:00Zand end of2011-06-02T00:00:00Z.
- Layers
[]Schedule
Layer A schedule layer block. Schedule layers documented below.
- Time
Zone string The time zone of the schedule (e.g Europe/Berlin).
- Description string
The description of the schedule
- Name string
The name of the schedule.
- Overflow bool
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter
overflowis passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from2011-06-01T10:00:00Zto2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of2011-06-01T10:00:00Zand end of2011-06-01T14:00:00Z. If you do pass theoverflowparameter, you will get one schedule entry returned with a start of2011-06-01T00:00:00Zand end of2011-06-02T00:00:00Z.
- layers
Schedule
Layer[] A schedule layer block. Schedule layers documented below.
- time
Zone string The time zone of the schedule (e.g Europe/Berlin).
- description string
The description of the schedule
- name string
The name of the schedule.
- overflow boolean
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter
overflowis passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from2011-06-01T10:00:00Zto2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of2011-06-01T10:00:00Zand end of2011-06-01T14:00:00Z. If you do pass theoverflowparameter, you will get one schedule entry returned with a start of2011-06-01T00:00:00Zand end of2011-06-02T00:00:00Z.
- layers
List[Schedule
Layer] A schedule layer block. Schedule layers documented below.
- time_
zone str The time zone of the schedule (e.g Europe/Berlin).
- description str
The description of the schedule
- name str
The name of the schedule.
- overflow bool
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter
overflowis passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from2011-06-01T10:00:00Zto2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of2011-06-01T10:00:00Zand end of2011-06-01T14:00:00Z. If you do pass theoverflowparameter, you will get one schedule entry returned with a start of2011-06-01T00:00:00Zand end of2011-06-02T00:00:00Z.
Outputs
All input properties are implicitly available as output properties. Additionally, the Schedule resource produces the following output properties:
Look up an Existing Schedule Resource
Get an existing Schedule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ScheduleState, opts?: CustomResourceOptions): Schedulestatic get(resource_name, id, opts=None, description=None, layers=None, name=None, overflow=None, time_zone=None, __props__=None);func GetSchedule(ctx *Context, name string, id IDInput, state *ScheduleState, opts ...ResourceOption) (*Schedule, error)public static Schedule Get(string name, Input<string> id, ScheduleState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Description string
The description of the schedule
- Layers
List<Schedule
Layer Args> A schedule layer block. Schedule layers documented below.
- Name string
The name of the schedule.
- Overflow bool
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter
overflowis passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from2011-06-01T10:00:00Zto2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of2011-06-01T10:00:00Zand end of2011-06-01T14:00:00Z. If you do pass theoverflowparameter, you will get one schedule entry returned with a start of2011-06-01T00:00:00Zand end of2011-06-02T00:00:00Z.- Time
Zone string The time zone of the schedule (e.g Europe/Berlin).
- Description string
The description of the schedule
- Layers
[]Schedule
Layer A schedule layer block. Schedule layers documented below.
- Name string
The name of the schedule.
- Overflow bool
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter
overflowis passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from2011-06-01T10:00:00Zto2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of2011-06-01T10:00:00Zand end of2011-06-01T14:00:00Z. If you do pass theoverflowparameter, you will get one schedule entry returned with a start of2011-06-01T00:00:00Zand end of2011-06-02T00:00:00Z.- Time
Zone string The time zone of the schedule (e.g Europe/Berlin).
- description string
The description of the schedule
- layers
Schedule
Layer[] A schedule layer block. Schedule layers documented below.
- name string
The name of the schedule.
- overflow boolean
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter
overflowis passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from2011-06-01T10:00:00Zto2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of2011-06-01T10:00:00Zand end of2011-06-01T14:00:00Z. If you do pass theoverflowparameter, you will get one schedule entry returned with a start of2011-06-01T00:00:00Zand end of2011-06-02T00:00:00Z.- time
Zone string The time zone of the schedule (e.g Europe/Berlin).
- description str
The description of the schedule
- layers
List[Schedule
Layer] A schedule layer block. Schedule layers documented below.
- name str
The name of the schedule.
- overflow bool
Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter
overflowis passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from2011-06-01T10:00:00Zto2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of2011-06-01T10:00:00Zand end of2011-06-01T14:00:00Z. If you do pass theoverflowparameter, you will get one schedule entry returned with a start of2011-06-01T00:00:00Zand end of2011-06-02T00:00:00Z.- time_
zone str The time zone of the schedule (e.g Europe/Berlin).
Supporting Types
ScheduleLayer
- Rotation
Turn intLength Seconds The duration of each on-call shift in
seconds.- Rotation
Virtual stringStart The effective start time of the schedule layer. This can be before the start time of the schedule.
- Start string
The start time of the schedule layer. This value will not be read back from the PagerDuty API because the API will always return a new
starttime, which represents the last updated time of the schedule layer.- Users List<string>
The ordered list of users on this layer. The position of the user on the list determines their order in the layer.
- End string
The end time of the schedule layer. If not specified, the layer does not end.
- Id string
The ID of the schedule
- Name string
The name of the schedule layer.
- Restrictions
List<Schedule
Layer Restriction Args> A schedule layer restriction block. Restriction blocks documented below.
- Rotation
Turn intLength Seconds The duration of each on-call shift in
seconds.- Rotation
Virtual stringStart The effective start time of the schedule layer. This can be before the start time of the schedule.
- Start string
The start time of the schedule layer. This value will not be read back from the PagerDuty API because the API will always return a new
starttime, which represents the last updated time of the schedule layer.- Users []string
The ordered list of users on this layer. The position of the user on the list determines their order in the layer.
- End string
The end time of the schedule layer. If not specified, the layer does not end.
- Id string
The ID of the schedule
- Name string
The name of the schedule layer.
- Restrictions
[]Schedule
Layer Restriction A schedule layer restriction block. Restriction blocks documented below.
- rotation
Turn numberLength Seconds The duration of each on-call shift in
seconds.- rotation
Virtual stringStart The effective start time of the schedule layer. This can be before the start time of the schedule.
- start string
The start time of the schedule layer. This value will not be read back from the PagerDuty API because the API will always return a new
starttime, which represents the last updated time of the schedule layer.- users string[]
The ordered list of users on this layer. The position of the user on the list determines their order in the layer.
- end string
The end time of the schedule layer. If not specified, the layer does not end.
- id string
The ID of the schedule
- name string
The name of the schedule layer.
- restrictions
Schedule
Layer Restriction[] A schedule layer restriction block. Restriction blocks documented below.
- rotation
Turn floatLength Seconds The duration of each on-call shift in
seconds.- rotation
Virtual strStart The effective start time of the schedule layer. This can be before the start time of the schedule.
- start str
The start time of the schedule layer. This value will not be read back from the PagerDuty API because the API will always return a new
starttime, which represents the last updated time of the schedule layer.- users List[str]
The ordered list of users on this layer. The position of the user on the list determines their order in the layer.
- end str
The end time of the schedule layer. If not specified, the layer does not end.
- id str
The ID of the schedule
- name str
The name of the schedule layer.
- restrictions
List[Schedule
Layer Restriction] A schedule layer restriction block. Restriction blocks documented below.
ScheduleLayerRestriction
- Duration
Seconds int The duration of the restriction in
seconds.- Start
Time stringOf Day The start time in
HH:mm:ssformat.- Type string
Can be
daily_restrictionorweekly_restriction- Start
Day intOf Week Number of the day when restriction starts. From 1 to 7 where 1 is Monday and 7 is Sunday.
- Duration
Seconds int The duration of the restriction in
seconds.- Start
Time stringOf Day The start time in
HH:mm:ssformat.- Type string
Can be
daily_restrictionorweekly_restriction- Start
Day intOf Week Number of the day when restriction starts. From 1 to 7 where 1 is Monday and 7 is Sunday.
- duration
Seconds number The duration of the restriction in
seconds.- start
Time stringOf Day The start time in
HH:mm:ssformat.- type string
Can be
daily_restrictionorweekly_restriction- start
Day numberOf Week Number of the day when restriction starts. From 1 to 7 where 1 is Monday and 7 is Sunday.
- duration
Seconds float The duration of the restriction in
seconds.- start
Time strOf Day The start time in
HH:mm:ssformat.- type str
Can be
daily_restrictionorweekly_restriction- start
Day floatOf Week Number of the day when restriction starts. From 1 to 7 where 1 is Monday and 7 is Sunday.
Package Details
- Repository
- https://github.com/pulumi/pulumi-pagerduty
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
pagerdutyTerraform Provider.