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

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<ScheduleLayerArgs>

A schedule layer block. Schedule layers documented below.

TimeZone 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 overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.

Layers []ScheduleLayer

A schedule layer block. Schedule layers documented below.

TimeZone 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 overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.

layers ScheduleLayer[]

A schedule layer block. Schedule layers documented below.

timeZone 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 overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.

layers List[ScheduleLayer]

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 overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.

Outputs

All input properties are implicitly available as output properties. Additionally, the Schedule resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

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): Schedule
static 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<ScheduleLayerArgs>

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 overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.

TimeZone string

The time zone of the schedule (e.g Europe/Berlin).

Description string

The description of the schedule

Layers []ScheduleLayer

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 overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.

TimeZone string

The time zone of the schedule (e.g Europe/Berlin).

description string

The description of the schedule

layers ScheduleLayer[]

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 overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.

timeZone string

The time zone of the schedule (e.g Europe/Berlin).

description str

The description of the schedule

layers List[ScheduleLayer]

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 overflow is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don’t pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.

time_zone str

The time zone of the schedule (e.g Europe/Berlin).

Supporting Types

ScheduleLayer

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

RotationTurnLengthSeconds int

The duration of each on-call shift in seconds.

RotationVirtualStart string

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 start time, 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<ScheduleLayerRestrictionArgs>

A schedule layer restriction block. Restriction blocks documented below.

RotationTurnLengthSeconds int

The duration of each on-call shift in seconds.

RotationVirtualStart string

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 start time, 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 []ScheduleLayerRestriction

A schedule layer restriction block. Restriction blocks documented below.

rotationTurnLengthSeconds number

The duration of each on-call shift in seconds.

rotationVirtualStart string

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 start time, 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 ScheduleLayerRestriction[]

A schedule layer restriction block. Restriction blocks documented below.

rotationTurnLengthSeconds float

The duration of each on-call shift in seconds.

rotationVirtualStart str

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 start time, 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[ScheduleLayerRestriction]

A schedule layer restriction block. Restriction blocks documented below.

ScheduleLayerRestriction

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

DurationSeconds int

The duration of the restriction in seconds.

StartTimeOfDay string

The start time in HH:mm:ss format.

Type string

Can be daily_restriction or weekly_restriction

StartDayOfWeek int

Number of the day when restriction starts. From 1 to 7 where 1 is Monday and 7 is Sunday.

DurationSeconds int

The duration of the restriction in seconds.

StartTimeOfDay string

The start time in HH:mm:ss format.

Type string

Can be daily_restriction or weekly_restriction

StartDayOfWeek int

Number of the day when restriction starts. From 1 to 7 where 1 is Monday and 7 is Sunday.

durationSeconds number

The duration of the restriction in seconds.

startTimeOfDay string

The start time in HH:mm:ss format.

type string

Can be daily_restriction or weekly_restriction

startDayOfWeek number

Number of the day when restriction starts. From 1 to 7 where 1 is Monday and 7 is Sunday.

durationSeconds float

The duration of the restriction in seconds.

startTimeOfDay str

The start time in HH:mm:ss format.

type str

Can be daily_restriction or weekly_restriction

startDayOfWeek float

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 pagerduty Terraform Provider.