forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getVirtualMachine.go
397 lines (341 loc) · 18 KB
/
getVirtualMachine.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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
// 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 virtual machine.
// Azure REST API version: 2018-09-15.
//
// Other available API versions: 2016-05-15.
func LookupVirtualMachine(ctx *pulumi.Context, args *LookupVirtualMachineArgs, opts ...pulumi.InvokeOption) (*LookupVirtualMachineResult, error) {
opts = utilities.PkgInvokeDefaultOpts(opts)
var rv LookupVirtualMachineResult
err := ctx.Invoke("azure-native:devtestlab:getVirtualMachine", args, &rv, opts...)
if err != nil {
return nil, err
}
return rv.Defaults(), nil
}
type LookupVirtualMachineArgs struct {
// Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'
Expand *string `pulumi:"expand"`
// The name of the lab.
LabName string `pulumi:"labName"`
// The name of the virtual machine.
Name string `pulumi:"name"`
// The name of the resource group.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A virtual machine.
type LookupVirtualMachineResult struct {
// Indicates whether another user can take ownership of the virtual machine
AllowClaim *bool `pulumi:"allowClaim"`
// The applicable schedule for the virtual machine.
ApplicableSchedule ApplicableScheduleResponse `pulumi:"applicableSchedule"`
// The artifact deployment status for the virtual machine.
ArtifactDeploymentStatus ArtifactDeploymentStatusPropertiesResponse `pulumi:"artifactDeploymentStatus"`
// The artifacts to be installed on the virtual machine.
Artifacts []ArtifactInstallPropertiesResponse `pulumi:"artifacts"`
// The resource identifier (Microsoft.Compute) of the virtual machine.
ComputeId string `pulumi:"computeId"`
// The compute virtual machine properties.
ComputeVm ComputeVmPropertiesResponse `pulumi:"computeVm"`
// The email address of creator of the virtual machine.
CreatedByUser string `pulumi:"createdByUser"`
// The object identifier of the creator of the virtual machine.
CreatedByUserId string `pulumi:"createdByUserId"`
// The creation date of the virtual machine.
CreatedDate *string `pulumi:"createdDate"`
// The custom image identifier of the virtual machine.
CustomImageId *string `pulumi:"customImageId"`
// New or existing data disks to attach to the virtual machine after creation
DataDiskParameters []DataDiskPropertiesResponse `pulumi:"dataDiskParameters"`
// Indicates whether the virtual machine is to be created without a public IP address.
DisallowPublicIpAddress *bool `pulumi:"disallowPublicIpAddress"`
// The resource ID of the environment that contains this virtual machine, if any.
EnvironmentId *string `pulumi:"environmentId"`
// The expiration date for VM.
ExpirationDate *string `pulumi:"expirationDate"`
// The fully-qualified domain name of the virtual machine.
Fqdn string `pulumi:"fqdn"`
// The Microsoft Azure Marketplace image reference of the virtual machine.
GalleryImageReference *GalleryImageReferenceResponse `pulumi:"galleryImageReference"`
// The identifier of the resource.
Id string `pulumi:"id"`
// Indicates whether this virtual machine uses an SSH key for authentication.
IsAuthenticationWithSshKey *bool `pulumi:"isAuthenticationWithSshKey"`
// The lab subnet name of the virtual machine.
LabSubnetName *string `pulumi:"labSubnetName"`
// The lab virtual network identifier of the virtual machine.
LabVirtualNetworkId *string `pulumi:"labVirtualNetworkId"`
// Last known compute power state captured in DTL
LastKnownPowerState string `pulumi:"lastKnownPowerState"`
// The location of the resource.
Location *string `pulumi:"location"`
// The name of the resource.
Name string `pulumi:"name"`
// The network interface properties.
NetworkInterface *NetworkInterfacePropertiesResponse `pulumi:"networkInterface"`
// The notes of the virtual machine.
Notes *string `pulumi:"notes"`
// The OS type of the virtual machine.
OsType string `pulumi:"osType"`
// The object identifier of the owner of the virtual machine.
OwnerObjectId *string `pulumi:"ownerObjectId"`
// The user principal name of the virtual machine owner.
OwnerUserPrincipalName *string `pulumi:"ownerUserPrincipalName"`
// The password of the virtual machine administrator.
Password *string `pulumi:"password"`
// The id of the plan associated with the virtual machine image
PlanId *string `pulumi:"planId"`
// The provisioning status of the resource.
ProvisioningState string `pulumi:"provisioningState"`
// Virtual Machine schedules to be created
ScheduleParameters []ScheduleCreationParameterResponse `pulumi:"scheduleParameters"`
// The size of the virtual machine.
Size *string `pulumi:"size"`
// The SSH key of the virtual machine administrator.
SshKey *string `pulumi:"sshKey"`
// Storage type to use for virtual machine (i.e. Standard, Premium).
StorageType *string `pulumi:"storageType"`
// 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"`
// The user name of the virtual machine.
UserName *string `pulumi:"userName"`
// Tells source of creation of lab virtual machine. Output property only.
VirtualMachineCreationSource string `pulumi:"virtualMachineCreationSource"`
}
// Defaults sets the appropriate defaults for LookupVirtualMachineResult
func (val *LookupVirtualMachineResult) Defaults() *LookupVirtualMachineResult {
if val == nil {
return nil
}
tmp := *val
if tmp.AllowClaim == nil {
allowClaim_ := false
tmp.AllowClaim = &allowClaim_
}
tmp.ApplicableSchedule = *tmp.ApplicableSchedule.Defaults()
if tmp.DisallowPublicIpAddress == nil {
disallowPublicIpAddress_ := false
tmp.DisallowPublicIpAddress = &disallowPublicIpAddress_
}
if tmp.OwnerObjectId == nil {
ownerObjectId_ := "dynamicValue"
tmp.OwnerObjectId = &ownerObjectId_
}
if tmp.StorageType == nil {
storageType_ := "labStorageType"
tmp.StorageType = &storageType_
}
return &tmp
}
func LookupVirtualMachineOutput(ctx *pulumi.Context, args LookupVirtualMachineOutputArgs, opts ...pulumi.InvokeOption) LookupVirtualMachineResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupVirtualMachineResult, error) {
args := v.(LookupVirtualMachineArgs)
r, err := LookupVirtualMachine(ctx, &args, opts...)
var s LookupVirtualMachineResult
if r != nil {
s = *r
}
return s, err
}).(LookupVirtualMachineResultOutput)
}
type LookupVirtualMachineOutputArgs struct {
// Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'
Expand pulumi.StringPtrInput `pulumi:"expand"`
// The name of the lab.
LabName pulumi.StringInput `pulumi:"labName"`
// The name of the virtual machine.
Name pulumi.StringInput `pulumi:"name"`
// The name of the resource group.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupVirtualMachineOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupVirtualMachineArgs)(nil)).Elem()
}
// A virtual machine.
type LookupVirtualMachineResultOutput struct{ *pulumi.OutputState }
func (LookupVirtualMachineResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupVirtualMachineResult)(nil)).Elem()
}
func (o LookupVirtualMachineResultOutput) ToLookupVirtualMachineResultOutput() LookupVirtualMachineResultOutput {
return o
}
func (o LookupVirtualMachineResultOutput) ToLookupVirtualMachineResultOutputWithContext(ctx context.Context) LookupVirtualMachineResultOutput {
return o
}
// Indicates whether another user can take ownership of the virtual machine
func (o LookupVirtualMachineResultOutput) AllowClaim() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *bool { return v.AllowClaim }).(pulumi.BoolPtrOutput)
}
// The applicable schedule for the virtual machine.
func (o LookupVirtualMachineResultOutput) ApplicableSchedule() ApplicableScheduleResponseOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) ApplicableScheduleResponse { return v.ApplicableSchedule }).(ApplicableScheduleResponseOutput)
}
// The artifact deployment status for the virtual machine.
func (o LookupVirtualMachineResultOutput) ArtifactDeploymentStatus() ArtifactDeploymentStatusPropertiesResponseOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) ArtifactDeploymentStatusPropertiesResponse {
return v.ArtifactDeploymentStatus
}).(ArtifactDeploymentStatusPropertiesResponseOutput)
}
// The artifacts to be installed on the virtual machine.
func (o LookupVirtualMachineResultOutput) Artifacts() ArtifactInstallPropertiesResponseArrayOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) []ArtifactInstallPropertiesResponse { return v.Artifacts }).(ArtifactInstallPropertiesResponseArrayOutput)
}
// The resource identifier (Microsoft.Compute) of the virtual machine.
func (o LookupVirtualMachineResultOutput) ComputeId() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.ComputeId }).(pulumi.StringOutput)
}
// The compute virtual machine properties.
func (o LookupVirtualMachineResultOutput) ComputeVm() ComputeVmPropertiesResponseOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) ComputeVmPropertiesResponse { return v.ComputeVm }).(ComputeVmPropertiesResponseOutput)
}
// The email address of creator of the virtual machine.
func (o LookupVirtualMachineResultOutput) CreatedByUser() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.CreatedByUser }).(pulumi.StringOutput)
}
// The object identifier of the creator of the virtual machine.
func (o LookupVirtualMachineResultOutput) CreatedByUserId() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.CreatedByUserId }).(pulumi.StringOutput)
}
// The creation date of the virtual machine.
func (o LookupVirtualMachineResultOutput) CreatedDate() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.CreatedDate }).(pulumi.StringPtrOutput)
}
// The custom image identifier of the virtual machine.
func (o LookupVirtualMachineResultOutput) CustomImageId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.CustomImageId }).(pulumi.StringPtrOutput)
}
// New or existing data disks to attach to the virtual machine after creation
func (o LookupVirtualMachineResultOutput) DataDiskParameters() DataDiskPropertiesResponseArrayOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) []DataDiskPropertiesResponse { return v.DataDiskParameters }).(DataDiskPropertiesResponseArrayOutput)
}
// Indicates whether the virtual machine is to be created without a public IP address.
func (o LookupVirtualMachineResultOutput) DisallowPublicIpAddress() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *bool { return v.DisallowPublicIpAddress }).(pulumi.BoolPtrOutput)
}
// The resource ID of the environment that contains this virtual machine, if any.
func (o LookupVirtualMachineResultOutput) EnvironmentId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.EnvironmentId }).(pulumi.StringPtrOutput)
}
// The expiration date for VM.
func (o LookupVirtualMachineResultOutput) ExpirationDate() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.ExpirationDate }).(pulumi.StringPtrOutput)
}
// The fully-qualified domain name of the virtual machine.
func (o LookupVirtualMachineResultOutput) Fqdn() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.Fqdn }).(pulumi.StringOutput)
}
// The Microsoft Azure Marketplace image reference of the virtual machine.
func (o LookupVirtualMachineResultOutput) GalleryImageReference() GalleryImageReferenceResponsePtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *GalleryImageReferenceResponse { return v.GalleryImageReference }).(GalleryImageReferenceResponsePtrOutput)
}
// The identifier of the resource.
func (o LookupVirtualMachineResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.Id }).(pulumi.StringOutput)
}
// Indicates whether this virtual machine uses an SSH key for authentication.
func (o LookupVirtualMachineResultOutput) IsAuthenticationWithSshKey() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *bool { return v.IsAuthenticationWithSshKey }).(pulumi.BoolPtrOutput)
}
// The lab subnet name of the virtual machine.
func (o LookupVirtualMachineResultOutput) LabSubnetName() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.LabSubnetName }).(pulumi.StringPtrOutput)
}
// The lab virtual network identifier of the virtual machine.
func (o LookupVirtualMachineResultOutput) LabVirtualNetworkId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.LabVirtualNetworkId }).(pulumi.StringPtrOutput)
}
// Last known compute power state captured in DTL
func (o LookupVirtualMachineResultOutput) LastKnownPowerState() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.LastKnownPowerState }).(pulumi.StringOutput)
}
// The location of the resource.
func (o LookupVirtualMachineResultOutput) Location() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.Location }).(pulumi.StringPtrOutput)
}
// The name of the resource.
func (o LookupVirtualMachineResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.Name }).(pulumi.StringOutput)
}
// The network interface properties.
func (o LookupVirtualMachineResultOutput) NetworkInterface() NetworkInterfacePropertiesResponsePtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *NetworkInterfacePropertiesResponse { return v.NetworkInterface }).(NetworkInterfacePropertiesResponsePtrOutput)
}
// The notes of the virtual machine.
func (o LookupVirtualMachineResultOutput) Notes() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.Notes }).(pulumi.StringPtrOutput)
}
// The OS type of the virtual machine.
func (o LookupVirtualMachineResultOutput) OsType() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.OsType }).(pulumi.StringOutput)
}
// The object identifier of the owner of the virtual machine.
func (o LookupVirtualMachineResultOutput) OwnerObjectId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.OwnerObjectId }).(pulumi.StringPtrOutput)
}
// The user principal name of the virtual machine owner.
func (o LookupVirtualMachineResultOutput) OwnerUserPrincipalName() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.OwnerUserPrincipalName }).(pulumi.StringPtrOutput)
}
// The password of the virtual machine administrator.
func (o LookupVirtualMachineResultOutput) Password() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.Password }).(pulumi.StringPtrOutput)
}
// The id of the plan associated with the virtual machine image
func (o LookupVirtualMachineResultOutput) PlanId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.PlanId }).(pulumi.StringPtrOutput)
}
// The provisioning status of the resource.
func (o LookupVirtualMachineResultOutput) ProvisioningState() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.ProvisioningState }).(pulumi.StringOutput)
}
// Virtual Machine schedules to be created
func (o LookupVirtualMachineResultOutput) ScheduleParameters() ScheduleCreationParameterResponseArrayOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) []ScheduleCreationParameterResponse { return v.ScheduleParameters }).(ScheduleCreationParameterResponseArrayOutput)
}
// The size of the virtual machine.
func (o LookupVirtualMachineResultOutput) Size() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.Size }).(pulumi.StringPtrOutput)
}
// The SSH key of the virtual machine administrator.
func (o LookupVirtualMachineResultOutput) SshKey() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.SshKey }).(pulumi.StringPtrOutput)
}
// Storage type to use for virtual machine (i.e. Standard, Premium).
func (o LookupVirtualMachineResultOutput) StorageType() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.StorageType }).(pulumi.StringPtrOutput)
}
// The tags of the resource.
func (o LookupVirtualMachineResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// The type of the resource.
func (o LookupVirtualMachineResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.Type }).(pulumi.StringOutput)
}
// The unique immutable identifier of a resource (Guid).
func (o LookupVirtualMachineResultOutput) UniqueIdentifier() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.UniqueIdentifier }).(pulumi.StringOutput)
}
// The user name of the virtual machine.
func (o LookupVirtualMachineResultOutput) UserName() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) *string { return v.UserName }).(pulumi.StringPtrOutput)
}
// Tells source of creation of lab virtual machine. Output property only.
func (o LookupVirtualMachineResultOutput) VirtualMachineCreationSource() pulumi.StringOutput {
return o.ApplyT(func(v LookupVirtualMachineResult) string { return v.VirtualMachineCreationSource }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupVirtualMachineResultOutput{})
}