generated from pulumi/pulumi-tf-provider-boilerplate
/
migrationTask.go
635 lines (574 loc) · 29.8 KB
/
migrationTask.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
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
// 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 oms
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an OMS migration task resource within HuaweiCloud.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Oms"
// "github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Oms"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// cfg := config.New(ctx, "")
// sourceRegion := cfg.RequireObject("sourceRegion")
// sourceBucket := cfg.RequireObject("sourceBucket")
// sourceAccessKey := cfg.RequireObject("sourceAccessKey")
// sourceSecretKey := cfg.RequireObject("sourceSecretKey")
// destRegion := cfg.RequireObject("destRegion")
// destBucket := cfg.RequireObject("destBucket")
// destAccessKey := cfg.RequireObject("destAccessKey")
// destSecretKey := cfg.RequireObject("destSecretKey")
// topicUrn := cfg.RequireObject("topicUrn")
// _, err := Oms.NewMigrationTask(ctx, "test", &Oms.MigrationTaskArgs{
// SourceObject: &oms.MigrationTaskSourceObjectArgs{
// DataSource: pulumi.String("Aliyun"),
// Region: pulumi.Any(sourceRegion),
// Bucket: pulumi.Any(sourceBucket),
// AccessKey: pulumi.Any(sourceAccessKey),
// SecretKey: pulumi.Any(sourceSecretKey),
// Objects: pulumi.StringArray{
// pulumi.String(""),
// },
// },
// DestinationObject: &oms.MigrationTaskDestinationObjectArgs{
// Region: pulumi.Any(destRegion),
// Bucket: pulumi.Any(destBucket),
// AccessKey: pulumi.Any(destAccessKey),
// SecretKey: pulumi.Any(destSecretKey),
// },
// Type: pulumi.String("object"),
// Description: pulumi.String("test task"),
// BandwidthPolicies: oms.MigrationTaskBandwidthPolicyArray{
// &oms.MigrationTaskBandwidthPolicyArgs{
// MaxBandwidth: pulumi.Int(2),
// Start: pulumi.String("15:00"),
// End: pulumi.String("16:00"),
// },
// },
// SmnConfig: &oms.MigrationTaskSmnConfigArgs{
// TopicUrn: pulumi.Any(topicUrn),
// TriggerConditions: pulumi.StringArray{
// pulumi.String("FAILURE"),
// pulumi.String("SUCCESS"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
type MigrationTask struct {
pulumi.CustomResourceState
// Specifies the traffic limit rules. Each element in the array
// corresponds to the maximum bandwidth of a time segment. A maximum of 5 time segments are allowed, and the time
// segments must not overlap. The object structure is documented below.
BandwidthPolicies MigrationTaskBandwidthPolicyArrayOutput `pulumi:"bandwidthPolicies"`
// Specifies the description of the task.
// Changing this creates a new resource.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Specifies the destination information. The object
// structure is documented below. Changing this creates a new resource.
DestinationObject MigrationTaskDestinationObjectOutput `pulumi:"destinationObject"`
// Specifies whether to record failed objects. If this
// function is enabled, information about objects that fail to be migrated will be stored in the destination bucket.
// Default value: **true**. Changing this creates a new resource.
EnableFailedObjectRecording pulumi.BoolPtrOutput `pulumi:"enableFailedObjectRecording"`
// Specifies whether to enable the KMS encryption function.
// Default value: **false**. Changing this creates a new resource.
EnableKms pulumi.BoolPtrOutput `pulumi:"enableKms"`
// Specifies whether to automatically restore the archive data. If enabled,
// archive data is automatically restored and migrated. Default value: **false**. Changing this creates a new resource.
EnableRestore pulumi.BoolPtrOutput `pulumi:"enableRestore"`
// Specifies a time in format **yyyy-MM-dd HH:mm:ss**,
// e.g. **2006-01-02 15:04:05**. The system migrates only the objects that are modified after the specified time.
// No time is specified by default. Changing this creates a new resource.
MigrateSince pulumi.StringOutput `pulumi:"migrateSince"`
// The name of the migration task.
Name pulumi.StringOutput `pulumi:"name"`
// Specifies the region where the destination bucket is located.
// Changing this creates a new resource.
Region pulumi.StringOutput `pulumi:"region"`
// Specifies the SMN message sending configuration.
// The object structure is documented below. Changing this creates a new resource.
SmnConfig MigrationTaskSmnConfigPtrOutput `pulumi:"smnConfig"`
// Specifies the CDN information. If this parameter is contained,
// using CDN to download source data is supported, the source objects to be migrated are obtained from the CDN domain
// name during migration. The object structure is documented below.
// Changing this creates a new resource.
SourceCdn MigrationTaskSourceCdnPtrOutput `pulumi:"sourceCdn"`
// Specifies the source information. The object
// structure is documented below. Changing this creates a new resource.
SourceObject MigrationTaskSourceObjectOutput `pulumi:"sourceObject"`
// Specifies whether to start the task. Default value: **true**.
StartTask pulumi.BoolPtrOutput `pulumi:"startTask"`
// The status the migration task. The value can be:
// + **1**: Waiting to migrate.
// + **2**: Migrating.
// + **3**: Migration paused.
// + **4**: Migration failed.
// + **5**: Migration succeeded.
Status pulumi.IntOutput `pulumi:"status"`
// Specifies the task type. The value can be:
// + **list**: indicates migrating objects using an object list.
// + **url_list**: indicates migrating objects using a URL object list.
// + **object**: indicates migrating selected files or folders.
// + **prefix**: indicates migrating objects with specified prefixes.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewMigrationTask registers a new resource with the given unique name, arguments, and options.
func NewMigrationTask(ctx *pulumi.Context,
name string, args *MigrationTaskArgs, opts ...pulumi.ResourceOption) (*MigrationTask, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DestinationObject == nil {
return nil, errors.New("invalid value for required argument 'DestinationObject'")
}
if args.SourceObject == nil {
return nil, errors.New("invalid value for required argument 'SourceObject'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
opts = pkgResourceDefaultOpts(opts)
var resource MigrationTask
err := ctx.RegisterResource("huaweicloud:Oms/migrationTask:MigrationTask", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetMigrationTask gets an existing MigrationTask 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 GetMigrationTask(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *MigrationTaskState, opts ...pulumi.ResourceOption) (*MigrationTask, error) {
var resource MigrationTask
err := ctx.ReadResource("huaweicloud:Oms/migrationTask:MigrationTask", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering MigrationTask resources.
type migrationTaskState struct {
// Specifies the traffic limit rules. Each element in the array
// corresponds to the maximum bandwidth of a time segment. A maximum of 5 time segments are allowed, and the time
// segments must not overlap. The object structure is documented below.
BandwidthPolicies []MigrationTaskBandwidthPolicy `pulumi:"bandwidthPolicies"`
// Specifies the description of the task.
// Changing this creates a new resource.
Description *string `pulumi:"description"`
// Specifies the destination information. The object
// structure is documented below. Changing this creates a new resource.
DestinationObject *MigrationTaskDestinationObject `pulumi:"destinationObject"`
// Specifies whether to record failed objects. If this
// function is enabled, information about objects that fail to be migrated will be stored in the destination bucket.
// Default value: **true**. Changing this creates a new resource.
EnableFailedObjectRecording *bool `pulumi:"enableFailedObjectRecording"`
// Specifies whether to enable the KMS encryption function.
// Default value: **false**. Changing this creates a new resource.
EnableKms *bool `pulumi:"enableKms"`
// Specifies whether to automatically restore the archive data. If enabled,
// archive data is automatically restored and migrated. Default value: **false**. Changing this creates a new resource.
EnableRestore *bool `pulumi:"enableRestore"`
// Specifies a time in format **yyyy-MM-dd HH:mm:ss**,
// e.g. **2006-01-02 15:04:05**. The system migrates only the objects that are modified after the specified time.
// No time is specified by default. Changing this creates a new resource.
MigrateSince *string `pulumi:"migrateSince"`
// The name of the migration task.
Name *string `pulumi:"name"`
// Specifies the region where the destination bucket is located.
// Changing this creates a new resource.
Region *string `pulumi:"region"`
// Specifies the SMN message sending configuration.
// The object structure is documented below. Changing this creates a new resource.
SmnConfig *MigrationTaskSmnConfig `pulumi:"smnConfig"`
// Specifies the CDN information. If this parameter is contained,
// using CDN to download source data is supported, the source objects to be migrated are obtained from the CDN domain
// name during migration. The object structure is documented below.
// Changing this creates a new resource.
SourceCdn *MigrationTaskSourceCdn `pulumi:"sourceCdn"`
// Specifies the source information. The object
// structure is documented below. Changing this creates a new resource.
SourceObject *MigrationTaskSourceObject `pulumi:"sourceObject"`
// Specifies whether to start the task. Default value: **true**.
StartTask *bool `pulumi:"startTask"`
// The status the migration task. The value can be:
// + **1**: Waiting to migrate.
// + **2**: Migrating.
// + **3**: Migration paused.
// + **4**: Migration failed.
// + **5**: Migration succeeded.
Status *int `pulumi:"status"`
// Specifies the task type. The value can be:
// + **list**: indicates migrating objects using an object list.
// + **url_list**: indicates migrating objects using a URL object list.
// + **object**: indicates migrating selected files or folders.
// + **prefix**: indicates migrating objects with specified prefixes.
Type *string `pulumi:"type"`
}
type MigrationTaskState struct {
// Specifies the traffic limit rules. Each element in the array
// corresponds to the maximum bandwidth of a time segment. A maximum of 5 time segments are allowed, and the time
// segments must not overlap. The object structure is documented below.
BandwidthPolicies MigrationTaskBandwidthPolicyArrayInput
// Specifies the description of the task.
// Changing this creates a new resource.
Description pulumi.StringPtrInput
// Specifies the destination information. The object
// structure is documented below. Changing this creates a new resource.
DestinationObject MigrationTaskDestinationObjectPtrInput
// Specifies whether to record failed objects. If this
// function is enabled, information about objects that fail to be migrated will be stored in the destination bucket.
// Default value: **true**. Changing this creates a new resource.
EnableFailedObjectRecording pulumi.BoolPtrInput
// Specifies whether to enable the KMS encryption function.
// Default value: **false**. Changing this creates a new resource.
EnableKms pulumi.BoolPtrInput
// Specifies whether to automatically restore the archive data. If enabled,
// archive data is automatically restored and migrated. Default value: **false**. Changing this creates a new resource.
EnableRestore pulumi.BoolPtrInput
// Specifies a time in format **yyyy-MM-dd HH:mm:ss**,
// e.g. **2006-01-02 15:04:05**. The system migrates only the objects that are modified after the specified time.
// No time is specified by default. Changing this creates a new resource.
MigrateSince pulumi.StringPtrInput
// The name of the migration task.
Name pulumi.StringPtrInput
// Specifies the region where the destination bucket is located.
// Changing this creates a new resource.
Region pulumi.StringPtrInput
// Specifies the SMN message sending configuration.
// The object structure is documented below. Changing this creates a new resource.
SmnConfig MigrationTaskSmnConfigPtrInput
// Specifies the CDN information. If this parameter is contained,
// using CDN to download source data is supported, the source objects to be migrated are obtained from the CDN domain
// name during migration. The object structure is documented below.
// Changing this creates a new resource.
SourceCdn MigrationTaskSourceCdnPtrInput
// Specifies the source information. The object
// structure is documented below. Changing this creates a new resource.
SourceObject MigrationTaskSourceObjectPtrInput
// Specifies whether to start the task. Default value: **true**.
StartTask pulumi.BoolPtrInput
// The status the migration task. The value can be:
// + **1**: Waiting to migrate.
// + **2**: Migrating.
// + **3**: Migration paused.
// + **4**: Migration failed.
// + **5**: Migration succeeded.
Status pulumi.IntPtrInput
// Specifies the task type. The value can be:
// + **list**: indicates migrating objects using an object list.
// + **url_list**: indicates migrating objects using a URL object list.
// + **object**: indicates migrating selected files or folders.
// + **prefix**: indicates migrating objects with specified prefixes.
Type pulumi.StringPtrInput
}
func (MigrationTaskState) ElementType() reflect.Type {
return reflect.TypeOf((*migrationTaskState)(nil)).Elem()
}
type migrationTaskArgs struct {
// Specifies the traffic limit rules. Each element in the array
// corresponds to the maximum bandwidth of a time segment. A maximum of 5 time segments are allowed, and the time
// segments must not overlap. The object structure is documented below.
BandwidthPolicies []MigrationTaskBandwidthPolicy `pulumi:"bandwidthPolicies"`
// Specifies the description of the task.
// Changing this creates a new resource.
Description *string `pulumi:"description"`
// Specifies the destination information. The object
// structure is documented below. Changing this creates a new resource.
DestinationObject MigrationTaskDestinationObject `pulumi:"destinationObject"`
// Specifies whether to record failed objects. If this
// function is enabled, information about objects that fail to be migrated will be stored in the destination bucket.
// Default value: **true**. Changing this creates a new resource.
EnableFailedObjectRecording *bool `pulumi:"enableFailedObjectRecording"`
// Specifies whether to enable the KMS encryption function.
// Default value: **false**. Changing this creates a new resource.
EnableKms *bool `pulumi:"enableKms"`
// Specifies whether to automatically restore the archive data. If enabled,
// archive data is automatically restored and migrated. Default value: **false**. Changing this creates a new resource.
EnableRestore *bool `pulumi:"enableRestore"`
// Specifies a time in format **yyyy-MM-dd HH:mm:ss**,
// e.g. **2006-01-02 15:04:05**. The system migrates only the objects that are modified after the specified time.
// No time is specified by default. Changing this creates a new resource.
MigrateSince *string `pulumi:"migrateSince"`
// Specifies the region where the destination bucket is located.
// Changing this creates a new resource.
Region *string `pulumi:"region"`
// Specifies the SMN message sending configuration.
// The object structure is documented below. Changing this creates a new resource.
SmnConfig *MigrationTaskSmnConfig `pulumi:"smnConfig"`
// Specifies the CDN information. If this parameter is contained,
// using CDN to download source data is supported, the source objects to be migrated are obtained from the CDN domain
// name during migration. The object structure is documented below.
// Changing this creates a new resource.
SourceCdn *MigrationTaskSourceCdn `pulumi:"sourceCdn"`
// Specifies the source information. The object
// structure is documented below. Changing this creates a new resource.
SourceObject MigrationTaskSourceObject `pulumi:"sourceObject"`
// Specifies whether to start the task. Default value: **true**.
StartTask *bool `pulumi:"startTask"`
// Specifies the task type. The value can be:
// + **list**: indicates migrating objects using an object list.
// + **url_list**: indicates migrating objects using a URL object list.
// + **object**: indicates migrating selected files or folders.
// + **prefix**: indicates migrating objects with specified prefixes.
Type string `pulumi:"type"`
}
// The set of arguments for constructing a MigrationTask resource.
type MigrationTaskArgs struct {
// Specifies the traffic limit rules. Each element in the array
// corresponds to the maximum bandwidth of a time segment. A maximum of 5 time segments are allowed, and the time
// segments must not overlap. The object structure is documented below.
BandwidthPolicies MigrationTaskBandwidthPolicyArrayInput
// Specifies the description of the task.
// Changing this creates a new resource.
Description pulumi.StringPtrInput
// Specifies the destination information. The object
// structure is documented below. Changing this creates a new resource.
DestinationObject MigrationTaskDestinationObjectInput
// Specifies whether to record failed objects. If this
// function is enabled, information about objects that fail to be migrated will be stored in the destination bucket.
// Default value: **true**. Changing this creates a new resource.
EnableFailedObjectRecording pulumi.BoolPtrInput
// Specifies whether to enable the KMS encryption function.
// Default value: **false**. Changing this creates a new resource.
EnableKms pulumi.BoolPtrInput
// Specifies whether to automatically restore the archive data. If enabled,
// archive data is automatically restored and migrated. Default value: **false**. Changing this creates a new resource.
EnableRestore pulumi.BoolPtrInput
// Specifies a time in format **yyyy-MM-dd HH:mm:ss**,
// e.g. **2006-01-02 15:04:05**. The system migrates only the objects that are modified after the specified time.
// No time is specified by default. Changing this creates a new resource.
MigrateSince pulumi.StringPtrInput
// Specifies the region where the destination bucket is located.
// Changing this creates a new resource.
Region pulumi.StringPtrInput
// Specifies the SMN message sending configuration.
// The object structure is documented below. Changing this creates a new resource.
SmnConfig MigrationTaskSmnConfigPtrInput
// Specifies the CDN information. If this parameter is contained,
// using CDN to download source data is supported, the source objects to be migrated are obtained from the CDN domain
// name during migration. The object structure is documented below.
// Changing this creates a new resource.
SourceCdn MigrationTaskSourceCdnPtrInput
// Specifies the source information. The object
// structure is documented below. Changing this creates a new resource.
SourceObject MigrationTaskSourceObjectInput
// Specifies whether to start the task. Default value: **true**.
StartTask pulumi.BoolPtrInput
// Specifies the task type. The value can be:
// + **list**: indicates migrating objects using an object list.
// + **url_list**: indicates migrating objects using a URL object list.
// + **object**: indicates migrating selected files or folders.
// + **prefix**: indicates migrating objects with specified prefixes.
Type pulumi.StringInput
}
func (MigrationTaskArgs) ElementType() reflect.Type {
return reflect.TypeOf((*migrationTaskArgs)(nil)).Elem()
}
type MigrationTaskInput interface {
pulumi.Input
ToMigrationTaskOutput() MigrationTaskOutput
ToMigrationTaskOutputWithContext(ctx context.Context) MigrationTaskOutput
}
func (*MigrationTask) ElementType() reflect.Type {
return reflect.TypeOf((**MigrationTask)(nil)).Elem()
}
func (i *MigrationTask) ToMigrationTaskOutput() MigrationTaskOutput {
return i.ToMigrationTaskOutputWithContext(context.Background())
}
func (i *MigrationTask) ToMigrationTaskOutputWithContext(ctx context.Context) MigrationTaskOutput {
return pulumi.ToOutputWithContext(ctx, i).(MigrationTaskOutput)
}
// MigrationTaskArrayInput is an input type that accepts MigrationTaskArray and MigrationTaskArrayOutput values.
// You can construct a concrete instance of `MigrationTaskArrayInput` via:
//
// MigrationTaskArray{ MigrationTaskArgs{...} }
type MigrationTaskArrayInput interface {
pulumi.Input
ToMigrationTaskArrayOutput() MigrationTaskArrayOutput
ToMigrationTaskArrayOutputWithContext(context.Context) MigrationTaskArrayOutput
}
type MigrationTaskArray []MigrationTaskInput
func (MigrationTaskArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MigrationTask)(nil)).Elem()
}
func (i MigrationTaskArray) ToMigrationTaskArrayOutput() MigrationTaskArrayOutput {
return i.ToMigrationTaskArrayOutputWithContext(context.Background())
}
func (i MigrationTaskArray) ToMigrationTaskArrayOutputWithContext(ctx context.Context) MigrationTaskArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(MigrationTaskArrayOutput)
}
// MigrationTaskMapInput is an input type that accepts MigrationTaskMap and MigrationTaskMapOutput values.
// You can construct a concrete instance of `MigrationTaskMapInput` via:
//
// MigrationTaskMap{ "key": MigrationTaskArgs{...} }
type MigrationTaskMapInput interface {
pulumi.Input
ToMigrationTaskMapOutput() MigrationTaskMapOutput
ToMigrationTaskMapOutputWithContext(context.Context) MigrationTaskMapOutput
}
type MigrationTaskMap map[string]MigrationTaskInput
func (MigrationTaskMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MigrationTask)(nil)).Elem()
}
func (i MigrationTaskMap) ToMigrationTaskMapOutput() MigrationTaskMapOutput {
return i.ToMigrationTaskMapOutputWithContext(context.Background())
}
func (i MigrationTaskMap) ToMigrationTaskMapOutputWithContext(ctx context.Context) MigrationTaskMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(MigrationTaskMapOutput)
}
type MigrationTaskOutput struct{ *pulumi.OutputState }
func (MigrationTaskOutput) ElementType() reflect.Type {
return reflect.TypeOf((**MigrationTask)(nil)).Elem()
}
func (o MigrationTaskOutput) ToMigrationTaskOutput() MigrationTaskOutput {
return o
}
func (o MigrationTaskOutput) ToMigrationTaskOutputWithContext(ctx context.Context) MigrationTaskOutput {
return o
}
// Specifies the traffic limit rules. Each element in the array
// corresponds to the maximum bandwidth of a time segment. A maximum of 5 time segments are allowed, and the time
// segments must not overlap. The object structure is documented below.
func (o MigrationTaskOutput) BandwidthPolicies() MigrationTaskBandwidthPolicyArrayOutput {
return o.ApplyT(func(v *MigrationTask) MigrationTaskBandwidthPolicyArrayOutput { return v.BandwidthPolicies }).(MigrationTaskBandwidthPolicyArrayOutput)
}
// Specifies the description of the task.
// Changing this creates a new resource.
func (o MigrationTaskOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MigrationTask) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Specifies the destination information. The object
// structure is documented below. Changing this creates a new resource.
func (o MigrationTaskOutput) DestinationObject() MigrationTaskDestinationObjectOutput {
return o.ApplyT(func(v *MigrationTask) MigrationTaskDestinationObjectOutput { return v.DestinationObject }).(MigrationTaskDestinationObjectOutput)
}
// Specifies whether to record failed objects. If this
// function is enabled, information about objects that fail to be migrated will be stored in the destination bucket.
// Default value: **true**. Changing this creates a new resource.
func (o MigrationTaskOutput) EnableFailedObjectRecording() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *MigrationTask) pulumi.BoolPtrOutput { return v.EnableFailedObjectRecording }).(pulumi.BoolPtrOutput)
}
// Specifies whether to enable the KMS encryption function.
// Default value: **false**. Changing this creates a new resource.
func (o MigrationTaskOutput) EnableKms() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *MigrationTask) pulumi.BoolPtrOutput { return v.EnableKms }).(pulumi.BoolPtrOutput)
}
// Specifies whether to automatically restore the archive data. If enabled,
// archive data is automatically restored and migrated. Default value: **false**. Changing this creates a new resource.
func (o MigrationTaskOutput) EnableRestore() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *MigrationTask) pulumi.BoolPtrOutput { return v.EnableRestore }).(pulumi.BoolPtrOutput)
}
// Specifies a time in format **yyyy-MM-dd HH:mm:ss**,
// e.g. **2006-01-02 15:04:05**. The system migrates only the objects that are modified after the specified time.
// No time is specified by default. Changing this creates a new resource.
func (o MigrationTaskOutput) MigrateSince() pulumi.StringOutput {
return o.ApplyT(func(v *MigrationTask) pulumi.StringOutput { return v.MigrateSince }).(pulumi.StringOutput)
}
// The name of the migration task.
func (o MigrationTaskOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *MigrationTask) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Specifies the region where the destination bucket is located.
// Changing this creates a new resource.
func (o MigrationTaskOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v *MigrationTask) pulumi.StringOutput { return v.Region }).(pulumi.StringOutput)
}
// Specifies the SMN message sending configuration.
// The object structure is documented below. Changing this creates a new resource.
func (o MigrationTaskOutput) SmnConfig() MigrationTaskSmnConfigPtrOutput {
return o.ApplyT(func(v *MigrationTask) MigrationTaskSmnConfigPtrOutput { return v.SmnConfig }).(MigrationTaskSmnConfigPtrOutput)
}
// Specifies the CDN information. If this parameter is contained,
// using CDN to download source data is supported, the source objects to be migrated are obtained from the CDN domain
// name during migration. The object structure is documented below.
// Changing this creates a new resource.
func (o MigrationTaskOutput) SourceCdn() MigrationTaskSourceCdnPtrOutput {
return o.ApplyT(func(v *MigrationTask) MigrationTaskSourceCdnPtrOutput { return v.SourceCdn }).(MigrationTaskSourceCdnPtrOutput)
}
// Specifies the source information. The object
// structure is documented below. Changing this creates a new resource.
func (o MigrationTaskOutput) SourceObject() MigrationTaskSourceObjectOutput {
return o.ApplyT(func(v *MigrationTask) MigrationTaskSourceObjectOutput { return v.SourceObject }).(MigrationTaskSourceObjectOutput)
}
// Specifies whether to start the task. Default value: **true**.
func (o MigrationTaskOutput) StartTask() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *MigrationTask) pulumi.BoolPtrOutput { return v.StartTask }).(pulumi.BoolPtrOutput)
}
// The status the migration task. The value can be:
// + **1**: Waiting to migrate.
// + **2**: Migrating.
// + **3**: Migration paused.
// + **4**: Migration failed.
// + **5**: Migration succeeded.
func (o MigrationTaskOutput) Status() pulumi.IntOutput {
return o.ApplyT(func(v *MigrationTask) pulumi.IntOutput { return v.Status }).(pulumi.IntOutput)
}
// Specifies the task type. The value can be:
// + **list**: indicates migrating objects using an object list.
// + **url_list**: indicates migrating objects using a URL object list.
// + **object**: indicates migrating selected files or folders.
// + **prefix**: indicates migrating objects with specified prefixes.
func (o MigrationTaskOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *MigrationTask) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
type MigrationTaskArrayOutput struct{ *pulumi.OutputState }
func (MigrationTaskArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MigrationTask)(nil)).Elem()
}
func (o MigrationTaskArrayOutput) ToMigrationTaskArrayOutput() MigrationTaskArrayOutput {
return o
}
func (o MigrationTaskArrayOutput) ToMigrationTaskArrayOutputWithContext(ctx context.Context) MigrationTaskArrayOutput {
return o
}
func (o MigrationTaskArrayOutput) Index(i pulumi.IntInput) MigrationTaskOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *MigrationTask {
return vs[0].([]*MigrationTask)[vs[1].(int)]
}).(MigrationTaskOutput)
}
type MigrationTaskMapOutput struct{ *pulumi.OutputState }
func (MigrationTaskMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MigrationTask)(nil)).Elem()
}
func (o MigrationTaskMapOutput) ToMigrationTaskMapOutput() MigrationTaskMapOutput {
return o
}
func (o MigrationTaskMapOutput) ToMigrationTaskMapOutputWithContext(ctx context.Context) MigrationTaskMapOutput {
return o
}
func (o MigrationTaskMapOutput) MapIndex(k pulumi.StringInput) MigrationTaskOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *MigrationTask {
return vs[0].(map[string]*MigrationTask)[vs[1].(string)]
}).(MigrationTaskOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*MigrationTaskInput)(nil)).Elem(), &MigrationTask{})
pulumi.RegisterInputType(reflect.TypeOf((*MigrationTaskArrayInput)(nil)).Elem(), MigrationTaskArray{})
pulumi.RegisterInputType(reflect.TypeOf((*MigrationTaskMapInput)(nil)).Elem(), MigrationTaskMap{})
pulumi.RegisterOutputType(MigrationTaskOutput{})
pulumi.RegisterOutputType(MigrationTaskArrayOutput{})
pulumi.RegisterOutputType(MigrationTaskMapOutput{})
}