1. Packages
  2. Azuredevops Provider
  3. API Docs
  4. getTeams
Azure DevOps v3.4.0 published on Wednesday, Oct 30, 2024 by Pulumi

azuredevops.getTeams

Explore with Pulumi AI

azuredevops logo
Azure DevOps v3.4.0 published on Wednesday, Oct 30, 2024 by Pulumi

    Use this data source to access information about existing Teams in a Project or globally within an Azure DevOps organization

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const example = azuredevops.getTeams({});
    export const projectId = example.then(example => example.teams.map(__item => __item.projectId));
    export const name = example.then(example => example.teams.map(__item => __item.name));
    export const alladministrators = example.then(example => example.teams.map(__item => __item.administrators));
    export const administrators = example.then(example => example.teams.map(__item => __item.members));
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example = azuredevops.get_teams()
    pulumi.export("projectId", [__item.project_id for __item in example.teams])
    pulumi.export("name", [__item.name for __item in example.teams])
    pulumi.export("alladministrators", [__item.administrators for __item in example.teams])
    pulumi.export("administrators", [__item.members for __item in example.teams])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    example, err := azuredevops.GetTeams(ctx, &azuredevops.GetTeamsArgs{
    }, nil);
    if err != nil {
    return err
    }
    ctx.Export("projectId", pulumi.StringArray(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:3,11-37)))
    ctx.Export("name", pulumi.StringArray(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:7,11-32)))
    ctx.Export("alladministrators", []interface{}(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:11,11-42)))
    ctx.Export("administrators", []interface{}(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:15,11-35)))
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AzureDevOps.GetTeams.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["projectId"] = example.Apply(getTeamsResult => getTeamsResult.Teams).Select(__item => __item.ProjectId).ToList(),
            ["name"] = example.Apply(getTeamsResult => getTeamsResult.Teams).Select(__item => __item.Name).ToList(),
            ["alladministrators"] = example.Apply(getTeamsResult => getTeamsResult.Teams).Select(__item => __item.Administrators).ToList(),
            ["administrators"] = example.Apply(getTeamsResult => getTeamsResult.Teams).Select(__item => __item.Members).ToList(),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuredevops.AzuredevopsFunctions;
    import com.pulumi.azuredevops.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 example = AzuredevopsFunctions.getTeams();
    
            ctx.export("projectId", example.applyValue(getTeamsResult -> getTeamsResult.teams()).stream().map(element -> element.projectId()).collect(toList()));
            ctx.export("name", example.applyValue(getTeamsResult -> getTeamsResult.teams()).stream().map(element -> element.name()).collect(toList()));
            ctx.export("alladministrators", example.applyValue(getTeamsResult -> getTeamsResult.teams()).stream().map(element -> element.administrators()).collect(toList()));
            ctx.export("administrators", example.applyValue(getTeamsResult -> getTeamsResult.teams()).stream().map(element -> element.members()).collect(toList()));
        }
    }
    
    Coming soon!
    

    PAT Permissions Required

    • vso.project: Grants the ability to read projects and teams.

    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(project_id: Optional[str] = None,
                  top: Optional[int] = None,
                  opts: Optional[InvokeOptions] = None) -> GetTeamsResult
    def get_teams_output(project_id: Optional[pulumi.Input[str]] = None,
                  top: Optional[pulumi.Input[int]] = 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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azuredevops:index/getTeams:getTeams
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ProjectId string
    The Project ID. If no project ID all teams of the organization will be returned.
    Top int
    The maximum number of teams to return. Defaults to 100.
    ProjectId string
    The Project ID. If no project ID all teams of the organization will be returned.
    Top int
    The maximum number of teams to return. Defaults to 100.
    projectId String
    The Project ID. If no project ID all teams of the organization will be returned.
    top Integer
    The maximum number of teams to return. Defaults to 100.
    projectId string
    The Project ID. If no project ID all teams of the organization will be returned.
    top number
    The maximum number of teams to return. Defaults to 100.
    project_id str
    The Project ID. If no project ID all teams of the organization will be returned.
    top int
    The maximum number of teams to return. Defaults to 100.
    projectId String
    The Project ID. If no project ID all teams of the organization will be returned.
    top Number
    The maximum number of teams to return. Defaults to 100.

    getTeams Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Teams List<Pulumi.AzureDevOps.Outputs.GetTeamsTeam>
    A list of existing projects in your Azure DevOps Organization with details about every project which includes:
    ProjectId string
    Project identifier.

    • `id - Team identifier
    Top int
    Id string
    The provider-assigned unique ID for this managed resource.
    Teams []GetTeamsTeam
    A list of existing projects in your Azure DevOps Organization with details about every project which includes:
    ProjectId string
    Project identifier.

    • `id - Team identifier
    Top int
    id String
    The provider-assigned unique ID for this managed resource.
    teams List<GetTeamsTeam>
    A list of existing projects in your Azure DevOps Organization with details about every project which includes:
    projectId String
    Project identifier.

    • `id - Team identifier
    top Integer
    id string
    The provider-assigned unique ID for this managed resource.
    teams GetTeamsTeam[]
    A list of existing projects in your Azure DevOps Organization with details about every project which includes:
    projectId string
    Project identifier.

    • `id - Team identifier
    top number
    id str
    The provider-assigned unique ID for this managed resource.
    teams Sequence[GetTeamsTeam]
    A list of existing projects in your Azure DevOps Organization with details about every project which includes:
    project_id str
    Project identifier.

    • `id - Team identifier
    top int
    id String
    The provider-assigned unique ID for this managed resource.
    teams List<Property Map>
    A list of existing projects in your Azure DevOps Organization with details about every project which includes:
    projectId String
    Project identifier.

    • `id - Team identifier
    top Number

    Supporting Types

    GetTeamsTeam

    Administrators List<string>
    List of subject descriptors for administrators of the team.
    Description string
    Team description.
    Id string
    Members List<string>
    List of subject descriptors for members of the team.
    Name string
    Team name.
    ProjectId string
    The Project ID. If no project ID all teams of the organization will be returned.
    Administrators []string
    List of subject descriptors for administrators of the team.
    Description string
    Team description.
    Id string
    Members []string
    List of subject descriptors for members of the team.
    Name string
    Team name.
    ProjectId string
    The Project ID. If no project ID all teams of the organization will be returned.
    administrators List<String>
    List of subject descriptors for administrators of the team.
    description String
    Team description.
    id String
    members List<String>
    List of subject descriptors for members of the team.
    name String
    Team name.
    projectId String
    The Project ID. If no project ID all teams of the organization will be returned.
    administrators string[]
    List of subject descriptors for administrators of the team.
    description string
    Team description.
    id string
    members string[]
    List of subject descriptors for members of the team.
    name string
    Team name.
    projectId string
    The Project ID. If no project ID all teams of the organization will be returned.
    administrators Sequence[str]
    List of subject descriptors for administrators of the team.
    description str
    Team description.
    id str
    members Sequence[str]
    List of subject descriptors for members of the team.
    name str
    Team name.
    project_id str
    The Project ID. If no project ID all teams of the organization will be returned.
    administrators List<String>
    List of subject descriptors for administrators of the team.
    description String
    Team description.
    id String
    members List<String>
    List of subject descriptors for members of the team.
    name String
    Team name.
    projectId String
    The Project ID. If no project ID all teams of the organization will be returned.

    Package Details

    Repository
    Azure DevOps pulumi/pulumi-azuredevops
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azuredevops Terraform Provider.
    azuredevops logo
    Azure DevOps v3.4.0 published on Wednesday, Oct 30, 2024 by Pulumi