getSchedule

Use this data source to get information about a specific schedule that you can use for other PagerDuty resources.

Example Usage

using Pulumi;
using Pagerduty = Pulumi.Pagerduty;

class MyStack : Stack
{
    public MyStack()
    {
        var test = Output.Create(Pagerduty.GetSchedule.InvokeAsync(new Pagerduty.GetScheduleArgs
        {
            Name = "Daily Engineering Rotation",
        }));
        var foo = new Pagerduty.EscalationPolicy("foo", new Pagerduty.EscalationPolicyArgs
        {
            NumLoops = 2,
            Rules = 
            {
                new Pagerduty.Inputs.EscalationPolicyRuleArgs
                {
                    EscalationDelayInMinutes = 10,
                    Targets = 
                    {
                        new Pagerduty.Inputs.EscalationPolicyRuleTargetArgs
                        {
                            Type = "schedule",
                            Id = test.Apply(test => test.Id),
                        },
                    },
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-pagerduty/sdk/v2/go/pagerduty"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		test, err := pagerduty.LookupSchedule(ctx, &pagerduty.LookupScheduleArgs{
			Name: "Daily Engineering Rotation",
		}, nil)
		if err != nil {
			return err
		}
		_, err = pagerduty.NewEscalationPolicy(ctx, "foo", &pagerduty.EscalationPolicyArgs{
			NumLoops: pulumi.Int(2),
			Rules: pagerduty.EscalationPolicyRuleArray{
				&pagerduty.EscalationPolicyRuleArgs{
					EscalationDelayInMinutes: pulumi.Int(10),
					Targets: pagerduty.EscalationPolicyRuleTargetArray{
						&pagerduty.EscalationPolicyRuleTargetArgs{
							Type: pulumi.String("schedule"),
							Id:   pulumi.String(test.Id),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_pagerduty as pagerduty

test = pagerduty.get_schedule(name="Daily Engineering Rotation")
foo = pagerduty.EscalationPolicy("foo",
    num_loops=2,
    rules=[pagerduty.EscalationPolicyRuleArgs(
        escalation_delay_in_minutes=10,
        targets=[pagerduty.EscalationPolicyRuleTargetArgs(
            type="schedule",
            id=test.id,
        )],
    )])
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";

const test = pagerduty.getSchedule({
    name: "Daily Engineering Rotation",
});
const foo = new pagerduty.EscalationPolicy("foo", {
    numLoops: 2,
    rules: [{
        escalationDelayInMinutes: 10,
        targets: [{
            type: "schedule",
            id: test.then(test => test.id),
        }],
    }],
});

Using getSchedule

function getSchedule(args: GetScheduleArgs, opts?: InvokeOptions): Promise<GetScheduleResult>
def get_schedule(name: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetScheduleResult
func LookupSchedule(ctx *Context, args *LookupScheduleArgs, opts ...InvokeOption) (*LookupScheduleResult, error)

Note: This function is named LookupSchedule in the Go SDK.

public static class GetSchedule {
    public static Task<GetScheduleResult> InvokeAsync(GetScheduleArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string
The name to use to find a schedule in the PagerDuty API.
Name string
The name to use to find a schedule in the PagerDuty API.
name string
The name to use to find a schedule in the PagerDuty API.
name str
The name to use to find a schedule in the PagerDuty API.

getSchedule Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Name string
The short name of the found schedule.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The short name of the found schedule.
id string
The provider-assigned unique ID for this managed resource.
name string
The short name of the found schedule.
id str
The provider-assigned unique ID for this managed resource.
name str
The short name of the found schedule.

Package Details

Repository
https://github.com/pulumi/pulumi-pagerduty
License
Apache-2.0
Notes
This Pulumi package is based on the pagerduty Terraform Provider.