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

azuredevops.getAgentQueue

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 Agent Queue 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 exampleAgentQueue = azuredevops.getAgentQueueOutput({
        projectId: exampleProject.id,
        name: "Example Agent Queue",
    });
    export const name = exampleAgentQueue.apply(exampleAgentQueue => exampleAgentQueue.name);
    export const poolId = exampleAgentQueue.apply(exampleAgentQueue => exampleAgentQueue.agentPoolId);
    
    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_agent_queue = azuredevops.get_agent_queue_output(project_id=example_project.id,
        name="Example Agent Queue")
    pulumi.export("name", example_agent_queue.name)
    pulumi.export("poolId", example_agent_queue.agent_pool_id)
    
    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
    		}
    		exampleAgentQueue := azuredevops.GetAgentQueueOutput(ctx, azuredevops.GetAgentQueueOutputArgs{
    			ProjectId: exampleProject.ID(),
    			Name:      pulumi.String("Example Agent Queue"),
    		}, nil)
    		ctx.Export("name", exampleAgentQueue.ApplyT(func(exampleAgentQueue azuredevops.GetAgentQueueResult) (*string, error) {
    			return &exampleAgentQueue.Name, nil
    		}).(pulumi.StringPtrOutput))
    		ctx.Export("poolId", exampleAgentQueue.ApplyT(func(exampleAgentQueue azuredevops.GetAgentQueueResult) (*int, error) {
    			return &exampleAgentQueue.AgentPoolId, nil
    		}).(pulumi.IntPtrOutput))
    		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 exampleAgentQueue = AzureDevOps.GetAgentQueue.Invoke(new()
        {
            ProjectId = exampleProject.Id,
            Name = "Example Agent Queue",
        });
    
        return new Dictionary<string, object?>
        {
            ["name"] = exampleAgentQueue.Apply(getAgentQueueResult => getAgentQueueResult.Name),
            ["poolId"] = exampleAgentQueue.Apply(getAgentQueueResult => getAgentQueueResult.AgentPoolId),
        };
    });
    
    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.GetAgentQueueArgs;
    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 exampleAgentQueue = AzuredevopsFunctions.getAgentQueue(GetAgentQueueArgs.builder()
                .projectId(exampleProject.id())
                .name("Example Agent Queue")
                .build());
    
            ctx.export("name", exampleAgentQueue.applyValue(getAgentQueueResult -> getAgentQueueResult).applyValue(exampleAgentQueue -> exampleAgentQueue.applyValue(getAgentQueueResult -> getAgentQueueResult.name())));
            ctx.export("poolId", exampleAgentQueue.applyValue(getAgentQueueResult -> getAgentQueueResult).applyValue(exampleAgentQueue -> exampleAgentQueue.applyValue(getAgentQueueResult -> getAgentQueueResult.agentPoolId())));
        }
    }
    
    resources:
      exampleProject:
        type: azuredevops:Project
        properties:
          workItemTemplate: Agile
          versionControl: Git
          visibility: private
          description: Managed by Terraform
    variables:
      exampleAgentQueue:
        fn::invoke:
          Function: azuredevops:getAgentQueue
          Arguments:
            projectId: ${exampleProject.id}
            name: Example Agent Queue
    outputs:
      name: ${exampleAgentQueue.name}
      poolId: ${exampleAgentQueue.agentPoolId}
    

    Using getAgentQueue

    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 getAgentQueue(args: GetAgentQueueArgs, opts?: InvokeOptions): Promise<GetAgentQueueResult>
    function getAgentQueueOutput(args: GetAgentQueueOutputArgs, opts?: InvokeOptions): Output<GetAgentQueueResult>
    def get_agent_queue(name: Optional[str] = None,
                        project_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetAgentQueueResult
    def get_agent_queue_output(name: Optional[pulumi.Input[str]] = None,
                        project_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetAgentQueueResult]
    func GetAgentQueue(ctx *Context, args *GetAgentQueueArgs, opts ...InvokeOption) (*GetAgentQueueResult, error)
    func GetAgentQueueOutput(ctx *Context, args *GetAgentQueueOutputArgs, opts ...InvokeOption) GetAgentQueueResultOutput

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

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

    The following arguments are supported:

    Name string
    Name of the Agent Queue.
    ProjectId string
    The Project Id.
    Name string
    Name of the Agent Queue.
    ProjectId string
    The Project Id.
    name String
    Name of the Agent Queue.
    projectId String
    The Project Id.
    name string
    Name of the Agent Queue.
    projectId string
    The Project Id.
    name str
    Name of the Agent Queue.
    project_id str
    The Project Id.
    name String
    Name of the Agent Queue.
    projectId String
    The Project Id.

    getAgentQueue Result

    The following output properties are available:

    AgentPoolId int
    Agent pool identifier to which the agent queue belongs.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the agent queue.
    ProjectId string
    Project identifier to which the agent queue belongs.
    AgentPoolId int
    Agent pool identifier to which the agent queue belongs.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the agent queue.
    ProjectId string
    Project identifier to which the agent queue belongs.
    agentPoolId Integer
    Agent pool identifier to which the agent queue belongs.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the agent queue.
    projectId String
    Project identifier to which the agent queue belongs.
    agentPoolId number
    Agent pool identifier to which the agent queue belongs.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the agent queue.
    projectId string
    Project identifier to which the agent queue belongs.
    agent_pool_id int
    Agent pool identifier to which the agent queue belongs.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the agent queue.
    project_id str
    Project identifier to which the agent queue belongs.
    agentPoolId Number
    Agent pool identifier to which the agent queue belongs.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the agent queue.
    projectId String
    Project identifier to which the agent queue belongs.

    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