1. Registry
  2. Packages
  3. Grafana Cloud
  4. API Docs
  5. onCall
  6. getUsers
Viewing docs for Grafana v2.45.0
published on Monday, Nov 9, 2026 by pulumiverse
grafana logo Grafana
Viewing docs for Grafana v2.45.0
published on Monday, Nov 9, 2026 by pulumiverse

    Lists every user in Grafana OnCall. Each plan reads the full user list from the API and stores it in state, so in organizations with many users every plan makes more API requests. To look up a single user, use grafana.onCall.getUser.

    Each user’s username is their Grafana login, which can differ from their email address. To refer to users by email, build a map from email to id, as shown in the example.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as grafana from "@pulumiverse/grafana";
    import * as std from "@pulumi/std";
    
    const all = grafana.onCall.getUsers({});
    const oncallUserIdsByEmail = Promise.all([all, std.lower({
        input: user.email,
    })]).then(([all, invoke]) => .reduce((__obj, user) => ({ ...__obj, [invoke.result]: user.id })));
    export const alfaOncallUserId = oncallUserIdsByEmail["alfa@example.com"];
    
    import pulumi
    import pulumi_grafana as grafana
    import pulumi_std as std
    
    all = grafana.onCall.get_users()
    oncall_user_ids_by_email = {std.lower(input=user.email).result: user.id for user in all.users}
    pulumi.export("alfaOncallUserId", oncall_user_ids_by_email["alfa@example.com"])
    
    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 all = Grafana.OnCall.GetUsers.Invoke();
    
        var oncallUserIdsByEmail = Output.Tuple(all, Std.Lower.Invoke(new()
        {
            Input = user.Email,
        })).Apply(values =>
        {
            var all = values.Item1;
            var invoke = values.Item2;
            return .ToDictionary(item => {
                return invoke.Result;
            }, item => {
                var user = item.Value;
                return user.Id;
            });
        });
    
        return new Dictionary<string, object?>
        {
            ["alfaOncallUserId"] = oncallUserIdsByEmail.Alfa_example_com,
        };
    });
    
    Example coming soon!
    
    Example coming soon!
    
    Example coming soon!
    

    Using getUsers

    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 getUsers(opts?: InvokeOptions): Promise<GetUsersResult>
    function getUsersOutput(opts?: InvokeOutputOptions): Output<GetUsersResult>
    def get_users(opts: Optional[InvokeOptions] = None) -> GetUsersResult
    def get_users_output(opts: Optional[InvokeOutputOptions] = None) -> Output[GetUsersResult]
    func GetUsers(ctx *Context, opts ...InvokeOption) (*GetUsersResult, error)
    func GetUsersOutput(ctx *Context, opts ...InvokeOption) GetUsersResultOutput

    > Note: This function is named GetUsers in the Go SDK.

    public static class GetUsers 
    {
        public static Task<GetUsersResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetUsersResult> Invoke(InvokeOptions? opts = null)
        public static Output<GetUsersResult> Invoke(InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetUsersResult> getUsers(InvokeOptions options)
    public static Output<GetUsersResult> getUsers(InvokeOptions options)
    public static Output<GetUsersResult> getUsers(InvokeOutputOptions options)
    
    fn::invoke:
      function: grafana:onCall/getUsers:getUsers
      arguments:
        # arguments dictionary
    data "grafana_on_call_get_users" "name" {
        # arguments
    }

    getUsers Result

    The following output properties are available:

    Id string
    The ID of this resource.
    Users List<Pulumiverse.Grafana.OnCall.Outputs.GetUsersUser>
    Every OnCall user, with their ID, username (the Grafana login), email, and role.
    Id string
    The ID of this resource.
    Users []GetUsersUser
    Every OnCall user, with their ID, username (the Grafana login), email, and role.
    id string
    The ID of this resource.
    users list(object)
    Every OnCall user, with their ID, username (the Grafana login), email, and role.
    id String
    The ID of this resource.
    users List<GetUsersUser>
    Every OnCall user, with their ID, username (the Grafana login), email, and role.
    id string
    The ID of this resource.
    users GetUsersUser[]
    Every OnCall user, with their ID, username (the Grafana login), email, and role.
    id str
    The ID of this resource.
    users Sequence[GetUsersUser]
    Every OnCall user, with their ID, username (the Grafana login), email, and role.
    id String
    The ID of this resource.
    users List<Property Map>
    Every OnCall user, with their ID, username (the Grafana login), email, and role.

    Supporting Types

    GetUsersUser

    Email string
    Id string
    Role string
    Username string
    Email string
    Id string
    Role string
    Username string
    email string
    id string
    role string
    username string
    email String
    id String
    role String
    username String
    email string
    id string
    role string
    username string
    email str
    id str
    role str
    username str
    email String
    id String
    role String
    username String

    Package Details

    Repository
    grafana pulumiverse/pulumi-grafana
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the grafana Terraform Provider.
    grafana logo Grafana
    Viewing docs for Grafana v2.45.0
    published on Monday, Nov 9, 2026 by pulumiverse

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial