This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
virtualMachine.go
347 lines (323 loc) · 12.1 KB
/
virtualMachine.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
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20190401
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Virtual machine model
type VirtualMachine struct {
pulumi.CustomResourceState
// The amount of memory
AmountOfRam pulumi.IntOutput `pulumi:"amountOfRam"`
// The list of Virtual Disks' Controllers
Controllers VirtualDiskControllerResponseArrayOutput `pulumi:"controllers"`
// Virtual machine properties
Customization GuestOSCustomizationResponsePtrOutput `pulumi:"customization"`
// The list of Virtual Disks
Disks VirtualDiskResponseArrayOutput `pulumi:"disks"`
// The DNS name of Virtual Machine in VCenter
Dnsname pulumi.StringOutput `pulumi:"dnsname"`
// Expose Guest OS or not
ExposeToGuestVM pulumi.BoolPtrOutput `pulumi:"exposeToGuestVM"`
// The path to virtual machine folder in VCenter
Folder pulumi.StringOutput `pulumi:"folder"`
// The name of Guest OS
GuestOS pulumi.StringOutput `pulumi:"guestOS"`
// The Guest OS type
GuestOSType pulumi.StringOutput `pulumi:"guestOSType"`
// Azure region
Location pulumi.StringOutput `pulumi:"location"`
// {virtualMachineName}
Name pulumi.StringOutput `pulumi:"name"`
// The list of Virtual NICs
Nics VirtualNicResponseArrayOutput `pulumi:"nics"`
// The number of CPU cores
NumberOfCores pulumi.IntOutput `pulumi:"numberOfCores"`
// Password for login. Deprecated - use customization property
Password pulumi.StringPtrOutput `pulumi:"password"`
// Private Cloud Id
PrivateCloudId pulumi.StringOutput `pulumi:"privateCloudId"`
// The provisioning status of the resource
ProvisioningState pulumi.StringOutput `pulumi:"provisioningState"`
// The public ip of Virtual Machine
PublicIP pulumi.StringOutput `pulumi:"publicIP"`
// Virtual Machines Resource Pool
ResourcePool ResourcePoolResponsePtrOutput `pulumi:"resourcePool"`
// The status of Virtual machine
Status pulumi.StringOutput `pulumi:"status"`
// The list of tags
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Virtual Machine Template Id
TemplateId pulumi.StringPtrOutput `pulumi:"templateId"`
// {resourceProviderNamespace}/{resourceType}
Type pulumi.StringOutput `pulumi:"type"`
// Username for login. Deprecated - use customization property
Username pulumi.StringPtrOutput `pulumi:"username"`
// The list of Virtual VSphere Networks
VSphereNetworks pulumi.StringArrayOutput `pulumi:"vSphereNetworks"`
// The internal id of Virtual Machine in VCenter
VmId pulumi.StringOutput `pulumi:"vmId"`
// VMware tools version
Vmwaretools pulumi.StringOutput `pulumi:"vmwaretools"`
}
// NewVirtualMachine registers a new resource with the given unique name, arguments, and options.
func NewVirtualMachine(ctx *pulumi.Context,
name string, args *VirtualMachineArgs, opts ...pulumi.ResourceOption) (*VirtualMachine, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AmountOfRam == nil {
return nil, errors.New("invalid value for required argument 'AmountOfRam'")
}
if args.NumberOfCores == nil {
return nil, errors.New("invalid value for required argument 'NumberOfCores'")
}
if args.PrivateCloudId == nil {
return nil, errors.New("invalid value for required argument 'PrivateCloudId'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.VirtualMachineName == nil {
return nil, errors.New("invalid value for required argument 'VirtualMachineName'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:vmwarecloudsimple/latest:VirtualMachine"),
},
})
opts = append(opts, aliases)
var resource VirtualMachine
err := ctx.RegisterResource("azure-nextgen:vmwarecloudsimple/v20190401:VirtualMachine", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetVirtualMachine gets an existing VirtualMachine resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetVirtualMachine(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *VirtualMachineState, opts ...pulumi.ResourceOption) (*VirtualMachine, error) {
var resource VirtualMachine
err := ctx.ReadResource("azure-nextgen:vmwarecloudsimple/v20190401:VirtualMachine", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering VirtualMachine resources.
type virtualMachineState struct {
// The amount of memory
AmountOfRam *int `pulumi:"amountOfRam"`
// The list of Virtual Disks' Controllers
Controllers []VirtualDiskControllerResponse `pulumi:"controllers"`
// Virtual machine properties
Customization *GuestOSCustomizationResponse `pulumi:"customization"`
// The list of Virtual Disks
Disks []VirtualDiskResponse `pulumi:"disks"`
// The DNS name of Virtual Machine in VCenter
Dnsname *string `pulumi:"dnsname"`
// Expose Guest OS or not
ExposeToGuestVM *bool `pulumi:"exposeToGuestVM"`
// The path to virtual machine folder in VCenter
Folder *string `pulumi:"folder"`
// The name of Guest OS
GuestOS *string `pulumi:"guestOS"`
// The Guest OS type
GuestOSType *string `pulumi:"guestOSType"`
// Azure region
Location *string `pulumi:"location"`
// {virtualMachineName}
Name *string `pulumi:"name"`
// The list of Virtual NICs
Nics []VirtualNicResponse `pulumi:"nics"`
// The number of CPU cores
NumberOfCores *int `pulumi:"numberOfCores"`
// Password for login. Deprecated - use customization property
Password *string `pulumi:"password"`
// Private Cloud Id
PrivateCloudId *string `pulumi:"privateCloudId"`
// The provisioning status of the resource
ProvisioningState *string `pulumi:"provisioningState"`
// The public ip of Virtual Machine
PublicIP *string `pulumi:"publicIP"`
// Virtual Machines Resource Pool
ResourcePool *ResourcePoolResponse `pulumi:"resourcePool"`
// The status of Virtual machine
Status *string `pulumi:"status"`
// The list of tags
Tags map[string]string `pulumi:"tags"`
// Virtual Machine Template Id
TemplateId *string `pulumi:"templateId"`
// {resourceProviderNamespace}/{resourceType}
Type *string `pulumi:"type"`
// Username for login. Deprecated - use customization property
Username *string `pulumi:"username"`
// The list of Virtual VSphere Networks
VSphereNetworks []string `pulumi:"vSphereNetworks"`
// The internal id of Virtual Machine in VCenter
VmId *string `pulumi:"vmId"`
// VMware tools version
Vmwaretools *string `pulumi:"vmwaretools"`
}
type VirtualMachineState struct {
// The amount of memory
AmountOfRam pulumi.IntPtrInput
// The list of Virtual Disks' Controllers
Controllers VirtualDiskControllerResponseArrayInput
// Virtual machine properties
Customization GuestOSCustomizationResponsePtrInput
// The list of Virtual Disks
Disks VirtualDiskResponseArrayInput
// The DNS name of Virtual Machine in VCenter
Dnsname pulumi.StringPtrInput
// Expose Guest OS or not
ExposeToGuestVM pulumi.BoolPtrInput
// The path to virtual machine folder in VCenter
Folder pulumi.StringPtrInput
// The name of Guest OS
GuestOS pulumi.StringPtrInput
// The Guest OS type
GuestOSType pulumi.StringPtrInput
// Azure region
Location pulumi.StringPtrInput
// {virtualMachineName}
Name pulumi.StringPtrInput
// The list of Virtual NICs
Nics VirtualNicResponseArrayInput
// The number of CPU cores
NumberOfCores pulumi.IntPtrInput
// Password for login. Deprecated - use customization property
Password pulumi.StringPtrInput
// Private Cloud Id
PrivateCloudId pulumi.StringPtrInput
// The provisioning status of the resource
ProvisioningState pulumi.StringPtrInput
// The public ip of Virtual Machine
PublicIP pulumi.StringPtrInput
// Virtual Machines Resource Pool
ResourcePool ResourcePoolResponsePtrInput
// The status of Virtual machine
Status pulumi.StringPtrInput
// The list of tags
Tags pulumi.StringMapInput
// Virtual Machine Template Id
TemplateId pulumi.StringPtrInput
// {resourceProviderNamespace}/{resourceType}
Type pulumi.StringPtrInput
// Username for login. Deprecated - use customization property
Username pulumi.StringPtrInput
// The list of Virtual VSphere Networks
VSphereNetworks pulumi.StringArrayInput
// The internal id of Virtual Machine in VCenter
VmId pulumi.StringPtrInput
// VMware tools version
Vmwaretools pulumi.StringPtrInput
}
func (VirtualMachineState) ElementType() reflect.Type {
return reflect.TypeOf((*virtualMachineState)(nil)).Elem()
}
type virtualMachineArgs struct {
// The amount of memory
AmountOfRam int `pulumi:"amountOfRam"`
// Virtual machine properties
Customization *GuestOSCustomization `pulumi:"customization"`
// The list of Virtual Disks
Disks []VirtualDisk `pulumi:"disks"`
// Expose Guest OS or not
ExposeToGuestVM *bool `pulumi:"exposeToGuestVM"`
// Azure region
Location *string `pulumi:"location"`
// The list of Virtual NICs
Nics []VirtualNic `pulumi:"nics"`
// The number of CPU cores
NumberOfCores int `pulumi:"numberOfCores"`
// Password for login. Deprecated - use customization property
Password *string `pulumi:"password"`
// Private Cloud Id
PrivateCloudId string `pulumi:"privateCloudId"`
// The name of the resource group
ResourceGroupName string `pulumi:"resourceGroupName"`
// Virtual Machines Resource Pool
ResourcePool *ResourcePool `pulumi:"resourcePool"`
// The list of tags
Tags map[string]string `pulumi:"tags"`
// Virtual Machine Template Id
TemplateId *string `pulumi:"templateId"`
// Username for login. Deprecated - use customization property
Username *string `pulumi:"username"`
// The list of Virtual VSphere Networks
VSphereNetworks []string `pulumi:"vSphereNetworks"`
// virtual machine name
VirtualMachineName string `pulumi:"virtualMachineName"`
}
// The set of arguments for constructing a VirtualMachine resource.
type VirtualMachineArgs struct {
// The amount of memory
AmountOfRam pulumi.IntInput
// Virtual machine properties
Customization GuestOSCustomizationPtrInput
// The list of Virtual Disks
Disks VirtualDiskArrayInput
// Expose Guest OS or not
ExposeToGuestVM pulumi.BoolPtrInput
// Azure region
Location pulumi.StringPtrInput
// The list of Virtual NICs
Nics VirtualNicArrayInput
// The number of CPU cores
NumberOfCores pulumi.IntInput
// Password for login. Deprecated - use customization property
Password pulumi.StringPtrInput
// Private Cloud Id
PrivateCloudId pulumi.StringInput
// The name of the resource group
ResourceGroupName pulumi.StringInput
// Virtual Machines Resource Pool
ResourcePool ResourcePoolPtrInput
// The list of tags
Tags pulumi.StringMapInput
// Virtual Machine Template Id
TemplateId pulumi.StringPtrInput
// Username for login. Deprecated - use customization property
Username pulumi.StringPtrInput
// The list of Virtual VSphere Networks
VSphereNetworks pulumi.StringArrayInput
// virtual machine name
VirtualMachineName pulumi.StringInput
}
func (VirtualMachineArgs) ElementType() reflect.Type {
return reflect.TypeOf((*virtualMachineArgs)(nil)).Elem()
}
type VirtualMachineInput interface {
pulumi.Input
ToVirtualMachineOutput() VirtualMachineOutput
ToVirtualMachineOutputWithContext(ctx context.Context) VirtualMachineOutput
}
func (*VirtualMachine) ElementType() reflect.Type {
return reflect.TypeOf((*VirtualMachine)(nil))
}
func (i *VirtualMachine) ToVirtualMachineOutput() VirtualMachineOutput {
return i.ToVirtualMachineOutputWithContext(context.Background())
}
func (i *VirtualMachine) ToVirtualMachineOutputWithContext(ctx context.Context) VirtualMachineOutput {
return pulumi.ToOutputWithContext(ctx, i).(VirtualMachineOutput)
}
type VirtualMachineOutput struct {
*pulumi.OutputState
}
func (VirtualMachineOutput) ElementType() reflect.Type {
return reflect.TypeOf((*VirtualMachine)(nil))
}
func (o VirtualMachineOutput) ToVirtualMachineOutput() VirtualMachineOutput {
return o
}
func (o VirtualMachineOutput) ToVirtualMachineOutputWithContext(ctx context.Context) VirtualMachineOutput {
return o
}
func init() {
pulumi.RegisterOutputType(VirtualMachineOutput{})
}