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

azuredevops.getAgentQueue

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 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("example", {
        name: "Example Project",
        workItemTemplate: "Agile",
        versionControl: "Git",
        visibility: "private",
        description: "Managed by Terraform",
    });
    const example = azuredevops.getAgentQueueOutput({
        projectId: exampleProject.id,
        name: "Example Agent Queue",
    });
    export const name = example.apply(example => example.name);
    export const poolId = example.apply(example => example.agentPoolId);
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example_project = azuredevops.Project("example",
        name="Example Project",
        work_item_template="Agile",
        version_control="Git",
        visibility="private",
        description="Managed by Terraform")
    example = azuredevops.get_agent_queue_output(project_id=example_project.id,
        name="Example Agent Queue")
    pulumi.export("name", example.name)
    pulumi.export("poolId", example.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, "example", &azuredevops.ProjectArgs{
    			Name:             pulumi.String("Example Project"),
    			WorkItemTemplate: pulumi.String("Agile"),
    			VersionControl:   pulumi.String("Git"),
    			Visibility:       pulumi.String("private"),
    			Description:      pulumi.String("Managed by Terraform"),
    		})
    		if err != nil {
    			return err
    		}
    		example := azuredevops.GetAgentQueueOutput(ctx, azuredevops.GetAgentQueueOutputArgs{
    			ProjectId: exampleProject.ID(),
    			Name:      pulumi.String("Example Agent Queue"),
    		}, nil)
    		ctx.Export("name", example.ApplyT(func(example azuredevops.GetAgentQueueResult) (*string, error) {
    			return &example.Name, nil
    		}).(pulumi.StringPtrOutput))
    		ctx.Export("poolId", example.ApplyT(func(example azuredevops.GetAgentQueueResult) (*int, error) {
    			return &example.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("example", new()
        {
            Name = "Example Project",
            WorkItemTemplate = "Agile",
            VersionControl = "Git",
            Visibility = "private",
            Description = "Managed by Terraform",
        });
    
        var example = AzureDevOps.GetAgentQueue.Invoke(new()
        {
            ProjectId = exampleProject.Id,
            Name = "Example Agent Queue",
        });
    
        return new Dictionary<string, object?>
        {
            ["name"] = example.Apply(getAgentQueueResult => getAgentQueueResult.Name),
            ["poolId"] = example.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()
                .name("Example Project")
                .workItemTemplate("Agile")
                .versionControl("Git")
                .visibility("private")
                .description("Managed by Terraform")
                .build());
    
            final var example = AzuredevopsFunctions.getAgentQueue(GetAgentQueueArgs.builder()
                .projectId(exampleProject.id())
                .name("Example Agent Queue")
                .build());
    
            ctx.export("name", example.applyValue(getAgentQueueResult -> getAgentQueueResult).applyValue(example -> example.applyValue(getAgentQueueResult -> getAgentQueueResult.name())));
            ctx.export("poolId", example.applyValue(getAgentQueueResult -> getAgentQueueResult).applyValue(example -> example.applyValue(getAgentQueueResult -> getAgentQueueResult.agentPoolId())));
        }
    }
    
    resources:
      exampleProject:
        type: azuredevops:Project
        name: example
        properties:
          name: Example Project
          workItemTemplate: Agile
          versionControl: Git
          visibility: private
          description: Managed by Terraform
    variables:
      example:
        fn::invoke:
          Function: azuredevops:getAgentQueue
          Arguments:
            projectId: ${exampleProject.id}
            name: Example Agent Queue
    outputs:
      name: ${example.name}
      poolId: ${example.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.4.0 published on Wednesday, Oct 30, 2024 by Pulumi