-
Notifications
You must be signed in to change notification settings - Fork 51
/
getResources.go
123 lines (103 loc) · 4.95 KB
/
getResources.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package core
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about existing resources.
func GetResources(ctx *pulumi.Context, args *GetResourcesArgs, opts ...pulumi.InvokeOption) (*GetResourcesResult, error) {
var rv GetResourcesResult
err := ctx.Invoke("azure:core/getResources:getResources", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getResources.
type GetResourcesArgs struct {
// The name of the Resource.
Name *string `pulumi:"name"`
// A mapping of tags which the resource has to have in order to be included in the result.
RequiredTags map[string]string `pulumi:"requiredTags"`
// The name of the Resource group where the Resources are located.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// The Resource Type of the Resources you want to list (e.g. `Microsoft.Network/virtualNetworks`). A full list of available Resource Types can be found [here](https://docs.microsoft.com/en-us/azure/azure-resource-manager/azure-services-resource-providers).
Type *string `pulumi:"type"`
}
// A collection of values returned by getResources.
type GetResourcesResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The name of this Resource.
Name string `pulumi:"name"`
RequiredTags map[string]string `pulumi:"requiredTags"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// One or more `resource` blocks as defined below.
Resources []GetResourcesResource `pulumi:"resources"`
// The type of this Resource. (e.g. `Microsoft.Network/virtualNetworks`).
Type string `pulumi:"type"`
}
func GetResourcesOutput(ctx *pulumi.Context, args GetResourcesOutputArgs, opts ...pulumi.InvokeOption) GetResourcesResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetResourcesResult, error) {
args := v.(GetResourcesArgs)
r, err := GetResources(ctx, &args, opts...)
var s GetResourcesResult
if r != nil {
s = *r
}
return s, err
}).(GetResourcesResultOutput)
}
// A collection of arguments for invoking getResources.
type GetResourcesOutputArgs struct {
// The name of the Resource.
Name pulumi.StringPtrInput `pulumi:"name"`
// A mapping of tags which the resource has to have in order to be included in the result.
RequiredTags pulumi.StringMapInput `pulumi:"requiredTags"`
// The name of the Resource group where the Resources are located.
ResourceGroupName pulumi.StringPtrInput `pulumi:"resourceGroupName"`
// The Resource Type of the Resources you want to list (e.g. `Microsoft.Network/virtualNetworks`). A full list of available Resource Types can be found [here](https://docs.microsoft.com/en-us/azure/azure-resource-manager/azure-services-resource-providers).
Type pulumi.StringPtrInput `pulumi:"type"`
}
func (GetResourcesOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetResourcesArgs)(nil)).Elem()
}
// A collection of values returned by getResources.
type GetResourcesResultOutput struct{ *pulumi.OutputState }
func (GetResourcesResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetResourcesResult)(nil)).Elem()
}
func (o GetResourcesResultOutput) ToGetResourcesResultOutput() GetResourcesResultOutput {
return o
}
func (o GetResourcesResultOutput) ToGetResourcesResultOutputWithContext(ctx context.Context) GetResourcesResultOutput {
return o
}
// The provider-assigned unique ID for this managed resource.
func (o GetResourcesResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetResourcesResult) string { return v.Id }).(pulumi.StringOutput)
}
// The name of this Resource.
func (o GetResourcesResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v GetResourcesResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o GetResourcesResultOutput) RequiredTags() pulumi.StringMapOutput {
return o.ApplyT(func(v GetResourcesResult) map[string]string { return v.RequiredTags }).(pulumi.StringMapOutput)
}
func (o GetResourcesResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v GetResourcesResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// One or more `resource` blocks as defined below.
func (o GetResourcesResultOutput) Resources() GetResourcesResourceArrayOutput {
return o.ApplyT(func(v GetResourcesResult) []GetResourcesResource { return v.Resources }).(GetResourcesResourceArrayOutput)
}
// The type of this Resource. (e.g. `Microsoft.Network/virtualNetworks`).
func (o GetResourcesResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v GetResourcesResult) string { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetResourcesResultOutput{})
}