/
migratingVm.go
355 lines (303 loc) · 19.7 KB
/
migratingVm.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
// 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 v1
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a new MigratingVm in a given Source.
// Auto-naming is currently not supported for this resource.
type MigratingVm struct {
pulumi.CustomResourceState
// Details of the VM from an AWS source.
AwsSourceVmDetails AwsSourceVmDetailsResponseOutput `pulumi:"awsSourceVmDetails"`
// Details of the VM from an Azure source.
AzureSourceVmDetails AzureSourceVmDetailsResponseOutput `pulumi:"azureSourceVmDetails"`
// Details of the target Persistent Disks in Compute Engine.
ComputeEngineDisksTargetDefaults ComputeEngineDisksTargetDefaultsResponseOutput `pulumi:"computeEngineDisksTargetDefaults"`
// Details of the target VM in Compute Engine.
ComputeEngineTargetDefaults ComputeEngineTargetDefaultsResponseOutput `pulumi:"computeEngineTargetDefaults"`
// The time the migrating VM was created (this refers to this resource and not to the time it was installed in the source).
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// Details of the current running replication cycle.
CurrentSyncInfo ReplicationCycleResponseOutput `pulumi:"currentSyncInfo"`
// Provides details of future CutoverJobs of a MigratingVm. Set to empty when cutover forecast is unavailable.
CutoverForecast CutoverForecastResponseOutput `pulumi:"cutoverForecast"`
// The description attached to the migrating VM by the user.
Description pulumi.StringOutput `pulumi:"description"`
// The display name attached to the MigratingVm by the user.
DisplayName pulumi.StringOutput `pulumi:"displayName"`
// Provides details on the state of the Migrating VM in case of an error in replication.
Error StatusResponseOutput `pulumi:"error"`
// The group this migrating vm is included in, if any. The group is represented by the full path of the appropriate Group resource.
Group pulumi.StringOutput `pulumi:"group"`
// The labels of the migrating VM.
Labels pulumi.StringMapOutput `pulumi:"labels"`
// Details of the last replication cycle. This will be updated whenever a replication cycle is finished and is not to be confused with last_sync which is only updated on successful replication cycles.
LastReplicationCycle ReplicationCycleResponseOutput `pulumi:"lastReplicationCycle"`
// The most updated snapshot created time in the source that finished replication.
LastSync ReplicationSyncResponseOutput `pulumi:"lastSync"`
Location pulumi.StringOutput `pulumi:"location"`
// Required. The migratingVm identifier.
MigratingVmId pulumi.StringOutput `pulumi:"migratingVmId"`
// The identifier of the MigratingVm.
Name pulumi.StringOutput `pulumi:"name"`
// The replication schedule policy.
Policy SchedulePolicyResponseOutput `pulumi:"policy"`
Project pulumi.StringOutput `pulumi:"project"`
// The recent clone jobs performed on the migrating VM. This field holds the vm's last completed clone job and the vm's running clone job, if one exists. Note: To have this field populated you need to explicitly request it via the "view" parameter of the Get/List request.
RecentCloneJobs CloneJobResponseArrayOutput `pulumi:"recentCloneJobs"`
// The recent cutover jobs performed on the migrating VM. This field holds the vm's last completed cutover job and the vm's running cutover job, if one exists. Note: To have this field populated you need to explicitly request it via the "view" parameter of the Get/List request.
RecentCutoverJobs CutoverJobResponseArrayOutput `pulumi:"recentCutoverJobs"`
// A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
RequestId pulumi.StringPtrOutput `pulumi:"requestId"`
SourceId pulumi.StringOutput `pulumi:"sourceId"`
// The unique ID of the VM in the source. The VM's name in vSphere can be changed, so this is not the VM's name but rather its moRef id. This id is of the form vm-.
SourceVmId pulumi.StringOutput `pulumi:"sourceVmId"`
// State of the MigratingVm.
State pulumi.StringOutput `pulumi:"state"`
// The last time the migrating VM state was updated.
StateTime pulumi.StringOutput `pulumi:"stateTime"`
// The last time the migrating VM resource was updated.
UpdateTime pulumi.StringOutput `pulumi:"updateTime"`
// Details of the VM from a Vmware source.
VmwareSourceVmDetails VmwareSourceVmDetailsResponseOutput `pulumi:"vmwareSourceVmDetails"`
}
// NewMigratingVm registers a new resource with the given unique name, arguments, and options.
func NewMigratingVm(ctx *pulumi.Context,
name string, args *MigratingVmArgs, opts ...pulumi.ResourceOption) (*MigratingVm, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.MigratingVmId == nil {
return nil, errors.New("invalid value for required argument 'MigratingVmId'")
}
if args.SourceId == nil {
return nil, errors.New("invalid value for required argument 'SourceId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"location",
"migratingVmId",
"project",
"sourceId",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource MigratingVm
err := ctx.RegisterResource("google-native:vmmigration/v1:MigratingVm", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetMigratingVm gets an existing MigratingVm 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 GetMigratingVm(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *MigratingVmState, opts ...pulumi.ResourceOption) (*MigratingVm, error) {
var resource MigratingVm
err := ctx.ReadResource("google-native:vmmigration/v1:MigratingVm", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering MigratingVm resources.
type migratingVmState struct {
}
type MigratingVmState struct {
}
func (MigratingVmState) ElementType() reflect.Type {
return reflect.TypeOf((*migratingVmState)(nil)).Elem()
}
type migratingVmArgs struct {
// Details of the target Persistent Disks in Compute Engine.
ComputeEngineDisksTargetDefaults *ComputeEngineDisksTargetDefaults `pulumi:"computeEngineDisksTargetDefaults"`
// Details of the target VM in Compute Engine.
ComputeEngineTargetDefaults *ComputeEngineTargetDefaults `pulumi:"computeEngineTargetDefaults"`
// The description attached to the migrating VM by the user.
Description *string `pulumi:"description"`
// The display name attached to the MigratingVm by the user.
DisplayName *string `pulumi:"displayName"`
// The labels of the migrating VM.
Labels map[string]string `pulumi:"labels"`
Location *string `pulumi:"location"`
// Required. The migratingVm identifier.
MigratingVmId string `pulumi:"migratingVmId"`
// The replication schedule policy.
Policy *SchedulePolicy `pulumi:"policy"`
Project *string `pulumi:"project"`
// A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
RequestId *string `pulumi:"requestId"`
SourceId string `pulumi:"sourceId"`
// The unique ID of the VM in the source. The VM's name in vSphere can be changed, so this is not the VM's name but rather its moRef id. This id is of the form vm-.
SourceVmId *string `pulumi:"sourceVmId"`
}
// The set of arguments for constructing a MigratingVm resource.
type MigratingVmArgs struct {
// Details of the target Persistent Disks in Compute Engine.
ComputeEngineDisksTargetDefaults ComputeEngineDisksTargetDefaultsPtrInput
// Details of the target VM in Compute Engine.
ComputeEngineTargetDefaults ComputeEngineTargetDefaultsPtrInput
// The description attached to the migrating VM by the user.
Description pulumi.StringPtrInput
// The display name attached to the MigratingVm by the user.
DisplayName pulumi.StringPtrInput
// The labels of the migrating VM.
Labels pulumi.StringMapInput
Location pulumi.StringPtrInput
// Required. The migratingVm identifier.
MigratingVmId pulumi.StringInput
// The replication schedule policy.
Policy SchedulePolicyPtrInput
Project pulumi.StringPtrInput
// A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
RequestId pulumi.StringPtrInput
SourceId pulumi.StringInput
// The unique ID of the VM in the source. The VM's name in vSphere can be changed, so this is not the VM's name but rather its moRef id. This id is of the form vm-.
SourceVmId pulumi.StringPtrInput
}
func (MigratingVmArgs) ElementType() reflect.Type {
return reflect.TypeOf((*migratingVmArgs)(nil)).Elem()
}
type MigratingVmInput interface {
pulumi.Input
ToMigratingVmOutput() MigratingVmOutput
ToMigratingVmOutputWithContext(ctx context.Context) MigratingVmOutput
}
func (*MigratingVm) ElementType() reflect.Type {
return reflect.TypeOf((**MigratingVm)(nil)).Elem()
}
func (i *MigratingVm) ToMigratingVmOutput() MigratingVmOutput {
return i.ToMigratingVmOutputWithContext(context.Background())
}
func (i *MigratingVm) ToMigratingVmOutputWithContext(ctx context.Context) MigratingVmOutput {
return pulumi.ToOutputWithContext(ctx, i).(MigratingVmOutput)
}
type MigratingVmOutput struct{ *pulumi.OutputState }
func (MigratingVmOutput) ElementType() reflect.Type {
return reflect.TypeOf((**MigratingVm)(nil)).Elem()
}
func (o MigratingVmOutput) ToMigratingVmOutput() MigratingVmOutput {
return o
}
func (o MigratingVmOutput) ToMigratingVmOutputWithContext(ctx context.Context) MigratingVmOutput {
return o
}
// Details of the VM from an AWS source.
func (o MigratingVmOutput) AwsSourceVmDetails() AwsSourceVmDetailsResponseOutput {
return o.ApplyT(func(v *MigratingVm) AwsSourceVmDetailsResponseOutput { return v.AwsSourceVmDetails }).(AwsSourceVmDetailsResponseOutput)
}
// Details of the VM from an Azure source.
func (o MigratingVmOutput) AzureSourceVmDetails() AzureSourceVmDetailsResponseOutput {
return o.ApplyT(func(v *MigratingVm) AzureSourceVmDetailsResponseOutput { return v.AzureSourceVmDetails }).(AzureSourceVmDetailsResponseOutput)
}
// Details of the target Persistent Disks in Compute Engine.
func (o MigratingVmOutput) ComputeEngineDisksTargetDefaults() ComputeEngineDisksTargetDefaultsResponseOutput {
return o.ApplyT(func(v *MigratingVm) ComputeEngineDisksTargetDefaultsResponseOutput {
return v.ComputeEngineDisksTargetDefaults
}).(ComputeEngineDisksTargetDefaultsResponseOutput)
}
// Details of the target VM in Compute Engine.
func (o MigratingVmOutput) ComputeEngineTargetDefaults() ComputeEngineTargetDefaultsResponseOutput {
return o.ApplyT(func(v *MigratingVm) ComputeEngineTargetDefaultsResponseOutput { return v.ComputeEngineTargetDefaults }).(ComputeEngineTargetDefaultsResponseOutput)
}
// The time the migrating VM was created (this refers to this resource and not to the time it was installed in the source).
func (o MigratingVmOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *MigratingVm) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// Details of the current running replication cycle.
func (o MigratingVmOutput) CurrentSyncInfo() ReplicationCycleResponseOutput {
return o.ApplyT(func(v *MigratingVm) ReplicationCycleResponseOutput { return v.CurrentSyncInfo }).(ReplicationCycleResponseOutput)
}
// Provides details of future CutoverJobs of a MigratingVm. Set to empty when cutover forecast is unavailable.
func (o MigratingVmOutput) CutoverForecast() CutoverForecastResponseOutput {
return o.ApplyT(func(v *MigratingVm) CutoverForecastResponseOutput { return v.CutoverForecast }).(CutoverForecastResponseOutput)
}
// The description attached to the migrating VM by the user.
func (o MigratingVmOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *MigratingVm) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
// The display name attached to the MigratingVm by the user.
func (o MigratingVmOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v *MigratingVm) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput)
}
// Provides details on the state of the Migrating VM in case of an error in replication.
func (o MigratingVmOutput) Error() StatusResponseOutput {
return o.ApplyT(func(v *MigratingVm) StatusResponseOutput { return v.Error }).(StatusResponseOutput)
}
// The group this migrating vm is included in, if any. The group is represented by the full path of the appropriate Group resource.
func (o MigratingVmOutput) Group() pulumi.StringOutput {
return o.ApplyT(func(v *MigratingVm) pulumi.StringOutput { return v.Group }).(pulumi.StringOutput)
}
// The labels of the migrating VM.
func (o MigratingVmOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v *MigratingVm) pulumi.StringMapOutput { return v.Labels }).(pulumi.StringMapOutput)
}
// Details of the last replication cycle. This will be updated whenever a replication cycle is finished and is not to be confused with last_sync which is only updated on successful replication cycles.
func (o MigratingVmOutput) LastReplicationCycle() ReplicationCycleResponseOutput {
return o.ApplyT(func(v *MigratingVm) ReplicationCycleResponseOutput { return v.LastReplicationCycle }).(ReplicationCycleResponseOutput)
}
// The most updated snapshot created time in the source that finished replication.
func (o MigratingVmOutput) LastSync() ReplicationSyncResponseOutput {
return o.ApplyT(func(v *MigratingVm) ReplicationSyncResponseOutput { return v.LastSync }).(ReplicationSyncResponseOutput)
}
func (o MigratingVmOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *MigratingVm) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Required. The migratingVm identifier.
func (o MigratingVmOutput) MigratingVmId() pulumi.StringOutput {
return o.ApplyT(func(v *MigratingVm) pulumi.StringOutput { return v.MigratingVmId }).(pulumi.StringOutput)
}
// The identifier of the MigratingVm.
func (o MigratingVmOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *MigratingVm) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The replication schedule policy.
func (o MigratingVmOutput) Policy() SchedulePolicyResponseOutput {
return o.ApplyT(func(v *MigratingVm) SchedulePolicyResponseOutput { return v.Policy }).(SchedulePolicyResponseOutput)
}
func (o MigratingVmOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *MigratingVm) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// The recent clone jobs performed on the migrating VM. This field holds the vm's last completed clone job and the vm's running clone job, if one exists. Note: To have this field populated you need to explicitly request it via the "view" parameter of the Get/List request.
func (o MigratingVmOutput) RecentCloneJobs() CloneJobResponseArrayOutput {
return o.ApplyT(func(v *MigratingVm) CloneJobResponseArrayOutput { return v.RecentCloneJobs }).(CloneJobResponseArrayOutput)
}
// The recent cutover jobs performed on the migrating VM. This field holds the vm's last completed cutover job and the vm's running cutover job, if one exists. Note: To have this field populated you need to explicitly request it via the "view" parameter of the Get/List request.
func (o MigratingVmOutput) RecentCutoverJobs() CutoverJobResponseArrayOutput {
return o.ApplyT(func(v *MigratingVm) CutoverJobResponseArrayOutput { return v.RecentCutoverJobs }).(CutoverJobResponseArrayOutput)
}
// A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
func (o MigratingVmOutput) RequestId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MigratingVm) pulumi.StringPtrOutput { return v.RequestId }).(pulumi.StringPtrOutput)
}
func (o MigratingVmOutput) SourceId() pulumi.StringOutput {
return o.ApplyT(func(v *MigratingVm) pulumi.StringOutput { return v.SourceId }).(pulumi.StringOutput)
}
// The unique ID of the VM in the source. The VM's name in vSphere can be changed, so this is not the VM's name but rather its moRef id. This id is of the form vm-.
func (o MigratingVmOutput) SourceVmId() pulumi.StringOutput {
return o.ApplyT(func(v *MigratingVm) pulumi.StringOutput { return v.SourceVmId }).(pulumi.StringOutput)
}
// State of the MigratingVm.
func (o MigratingVmOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *MigratingVm) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// The last time the migrating VM state was updated.
func (o MigratingVmOutput) StateTime() pulumi.StringOutput {
return o.ApplyT(func(v *MigratingVm) pulumi.StringOutput { return v.StateTime }).(pulumi.StringOutput)
}
// The last time the migrating VM resource was updated.
func (o MigratingVmOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v *MigratingVm) pulumi.StringOutput { return v.UpdateTime }).(pulumi.StringOutput)
}
// Details of the VM from a Vmware source.
func (o MigratingVmOutput) VmwareSourceVmDetails() VmwareSourceVmDetailsResponseOutput {
return o.ApplyT(func(v *MigratingVm) VmwareSourceVmDetailsResponseOutput { return v.VmwareSourceVmDetails }).(VmwareSourceVmDetailsResponseOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*MigratingVmInput)(nil)).Elem(), &MigratingVm{})
pulumi.RegisterOutputType(MigratingVmOutput{})
}