/
getPools.go
67 lines (63 loc) · 2.04 KB
/
getPools.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package agent
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Use this data source to access information about existing Agent Pools within Azure DevOps.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-azuredevops/sdk/go/azuredevops"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// pools, err := azuredevops.GetPools(ctx, nil, nil)
// if err != nil {
// return err
// }
// var splat0 []string
// for _, val0 := range pools.AgentPools {
// splat0 = append(splat0, val0.Name)
// }
// ctx.Export("agentPoolName", splat0)
// var splat1 []bool
// for _, val0 := range pools.AgentPools {
// splat1 = append(splat1, val0.AutoProvision)
// }
// ctx.Export("autoProvision", splat1)
// var splat2 []string
// for _, val0 := range pools.AgentPools {
// splat2 = append(splat2, val0.PoolType)
// }
// ctx.Export("poolType", splat2)
// return nil
// })
// }
// ```
// ## Relevant Links
//
// - [Azure DevOps Service REST API 5.1 - Agent Pools - Get](https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/pools/get?view=azure-devops-rest-5.1)
//
// Deprecated: azuredevops.agent.getPools has been deprecated in favor of azuredevops.getPools
func GetPools(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetPoolsResult, error) {
var rv GetPoolsResult
err := ctx.Invoke("azuredevops:Agent/getPools:getPools", nil, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of values returned by getPools.
type GetPoolsResult struct {
// A list of existing agent pools in your Azure DevOps Organization with the following details about every agent pool:
AgentPools []GetPoolsAgentPool `pulumi:"agentPools"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
}