-
Notifications
You must be signed in to change notification settings - Fork 1
/
switchprofile.go
358 lines (305 loc) · 15.2 KB
/
switchprofile.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
// 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 switchcontroller
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-fortios/sdk/go/fortios/internal"
)
// Configure FortiSwitch switch profile.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/pulumiverse/pulumi-fortios/sdk/go/fortios/switchcontroller"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := switchcontroller.NewSwitchprofile(ctx, "trname", &switchcontroller.SwitchprofileArgs{
// LoginPasswdOverride: pulumi.String("enable"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// SwitchController SwitchProfile can be imported using any of these accepted formats:
//
// ```sh
// $ pulumi import fortios:switchcontroller/switchprofile:Switchprofile labelname {{name}}
// ```
//
// If you do not want to import arguments of block:
//
// $ export "FORTIOS_IMPORT_TABLE"="false"
//
// ```sh
// $ pulumi import fortios:switchcontroller/switchprofile:Switchprofile labelname {{name}}
// ```
//
// $ unset "FORTIOS_IMPORT_TABLE"
type Switchprofile struct {
pulumi.CustomResourceState
// Enable/disable FortiSwitch serial console. Valid values: `enable`, `disable`.
Login pulumi.StringOutput `pulumi:"login"`
// Login password of managed FortiSwitch.
LoginPasswd pulumi.StringPtrOutput `pulumi:"loginPasswd"`
// Enable/disable overriding the admin administrator password for a managed FortiSwitch with the FortiGate admin administrator account password. Valid values: `enable`, `disable`.
LoginPasswdOverride pulumi.StringOutput `pulumi:"loginPasswdOverride"`
// FortiSwitch Profile name.
Name pulumi.StringOutput `pulumi:"name"`
// Enable/disable automatic revision backup upon logout from FortiSwitch. Valid values: `enable`, `disable`.
RevisionBackupOnLogout pulumi.StringOutput `pulumi:"revisionBackupOnLogout"`
// Enable/disable automatic revision backup upon FortiSwitch image upgrade. Valid values: `enable`, `disable`.
RevisionBackupOnUpgrade pulumi.StringOutput `pulumi:"revisionBackupOnUpgrade"`
// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
Vdomparam pulumi.StringPtrOutput `pulumi:"vdomparam"`
}
// NewSwitchprofile registers a new resource with the given unique name, arguments, and options.
func NewSwitchprofile(ctx *pulumi.Context,
name string, args *SwitchprofileArgs, opts ...pulumi.ResourceOption) (*Switchprofile, error) {
if args == nil {
args = &SwitchprofileArgs{}
}
if args.LoginPasswd != nil {
args.LoginPasswd = pulumi.ToSecret(args.LoginPasswd).(pulumi.StringPtrInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"loginPasswd",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Switchprofile
err := ctx.RegisterResource("fortios:switchcontroller/switchprofile:Switchprofile", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSwitchprofile gets an existing Switchprofile 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 GetSwitchprofile(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SwitchprofileState, opts ...pulumi.ResourceOption) (*Switchprofile, error) {
var resource Switchprofile
err := ctx.ReadResource("fortios:switchcontroller/switchprofile:Switchprofile", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Switchprofile resources.
type switchprofileState struct {
// Enable/disable FortiSwitch serial console. Valid values: `enable`, `disable`.
Login *string `pulumi:"login"`
// Login password of managed FortiSwitch.
LoginPasswd *string `pulumi:"loginPasswd"`
// Enable/disable overriding the admin administrator password for a managed FortiSwitch with the FortiGate admin administrator account password. Valid values: `enable`, `disable`.
LoginPasswdOverride *string `pulumi:"loginPasswdOverride"`
// FortiSwitch Profile name.
Name *string `pulumi:"name"`
// Enable/disable automatic revision backup upon logout from FortiSwitch. Valid values: `enable`, `disable`.
RevisionBackupOnLogout *string `pulumi:"revisionBackupOnLogout"`
// Enable/disable automatic revision backup upon FortiSwitch image upgrade. Valid values: `enable`, `disable`.
RevisionBackupOnUpgrade *string `pulumi:"revisionBackupOnUpgrade"`
// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
Vdomparam *string `pulumi:"vdomparam"`
}
type SwitchprofileState struct {
// Enable/disable FortiSwitch serial console. Valid values: `enable`, `disable`.
Login pulumi.StringPtrInput
// Login password of managed FortiSwitch.
LoginPasswd pulumi.StringPtrInput
// Enable/disable overriding the admin administrator password for a managed FortiSwitch with the FortiGate admin administrator account password. Valid values: `enable`, `disable`.
LoginPasswdOverride pulumi.StringPtrInput
// FortiSwitch Profile name.
Name pulumi.StringPtrInput
// Enable/disable automatic revision backup upon logout from FortiSwitch. Valid values: `enable`, `disable`.
RevisionBackupOnLogout pulumi.StringPtrInput
// Enable/disable automatic revision backup upon FortiSwitch image upgrade. Valid values: `enable`, `disable`.
RevisionBackupOnUpgrade pulumi.StringPtrInput
// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
Vdomparam pulumi.StringPtrInput
}
func (SwitchprofileState) ElementType() reflect.Type {
return reflect.TypeOf((*switchprofileState)(nil)).Elem()
}
type switchprofileArgs struct {
// Enable/disable FortiSwitch serial console. Valid values: `enable`, `disable`.
Login *string `pulumi:"login"`
// Login password of managed FortiSwitch.
LoginPasswd *string `pulumi:"loginPasswd"`
// Enable/disable overriding the admin administrator password for a managed FortiSwitch with the FortiGate admin administrator account password. Valid values: `enable`, `disable`.
LoginPasswdOverride *string `pulumi:"loginPasswdOverride"`
// FortiSwitch Profile name.
Name *string `pulumi:"name"`
// Enable/disable automatic revision backup upon logout from FortiSwitch. Valid values: `enable`, `disable`.
RevisionBackupOnLogout *string `pulumi:"revisionBackupOnLogout"`
// Enable/disable automatic revision backup upon FortiSwitch image upgrade. Valid values: `enable`, `disable`.
RevisionBackupOnUpgrade *string `pulumi:"revisionBackupOnUpgrade"`
// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
Vdomparam *string `pulumi:"vdomparam"`
}
// The set of arguments for constructing a Switchprofile resource.
type SwitchprofileArgs struct {
// Enable/disable FortiSwitch serial console. Valid values: `enable`, `disable`.
Login pulumi.StringPtrInput
// Login password of managed FortiSwitch.
LoginPasswd pulumi.StringPtrInput
// Enable/disable overriding the admin administrator password for a managed FortiSwitch with the FortiGate admin administrator account password. Valid values: `enable`, `disable`.
LoginPasswdOverride pulumi.StringPtrInput
// FortiSwitch Profile name.
Name pulumi.StringPtrInput
// Enable/disable automatic revision backup upon logout from FortiSwitch. Valid values: `enable`, `disable`.
RevisionBackupOnLogout pulumi.StringPtrInput
// Enable/disable automatic revision backup upon FortiSwitch image upgrade. Valid values: `enable`, `disable`.
RevisionBackupOnUpgrade pulumi.StringPtrInput
// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
Vdomparam pulumi.StringPtrInput
}
func (SwitchprofileArgs) ElementType() reflect.Type {
return reflect.TypeOf((*switchprofileArgs)(nil)).Elem()
}
type SwitchprofileInput interface {
pulumi.Input
ToSwitchprofileOutput() SwitchprofileOutput
ToSwitchprofileOutputWithContext(ctx context.Context) SwitchprofileOutput
}
func (*Switchprofile) ElementType() reflect.Type {
return reflect.TypeOf((**Switchprofile)(nil)).Elem()
}
func (i *Switchprofile) ToSwitchprofileOutput() SwitchprofileOutput {
return i.ToSwitchprofileOutputWithContext(context.Background())
}
func (i *Switchprofile) ToSwitchprofileOutputWithContext(ctx context.Context) SwitchprofileOutput {
return pulumi.ToOutputWithContext(ctx, i).(SwitchprofileOutput)
}
// SwitchprofileArrayInput is an input type that accepts SwitchprofileArray and SwitchprofileArrayOutput values.
// You can construct a concrete instance of `SwitchprofileArrayInput` via:
//
// SwitchprofileArray{ SwitchprofileArgs{...} }
type SwitchprofileArrayInput interface {
pulumi.Input
ToSwitchprofileArrayOutput() SwitchprofileArrayOutput
ToSwitchprofileArrayOutputWithContext(context.Context) SwitchprofileArrayOutput
}
type SwitchprofileArray []SwitchprofileInput
func (SwitchprofileArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Switchprofile)(nil)).Elem()
}
func (i SwitchprofileArray) ToSwitchprofileArrayOutput() SwitchprofileArrayOutput {
return i.ToSwitchprofileArrayOutputWithContext(context.Background())
}
func (i SwitchprofileArray) ToSwitchprofileArrayOutputWithContext(ctx context.Context) SwitchprofileArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SwitchprofileArrayOutput)
}
// SwitchprofileMapInput is an input type that accepts SwitchprofileMap and SwitchprofileMapOutput values.
// You can construct a concrete instance of `SwitchprofileMapInput` via:
//
// SwitchprofileMap{ "key": SwitchprofileArgs{...} }
type SwitchprofileMapInput interface {
pulumi.Input
ToSwitchprofileMapOutput() SwitchprofileMapOutput
ToSwitchprofileMapOutputWithContext(context.Context) SwitchprofileMapOutput
}
type SwitchprofileMap map[string]SwitchprofileInput
func (SwitchprofileMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Switchprofile)(nil)).Elem()
}
func (i SwitchprofileMap) ToSwitchprofileMapOutput() SwitchprofileMapOutput {
return i.ToSwitchprofileMapOutputWithContext(context.Background())
}
func (i SwitchprofileMap) ToSwitchprofileMapOutputWithContext(ctx context.Context) SwitchprofileMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SwitchprofileMapOutput)
}
type SwitchprofileOutput struct{ *pulumi.OutputState }
func (SwitchprofileOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Switchprofile)(nil)).Elem()
}
func (o SwitchprofileOutput) ToSwitchprofileOutput() SwitchprofileOutput {
return o
}
func (o SwitchprofileOutput) ToSwitchprofileOutputWithContext(ctx context.Context) SwitchprofileOutput {
return o
}
// Enable/disable FortiSwitch serial console. Valid values: `enable`, `disable`.
func (o SwitchprofileOutput) Login() pulumi.StringOutput {
return o.ApplyT(func(v *Switchprofile) pulumi.StringOutput { return v.Login }).(pulumi.StringOutput)
}
// Login password of managed FortiSwitch.
func (o SwitchprofileOutput) LoginPasswd() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Switchprofile) pulumi.StringPtrOutput { return v.LoginPasswd }).(pulumi.StringPtrOutput)
}
// Enable/disable overriding the admin administrator password for a managed FortiSwitch with the FortiGate admin administrator account password. Valid values: `enable`, `disable`.
func (o SwitchprofileOutput) LoginPasswdOverride() pulumi.StringOutput {
return o.ApplyT(func(v *Switchprofile) pulumi.StringOutput { return v.LoginPasswdOverride }).(pulumi.StringOutput)
}
// FortiSwitch Profile name.
func (o SwitchprofileOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Switchprofile) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Enable/disable automatic revision backup upon logout from FortiSwitch. Valid values: `enable`, `disable`.
func (o SwitchprofileOutput) RevisionBackupOnLogout() pulumi.StringOutput {
return o.ApplyT(func(v *Switchprofile) pulumi.StringOutput { return v.RevisionBackupOnLogout }).(pulumi.StringOutput)
}
// Enable/disable automatic revision backup upon FortiSwitch image upgrade. Valid values: `enable`, `disable`.
func (o SwitchprofileOutput) RevisionBackupOnUpgrade() pulumi.StringOutput {
return o.ApplyT(func(v *Switchprofile) pulumi.StringOutput { return v.RevisionBackupOnUpgrade }).(pulumi.StringOutput)
}
// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
func (o SwitchprofileOutput) Vdomparam() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Switchprofile) pulumi.StringPtrOutput { return v.Vdomparam }).(pulumi.StringPtrOutput)
}
type SwitchprofileArrayOutput struct{ *pulumi.OutputState }
func (SwitchprofileArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Switchprofile)(nil)).Elem()
}
func (o SwitchprofileArrayOutput) ToSwitchprofileArrayOutput() SwitchprofileArrayOutput {
return o
}
func (o SwitchprofileArrayOutput) ToSwitchprofileArrayOutputWithContext(ctx context.Context) SwitchprofileArrayOutput {
return o
}
func (o SwitchprofileArrayOutput) Index(i pulumi.IntInput) SwitchprofileOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Switchprofile {
return vs[0].([]*Switchprofile)[vs[1].(int)]
}).(SwitchprofileOutput)
}
type SwitchprofileMapOutput struct{ *pulumi.OutputState }
func (SwitchprofileMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Switchprofile)(nil)).Elem()
}
func (o SwitchprofileMapOutput) ToSwitchprofileMapOutput() SwitchprofileMapOutput {
return o
}
func (o SwitchprofileMapOutput) ToSwitchprofileMapOutputWithContext(ctx context.Context) SwitchprofileMapOutput {
return o
}
func (o SwitchprofileMapOutput) MapIndex(k pulumi.StringInput) SwitchprofileOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Switchprofile {
return vs[0].(map[string]*Switchprofile)[vs[1].(string)]
}).(SwitchprofileOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SwitchprofileInput)(nil)).Elem(), &Switchprofile{})
pulumi.RegisterInputType(reflect.TypeOf((*SwitchprofileArrayInput)(nil)).Elem(), SwitchprofileArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SwitchprofileMapInput)(nil)).Elem(), SwitchprofileMap{})
pulumi.RegisterOutputType(SwitchprofileOutput{})
pulumi.RegisterOutputType(SwitchprofileArrayOutput{})
pulumi.RegisterOutputType(SwitchprofileMapOutput{})
}