1. Packages
  2. Packages
  3. Grafana Cloud
  4. API Docs
  5. onCall
  6. OnCallShift
Viewing docs for Grafana v2.29.0
published on Friday, May 1, 2026 by pulumiverse
grafana logo
Viewing docs for Grafana v2.29.0
published on Friday, May 1, 2026 by pulumiverse

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as grafana from "@pulumiverse/grafana";
    import * as std from "@pulumi/std";
    
    const alex = grafana.onCall.getUser({
        username: "alex",
    });
    const myTeam = grafana.oss.getTeam({
        name: "my team",
    });
    const myTeamGetTeam = myTeam.then(myTeam => grafana.onCall.getTeam({
        name: myTeam.name,
    }));
    const exampleShift = new grafana.oncall.OnCallShift("example_shift", {
        name: "Example Shift",
        type: "recurrent_event",
        start: "2020-09-07T14:00:00",
        duration: 60 * 30,
        frequency: "weekly",
        interval: 2,
        byDays: [
            "MO",
            "FR",
        ],
        weekStart: "MO",
        users: [alex.then(alex => alex.id)],
        timeZone: "UTC",
        teamId: myTeamGetTeam.then(myTeamGetTeam => myTeamGetTeam.id),
    });
    ////////
    // Advanced example
    ////////
    const teams = {
        emea: [
            "alfa@grafana.com",
            "bravo@grafana.com",
            "charlie@grafana.com",
            "echo@grafana.com",
            "delta@grafana.com",
            "foxtrot@grafana.com",
            "golf@grafana.com",
        ],
    };
    // Importing users
    const allUsers = .reduce((__obj, [__key, __value]) => ({ ...__obj, [__key]: grafana.onCall.getUser({
        username: __key,
    }) }));
    // oncall API operates with resources ID's, so we convert emails into ID's
    const teamsMapOfUserId = Object.entries(teams).reduce((__obj, [teamName, usernameList]) => ({ ...__obj, [teamName]: usernameList.map(username => (std.index.lookup({
        map: allUsers,
        key: username,
    }).result.id)) }));
    const usersMapById = _arg0_;
    // A 12 hour shift on week days with the on-call person rotating weekly.
    const emeaWeekdayShift = new grafana.oncall.OnCallShift("emea_weekday_shift", {
        name: "EMEA Weekday Shift",
        type: "rolling_users",
        start: "2022-02-28T03:00:00",
        duration: 60 * 60 * 12,
        frequency: "weekly",
        interval: 1,
        byDays: [
            "MO",
            "TU",
            "WE",
            "TH",
            "FR",
        ],
        weekStart: "MO",
        rollingUsers: .map(k => ([k])),
        startRotationFromUserIndex: 0,
        teamId: myTeamGetTeam.then(myTeamGetTeam => myTeamGetTeam.id),
    });
    export const emeaWeekdayRollingUsers = .map(k => (std.index.lookup({
        map: usersMapById,
        key: k,
    }).result.username));
    
    import pulumi
    import pulumi_grafana as grafana
    import pulumi_std as std
    import pulumiverse_grafana as grafana
    
    alex = grafana.onCall.get_user(username="alex")
    my_team = grafana.oss.get_team(name="my team")
    my_team_get_team = grafana.onCall.get_team(name=my_team.name)
    example_shift = grafana.oncall.OnCallShift("example_shift",
        name="Example Shift",
        type="recurrent_event",
        start="2020-09-07T14:00:00",
        duration=60 * 30,
        frequency="weekly",
        interval=2,
        by_days=[
            "MO",
            "FR",
        ],
        week_start="MO",
        users=[alex.id],
        time_zone="UTC",
        team_id=my_team_get_team.id)
    #//////
    # Advanced example
    #//////
    teams = {
        "emea": [
            "alfa@grafana.com",
            "bravo@grafana.com",
            "charlie@grafana.com",
            "echo@grafana.com",
            "delta@grafana.com",
            "foxtrot@grafana.com",
            "golf@grafana.com",
        ],
    }
    # Importing users
    all_users = {__key: grafana.onCall.get_user(username=__key) for __key, __value in enumerate(std.index.toset(input=std.index.flatten(input=[[username_list] for teamName, usernameList in teams.items()])["result"])["result"])}
    # oncall API operates with resources ID's, so we convert emails into ID's
    teams_map_of_user_id = {team_name: [std.index.lookup(map=all_users,
        key=username)["result"]["id"] for username in username_list] for teamName, usernameList in teams.items()}
    users_map_by_id = {oncall_user.id: oncall_user for username, oncallUser in all_users.items()}
    # A 12 hour shift on week days with the on-call person rotating weekly.
    emea_weekday_shift = grafana.oncall.OnCallShift("emea_weekday_shift",
        name="EMEA Weekday Shift",
        type="rolling_users",
        start="2022-02-28T03:00:00",
        duration=60 * 60 * 12,
        frequency="weekly",
        interval=1,
        by_days=[
            "MO",
            "TU",
            "WE",
            "TH",
            "FR",
        ],
        week_start="MO",
        rolling_users=[[k] for k in std.index.flatten(input=[teams_map_of_user_id["emea"]])["result"]],
        start_rotation_from_user_index=0,
        team_id=my_team_get_team.id)
    pulumi.export("emeaWeekdayRollingUsers", [std.index.lookup(map=users_map_by_id,
        key=k)["result"]["username"] for k in std.index.flatten(input=emea_weekday_shift.rolling_users)["result"]])
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Grafana = Pulumiverse.Grafana;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var alex = Grafana.OnCall.GetUser.Invoke(new()
        {
            Username = "alex",
        });
    
        var myTeam = Grafana.Oss.GetTeam.Invoke(new()
        {
            Name = "my team",
        });
    
        var myTeamGetTeam = Grafana.OnCall.GetTeam.Invoke(new()
        {
            Name = myTeam.Apply(getTeamResult => getTeamResult.Name),
        });
    
        var exampleShift = new Grafana.OnCall.OnCallShift("example_shift", new()
        {
            Name = "Example Shift",
            Type = "recurrent_event",
            Start = "2020-09-07T14:00:00",
            Duration = 60 * 30,
            Frequency = "weekly",
            Interval = 2,
            ByDays = new[]
            {
                "MO",
                "FR",
            },
            WeekStart = "MO",
            Users = new[]
            {
                alex.Apply(getUserResult => getUserResult.Id),
            },
            TimeZone = "UTC",
            TeamId = myTeamGetTeam.Apply(getTeamResult => getTeamResult.Id),
        });
    
        ////////
        // Advanced example
        ////////
        var teams = 
        {
            { "emea", new[]
            {
                "alfa@grafana.com",
                "bravo@grafana.com",
                "charlie@grafana.com",
                "echo@grafana.com",
                "delta@grafana.com",
                "foxtrot@grafana.com",
                "golf@grafana.com",
            } },
        };
    
        // Importing users
        var allUsers = .ToDictionary(item => {
            var __key = item.Key;
            return __key;
        }, item => {
            var __key = item.Key;
            return Grafana.OnCall.GetUser.Invoke(new()
            {
                Username = __key,
            });
        });
    
        // oncall API operates with resources ID's, so we convert emails into ID's
        var teamsMapOfUserId = .ToDictionary(item => {
            var teamName = item.Key;
            return teamName;
        }, item => {
            var usernameList = item.Value;
            return usernameList.Select(username => 
            {
                return Std.Index.Lookup.Invoke(new()
                {
                    Map = allUsers,
                    Key = username,
                }).Result.Id;
            }).ToList();
        });
    
        var usersMapById = _arg0_;
    
        // A 12 hour shift on week days with the on-call person rotating weekly.
        var emeaWeekdayShift = new Grafana.OnCall.OnCallShift("emea_weekday_shift", new()
        {
            Name = "EMEA Weekday Shift",
            Type = "rolling_users",
            Start = "2022-02-28T03:00:00",
            Duration = 60 * 60 * 12,
            Frequency = "weekly",
            Interval = 1,
            ByDays = new[]
            {
                "MO",
                "TU",
                "WE",
                "TH",
                "FR",
            },
            WeekStart = "MO",
            RollingUsers = .Select(k => 
            {
                return new[]
                {
                    k,
                };
            }).ToList(),
            StartRotationFromUserIndex = 0,
            TeamId = myTeamGetTeam.Apply(getTeamResult => getTeamResult.Id),
        });
    
        return new Dictionary<string, object?>
        {
            ["emeaWeekdayRollingUsers"] = .Select(k => 
            {
                return Std.Index.Lookup.Invoke(new()
                {
                    Map = usersMapById,
                    Key = k,
                }).Result.Username;
            }).ToList(),
        };
    });
    
    Example coming soon!
    
    Example coming soon!
    

    Create OnCallShift Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new OnCallShift(name: string, args: OnCallShiftArgs, opts?: CustomResourceOptions);
    @overload
    def OnCallShift(resource_name: str,
                    args: OnCallShiftArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def OnCallShift(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    duration: Optional[int] = None,
                    type: Optional[str] = None,
                    start: Optional[str] = None,
                    rolling_users: Optional[Sequence[Sequence[str]]] = None,
                    start_rotation_from_user_index: Optional[int] = None,
                    interval: Optional[int] = None,
                    level: Optional[int] = None,
                    name: Optional[str] = None,
                    by_days: Optional[Sequence[str]] = None,
                    by_months: Optional[Sequence[int]] = None,
                    frequency: Optional[str] = None,
                    team_id: Optional[str] = None,
                    time_zone: Optional[str] = None,
                    by_monthdays: Optional[Sequence[int]] = None,
                    until: Optional[str] = None,
                    users: Optional[Sequence[str]] = None,
                    week_start: Optional[str] = None)
    func NewOnCallShift(ctx *Context, name string, args OnCallShiftArgs, opts ...ResourceOption) (*OnCallShift, error)
    public OnCallShift(string name, OnCallShiftArgs args, CustomResourceOptions? opts = null)
    public OnCallShift(String name, OnCallShiftArgs args)
    public OnCallShift(String name, OnCallShiftArgs args, CustomResourceOptions options)
    
    type: grafana:onCall:OnCallShift
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args OnCallShiftArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args OnCallShiftArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args OnCallShiftArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OnCallShiftArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OnCallShiftArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var onCallShiftResource = new Grafana.OnCall.OnCallShift("onCallShiftResource", new()
    {
        Duration = 0,
        Type = "string",
        Start = "string",
        RollingUsers = new[]
        {
            new[]
            {
                "string",
            },
        },
        StartRotationFromUserIndex = 0,
        Interval = 0,
        Level = 0,
        Name = "string",
        ByDays = new[]
        {
            "string",
        },
        ByMonths = new[]
        {
            0,
        },
        Frequency = "string",
        TeamId = "string",
        TimeZone = "string",
        ByMonthdays = new[]
        {
            0,
        },
        Until = "string",
        Users = new[]
        {
            "string",
        },
        WeekStart = "string",
    });
    
    example, err := oncall.NewOnCallShift(ctx, "onCallShiftResource", &oncall.OnCallShiftArgs{
    	Duration: pulumi.Int(0),
    	Type:     pulumi.String("string"),
    	Start:    pulumi.String("string"),
    	RollingUsers: pulumi.StringArrayArray{
    		pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	StartRotationFromUserIndex: pulumi.Int(0),
    	Interval:                   pulumi.Int(0),
    	Level:                      pulumi.Int(0),
    	Name:                       pulumi.String("string"),
    	ByDays: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ByMonths: pulumi.IntArray{
    		pulumi.Int(0),
    	},
    	Frequency: pulumi.String("string"),
    	TeamId:    pulumi.String("string"),
    	TimeZone:  pulumi.String("string"),
    	ByMonthdays: pulumi.IntArray{
    		pulumi.Int(0),
    	},
    	Until: pulumi.String("string"),
    	Users: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	WeekStart: pulumi.String("string"),
    })
    
    var onCallShiftResource = new OnCallShift("onCallShiftResource", OnCallShiftArgs.builder()
        .duration(0)
        .type("string")
        .start("string")
        .rollingUsers("string")
        .startRotationFromUserIndex(0)
        .interval(0)
        .level(0)
        .name("string")
        .byDays("string")
        .byMonths(0)
        .frequency("string")
        .teamId("string")
        .timeZone("string")
        .byMonthdays(0)
        .until("string")
        .users("string")
        .weekStart("string")
        .build());
    
    on_call_shift_resource = grafana.oncall.OnCallShift("onCallShiftResource",
        duration=0,
        type="string",
        start="string",
        rolling_users=[["string"]],
        start_rotation_from_user_index=0,
        interval=0,
        level=0,
        name="string",
        by_days=["string"],
        by_months=[0],
        frequency="string",
        team_id="string",
        time_zone="string",
        by_monthdays=[0],
        until="string",
        users=["string"],
        week_start="string")
    
    const onCallShiftResource = new grafana.oncall.OnCallShift("onCallShiftResource", {
        duration: 0,
        type: "string",
        start: "string",
        rollingUsers: [["string"]],
        startRotationFromUserIndex: 0,
        interval: 0,
        level: 0,
        name: "string",
        byDays: ["string"],
        byMonths: [0],
        frequency: "string",
        teamId: "string",
        timeZone: "string",
        byMonthdays: [0],
        until: "string",
        users: ["string"],
        weekStart: "string",
    });
    
    type: grafana:onCall:OnCallShift
    properties:
        byDays:
            - string
        byMonthdays:
            - 0
        byMonths:
            - 0
        duration: 0
        frequency: string
        interval: 0
        level: 0
        name: string
        rollingUsers:
            - - string
        start: string
        startRotationFromUserIndex: 0
        teamId: string
        timeZone: string
        type: string
        until: string
        users:
            - string
        weekStart: string
    

    OnCallShift Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The OnCallShift resource accepts the following input properties:

    Duration int
    The duration of the event.
    Start string
    The start time of the on-call shift. This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    Type string
    The shift's type. Can be rollingusers, recurrentevent, single_event
    ByDays List<string>
    This parameter takes a list of days in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    ByMonthdays List<int>
    This parameter takes a list of days of the month. Valid values are 1 to 31 or -31 to -1
    ByMonths List<int>
    This parameter takes a list of months. Valid values are 1 to 12
    Frequency string
    The frequency of the event. Can be hourly, daily, weekly, monthly
    Interval int
    The positive integer representing at which intervals the recurrence rule repeats.
    Level int
    The priority level. The higher the value, the higher the priority.
    Name string
    The shift's name.
    RollingUsers List<ImmutableArray<string>>
    The list of lists with on-call users (for rollingUsers event type)
    StartRotationFromUserIndex int
    The index of the list of users in rolling_users, from which on-call rotation starts.
    TeamId string
    The ID of the OnCall team (using the grafana.onCall.getTeam datasource).
    TimeZone string
    The shift's timezone. Overrides schedule's timezone.
    Until string
    The end time of recurrent on-call shifts (endless if null). This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    Users List<string>
    The list of on-call users (for singleevent and recurrentevent event type).
    WeekStart string
    Start day of the week in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    Duration int
    The duration of the event.
    Start string
    The start time of the on-call shift. This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    Type string
    The shift's type. Can be rollingusers, recurrentevent, single_event
    ByDays []string
    This parameter takes a list of days in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    ByMonthdays []int
    This parameter takes a list of days of the month. Valid values are 1 to 31 or -31 to -1
    ByMonths []int
    This parameter takes a list of months. Valid values are 1 to 12
    Frequency string
    The frequency of the event. Can be hourly, daily, weekly, monthly
    Interval int
    The positive integer representing at which intervals the recurrence rule repeats.
    Level int
    The priority level. The higher the value, the higher the priority.
    Name string
    The shift's name.
    RollingUsers [][]string
    The list of lists with on-call users (for rollingUsers event type)
    StartRotationFromUserIndex int
    The index of the list of users in rolling_users, from which on-call rotation starts.
    TeamId string
    The ID of the OnCall team (using the grafana.onCall.getTeam datasource).
    TimeZone string
    The shift's timezone. Overrides schedule's timezone.
    Until string
    The end time of recurrent on-call shifts (endless if null). This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    Users []string
    The list of on-call users (for singleevent and recurrentevent event type).
    WeekStart string
    Start day of the week in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    duration Integer
    The duration of the event.
    start String
    The start time of the on-call shift. This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    type String
    The shift's type. Can be rollingusers, recurrentevent, single_event
    byDays List<String>
    This parameter takes a list of days in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    byMonthdays List<Integer>
    This parameter takes a list of days of the month. Valid values are 1 to 31 or -31 to -1
    byMonths List<Integer>
    This parameter takes a list of months. Valid values are 1 to 12
    frequency String
    The frequency of the event. Can be hourly, daily, weekly, monthly
    interval Integer
    The positive integer representing at which intervals the recurrence rule repeats.
    level Integer
    The priority level. The higher the value, the higher the priority.
    name String
    The shift's name.
    rollingUsers List<List<String>>
    The list of lists with on-call users (for rollingUsers event type)
    startRotationFromUserIndex Integer
    The index of the list of users in rolling_users, from which on-call rotation starts.
    teamId String
    The ID of the OnCall team (using the grafana.onCall.getTeam datasource).
    timeZone String
    The shift's timezone. Overrides schedule's timezone.
    until String
    The end time of recurrent on-call shifts (endless if null). This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    users List<String>
    The list of on-call users (for singleevent and recurrentevent event type).
    weekStart String
    Start day of the week in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    duration number
    The duration of the event.
    start string
    The start time of the on-call shift. This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    type string
    The shift's type. Can be rollingusers, recurrentevent, single_event
    byDays string[]
    This parameter takes a list of days in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    byMonthdays number[]
    This parameter takes a list of days of the month. Valid values are 1 to 31 or -31 to -1
    byMonths number[]
    This parameter takes a list of months. Valid values are 1 to 12
    frequency string
    The frequency of the event. Can be hourly, daily, weekly, monthly
    interval number
    The positive integer representing at which intervals the recurrence rule repeats.
    level number
    The priority level. The higher the value, the higher the priority.
    name string
    The shift's name.
    rollingUsers string[][]
    The list of lists with on-call users (for rollingUsers event type)
    startRotationFromUserIndex number
    The index of the list of users in rolling_users, from which on-call rotation starts.
    teamId string
    The ID of the OnCall team (using the grafana.onCall.getTeam datasource).
    timeZone string
    The shift's timezone. Overrides schedule's timezone.
    until string
    The end time of recurrent on-call shifts (endless if null). This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    users string[]
    The list of on-call users (for singleevent and recurrentevent event type).
    weekStart string
    Start day of the week in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    duration int
    The duration of the event.
    start str
    The start time of the on-call shift. This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    type str
    The shift's type. Can be rollingusers, recurrentevent, single_event
    by_days Sequence[str]
    This parameter takes a list of days in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    by_monthdays Sequence[int]
    This parameter takes a list of days of the month. Valid values are 1 to 31 or -31 to -1
    by_months Sequence[int]
    This parameter takes a list of months. Valid values are 1 to 12
    frequency str
    The frequency of the event. Can be hourly, daily, weekly, monthly
    interval int
    The positive integer representing at which intervals the recurrence rule repeats.
    level int
    The priority level. The higher the value, the higher the priority.
    name str
    The shift's name.
    rolling_users Sequence[Sequence[str]]
    The list of lists with on-call users (for rollingUsers event type)
    start_rotation_from_user_index int
    The index of the list of users in rolling_users, from which on-call rotation starts.
    team_id str
    The ID of the OnCall team (using the grafana.onCall.getTeam datasource).
    time_zone str
    The shift's timezone. Overrides schedule's timezone.
    until str
    The end time of recurrent on-call shifts (endless if null). This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    users Sequence[str]
    The list of on-call users (for singleevent and recurrentevent event type).
    week_start str
    Start day of the week in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    duration Number
    The duration of the event.
    start String
    The start time of the on-call shift. This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    type String
    The shift's type. Can be rollingusers, recurrentevent, single_event
    byDays List<String>
    This parameter takes a list of days in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    byMonthdays List<Number>
    This parameter takes a list of days of the month. Valid values are 1 to 31 or -31 to -1
    byMonths List<Number>
    This parameter takes a list of months. Valid values are 1 to 12
    frequency String
    The frequency of the event. Can be hourly, daily, weekly, monthly
    interval Number
    The positive integer representing at which intervals the recurrence rule repeats.
    level Number
    The priority level. The higher the value, the higher the priority.
    name String
    The shift's name.
    rollingUsers List<List<String>>
    The list of lists with on-call users (for rollingUsers event type)
    startRotationFromUserIndex Number
    The index of the list of users in rolling_users, from which on-call rotation starts.
    teamId String
    The ID of the OnCall team (using the grafana.onCall.getTeam datasource).
    timeZone String
    The shift's timezone. Overrides schedule's timezone.
    until String
    The end time of recurrent on-call shifts (endless if null). This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    users List<String>
    The list of on-call users (for singleevent and recurrentevent event type).
    weekStart String
    Start day of the week in iCal format. Can be MO, TU, WE, TH, FR, SA, SU

    Outputs

    All input properties are implicitly available as output properties. Additionally, the OnCallShift 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 string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing OnCallShift Resource

    Get an existing OnCallShift 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?: OnCallShiftState, opts?: CustomResourceOptions): OnCallShift
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            by_days: Optional[Sequence[str]] = None,
            by_monthdays: Optional[Sequence[int]] = None,
            by_months: Optional[Sequence[int]] = None,
            duration: Optional[int] = None,
            frequency: Optional[str] = None,
            interval: Optional[int] = None,
            level: Optional[int] = None,
            name: Optional[str] = None,
            rolling_users: Optional[Sequence[Sequence[str]]] = None,
            start: Optional[str] = None,
            start_rotation_from_user_index: Optional[int] = None,
            team_id: Optional[str] = None,
            time_zone: Optional[str] = None,
            type: Optional[str] = None,
            until: Optional[str] = None,
            users: Optional[Sequence[str]] = None,
            week_start: Optional[str] = None) -> OnCallShift
    func GetOnCallShift(ctx *Context, name string, id IDInput, state *OnCallShiftState, opts ...ResourceOption) (*OnCallShift, error)
    public static OnCallShift Get(string name, Input<string> id, OnCallShiftState? state, CustomResourceOptions? opts = null)
    public static OnCallShift get(String name, Output<String> id, OnCallShiftState state, CustomResourceOptions options)
    resources:  _:    type: grafana:onCall:OnCallShift    get:      id: ${id}
    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.
    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:
    ByDays List<string>
    This parameter takes a list of days in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    ByMonthdays List<int>
    This parameter takes a list of days of the month. Valid values are 1 to 31 or -31 to -1
    ByMonths List<int>
    This parameter takes a list of months. Valid values are 1 to 12
    Duration int
    The duration of the event.
    Frequency string
    The frequency of the event. Can be hourly, daily, weekly, monthly
    Interval int
    The positive integer representing at which intervals the recurrence rule repeats.
    Level int
    The priority level. The higher the value, the higher the priority.
    Name string
    The shift's name.
    RollingUsers List<ImmutableArray<string>>
    The list of lists with on-call users (for rollingUsers event type)
    Start string
    The start time of the on-call shift. This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    StartRotationFromUserIndex int
    The index of the list of users in rolling_users, from which on-call rotation starts.
    TeamId string
    The ID of the OnCall team (using the grafana.onCall.getTeam datasource).
    TimeZone string
    The shift's timezone. Overrides schedule's timezone.
    Type string
    The shift's type. Can be rollingusers, recurrentevent, single_event
    Until string
    The end time of recurrent on-call shifts (endless if null). This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    Users List<string>
    The list of on-call users (for singleevent and recurrentevent event type).
    WeekStart string
    Start day of the week in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    ByDays []string
    This parameter takes a list of days in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    ByMonthdays []int
    This parameter takes a list of days of the month. Valid values are 1 to 31 or -31 to -1
    ByMonths []int
    This parameter takes a list of months. Valid values are 1 to 12
    Duration int
    The duration of the event.
    Frequency string
    The frequency of the event. Can be hourly, daily, weekly, monthly
    Interval int
    The positive integer representing at which intervals the recurrence rule repeats.
    Level int
    The priority level. The higher the value, the higher the priority.
    Name string
    The shift's name.
    RollingUsers [][]string
    The list of lists with on-call users (for rollingUsers event type)
    Start string
    The start time of the on-call shift. This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    StartRotationFromUserIndex int
    The index of the list of users in rolling_users, from which on-call rotation starts.
    TeamId string
    The ID of the OnCall team (using the grafana.onCall.getTeam datasource).
    TimeZone string
    The shift's timezone. Overrides schedule's timezone.
    Type string
    The shift's type. Can be rollingusers, recurrentevent, single_event
    Until string
    The end time of recurrent on-call shifts (endless if null). This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    Users []string
    The list of on-call users (for singleevent and recurrentevent event type).
    WeekStart string
    Start day of the week in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    byDays List<String>
    This parameter takes a list of days in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    byMonthdays List<Integer>
    This parameter takes a list of days of the month. Valid values are 1 to 31 or -31 to -1
    byMonths List<Integer>
    This parameter takes a list of months. Valid values are 1 to 12
    duration Integer
    The duration of the event.
    frequency String
    The frequency of the event. Can be hourly, daily, weekly, monthly
    interval Integer
    The positive integer representing at which intervals the recurrence rule repeats.
    level Integer
    The priority level. The higher the value, the higher the priority.
    name String
    The shift's name.
    rollingUsers List<List<String>>
    The list of lists with on-call users (for rollingUsers event type)
    start String
    The start time of the on-call shift. This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    startRotationFromUserIndex Integer
    The index of the list of users in rolling_users, from which on-call rotation starts.
    teamId String
    The ID of the OnCall team (using the grafana.onCall.getTeam datasource).
    timeZone String
    The shift's timezone. Overrides schedule's timezone.
    type String
    The shift's type. Can be rollingusers, recurrentevent, single_event
    until String
    The end time of recurrent on-call shifts (endless if null). This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    users List<String>
    The list of on-call users (for singleevent and recurrentevent event type).
    weekStart String
    Start day of the week in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    byDays string[]
    This parameter takes a list of days in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    byMonthdays number[]
    This parameter takes a list of days of the month. Valid values are 1 to 31 or -31 to -1
    byMonths number[]
    This parameter takes a list of months. Valid values are 1 to 12
    duration number
    The duration of the event.
    frequency string
    The frequency of the event. Can be hourly, daily, weekly, monthly
    interval number
    The positive integer representing at which intervals the recurrence rule repeats.
    level number
    The priority level. The higher the value, the higher the priority.
    name string
    The shift's name.
    rollingUsers string[][]
    The list of lists with on-call users (for rollingUsers event type)
    start string
    The start time of the on-call shift. This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    startRotationFromUserIndex number
    The index of the list of users in rolling_users, from which on-call rotation starts.
    teamId string
    The ID of the OnCall team (using the grafana.onCall.getTeam datasource).
    timeZone string
    The shift's timezone. Overrides schedule's timezone.
    type string
    The shift's type. Can be rollingusers, recurrentevent, single_event
    until string
    The end time of recurrent on-call shifts (endless if null). This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    users string[]
    The list of on-call users (for singleevent and recurrentevent event type).
    weekStart string
    Start day of the week in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    by_days Sequence[str]
    This parameter takes a list of days in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    by_monthdays Sequence[int]
    This parameter takes a list of days of the month. Valid values are 1 to 31 or -31 to -1
    by_months Sequence[int]
    This parameter takes a list of months. Valid values are 1 to 12
    duration int
    The duration of the event.
    frequency str
    The frequency of the event. Can be hourly, daily, weekly, monthly
    interval int
    The positive integer representing at which intervals the recurrence rule repeats.
    level int
    The priority level. The higher the value, the higher the priority.
    name str
    The shift's name.
    rolling_users Sequence[Sequence[str]]
    The list of lists with on-call users (for rollingUsers event type)
    start str
    The start time of the on-call shift. This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    start_rotation_from_user_index int
    The index of the list of users in rolling_users, from which on-call rotation starts.
    team_id str
    The ID of the OnCall team (using the grafana.onCall.getTeam datasource).
    time_zone str
    The shift's timezone. Overrides schedule's timezone.
    type str
    The shift's type. Can be rollingusers, recurrentevent, single_event
    until str
    The end time of recurrent on-call shifts (endless if null). This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    users Sequence[str]
    The list of on-call users (for singleevent and recurrentevent event type).
    week_start str
    Start day of the week in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    byDays List<String>
    This parameter takes a list of days in iCal format. Can be MO, TU, WE, TH, FR, SA, SU
    byMonthdays List<Number>
    This parameter takes a list of days of the month. Valid values are 1 to 31 or -31 to -1
    byMonths List<Number>
    This parameter takes a list of months. Valid values are 1 to 12
    duration Number
    The duration of the event.
    frequency String
    The frequency of the event. Can be hourly, daily, weekly, monthly
    interval Number
    The positive integer representing at which intervals the recurrence rule repeats.
    level Number
    The priority level. The higher the value, the higher the priority.
    name String
    The shift's name.
    rollingUsers List<List<String>>
    The list of lists with on-call users (for rollingUsers event type)
    start String
    The start time of the on-call shift. This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    startRotationFromUserIndex Number
    The index of the list of users in rolling_users, from which on-call rotation starts.
    teamId String
    The ID of the OnCall team (using the grafana.onCall.getTeam datasource).
    timeZone String
    The shift's timezone. Overrides schedule's timezone.
    type String
    The shift's type. Can be rollingusers, recurrentevent, single_event
    until String
    The end time of recurrent on-call shifts (endless if null). This parameter takes a date format as yyyy-MM-dd'T'HH:mm:ss (for example "2020-09-05T08:00:00")
    users List<String>
    The list of on-call users (for singleevent and recurrentevent event type).
    weekStart String
    Start day of the week in iCal format. Can be MO, TU, WE, TH, FR, SA, SU

    Import

    terraform import grafana_oncall_on_call_shift.name "{{ id }}"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    grafana pulumiverse/pulumi-grafana
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the grafana Terraform Provider.
    grafana logo
    Viewing docs for Grafana v2.29.0
    published on Friday, May 1, 2026 by pulumiverse
      Try Pulumi Cloud free. Your team will thank you.