1. Packages
  2. Packages
  3. Grafana Cloud
  4. API Docs
  5. oss
  6. getTeams
Viewing docs for Grafana v2.30.1
published on Thursday, May 28, 2026 by pulumiverse
grafana logo
Viewing docs for Grafana v2.30.1
published on Thursday, May 28, 2026 by pulumiverse

    Fetches a list of teams from Grafana, optionally filtered by a search keyword.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as grafana from "@pulumiverse/grafana";
    
    const all = grafana.oss.getTeams({});
    const dev = grafana.oss.getTeams({
        query: "dev",
    });
    
    import pulumi
    import pulumi_grafana as grafana
    
    all = grafana.oss.get_teams()
    dev = grafana.oss.get_teams(query="dev")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-grafana/sdk/v2/go/grafana/oss"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := oss.GetTeams(ctx, &oss.GetTeamsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = oss.GetTeams(ctx, &oss.GetTeamsArgs{
    			Query: pulumi.StringRef("dev"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Grafana = Pulumiverse.Grafana;
    
    return await Deployment.RunAsync(() => 
    {
        var all = Grafana.Oss.GetTeams.Invoke();
    
        var dev = Grafana.Oss.GetTeams.Invoke(new()
        {
            Query = "dev",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.grafana.oss.OssFunctions;
    import com.pulumi.grafana.oss.inputs.GetTeamsArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var all = OssFunctions.getTeams(GetTeamsArgs.builder()
                .build());
    
            final var dev = OssFunctions.getTeams(GetTeamsArgs.builder()
                .query("dev")
                .build());
    
        }
    }
    
    variables:
      all:
        fn::invoke:
          function: grafana:oss:getTeams
          arguments: {}
      dev:
        fn::invoke:
          function: grafana:oss:getTeams
          arguments:
            query: dev
    
    Example coming soon!
    

    Using getTeams

    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 getTeams(args: GetTeamsArgs, opts?: InvokeOptions): Promise<GetTeamsResult>
    function getTeamsOutput(args: GetTeamsOutputArgs, opts?: InvokeOptions): Output<GetTeamsResult>
    def get_teams(org_id: Optional[str] = None,
                  query: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetTeamsResult
    def get_teams_output(org_id: pulumi.Input[Optional[str]] = None,
                  query: pulumi.Input[Optional[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetTeamsResult]
    func GetTeams(ctx *Context, args *GetTeamsArgs, opts ...InvokeOption) (*GetTeamsResult, error)
    func GetTeamsOutput(ctx *Context, args *GetTeamsOutputArgs, opts ...InvokeOption) GetTeamsResultOutput

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

    public static class GetTeams 
    {
        public static Task<GetTeamsResult> InvokeAsync(GetTeamsArgs args, InvokeOptions? opts = null)
        public static Output<GetTeamsResult> Invoke(GetTeamsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTeamsResult> getTeams(GetTeamsArgs args, InvokeOptions options)
    public static Output<GetTeamsResult> getTeams(GetTeamsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: grafana:oss/getTeams:getTeams
      arguments:
        # arguments dictionary
    data "grafana_oss_getteams" "name" {
        # arguments
    }

    The following arguments are supported:

    OrgId string
    The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
    Query string
    A keyword to filter teams by name (substring match). If omitted, all teams are returned.
    OrgId string
    The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
    Query string
    A keyword to filter teams by name (substring match). If omitted, all teams are returned.
    org_id string
    The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
    query string
    A keyword to filter teams by name (substring match). If omitted, all teams are returned.
    orgId String
    The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
    query String
    A keyword to filter teams by name (substring match). If omitted, all teams are returned.
    orgId string
    The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
    query string
    A keyword to filter teams by name (substring match). If omitted, all teams are returned.
    org_id str
    The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
    query str
    A keyword to filter teams by name (substring match). If omitted, all teams are returned.
    orgId String
    The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
    query String
    A keyword to filter teams by name (substring match). If omitted, all teams are returned.

    getTeams Result

    The following output properties are available:

    Id string
    The ID of this resource.
    OrgId string
    The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
    Teams List<Pulumiverse.Grafana.Oss.Outputs.GetTeamsTeam>
    The list of matching Grafana teams.
    Query string
    A keyword to filter teams by name (substring match). If omitted, all teams are returned.
    Id string
    The ID of this resource.
    OrgId string
    The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
    Teams []GetTeamsTeam
    The list of matching Grafana teams.
    Query string
    A keyword to filter teams by name (substring match). If omitted, all teams are returned.
    id string
    The ID of this resource.
    org_id string
    The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
    teams list(object)
    The list of matching Grafana teams.
    query string
    A keyword to filter teams by name (substring match). If omitted, all teams are returned.
    id String
    The ID of this resource.
    orgId String
    The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
    teams List<GetTeamsTeam>
    The list of matching Grafana teams.
    query String
    A keyword to filter teams by name (substring match). If omitted, all teams are returned.
    id string
    The ID of this resource.
    orgId string
    The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
    teams GetTeamsTeam[]
    The list of matching Grafana teams.
    query string
    A keyword to filter teams by name (substring match). If omitted, all teams are returned.
    id str
    The ID of this resource.
    org_id str
    The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
    teams Sequence[GetTeamsTeam]
    The list of matching Grafana teams.
    query str
    A keyword to filter teams by name (substring match). If omitted, all teams are returned.
    id String
    The ID of this resource.
    orgId String
    The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
    teams List<Property Map>
    The list of matching Grafana teams.
    query String
    A keyword to filter teams by name (substring match). If omitted, all teams are returned.

    Supporting Types

    GetTeamsTeam

    Email string
    Id int
    MemberCount int
    Name string
    OrgId int
    Uid string
    Email string
    Id int
    MemberCount int
    Name string
    OrgId int
    Uid string
    email string
    id number
    member_count number
    name string
    org_id number
    uid string
    email String
    id Integer
    memberCount Integer
    name String
    orgId Integer
    uid String
    email string
    id number
    memberCount number
    name string
    orgId number
    uid string
    email str
    id int
    member_count int
    name str
    org_id int
    uid str
    email String
    id Number
    memberCount Number
    name String
    orgId Number
    uid 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
    Viewing docs for Grafana v2.30.1
    published on Thursday, May 28, 2026 by pulumiverse

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial