generated from pulumi/pulumi-tf-provider-boilerplate
/
job.go
604 lines (545 loc) · 29 KB
/
job.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
// 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 mrs
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manage a job resource within HuaweiCloud MRS.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "fmt"
//
// "github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Mrs"
// "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, "")
// clusterId := cfg.RequireObject("clusterId")
// jobName := cfg.RequireObject("jobName")
// programPath := cfg.RequireObject("programPath")
// accessKey := cfg.RequireObject("accessKey")
// secretKey := cfg.RequireObject("secretKey")
// _, err := Mrs.NewJob(ctx, "test", &Mrs.JobArgs{
// ClusterId: pulumi.Any(clusterId),
// Type: pulumi.String("SparkSubmit"),
// ProgramPath: pulumi.Any(programPath),
// Parameters: pulumi.String(fmt.Sprintf("%v %v 1 obs://obs-demo-analysis/input obs://obs-demo-analysis/output", accessKey, secretKey)),
// ProgramParameters: pulumi.StringMap{
// "--class": pulumi.String("com.huawei.bigdata.spark.examples.DriverBehavior"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// MapReduce jobs can be imported using their `id` and the IDs of the MapReduce cluster to which the job belongs, separated by a slash, e.g. bash
//
// ```sh
//
// $ pulumi import huaweicloud:Mrs/job:Job test <cluster_id>/<id>
//
// ```
type Job struct {
pulumi.CustomResourceState
// Specifies an ID of the MapReduce cluster to which the job belongs to.
// Changing this will create a new MapReduce job resource.
ClusterId pulumi.StringOutput `pulumi:"clusterId"`
// The completion time of the MapReduce job.
FinishTime pulumi.StringOutput `pulumi:"finishTime"`
// Specifies the name of the MapReduce job. The name can contain 1 to 64
// characters, which may consist of letters, digits, underscores (_) and hyphens (-). Changing this will create a new
// MapReduce job resource.
Name pulumi.StringOutput `pulumi:"name"`
// Specifies the parameters for the MapReduce job. Add an at sign (@) before
// each parameter can prevent the parameters being saved in plaintext format. Each parameters are separated with spaces.
// This parameter can be set when `type` is **Flink**, **MapReduce** or **SparkSubmit**. Changing this will create a new
// MapReduce job resource.
Parameters pulumi.StringPtrOutput `pulumi:"parameters"`
// Specifies the the key/value pairs of the program parameters, such as
// thread, memory, and vCPUs, are used to optimize resource usage and improve job execution performance. This parameter
// can be set when `type` is **Flink**, **SparkSubmit**, **SparkSql**, **SparkScript**, **HiveSql** or
// **HiveScript**. Refer to the documents for each type of support key-values.
// Changing this will create a new MapReduce job resource.
ProgramParameters pulumi.StringMapOutput `pulumi:"programParameters"`
// Specifies the .jar package path or .py file path for program execution.
// The parameter must meet the following requirements:
// + Contains a maximum of 1023 characters, excluding special characters such as `;|&><'$`.
// + The address cannot be empty or full of spaces.
// + The program support OBS or DHFS to storage program file or package. For OBS, starts with (OBS:) **obs://** and end
// with **.jar** or **.py**. For DHFS, starts with (DHFS:) **/user**.
ProgramPath pulumi.StringPtrOutput `pulumi:"programPath"`
// Specifies the region in which to create the MapReduce job resource. If
// omitted, the provider-level region will be used. Changing this will create a new MapReduce job resource.
Region pulumi.StringOutput `pulumi:"region"`
// Specifies the key/value pairs used to modify service configuration.
// Parameter configurations of services are available on the Service Configuration tab page of MapReduce Manager.
// Changing this will create a new MapReduce job resource.
ServiceParameters pulumi.StringMapOutput `pulumi:"serviceParameters"`
// Specifies the SQL command or file path. Only required if `type` is **HiveSql**
// or **SparkSql**. Changing this will create a new MapReduce job resource.
Sql pulumi.StringPtrOutput `pulumi:"sql"`
// The creation time of the MapReduce job.
StartTime pulumi.StringOutput `pulumi:"startTime"`
// Status of the MapReduce job.
Status pulumi.StringOutput `pulumi:"status"`
// The submission time of the MapReduce job.
SubmitTime pulumi.StringOutput `pulumi:"submitTime"`
// Specifies the job type.
// <a name="mapreduceJobType"></a>
// The valid values are as follows:
// + [Flink](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0527.html)
// + [HiveSql](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0525.html)
// + [HiveScript](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0525.html)
// + [MapReduce](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0052.html)
// + [SparkSubmit](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0524.html)
// + [SparkSql](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0526.html)
// + [SparkScript](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0526.html)
Type pulumi.StringOutput `pulumi:"type"`
}
// NewJob registers a new resource with the given unique name, arguments, and options.
func NewJob(ctx *pulumi.Context,
name string, args *JobArgs, opts ...pulumi.ResourceOption) (*Job, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ClusterId == nil {
return nil, errors.New("invalid value for required argument 'ClusterId'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
opts = pkgResourceDefaultOpts(opts)
var resource Job
err := ctx.RegisterResource("huaweicloud:Mrs/job:Job", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetJob gets an existing Job 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 GetJob(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *JobState, opts ...pulumi.ResourceOption) (*Job, error) {
var resource Job
err := ctx.ReadResource("huaweicloud:Mrs/job:Job", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Job resources.
type jobState struct {
// Specifies an ID of the MapReduce cluster to which the job belongs to.
// Changing this will create a new MapReduce job resource.
ClusterId *string `pulumi:"clusterId"`
// The completion time of the MapReduce job.
FinishTime *string `pulumi:"finishTime"`
// Specifies the name of the MapReduce job. The name can contain 1 to 64
// characters, which may consist of letters, digits, underscores (_) and hyphens (-). Changing this will create a new
// MapReduce job resource.
Name *string `pulumi:"name"`
// Specifies the parameters for the MapReduce job. Add an at sign (@) before
// each parameter can prevent the parameters being saved in plaintext format. Each parameters are separated with spaces.
// This parameter can be set when `type` is **Flink**, **MapReduce** or **SparkSubmit**. Changing this will create a new
// MapReduce job resource.
Parameters *string `pulumi:"parameters"`
// Specifies the the key/value pairs of the program parameters, such as
// thread, memory, and vCPUs, are used to optimize resource usage and improve job execution performance. This parameter
// can be set when `type` is **Flink**, **SparkSubmit**, **SparkSql**, **SparkScript**, **HiveSql** or
// **HiveScript**. Refer to the documents for each type of support key-values.
// Changing this will create a new MapReduce job resource.
ProgramParameters map[string]string `pulumi:"programParameters"`
// Specifies the .jar package path or .py file path for program execution.
// The parameter must meet the following requirements:
// + Contains a maximum of 1023 characters, excluding special characters such as `;|&><'$`.
// + The address cannot be empty or full of spaces.
// + The program support OBS or DHFS to storage program file or package. For OBS, starts with (OBS:) **obs://** and end
// with **.jar** or **.py**. For DHFS, starts with (DHFS:) **/user**.
ProgramPath *string `pulumi:"programPath"`
// Specifies the region in which to create the MapReduce job resource. If
// omitted, the provider-level region will be used. Changing this will create a new MapReduce job resource.
Region *string `pulumi:"region"`
// Specifies the key/value pairs used to modify service configuration.
// Parameter configurations of services are available on the Service Configuration tab page of MapReduce Manager.
// Changing this will create a new MapReduce job resource.
ServiceParameters map[string]string `pulumi:"serviceParameters"`
// Specifies the SQL command or file path. Only required if `type` is **HiveSql**
// or **SparkSql**. Changing this will create a new MapReduce job resource.
Sql *string `pulumi:"sql"`
// The creation time of the MapReduce job.
StartTime *string `pulumi:"startTime"`
// Status of the MapReduce job.
Status *string `pulumi:"status"`
// The submission time of the MapReduce job.
SubmitTime *string `pulumi:"submitTime"`
// Specifies the job type.
// <a name="mapreduceJobType"></a>
// The valid values are as follows:
// + [Flink](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0527.html)
// + [HiveSql](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0525.html)
// + [HiveScript](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0525.html)
// + [MapReduce](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0052.html)
// + [SparkSubmit](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0524.html)
// + [SparkSql](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0526.html)
// + [SparkScript](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0526.html)
Type *string `pulumi:"type"`
}
type JobState struct {
// Specifies an ID of the MapReduce cluster to which the job belongs to.
// Changing this will create a new MapReduce job resource.
ClusterId pulumi.StringPtrInput
// The completion time of the MapReduce job.
FinishTime pulumi.StringPtrInput
// Specifies the name of the MapReduce job. The name can contain 1 to 64
// characters, which may consist of letters, digits, underscores (_) and hyphens (-). Changing this will create a new
// MapReduce job resource.
Name pulumi.StringPtrInput
// Specifies the parameters for the MapReduce job. Add an at sign (@) before
// each parameter can prevent the parameters being saved in plaintext format. Each parameters are separated with spaces.
// This parameter can be set when `type` is **Flink**, **MapReduce** or **SparkSubmit**. Changing this will create a new
// MapReduce job resource.
Parameters pulumi.StringPtrInput
// Specifies the the key/value pairs of the program parameters, such as
// thread, memory, and vCPUs, are used to optimize resource usage and improve job execution performance. This parameter
// can be set when `type` is **Flink**, **SparkSubmit**, **SparkSql**, **SparkScript**, **HiveSql** or
// **HiveScript**. Refer to the documents for each type of support key-values.
// Changing this will create a new MapReduce job resource.
ProgramParameters pulumi.StringMapInput
// Specifies the .jar package path or .py file path for program execution.
// The parameter must meet the following requirements:
// + Contains a maximum of 1023 characters, excluding special characters such as `;|&><'$`.
// + The address cannot be empty or full of spaces.
// + The program support OBS or DHFS to storage program file or package. For OBS, starts with (OBS:) **obs://** and end
// with **.jar** or **.py**. For DHFS, starts with (DHFS:) **/user**.
ProgramPath pulumi.StringPtrInput
// Specifies the region in which to create the MapReduce job resource. If
// omitted, the provider-level region will be used. Changing this will create a new MapReduce job resource.
Region pulumi.StringPtrInput
// Specifies the key/value pairs used to modify service configuration.
// Parameter configurations of services are available on the Service Configuration tab page of MapReduce Manager.
// Changing this will create a new MapReduce job resource.
ServiceParameters pulumi.StringMapInput
// Specifies the SQL command or file path. Only required if `type` is **HiveSql**
// or **SparkSql**. Changing this will create a new MapReduce job resource.
Sql pulumi.StringPtrInput
// The creation time of the MapReduce job.
StartTime pulumi.StringPtrInput
// Status of the MapReduce job.
Status pulumi.StringPtrInput
// The submission time of the MapReduce job.
SubmitTime pulumi.StringPtrInput
// Specifies the job type.
// <a name="mapreduceJobType"></a>
// The valid values are as follows:
// + [Flink](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0527.html)
// + [HiveSql](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0525.html)
// + [HiveScript](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0525.html)
// + [MapReduce](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0052.html)
// + [SparkSubmit](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0524.html)
// + [SparkSql](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0526.html)
// + [SparkScript](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0526.html)
Type pulumi.StringPtrInput
}
func (JobState) ElementType() reflect.Type {
return reflect.TypeOf((*jobState)(nil)).Elem()
}
type jobArgs struct {
// Specifies an ID of the MapReduce cluster to which the job belongs to.
// Changing this will create a new MapReduce job resource.
ClusterId string `pulumi:"clusterId"`
// Specifies the name of the MapReduce job. The name can contain 1 to 64
// characters, which may consist of letters, digits, underscores (_) and hyphens (-). Changing this will create a new
// MapReduce job resource.
Name *string `pulumi:"name"`
// Specifies the parameters for the MapReduce job. Add an at sign (@) before
// each parameter can prevent the parameters being saved in plaintext format. Each parameters are separated with spaces.
// This parameter can be set when `type` is **Flink**, **MapReduce** or **SparkSubmit**. Changing this will create a new
// MapReduce job resource.
Parameters *string `pulumi:"parameters"`
// Specifies the the key/value pairs of the program parameters, such as
// thread, memory, and vCPUs, are used to optimize resource usage and improve job execution performance. This parameter
// can be set when `type` is **Flink**, **SparkSubmit**, **SparkSql**, **SparkScript**, **HiveSql** or
// **HiveScript**. Refer to the documents for each type of support key-values.
// Changing this will create a new MapReduce job resource.
ProgramParameters map[string]string `pulumi:"programParameters"`
// Specifies the .jar package path or .py file path for program execution.
// The parameter must meet the following requirements:
// + Contains a maximum of 1023 characters, excluding special characters such as `;|&><'$`.
// + The address cannot be empty or full of spaces.
// + The program support OBS or DHFS to storage program file or package. For OBS, starts with (OBS:) **obs://** and end
// with **.jar** or **.py**. For DHFS, starts with (DHFS:) **/user**.
ProgramPath *string `pulumi:"programPath"`
// Specifies the region in which to create the MapReduce job resource. If
// omitted, the provider-level region will be used. Changing this will create a new MapReduce job resource.
Region *string `pulumi:"region"`
// Specifies the key/value pairs used to modify service configuration.
// Parameter configurations of services are available on the Service Configuration tab page of MapReduce Manager.
// Changing this will create a new MapReduce job resource.
ServiceParameters map[string]string `pulumi:"serviceParameters"`
// Specifies the SQL command or file path. Only required if `type` is **HiveSql**
// or **SparkSql**. Changing this will create a new MapReduce job resource.
Sql *string `pulumi:"sql"`
// Specifies the job type.
// <a name="mapreduceJobType"></a>
// The valid values are as follows:
// + [Flink](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0527.html)
// + [HiveSql](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0525.html)
// + [HiveScript](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0525.html)
// + [MapReduce](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0052.html)
// + [SparkSubmit](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0524.html)
// + [SparkSql](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0526.html)
// + [SparkScript](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0526.html)
Type string `pulumi:"type"`
}
// The set of arguments for constructing a Job resource.
type JobArgs struct {
// Specifies an ID of the MapReduce cluster to which the job belongs to.
// Changing this will create a new MapReduce job resource.
ClusterId pulumi.StringInput
// Specifies the name of the MapReduce job. The name can contain 1 to 64
// characters, which may consist of letters, digits, underscores (_) and hyphens (-). Changing this will create a new
// MapReduce job resource.
Name pulumi.StringPtrInput
// Specifies the parameters for the MapReduce job. Add an at sign (@) before
// each parameter can prevent the parameters being saved in plaintext format. Each parameters are separated with spaces.
// This parameter can be set when `type` is **Flink**, **MapReduce** or **SparkSubmit**. Changing this will create a new
// MapReduce job resource.
Parameters pulumi.StringPtrInput
// Specifies the the key/value pairs of the program parameters, such as
// thread, memory, and vCPUs, are used to optimize resource usage and improve job execution performance. This parameter
// can be set when `type` is **Flink**, **SparkSubmit**, **SparkSql**, **SparkScript**, **HiveSql** or
// **HiveScript**. Refer to the documents for each type of support key-values.
// Changing this will create a new MapReduce job resource.
ProgramParameters pulumi.StringMapInput
// Specifies the .jar package path or .py file path for program execution.
// The parameter must meet the following requirements:
// + Contains a maximum of 1023 characters, excluding special characters such as `;|&><'$`.
// + The address cannot be empty or full of spaces.
// + The program support OBS or DHFS to storage program file or package. For OBS, starts with (OBS:) **obs://** and end
// with **.jar** or **.py**. For DHFS, starts with (DHFS:) **/user**.
ProgramPath pulumi.StringPtrInput
// Specifies the region in which to create the MapReduce job resource. If
// omitted, the provider-level region will be used. Changing this will create a new MapReduce job resource.
Region pulumi.StringPtrInput
// Specifies the key/value pairs used to modify service configuration.
// Parameter configurations of services are available on the Service Configuration tab page of MapReduce Manager.
// Changing this will create a new MapReduce job resource.
ServiceParameters pulumi.StringMapInput
// Specifies the SQL command or file path. Only required if `type` is **HiveSql**
// or **SparkSql**. Changing this will create a new MapReduce job resource.
Sql pulumi.StringPtrInput
// Specifies the job type.
// <a name="mapreduceJobType"></a>
// The valid values are as follows:
// + [Flink](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0527.html)
// + [HiveSql](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0525.html)
// + [HiveScript](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0525.html)
// + [MapReduce](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0052.html)
// + [SparkSubmit](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0524.html)
// + [SparkSql](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0526.html)
// + [SparkScript](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0526.html)
Type pulumi.StringInput
}
func (JobArgs) ElementType() reflect.Type {
return reflect.TypeOf((*jobArgs)(nil)).Elem()
}
type JobInput interface {
pulumi.Input
ToJobOutput() JobOutput
ToJobOutputWithContext(ctx context.Context) JobOutput
}
func (*Job) ElementType() reflect.Type {
return reflect.TypeOf((**Job)(nil)).Elem()
}
func (i *Job) ToJobOutput() JobOutput {
return i.ToJobOutputWithContext(context.Background())
}
func (i *Job) ToJobOutputWithContext(ctx context.Context) JobOutput {
return pulumi.ToOutputWithContext(ctx, i).(JobOutput)
}
// JobArrayInput is an input type that accepts JobArray and JobArrayOutput values.
// You can construct a concrete instance of `JobArrayInput` via:
//
// JobArray{ JobArgs{...} }
type JobArrayInput interface {
pulumi.Input
ToJobArrayOutput() JobArrayOutput
ToJobArrayOutputWithContext(context.Context) JobArrayOutput
}
type JobArray []JobInput
func (JobArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Job)(nil)).Elem()
}
func (i JobArray) ToJobArrayOutput() JobArrayOutput {
return i.ToJobArrayOutputWithContext(context.Background())
}
func (i JobArray) ToJobArrayOutputWithContext(ctx context.Context) JobArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(JobArrayOutput)
}
// JobMapInput is an input type that accepts JobMap and JobMapOutput values.
// You can construct a concrete instance of `JobMapInput` via:
//
// JobMap{ "key": JobArgs{...} }
type JobMapInput interface {
pulumi.Input
ToJobMapOutput() JobMapOutput
ToJobMapOutputWithContext(context.Context) JobMapOutput
}
type JobMap map[string]JobInput
func (JobMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Job)(nil)).Elem()
}
func (i JobMap) ToJobMapOutput() JobMapOutput {
return i.ToJobMapOutputWithContext(context.Background())
}
func (i JobMap) ToJobMapOutputWithContext(ctx context.Context) JobMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(JobMapOutput)
}
type JobOutput struct{ *pulumi.OutputState }
func (JobOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Job)(nil)).Elem()
}
func (o JobOutput) ToJobOutput() JobOutput {
return o
}
func (o JobOutput) ToJobOutputWithContext(ctx context.Context) JobOutput {
return o
}
// Specifies an ID of the MapReduce cluster to which the job belongs to.
// Changing this will create a new MapReduce job resource.
func (o JobOutput) ClusterId() pulumi.StringOutput {
return o.ApplyT(func(v *Job) pulumi.StringOutput { return v.ClusterId }).(pulumi.StringOutput)
}
// The completion time of the MapReduce job.
func (o JobOutput) FinishTime() pulumi.StringOutput {
return o.ApplyT(func(v *Job) pulumi.StringOutput { return v.FinishTime }).(pulumi.StringOutput)
}
// Specifies the name of the MapReduce job. The name can contain 1 to 64
// characters, which may consist of letters, digits, underscores (_) and hyphens (-). Changing this will create a new
// MapReduce job resource.
func (o JobOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Job) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Specifies the parameters for the MapReduce job. Add an at sign (@) before
// each parameter can prevent the parameters being saved in plaintext format. Each parameters are separated with spaces.
// This parameter can be set when `type` is **Flink**, **MapReduce** or **SparkSubmit**. Changing this will create a new
// MapReduce job resource.
func (o JobOutput) Parameters() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Job) pulumi.StringPtrOutput { return v.Parameters }).(pulumi.StringPtrOutput)
}
// Specifies the the key/value pairs of the program parameters, such as
// thread, memory, and vCPUs, are used to optimize resource usage and improve job execution performance. This parameter
// can be set when `type` is **Flink**, **SparkSubmit**, **SparkSql**, **SparkScript**, **HiveSql** or
// **HiveScript**. Refer to the documents for each type of support key-values.
// Changing this will create a new MapReduce job resource.
func (o JobOutput) ProgramParameters() pulumi.StringMapOutput {
return o.ApplyT(func(v *Job) pulumi.StringMapOutput { return v.ProgramParameters }).(pulumi.StringMapOutput)
}
// Specifies the .jar package path or .py file path for program execution.
// The parameter must meet the following requirements:
// - Contains a maximum of 1023 characters, excluding special characters such as `;|&><'$`.
// - The address cannot be empty or full of spaces.
// - The program support OBS or DHFS to storage program file or package. For OBS, starts with (OBS:) **obs://** and end
// with **.jar** or **.py**. For DHFS, starts with (DHFS:) **/user**.
func (o JobOutput) ProgramPath() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Job) pulumi.StringPtrOutput { return v.ProgramPath }).(pulumi.StringPtrOutput)
}
// Specifies the region in which to create the MapReduce job resource. If
// omitted, the provider-level region will be used. Changing this will create a new MapReduce job resource.
func (o JobOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v *Job) pulumi.StringOutput { return v.Region }).(pulumi.StringOutput)
}
// Specifies the key/value pairs used to modify service configuration.
// Parameter configurations of services are available on the Service Configuration tab page of MapReduce Manager.
// Changing this will create a new MapReduce job resource.
func (o JobOutput) ServiceParameters() pulumi.StringMapOutput {
return o.ApplyT(func(v *Job) pulumi.StringMapOutput { return v.ServiceParameters }).(pulumi.StringMapOutput)
}
// Specifies the SQL command or file path. Only required if `type` is **HiveSql**
// or **SparkSql**. Changing this will create a new MapReduce job resource.
func (o JobOutput) Sql() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Job) pulumi.StringPtrOutput { return v.Sql }).(pulumi.StringPtrOutput)
}
// The creation time of the MapReduce job.
func (o JobOutput) StartTime() pulumi.StringOutput {
return o.ApplyT(func(v *Job) pulumi.StringOutput { return v.StartTime }).(pulumi.StringOutput)
}
// Status of the MapReduce job.
func (o JobOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v *Job) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
}
// The submission time of the MapReduce job.
func (o JobOutput) SubmitTime() pulumi.StringOutput {
return o.ApplyT(func(v *Job) pulumi.StringOutput { return v.SubmitTime }).(pulumi.StringOutput)
}
// Specifies the job type.
// <a name="mapreduceJobType"></a>
// The valid values are as follows:
// + [Flink](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0527.html)
// + [HiveSql](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0525.html)
// + [HiveScript](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0525.html)
// + [MapReduce](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0052.html)
// + [SparkSubmit](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0524.html)
// + [SparkSql](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0526.html)
// + [SparkScript](https://support.huaweicloud.com/intl/en-us/usermanual-mrs/mrs_01_0526.html)
func (o JobOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *Job) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
type JobArrayOutput struct{ *pulumi.OutputState }
func (JobArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Job)(nil)).Elem()
}
func (o JobArrayOutput) ToJobArrayOutput() JobArrayOutput {
return o
}
func (o JobArrayOutput) ToJobArrayOutputWithContext(ctx context.Context) JobArrayOutput {
return o
}
func (o JobArrayOutput) Index(i pulumi.IntInput) JobOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Job {
return vs[0].([]*Job)[vs[1].(int)]
}).(JobOutput)
}
type JobMapOutput struct{ *pulumi.OutputState }
func (JobMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Job)(nil)).Elem()
}
func (o JobMapOutput) ToJobMapOutput() JobMapOutput {
return o
}
func (o JobMapOutput) ToJobMapOutputWithContext(ctx context.Context) JobMapOutput {
return o
}
func (o JobMapOutput) MapIndex(k pulumi.StringInput) JobOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Job {
return vs[0].(map[string]*Job)[vs[1].(string)]
}).(JobOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*JobInput)(nil)).Elem(), &Job{})
pulumi.RegisterInputType(reflect.TypeOf((*JobArrayInput)(nil)).Elem(), JobArray{})
pulumi.RegisterInputType(reflect.TypeOf((*JobMapInput)(nil)).Elem(), JobMap{})
pulumi.RegisterOutputType(JobOutput{})
pulumi.RegisterOutputType(JobArrayOutput{})
pulumi.RegisterOutputType(JobMapOutput{})
}