Azure DevOps v3.4.0 published on Wednesday, Oct 30, 2024 by Pulumi
azuredevops.getTeams
Explore with Pulumi AI
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!
Relevant Links
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:
- 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
.
getTeams Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Teams
List<Pulumi.
Azure Dev Ops. Outputs. Get Teams Team> - A list of existing projects in your Azure DevOps Organization with details about every project which includes:
- Project
Id string - Project identifier.
- `id - Team identifier
- Top int
- Id string
- The provider-assigned unique ID for this managed resource.
- Teams
[]Get
Teams Team - A list of existing projects in your Azure DevOps Organization with details about every project which includes:
- Project
Id string - Project identifier.
- `id - Team identifier
- Top int
- id String
- The provider-assigned unique ID for this managed resource.
- teams
List<Get
Teams Team> - A list of existing projects in your Azure DevOps Organization with details about every project which includes:
- project
Id String - Project identifier.
- `id - Team identifier
- top Integer
- id string
- The provider-assigned unique ID for this managed resource.
- teams
Get
Teams Team[] - A list of existing projects in your Azure DevOps Organization with details about every project which includes:
- project
Id string - Project identifier.
- `id - Team identifier
- top number
- id str
- The provider-assigned unique ID for this managed resource.
- teams
Sequence[Get
Teams Team] - 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:
- project
Id 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.
- Project
Id 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.
- Project
Id 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.
- project
Id 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.
- project
Id 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.
- project
Id 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.