generated from pulumi/pulumi-tf-provider-boilerplate
/
meInstallationTemplatePartitionSchemePartition.go
403 lines (348 loc) · 18.5 KB
/
meInstallationTemplatePartitionSchemePartition.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
// 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 ovh
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this resource to create a partition in the partition scheme of a custom installation template available for dedicated servers.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-ovh/sdk/go/ovh"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// mytemplate, err := ovh.NewMeInstallationTemplate(ctx, "mytemplate", &ovh.MeInstallationTemplateArgs{
// BaseTemplateName: pulumi.String("centos7_64"),
// TemplateName: pulumi.String("mytemplate"),
// DefaultLanguage: pulumi.String("fr"),
// })
// if err != nil {
// return err
// }
// scheme, err := ovh.NewMeInstallationTemplatePartitionScheme(ctx, "scheme", &ovh.MeInstallationTemplatePartitionSchemeArgs{
// TemplateName: mytemplate.TemplateName,
// Priority: pulumi.Int(1),
// })
// if err != nil {
// return err
// }
// _, err = ovh.NewMeInstallationTemplatePartitionSchemePartition(ctx, "root", &ovh.MeInstallationTemplatePartitionSchemePartitionArgs{
// TemplateName: scheme.TemplateName,
// SchemeName: scheme.Name,
// Mountpoint: pulumi.String("/"),
// Filesystem: pulumi.String("ext4"),
// Size: pulumi.Int(400),
// Order: pulumi.Int(1),
// Type: pulumi.String("primary"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Use the fake id format to import the resource `template_name/scheme_name/mountpoint` (example"mytemplate/myscheme//").
type MeInstallationTemplatePartitionSchemePartition struct {
pulumi.CustomResourceState
// Partition filesystem
Filesystem pulumi.StringOutput `pulumi:"filesystem"`
// partition mount point
Mountpoint pulumi.StringOutput `pulumi:"mountpoint"`
// step or order. specifies the creation order of the partition on the disk
Order pulumi.IntOutput `pulumi:"order"`
// raid partition type
Raid pulumi.StringOutput `pulumi:"raid"`
// name of this partitioning scheme
SchemeName pulumi.StringOutput `pulumi:"schemeName"`
// size of partition in MB, 0 => rest of the space
Size pulumi.IntOutput `pulumi:"size"`
// Template name
TemplateName pulumi.StringOutput `pulumi:"templateName"`
// partition type
Type pulumi.StringOutput `pulumi:"type"`
// The volume name needed for proxmox distribution
VolumeName pulumi.StringOutput `pulumi:"volumeName"`
}
// NewMeInstallationTemplatePartitionSchemePartition registers a new resource with the given unique name, arguments, and options.
func NewMeInstallationTemplatePartitionSchemePartition(ctx *pulumi.Context,
name string, args *MeInstallationTemplatePartitionSchemePartitionArgs, opts ...pulumi.ResourceOption) (*MeInstallationTemplatePartitionSchemePartition, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Filesystem == nil {
return nil, errors.New("invalid value for required argument 'Filesystem'")
}
if args.Mountpoint == nil {
return nil, errors.New("invalid value for required argument 'Mountpoint'")
}
if args.Order == nil {
return nil, errors.New("invalid value for required argument 'Order'")
}
if args.SchemeName == nil {
return nil, errors.New("invalid value for required argument 'SchemeName'")
}
if args.Size == nil {
return nil, errors.New("invalid value for required argument 'Size'")
}
if args.TemplateName == nil {
return nil, errors.New("invalid value for required argument 'TemplateName'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
var resource MeInstallationTemplatePartitionSchemePartition
err := ctx.RegisterResource("ovh:index/meInstallationTemplatePartitionSchemePartition:MeInstallationTemplatePartitionSchemePartition", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetMeInstallationTemplatePartitionSchemePartition gets an existing MeInstallationTemplatePartitionSchemePartition 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 GetMeInstallationTemplatePartitionSchemePartition(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *MeInstallationTemplatePartitionSchemePartitionState, opts ...pulumi.ResourceOption) (*MeInstallationTemplatePartitionSchemePartition, error) {
var resource MeInstallationTemplatePartitionSchemePartition
err := ctx.ReadResource("ovh:index/meInstallationTemplatePartitionSchemePartition:MeInstallationTemplatePartitionSchemePartition", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering MeInstallationTemplatePartitionSchemePartition resources.
type meInstallationTemplatePartitionSchemePartitionState struct {
// Partition filesystem
Filesystem *string `pulumi:"filesystem"`
// partition mount point
Mountpoint *string `pulumi:"mountpoint"`
// step or order. specifies the creation order of the partition on the disk
Order *int `pulumi:"order"`
// raid partition type
Raid *string `pulumi:"raid"`
// name of this partitioning scheme
SchemeName *string `pulumi:"schemeName"`
// size of partition in MB, 0 => rest of the space
Size *int `pulumi:"size"`
// Template name
TemplateName *string `pulumi:"templateName"`
// partition type
Type *string `pulumi:"type"`
// The volume name needed for proxmox distribution
VolumeName *string `pulumi:"volumeName"`
}
type MeInstallationTemplatePartitionSchemePartitionState struct {
// Partition filesystem
Filesystem pulumi.StringPtrInput
// partition mount point
Mountpoint pulumi.StringPtrInput
// step or order. specifies the creation order of the partition on the disk
Order pulumi.IntPtrInput
// raid partition type
Raid pulumi.StringPtrInput
// name of this partitioning scheme
SchemeName pulumi.StringPtrInput
// size of partition in MB, 0 => rest of the space
Size pulumi.IntPtrInput
// Template name
TemplateName pulumi.StringPtrInput
// partition type
Type pulumi.StringPtrInput
// The volume name needed for proxmox distribution
VolumeName pulumi.StringPtrInput
}
func (MeInstallationTemplatePartitionSchemePartitionState) ElementType() reflect.Type {
return reflect.TypeOf((*meInstallationTemplatePartitionSchemePartitionState)(nil)).Elem()
}
type meInstallationTemplatePartitionSchemePartitionArgs struct {
// Partition filesystem
Filesystem string `pulumi:"filesystem"`
// partition mount point
Mountpoint string `pulumi:"mountpoint"`
// step or order. specifies the creation order of the partition on the disk
Order int `pulumi:"order"`
// raid partition type
Raid *string `pulumi:"raid"`
// name of this partitioning scheme
SchemeName string `pulumi:"schemeName"`
// size of partition in MB, 0 => rest of the space
Size int `pulumi:"size"`
// Template name
TemplateName string `pulumi:"templateName"`
// partition type
Type string `pulumi:"type"`
// The volume name needed for proxmox distribution
VolumeName *string `pulumi:"volumeName"`
}
// The set of arguments for constructing a MeInstallationTemplatePartitionSchemePartition resource.
type MeInstallationTemplatePartitionSchemePartitionArgs struct {
// Partition filesystem
Filesystem pulumi.StringInput
// partition mount point
Mountpoint pulumi.StringInput
// step or order. specifies the creation order of the partition on the disk
Order pulumi.IntInput
// raid partition type
Raid pulumi.StringPtrInput
// name of this partitioning scheme
SchemeName pulumi.StringInput
// size of partition in MB, 0 => rest of the space
Size pulumi.IntInput
// Template name
TemplateName pulumi.StringInput
// partition type
Type pulumi.StringInput
// The volume name needed for proxmox distribution
VolumeName pulumi.StringPtrInput
}
func (MeInstallationTemplatePartitionSchemePartitionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*meInstallationTemplatePartitionSchemePartitionArgs)(nil)).Elem()
}
type MeInstallationTemplatePartitionSchemePartitionInput interface {
pulumi.Input
ToMeInstallationTemplatePartitionSchemePartitionOutput() MeInstallationTemplatePartitionSchemePartitionOutput
ToMeInstallationTemplatePartitionSchemePartitionOutputWithContext(ctx context.Context) MeInstallationTemplatePartitionSchemePartitionOutput
}
func (*MeInstallationTemplatePartitionSchemePartition) ElementType() reflect.Type {
return reflect.TypeOf((**MeInstallationTemplatePartitionSchemePartition)(nil)).Elem()
}
func (i *MeInstallationTemplatePartitionSchemePartition) ToMeInstallationTemplatePartitionSchemePartitionOutput() MeInstallationTemplatePartitionSchemePartitionOutput {
return i.ToMeInstallationTemplatePartitionSchemePartitionOutputWithContext(context.Background())
}
func (i *MeInstallationTemplatePartitionSchemePartition) ToMeInstallationTemplatePartitionSchemePartitionOutputWithContext(ctx context.Context) MeInstallationTemplatePartitionSchemePartitionOutput {
return pulumi.ToOutputWithContext(ctx, i).(MeInstallationTemplatePartitionSchemePartitionOutput)
}
// MeInstallationTemplatePartitionSchemePartitionArrayInput is an input type that accepts MeInstallationTemplatePartitionSchemePartitionArray and MeInstallationTemplatePartitionSchemePartitionArrayOutput values.
// You can construct a concrete instance of `MeInstallationTemplatePartitionSchemePartitionArrayInput` via:
//
// MeInstallationTemplatePartitionSchemePartitionArray{ MeInstallationTemplatePartitionSchemePartitionArgs{...} }
type MeInstallationTemplatePartitionSchemePartitionArrayInput interface {
pulumi.Input
ToMeInstallationTemplatePartitionSchemePartitionArrayOutput() MeInstallationTemplatePartitionSchemePartitionArrayOutput
ToMeInstallationTemplatePartitionSchemePartitionArrayOutputWithContext(context.Context) MeInstallationTemplatePartitionSchemePartitionArrayOutput
}
type MeInstallationTemplatePartitionSchemePartitionArray []MeInstallationTemplatePartitionSchemePartitionInput
func (MeInstallationTemplatePartitionSchemePartitionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MeInstallationTemplatePartitionSchemePartition)(nil)).Elem()
}
func (i MeInstallationTemplatePartitionSchemePartitionArray) ToMeInstallationTemplatePartitionSchemePartitionArrayOutput() MeInstallationTemplatePartitionSchemePartitionArrayOutput {
return i.ToMeInstallationTemplatePartitionSchemePartitionArrayOutputWithContext(context.Background())
}
func (i MeInstallationTemplatePartitionSchemePartitionArray) ToMeInstallationTemplatePartitionSchemePartitionArrayOutputWithContext(ctx context.Context) MeInstallationTemplatePartitionSchemePartitionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(MeInstallationTemplatePartitionSchemePartitionArrayOutput)
}
// MeInstallationTemplatePartitionSchemePartitionMapInput is an input type that accepts MeInstallationTemplatePartitionSchemePartitionMap and MeInstallationTemplatePartitionSchemePartitionMapOutput values.
// You can construct a concrete instance of `MeInstallationTemplatePartitionSchemePartitionMapInput` via:
//
// MeInstallationTemplatePartitionSchemePartitionMap{ "key": MeInstallationTemplatePartitionSchemePartitionArgs{...} }
type MeInstallationTemplatePartitionSchemePartitionMapInput interface {
pulumi.Input
ToMeInstallationTemplatePartitionSchemePartitionMapOutput() MeInstallationTemplatePartitionSchemePartitionMapOutput
ToMeInstallationTemplatePartitionSchemePartitionMapOutputWithContext(context.Context) MeInstallationTemplatePartitionSchemePartitionMapOutput
}
type MeInstallationTemplatePartitionSchemePartitionMap map[string]MeInstallationTemplatePartitionSchemePartitionInput
func (MeInstallationTemplatePartitionSchemePartitionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MeInstallationTemplatePartitionSchemePartition)(nil)).Elem()
}
func (i MeInstallationTemplatePartitionSchemePartitionMap) ToMeInstallationTemplatePartitionSchemePartitionMapOutput() MeInstallationTemplatePartitionSchemePartitionMapOutput {
return i.ToMeInstallationTemplatePartitionSchemePartitionMapOutputWithContext(context.Background())
}
func (i MeInstallationTemplatePartitionSchemePartitionMap) ToMeInstallationTemplatePartitionSchemePartitionMapOutputWithContext(ctx context.Context) MeInstallationTemplatePartitionSchemePartitionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(MeInstallationTemplatePartitionSchemePartitionMapOutput)
}
type MeInstallationTemplatePartitionSchemePartitionOutput struct{ *pulumi.OutputState }
func (MeInstallationTemplatePartitionSchemePartitionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**MeInstallationTemplatePartitionSchemePartition)(nil)).Elem()
}
func (o MeInstallationTemplatePartitionSchemePartitionOutput) ToMeInstallationTemplatePartitionSchemePartitionOutput() MeInstallationTemplatePartitionSchemePartitionOutput {
return o
}
func (o MeInstallationTemplatePartitionSchemePartitionOutput) ToMeInstallationTemplatePartitionSchemePartitionOutputWithContext(ctx context.Context) MeInstallationTemplatePartitionSchemePartitionOutput {
return o
}
// Partition filesystem
func (o MeInstallationTemplatePartitionSchemePartitionOutput) Filesystem() pulumi.StringOutput {
return o.ApplyT(func(v *MeInstallationTemplatePartitionSchemePartition) pulumi.StringOutput { return v.Filesystem }).(pulumi.StringOutput)
}
// partition mount point
func (o MeInstallationTemplatePartitionSchemePartitionOutput) Mountpoint() pulumi.StringOutput {
return o.ApplyT(func(v *MeInstallationTemplatePartitionSchemePartition) pulumi.StringOutput { return v.Mountpoint }).(pulumi.StringOutput)
}
// step or order. specifies the creation order of the partition on the disk
func (o MeInstallationTemplatePartitionSchemePartitionOutput) Order() pulumi.IntOutput {
return o.ApplyT(func(v *MeInstallationTemplatePartitionSchemePartition) pulumi.IntOutput { return v.Order }).(pulumi.IntOutput)
}
// raid partition type
func (o MeInstallationTemplatePartitionSchemePartitionOutput) Raid() pulumi.StringOutput {
return o.ApplyT(func(v *MeInstallationTemplatePartitionSchemePartition) pulumi.StringOutput { return v.Raid }).(pulumi.StringOutput)
}
// name of this partitioning scheme
func (o MeInstallationTemplatePartitionSchemePartitionOutput) SchemeName() pulumi.StringOutput {
return o.ApplyT(func(v *MeInstallationTemplatePartitionSchemePartition) pulumi.StringOutput { return v.SchemeName }).(pulumi.StringOutput)
}
// size of partition in MB, 0 => rest of the space
func (o MeInstallationTemplatePartitionSchemePartitionOutput) Size() pulumi.IntOutput {
return o.ApplyT(func(v *MeInstallationTemplatePartitionSchemePartition) pulumi.IntOutput { return v.Size }).(pulumi.IntOutput)
}
// Template name
func (o MeInstallationTemplatePartitionSchemePartitionOutput) TemplateName() pulumi.StringOutput {
return o.ApplyT(func(v *MeInstallationTemplatePartitionSchemePartition) pulumi.StringOutput { return v.TemplateName }).(pulumi.StringOutput)
}
// partition type
func (o MeInstallationTemplatePartitionSchemePartitionOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *MeInstallationTemplatePartitionSchemePartition) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
// The volume name needed for proxmox distribution
func (o MeInstallationTemplatePartitionSchemePartitionOutput) VolumeName() pulumi.StringOutput {
return o.ApplyT(func(v *MeInstallationTemplatePartitionSchemePartition) pulumi.StringOutput { return v.VolumeName }).(pulumi.StringOutput)
}
type MeInstallationTemplatePartitionSchemePartitionArrayOutput struct{ *pulumi.OutputState }
func (MeInstallationTemplatePartitionSchemePartitionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MeInstallationTemplatePartitionSchemePartition)(nil)).Elem()
}
func (o MeInstallationTemplatePartitionSchemePartitionArrayOutput) ToMeInstallationTemplatePartitionSchemePartitionArrayOutput() MeInstallationTemplatePartitionSchemePartitionArrayOutput {
return o
}
func (o MeInstallationTemplatePartitionSchemePartitionArrayOutput) ToMeInstallationTemplatePartitionSchemePartitionArrayOutputWithContext(ctx context.Context) MeInstallationTemplatePartitionSchemePartitionArrayOutput {
return o
}
func (o MeInstallationTemplatePartitionSchemePartitionArrayOutput) Index(i pulumi.IntInput) MeInstallationTemplatePartitionSchemePartitionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *MeInstallationTemplatePartitionSchemePartition {
return vs[0].([]*MeInstallationTemplatePartitionSchemePartition)[vs[1].(int)]
}).(MeInstallationTemplatePartitionSchemePartitionOutput)
}
type MeInstallationTemplatePartitionSchemePartitionMapOutput struct{ *pulumi.OutputState }
func (MeInstallationTemplatePartitionSchemePartitionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MeInstallationTemplatePartitionSchemePartition)(nil)).Elem()
}
func (o MeInstallationTemplatePartitionSchemePartitionMapOutput) ToMeInstallationTemplatePartitionSchemePartitionMapOutput() MeInstallationTemplatePartitionSchemePartitionMapOutput {
return o
}
func (o MeInstallationTemplatePartitionSchemePartitionMapOutput) ToMeInstallationTemplatePartitionSchemePartitionMapOutputWithContext(ctx context.Context) MeInstallationTemplatePartitionSchemePartitionMapOutput {
return o
}
func (o MeInstallationTemplatePartitionSchemePartitionMapOutput) MapIndex(k pulumi.StringInput) MeInstallationTemplatePartitionSchemePartitionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *MeInstallationTemplatePartitionSchemePartition {
return vs[0].(map[string]*MeInstallationTemplatePartitionSchemePartition)[vs[1].(string)]
}).(MeInstallationTemplatePartitionSchemePartitionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*MeInstallationTemplatePartitionSchemePartitionInput)(nil)).Elem(), &MeInstallationTemplatePartitionSchemePartition{})
pulumi.RegisterInputType(reflect.TypeOf((*MeInstallationTemplatePartitionSchemePartitionArrayInput)(nil)).Elem(), MeInstallationTemplatePartitionSchemePartitionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*MeInstallationTemplatePartitionSchemePartitionMapInput)(nil)).Elem(), MeInstallationTemplatePartitionSchemePartitionMap{})
pulumi.RegisterOutputType(MeInstallationTemplatePartitionSchemePartitionOutput{})
pulumi.RegisterOutputType(MeInstallationTemplatePartitionSchemePartitionArrayOutput{})
pulumi.RegisterOutputType(MeInstallationTemplatePartitionSchemePartitionMapOutput{})
}