1. Packages
  2. AzureDevOps
  3. API Docs
  4. getArea
Azure DevOps v3.0.0 published on Friday, Mar 15, 2024 by Pulumi

azuredevops.getArea

Explore with Pulumi AI

azuredevops logo
Azure DevOps v3.0.0 published on Friday, Mar 15, 2024 by Pulumi

    Use this data source to access information about an existing Area (Component) within Azure DevOps.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const exampleProject = new azuredevops.Project("exampleProject", {
        workItemTemplate: "Agile",
        versionControl: "Git",
        visibility: "private",
        description: "Managed by Terraform",
    });
    const exampleArea = exampleProject.id.apply(id => azuredevops.getAreaOutput({
        projectId: id,
        path: "/",
        fetchChildren: false,
    }));
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example_project = azuredevops.Project("exampleProject",
        work_item_template="Agile",
        version_control="Git",
        visibility="private",
        description="Managed by Terraform")
    example_area = example_project.id.apply(lambda id: azuredevops.get_area_output(project_id=id,
        path="/",
        fetch_children=False))
    
    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 {
    		exampleProject, err := azuredevops.NewProject(ctx, "exampleProject", &azuredevops.ProjectArgs{
    			WorkItemTemplate: pulumi.String("Agile"),
    			VersionControl:   pulumi.String("Git"),
    			Visibility:       pulumi.String("private"),
    			Description:      pulumi.String("Managed by Terraform"),
    		})
    		if err != nil {
    			return err
    		}
    		_ = exampleProject.ID().ApplyT(func(id string) (azuredevops.GetAreaResult, error) {
    			return azuredevops.GetAreaOutput(ctx, azuredevops.GetAreaOutputArgs{
    				ProjectId:     id,
    				Path:          "/",
    				FetchChildren: false,
    			}, nil), nil
    		}).(azuredevops.GetAreaResultOutput)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleProject = new AzureDevOps.Project("exampleProject", new()
        {
            WorkItemTemplate = "Agile",
            VersionControl = "Git",
            Visibility = "private",
            Description = "Managed by Terraform",
        });
    
        var exampleArea = AzureDevOps.GetArea.Invoke(new()
        {
            ProjectId = exampleProject.Id,
            Path = "/",
            FetchChildren = false,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuredevops.Project;
    import com.pulumi.azuredevops.ProjectArgs;
    import com.pulumi.azuredevops.AzuredevopsFunctions;
    import com.pulumi.azuredevops.inputs.GetAreaArgs;
    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) {
            var exampleProject = new Project("exampleProject", ProjectArgs.builder()        
                .workItemTemplate("Agile")
                .versionControl("Git")
                .visibility("private")
                .description("Managed by Terraform")
                .build());
    
            final var exampleArea = AzuredevopsFunctions.getArea(GetAreaArgs.builder()
                .projectId(exampleProject.id())
                .path("/")
                .fetchChildren("false")
                .build());
    
        }
    }
    
    resources:
      exampleProject:
        type: azuredevops:Project
        properties:
          workItemTemplate: Agile
          versionControl: Git
          visibility: private
          description: Managed by Terraform
    variables:
      exampleArea:
        fn::invoke:
          Function: azuredevops:getArea
          Arguments:
            projectId: ${exampleProject.id}
            path: /
            fetchChildren: 'false'
    

    PAT Permissions Required

    • Project & Team: vso.work - Grants the ability to read work items, queries, boards, area and iterations paths, and other work item tracking related metadata. Also grants the ability to execute queries, search work items and to receive notifications about work item events via service hooks.

    Using getArea

    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 getArea(args: GetAreaArgs, opts?: InvokeOptions): Promise<GetAreaResult>
    function getAreaOutput(args: GetAreaOutputArgs, opts?: InvokeOptions): Output<GetAreaResult>
    def get_area(fetch_children: Optional[bool] = None,
                 path: Optional[str] = None,
                 project_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetAreaResult
    def get_area_output(fetch_children: Optional[pulumi.Input[bool]] = None,
                 path: Optional[pulumi.Input[str]] = None,
                 project_id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetAreaResult]
    func GetArea(ctx *Context, args *GetAreaArgs, opts ...InvokeOption) (*GetAreaResult, error)
    func GetAreaOutput(ctx *Context, args *GetAreaOutputArgs, opts ...InvokeOption) GetAreaResultOutput

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

    public static class GetArea 
    {
        public static Task<GetAreaResult> InvokeAsync(GetAreaArgs args, InvokeOptions? opts = null)
        public static Output<GetAreaResult> Invoke(GetAreaInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAreaResult> getArea(GetAreaArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azuredevops:index/getArea:getArea
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ProjectId string
    The project ID.
    FetchChildren bool
    Read children nodes, Depth: 1, Default: true
    Path string
    The path to the Area; Format: URL relative; if omitted, or value "/" is used, the root Area will be returned
    ProjectId string
    The project ID.
    FetchChildren bool
    Read children nodes, Depth: 1, Default: true
    Path string
    The path to the Area; Format: URL relative; if omitted, or value "/" is used, the root Area will be returned
    projectId String
    The project ID.
    fetchChildren Boolean
    Read children nodes, Depth: 1, Default: true
    path String
    The path to the Area; Format: URL relative; if omitted, or value "/" is used, the root Area will be returned
    projectId string
    The project ID.
    fetchChildren boolean
    Read children nodes, Depth: 1, Default: true
    path string
    The path to the Area; Format: URL relative; if omitted, or value "/" is used, the root Area will be returned
    project_id str
    The project ID.
    fetch_children bool
    Read children nodes, Depth: 1, Default: true
    path str
    The path to the Area; Format: URL relative; if omitted, or value "/" is used, the root Area will be returned
    projectId String
    The project ID.
    fetchChildren Boolean
    Read children nodes, Depth: 1, Default: true
    path String
    The path to the Area; Format: URL relative; if omitted, or value "/" is used, the root Area will be returned

    getArea Result

    The following output properties are available:

    Childrens List<Pulumi.AzureDevOps.Outputs.GetAreaChildren>
    A list of children blocks as defined below, empty if has_children == false
    HasChildren bool
    Indicator if the child Area node has child nodes
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the child Area node
    Path string
    The complete path (in relative URL format) of the child Area
    ProjectId string
    The project ID of the child Area node
    FetchChildren bool
    Childrens []GetAreaChildren
    A list of children blocks as defined below, empty if has_children == false
    HasChildren bool
    Indicator if the child Area node has child nodes
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the child Area node
    Path string
    The complete path (in relative URL format) of the child Area
    ProjectId string
    The project ID of the child Area node
    FetchChildren bool
    childrens List<GetAreaChildren>
    A list of children blocks as defined below, empty if has_children == false
    hasChildren Boolean
    Indicator if the child Area node has child nodes
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the child Area node
    path String
    The complete path (in relative URL format) of the child Area
    projectId String
    The project ID of the child Area node
    fetchChildren Boolean
    childrens GetAreaChildren[]
    A list of children blocks as defined below, empty if has_children == false
    hasChildren boolean
    Indicator if the child Area node has child nodes
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the child Area node
    path string
    The complete path (in relative URL format) of the child Area
    projectId string
    The project ID of the child Area node
    fetchChildren boolean
    childrens Sequence[GetAreaChildren]
    A list of children blocks as defined below, empty if has_children == false
    has_children bool
    Indicator if the child Area node has child nodes
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the child Area node
    path str
    The complete path (in relative URL format) of the child Area
    project_id str
    The project ID of the child Area node
    fetch_children bool
    childrens List<Property Map>
    A list of children blocks as defined below, empty if has_children == false
    hasChildren Boolean
    Indicator if the child Area node has child nodes
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the child Area node
    path String
    The complete path (in relative URL format) of the child Area
    projectId String
    The project ID of the child Area node
    fetchChildren Boolean

    Supporting Types

    GetAreaChildren

    HasChildren bool
    Indicator if the child Area node has child nodes
    Id string
    The id of the child Area node
    Name string
    The name of the child Area node
    Path string
    The path to the Area; Format: URL relative; if omitted, or value "/" is used, the root Area will be returned
    ProjectId string
    The project ID.
    HasChildren bool
    Indicator if the child Area node has child nodes
    Id string
    The id of the child Area node
    Name string
    The name of the child Area node
    Path string
    The path to the Area; Format: URL relative; if omitted, or value "/" is used, the root Area will be returned
    ProjectId string
    The project ID.
    hasChildren Boolean
    Indicator if the child Area node has child nodes
    id String
    The id of the child Area node
    name String
    The name of the child Area node
    path String
    The path to the Area; Format: URL relative; if omitted, or value "/" is used, the root Area will be returned
    projectId String
    The project ID.
    hasChildren boolean
    Indicator if the child Area node has child nodes
    id string
    The id of the child Area node
    name string
    The name of the child Area node
    path string
    The path to the Area; Format: URL relative; if omitted, or value "/" is used, the root Area will be returned
    projectId string
    The project ID.
    has_children bool
    Indicator if the child Area node has child nodes
    id str
    The id of the child Area node
    name str
    The name of the child Area node
    path str
    The path to the Area; Format: URL relative; if omitted, or value "/" is used, the root Area will be returned
    project_id str
    The project ID.
    hasChildren Boolean
    Indicator if the child Area node has child nodes
    id String
    The id of the child Area node
    name String
    The name of the child Area node
    path String
    The path to the Area; Format: URL relative; if omitted, or value "/" is used, the root Area will be returned
    projectId String
    The project ID.

    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.0.0 published on Friday, Mar 15, 2024 by Pulumi