1. Packages
  2. GitHub
  3. API Docs
  4. getOrganizationTeams
GitHub v6.2.2 published on Tuesday, Jun 18, 2024 by Pulumi

github.getOrganizationTeams

Explore with Pulumi AI

github logo
GitHub v6.2.2 published on Tuesday, Jun 18, 2024 by Pulumi

    Use this data source to retrieve information about all GitHub teams in an organization.

    Example Usage

    To retrieve all teams of the organization:

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const all = github.getOrganizationTeams({});
    
    import pulumi
    import pulumi_github as github
    
    all = github.get_organization_teams()
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-github/sdk/v6/go/github"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := github.GetOrganizationTeams(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        var all = Github.GetOrganizationTeams.Invoke();
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.GithubFunctions;
    import com.pulumi.github.inputs.GetOrganizationTeamsArgs;
    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 = GithubFunctions.getOrganizationTeams();
    
        }
    }
    
    variables:
      all:
        fn::invoke:
          Function: github:getOrganizationTeams
          Arguments: {}
    

    To retrieve only the team’s at the root of the organization:

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const rootTeams = github.getOrganizationTeams({
        rootTeamsOnly: true,
    });
    
    import pulumi
    import pulumi_github as github
    
    root_teams = github.get_organization_teams(root_teams_only=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-github/sdk/v6/go/github"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := github.GetOrganizationTeams(ctx, &github.GetOrganizationTeamsArgs{
    			RootTeamsOnly: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        var rootTeams = Github.GetOrganizationTeams.Invoke(new()
        {
            RootTeamsOnly = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.GithubFunctions;
    import com.pulumi.github.inputs.GetOrganizationTeamsArgs;
    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 rootTeams = GithubFunctions.getOrganizationTeams(GetOrganizationTeamsArgs.builder()
                .rootTeamsOnly(true)
                .build());
    
        }
    }
    
    variables:
      rootTeams:
        fn::invoke:
          Function: github:getOrganizationTeams
          Arguments:
            rootTeamsOnly: true
    

    Using getOrganizationTeams

    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 getOrganizationTeams(args: GetOrganizationTeamsArgs, opts?: InvokeOptions): Promise<GetOrganizationTeamsResult>
    function getOrganizationTeamsOutput(args: GetOrganizationTeamsOutputArgs, opts?: InvokeOptions): Output<GetOrganizationTeamsResult>
    def get_organization_teams(results_per_page: Optional[int] = None,
                               root_teams_only: Optional[bool] = None,
                               summary_only: Optional[bool] = None,
                               opts: Optional[InvokeOptions] = None) -> GetOrganizationTeamsResult
    def get_organization_teams_output(results_per_page: Optional[pulumi.Input[int]] = None,
                               root_teams_only: Optional[pulumi.Input[bool]] = None,
                               summary_only: Optional[pulumi.Input[bool]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetOrganizationTeamsResult]
    func GetOrganizationTeams(ctx *Context, args *GetOrganizationTeamsArgs, opts ...InvokeOption) (*GetOrganizationTeamsResult, error)
    func GetOrganizationTeamsOutput(ctx *Context, args *GetOrganizationTeamsOutputArgs, opts ...InvokeOption) GetOrganizationTeamsResultOutput

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

    public static class GetOrganizationTeams 
    {
        public static Task<GetOrganizationTeamsResult> InvokeAsync(GetOrganizationTeamsArgs args, InvokeOptions? opts = null)
        public static Output<GetOrganizationTeamsResult> Invoke(GetOrganizationTeamsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetOrganizationTeamsResult> getOrganizationTeams(GetOrganizationTeamsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: github:index/getOrganizationTeams:getOrganizationTeams
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ResultsPerPage int
    (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to 100.
    RootTeamsOnly bool
    (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to false.
    SummaryOnly bool
    (Optional) Exclude the members and repositories of the team from the returned result. Defaults to false.
    ResultsPerPage int
    (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to 100.
    RootTeamsOnly bool
    (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to false.
    SummaryOnly bool
    (Optional) Exclude the members and repositories of the team from the returned result. Defaults to false.
    resultsPerPage Integer
    (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to 100.
    rootTeamsOnly Boolean
    (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to false.
    summaryOnly Boolean
    (Optional) Exclude the members and repositories of the team from the returned result. Defaults to false.
    resultsPerPage number
    (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to 100.
    rootTeamsOnly boolean
    (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to false.
    summaryOnly boolean
    (Optional) Exclude the members and repositories of the team from the returned result. Defaults to false.
    results_per_page int
    (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to 100.
    root_teams_only bool
    (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to false.
    summary_only bool
    (Optional) Exclude the members and repositories of the team from the returned result. Defaults to false.
    resultsPerPage Number
    (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to 100.
    rootTeamsOnly Boolean
    (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to false.
    summaryOnly Boolean
    (Optional) Exclude the members and repositories of the team from the returned result. Defaults to false.

    getOrganizationTeams Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Teams List<GetOrganizationTeamsTeam>
    (Required) An Array of GitHub Teams. Each team block consists of the fields documented below.
    ResultsPerPage int
    (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to 100.
    RootTeamsOnly bool
    (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to false.
    SummaryOnly bool
    (Optional) Exclude the members and repositories of the team from the returned result. Defaults to false.
    Id string
    The provider-assigned unique ID for this managed resource.
    Teams []GetOrganizationTeamsTeam
    (Required) An Array of GitHub Teams. Each team block consists of the fields documented below.
    ResultsPerPage int
    (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to 100.
    RootTeamsOnly bool
    (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to false.
    SummaryOnly bool
    (Optional) Exclude the members and repositories of the team from the returned result. Defaults to false.
    id String
    The provider-assigned unique ID for this managed resource.
    teams List<GetOrganizationTeamsTeam>
    (Required) An Array of GitHub Teams. Each team block consists of the fields documented below.
    resultsPerPage Integer
    (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to 100.
    rootTeamsOnly Boolean
    (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to false.
    summaryOnly Boolean
    (Optional) Exclude the members and repositories of the team from the returned result. Defaults to false.
    id string
    The provider-assigned unique ID for this managed resource.
    teams GetOrganizationTeamsTeam[]
    (Required) An Array of GitHub Teams. Each team block consists of the fields documented below.
    resultsPerPage number
    (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to 100.
    rootTeamsOnly boolean
    (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to false.
    summaryOnly boolean
    (Optional) Exclude the members and repositories of the team from the returned result. Defaults to false.
    id str
    The provider-assigned unique ID for this managed resource.
    teams Sequence[GetOrganizationTeamsTeam]
    (Required) An Array of GitHub Teams. Each team block consists of the fields documented below.
    results_per_page int
    (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to 100.
    root_teams_only bool
    (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to false.
    summary_only bool
    (Optional) Exclude the members and repositories of the team from the returned result. Defaults to false.
    id String
    The provider-assigned unique ID for this managed resource.
    teams List<Property Map>
    (Required) An Array of GitHub Teams. Each team block consists of the fields documented below.
    resultsPerPage Number
    (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to 100.
    rootTeamsOnly Boolean
    (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to false.
    summaryOnly Boolean
    (Optional) Exclude the members and repositories of the team from the returned result. Defaults to false.

    Supporting Types

    GetOrganizationTeamsTeam

    Description string
    the team's description.
    Id int
    the ID of the team.
    Members List<string>
    List of team members. Not returned if summary_only = true
    Name string
    the team's full name.
    NodeId string
    the Node ID of the team.
    Parent Dictionary<string, string>
    the parent team.
    Privacy string
    the team's privacy type.
    Repositories List<string>
    List of team repositories. Not returned if summary_only = true
    Slug string
    the slug of the team.
    Description string
    the team's description.
    Id int
    the ID of the team.
    Members []string
    List of team members. Not returned if summary_only = true
    Name string
    the team's full name.
    NodeId string
    the Node ID of the team.
    Parent map[string]string
    the parent team.
    Privacy string
    the team's privacy type.
    Repositories []string
    List of team repositories. Not returned if summary_only = true
    Slug string
    the slug of the team.
    description String
    the team's description.
    id Integer
    the ID of the team.
    members List<String>
    List of team members. Not returned if summary_only = true
    name String
    the team's full name.
    nodeId String
    the Node ID of the team.
    parent Map<String,String>
    the parent team.
    privacy String
    the team's privacy type.
    repositories List<String>
    List of team repositories. Not returned if summary_only = true
    slug String
    the slug of the team.
    description string
    the team's description.
    id number
    the ID of the team.
    members string[]
    List of team members. Not returned if summary_only = true
    name string
    the team's full name.
    nodeId string
    the Node ID of the team.
    parent {[key: string]: string}
    the parent team.
    privacy string
    the team's privacy type.
    repositories string[]
    List of team repositories. Not returned if summary_only = true
    slug string
    the slug of the team.
    description str
    the team's description.
    id int
    the ID of the team.
    members Sequence[str]
    List of team members. Not returned if summary_only = true
    name str
    the team's full name.
    node_id str
    the Node ID of the team.
    parent Mapping[str, str]
    the parent team.
    privacy str
    the team's privacy type.
    repositories Sequence[str]
    List of team repositories. Not returned if summary_only = true
    slug str
    the slug of the team.
    description String
    the team's description.
    id Number
    the ID of the team.
    members List<String>
    List of team members. Not returned if summary_only = true
    name String
    the team's full name.
    nodeId String
    the Node ID of the team.
    parent Map<String>
    the parent team.
    privacy String
    the team's privacy type.
    repositories List<String>
    List of team repositories. Not returned if summary_only = true
    slug String
    the slug of the team.

    Package Details

    Repository
    GitHub pulumi/pulumi-github
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the github Terraform Provider.
    github logo
    GitHub v6.2.2 published on Tuesday, Jun 18, 2024 by Pulumi