forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getDisk.go
204 lines (174 loc) · 7.5 KB
/
getDisk.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devtestlab
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure-native-sdk/v2/utilities"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Get disk.
// Azure REST API version: 2018-09-15.
//
// Other available API versions: 2016-05-15.
func LookupDisk(ctx *pulumi.Context, args *LookupDiskArgs, opts ...pulumi.InvokeOption) (*LookupDiskResult, error) {
opts = utilities.PkgInvokeDefaultOpts(opts)
var rv LookupDiskResult
err := ctx.Invoke("azure-native:devtestlab:getDisk", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupDiskArgs struct {
// Specify the $expand query. Example: 'properties($select=diskType)'
Expand *string `pulumi:"expand"`
// The name of the lab.
LabName string `pulumi:"labName"`
// The name of the disk.
Name string `pulumi:"name"`
// The name of the resource group.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The name of the user profile.
UserName string `pulumi:"userName"`
}
// A Disk.
type LookupDiskResult struct {
// The creation date of the disk.
CreatedDate string `pulumi:"createdDate"`
// When backed by a blob, the name of the VHD blob without extension.
DiskBlobName *string `pulumi:"diskBlobName"`
// The size of the disk in Gibibytes.
DiskSizeGiB *int `pulumi:"diskSizeGiB"`
// The storage type for the disk (i.e. Standard, Premium).
DiskType *string `pulumi:"diskType"`
// When backed by a blob, the URI of underlying blob.
DiskUri *string `pulumi:"diskUri"`
// The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite).
HostCaching *string `pulumi:"hostCaching"`
// The identifier of the resource.
Id string `pulumi:"id"`
// The resource ID of the VM to which this disk is leased.
LeasedByLabVmId *string `pulumi:"leasedByLabVmId"`
// The location of the resource.
Location *string `pulumi:"location"`
// When backed by managed disk, this is the ID of the compute disk resource.
ManagedDiskId *string `pulumi:"managedDiskId"`
// The name of the resource.
Name string `pulumi:"name"`
// The provisioning status of the resource.
ProvisioningState string `pulumi:"provisioningState"`
// When backed by a blob, the storage account where the blob is.
StorageAccountId *string `pulumi:"storageAccountId"`
// The tags of the resource.
Tags map[string]string `pulumi:"tags"`
// The type of the resource.
Type string `pulumi:"type"`
// The unique immutable identifier of a resource (Guid).
UniqueIdentifier string `pulumi:"uniqueIdentifier"`
}
func LookupDiskOutput(ctx *pulumi.Context, args LookupDiskOutputArgs, opts ...pulumi.InvokeOption) LookupDiskResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupDiskResult, error) {
args := v.(LookupDiskArgs)
r, err := LookupDisk(ctx, &args, opts...)
var s LookupDiskResult
if r != nil {
s = *r
}
return s, err
}).(LookupDiskResultOutput)
}
type LookupDiskOutputArgs struct {
// Specify the $expand query. Example: 'properties($select=diskType)'
Expand pulumi.StringPtrInput `pulumi:"expand"`
// The name of the lab.
LabName pulumi.StringInput `pulumi:"labName"`
// The name of the disk.
Name pulumi.StringInput `pulumi:"name"`
// The name of the resource group.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
// The name of the user profile.
UserName pulumi.StringInput `pulumi:"userName"`
}
func (LookupDiskOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDiskArgs)(nil)).Elem()
}
// A Disk.
type LookupDiskResultOutput struct{ *pulumi.OutputState }
func (LookupDiskResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDiskResult)(nil)).Elem()
}
func (o LookupDiskResultOutput) ToLookupDiskResultOutput() LookupDiskResultOutput {
return o
}
func (o LookupDiskResultOutput) ToLookupDiskResultOutputWithContext(ctx context.Context) LookupDiskResultOutput {
return o
}
// The creation date of the disk.
func (o LookupDiskResultOutput) CreatedDate() pulumi.StringOutput {
return o.ApplyT(func(v LookupDiskResult) string { return v.CreatedDate }).(pulumi.StringOutput)
}
// When backed by a blob, the name of the VHD blob without extension.
func (o LookupDiskResultOutput) DiskBlobName() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupDiskResult) *string { return v.DiskBlobName }).(pulumi.StringPtrOutput)
}
// The size of the disk in Gibibytes.
func (o LookupDiskResultOutput) DiskSizeGiB() pulumi.IntPtrOutput {
return o.ApplyT(func(v LookupDiskResult) *int { return v.DiskSizeGiB }).(pulumi.IntPtrOutput)
}
// The storage type for the disk (i.e. Standard, Premium).
func (o LookupDiskResultOutput) DiskType() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupDiskResult) *string { return v.DiskType }).(pulumi.StringPtrOutput)
}
// When backed by a blob, the URI of underlying blob.
func (o LookupDiskResultOutput) DiskUri() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupDiskResult) *string { return v.DiskUri }).(pulumi.StringPtrOutput)
}
// The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite).
func (o LookupDiskResultOutput) HostCaching() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupDiskResult) *string { return v.HostCaching }).(pulumi.StringPtrOutput)
}
// The identifier of the resource.
func (o LookupDiskResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupDiskResult) string { return v.Id }).(pulumi.StringOutput)
}
// The resource ID of the VM to which this disk is leased.
func (o LookupDiskResultOutput) LeasedByLabVmId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupDiskResult) *string { return v.LeasedByLabVmId }).(pulumi.StringPtrOutput)
}
// The location of the resource.
func (o LookupDiskResultOutput) Location() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupDiskResult) *string { return v.Location }).(pulumi.StringPtrOutput)
}
// When backed by managed disk, this is the ID of the compute disk resource.
func (o LookupDiskResultOutput) ManagedDiskId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupDiskResult) *string { return v.ManagedDiskId }).(pulumi.StringPtrOutput)
}
// The name of the resource.
func (o LookupDiskResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupDiskResult) string { return v.Name }).(pulumi.StringOutput)
}
// The provisioning status of the resource.
func (o LookupDiskResultOutput) ProvisioningState() pulumi.StringOutput {
return o.ApplyT(func(v LookupDiskResult) string { return v.ProvisioningState }).(pulumi.StringOutput)
}
// When backed by a blob, the storage account where the blob is.
func (o LookupDiskResultOutput) StorageAccountId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupDiskResult) *string { return v.StorageAccountId }).(pulumi.StringPtrOutput)
}
// The tags of the resource.
func (o LookupDiskResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupDiskResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// The type of the resource.
func (o LookupDiskResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupDiskResult) string { return v.Type }).(pulumi.StringOutput)
}
// The unique immutable identifier of a resource (Guid).
func (o LookupDiskResultOutput) UniqueIdentifier() pulumi.StringOutput {
return o.ApplyT(func(v LookupDiskResult) string { return v.UniqueIdentifier }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupDiskResultOutput{})
}