-
Notifications
You must be signed in to change notification settings - Fork 1
/
quarantine.go
293 lines (242 loc) · 14.7 KB
/
quarantine.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
// 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 quarantine support.
//
// ## Import
//
// SwitchController Quarantine can be imported using any of these accepted formats:
//
// ```sh
// $ pulumi import fortios:switchcontroller/quarantine:Quarantine labelname SwitchControllerQuarantine
// ```
//
// If you do not want to import arguments of block:
//
// $ export "FORTIOS_IMPORT_TABLE"="false"
//
// ```sh
// $ pulumi import fortios:switchcontroller/quarantine:Quarantine labelname SwitchControllerQuarantine
// ```
//
// $ unset "FORTIOS_IMPORT_TABLE"
type Quarantine struct {
pulumi.CustomResourceState
// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -> [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -> [ a10, a2 ].
DynamicSortSubtable pulumi.StringPtrOutput `pulumi:"dynamicSortSubtable"`
// Get all sub-tables including unconfigured tables. Do not set this variable to true if you configure sub-table in another resource, otherwish conflicts and overwrite will occur. Options: [ false, true ]. false: Default value, do not get unconfigured tables; true: get all tables including unconfigured tables.
GetAllTables pulumi.StringPtrOutput `pulumi:"getAllTables"`
// Enable/disable quarantine. Valid values: `enable`, `disable`.
Quarantine pulumi.StringOutput `pulumi:"quarantine"`
// Quarantine MACs. The structure of `targets` block is documented below.
Targets QuarantineTargetArrayOutput `pulumi:"targets"`
// 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"`
}
// NewQuarantine registers a new resource with the given unique name, arguments, and options.
func NewQuarantine(ctx *pulumi.Context,
name string, args *QuarantineArgs, opts ...pulumi.ResourceOption) (*Quarantine, error) {
if args == nil {
args = &QuarantineArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Quarantine
err := ctx.RegisterResource("fortios:switchcontroller/quarantine:Quarantine", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetQuarantine gets an existing Quarantine 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 GetQuarantine(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *QuarantineState, opts ...pulumi.ResourceOption) (*Quarantine, error) {
var resource Quarantine
err := ctx.ReadResource("fortios:switchcontroller/quarantine:Quarantine", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Quarantine resources.
type quarantineState struct {
// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -> [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -> [ a10, a2 ].
DynamicSortSubtable *string `pulumi:"dynamicSortSubtable"`
// Get all sub-tables including unconfigured tables. Do not set this variable to true if you configure sub-table in another resource, otherwish conflicts and overwrite will occur. Options: [ false, true ]. false: Default value, do not get unconfigured tables; true: get all tables including unconfigured tables.
GetAllTables *string `pulumi:"getAllTables"`
// Enable/disable quarantine. Valid values: `enable`, `disable`.
Quarantine *string `pulumi:"quarantine"`
// Quarantine MACs. The structure of `targets` block is documented below.
Targets []QuarantineTarget `pulumi:"targets"`
// 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 QuarantineState struct {
// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -> [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -> [ a10, a2 ].
DynamicSortSubtable pulumi.StringPtrInput
// Get all sub-tables including unconfigured tables. Do not set this variable to true if you configure sub-table in another resource, otherwish conflicts and overwrite will occur. Options: [ false, true ]. false: Default value, do not get unconfigured tables; true: get all tables including unconfigured tables.
GetAllTables pulumi.StringPtrInput
// Enable/disable quarantine. Valid values: `enable`, `disable`.
Quarantine pulumi.StringPtrInput
// Quarantine MACs. The structure of `targets` block is documented below.
Targets QuarantineTargetArrayInput
// 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 (QuarantineState) ElementType() reflect.Type {
return reflect.TypeOf((*quarantineState)(nil)).Elem()
}
type quarantineArgs struct {
// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -> [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -> [ a10, a2 ].
DynamicSortSubtable *string `pulumi:"dynamicSortSubtable"`
// Get all sub-tables including unconfigured tables. Do not set this variable to true if you configure sub-table in another resource, otherwish conflicts and overwrite will occur. Options: [ false, true ]. false: Default value, do not get unconfigured tables; true: get all tables including unconfigured tables.
GetAllTables *string `pulumi:"getAllTables"`
// Enable/disable quarantine. Valid values: `enable`, `disable`.
Quarantine *string `pulumi:"quarantine"`
// Quarantine MACs. The structure of `targets` block is documented below.
Targets []QuarantineTarget `pulumi:"targets"`
// 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 Quarantine resource.
type QuarantineArgs struct {
// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -> [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -> [ a10, a2 ].
DynamicSortSubtable pulumi.StringPtrInput
// Get all sub-tables including unconfigured tables. Do not set this variable to true if you configure sub-table in another resource, otherwish conflicts and overwrite will occur. Options: [ false, true ]. false: Default value, do not get unconfigured tables; true: get all tables including unconfigured tables.
GetAllTables pulumi.StringPtrInput
// Enable/disable quarantine. Valid values: `enable`, `disable`.
Quarantine pulumi.StringPtrInput
// Quarantine MACs. The structure of `targets` block is documented below.
Targets QuarantineTargetArrayInput
// 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 (QuarantineArgs) ElementType() reflect.Type {
return reflect.TypeOf((*quarantineArgs)(nil)).Elem()
}
type QuarantineInput interface {
pulumi.Input
ToQuarantineOutput() QuarantineOutput
ToQuarantineOutputWithContext(ctx context.Context) QuarantineOutput
}
func (*Quarantine) ElementType() reflect.Type {
return reflect.TypeOf((**Quarantine)(nil)).Elem()
}
func (i *Quarantine) ToQuarantineOutput() QuarantineOutput {
return i.ToQuarantineOutputWithContext(context.Background())
}
func (i *Quarantine) ToQuarantineOutputWithContext(ctx context.Context) QuarantineOutput {
return pulumi.ToOutputWithContext(ctx, i).(QuarantineOutput)
}
// QuarantineArrayInput is an input type that accepts QuarantineArray and QuarantineArrayOutput values.
// You can construct a concrete instance of `QuarantineArrayInput` via:
//
// QuarantineArray{ QuarantineArgs{...} }
type QuarantineArrayInput interface {
pulumi.Input
ToQuarantineArrayOutput() QuarantineArrayOutput
ToQuarantineArrayOutputWithContext(context.Context) QuarantineArrayOutput
}
type QuarantineArray []QuarantineInput
func (QuarantineArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Quarantine)(nil)).Elem()
}
func (i QuarantineArray) ToQuarantineArrayOutput() QuarantineArrayOutput {
return i.ToQuarantineArrayOutputWithContext(context.Background())
}
func (i QuarantineArray) ToQuarantineArrayOutputWithContext(ctx context.Context) QuarantineArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(QuarantineArrayOutput)
}
// QuarantineMapInput is an input type that accepts QuarantineMap and QuarantineMapOutput values.
// You can construct a concrete instance of `QuarantineMapInput` via:
//
// QuarantineMap{ "key": QuarantineArgs{...} }
type QuarantineMapInput interface {
pulumi.Input
ToQuarantineMapOutput() QuarantineMapOutput
ToQuarantineMapOutputWithContext(context.Context) QuarantineMapOutput
}
type QuarantineMap map[string]QuarantineInput
func (QuarantineMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Quarantine)(nil)).Elem()
}
func (i QuarantineMap) ToQuarantineMapOutput() QuarantineMapOutput {
return i.ToQuarantineMapOutputWithContext(context.Background())
}
func (i QuarantineMap) ToQuarantineMapOutputWithContext(ctx context.Context) QuarantineMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(QuarantineMapOutput)
}
type QuarantineOutput struct{ *pulumi.OutputState }
func (QuarantineOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Quarantine)(nil)).Elem()
}
func (o QuarantineOutput) ToQuarantineOutput() QuarantineOutput {
return o
}
func (o QuarantineOutput) ToQuarantineOutputWithContext(ctx context.Context) QuarantineOutput {
return o
}
// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -> [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -> [ a10, a2 ].
func (o QuarantineOutput) DynamicSortSubtable() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Quarantine) pulumi.StringPtrOutput { return v.DynamicSortSubtable }).(pulumi.StringPtrOutput)
}
// Get all sub-tables including unconfigured tables. Do not set this variable to true if you configure sub-table in another resource, otherwish conflicts and overwrite will occur. Options: [ false, true ]. false: Default value, do not get unconfigured tables; true: get all tables including unconfigured tables.
func (o QuarantineOutput) GetAllTables() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Quarantine) pulumi.StringPtrOutput { return v.GetAllTables }).(pulumi.StringPtrOutput)
}
// Enable/disable quarantine. Valid values: `enable`, `disable`.
func (o QuarantineOutput) Quarantine() pulumi.StringOutput {
return o.ApplyT(func(v *Quarantine) pulumi.StringOutput { return v.Quarantine }).(pulumi.StringOutput)
}
// Quarantine MACs. The structure of `targets` block is documented below.
func (o QuarantineOutput) Targets() QuarantineTargetArrayOutput {
return o.ApplyT(func(v *Quarantine) QuarantineTargetArrayOutput { return v.Targets }).(QuarantineTargetArrayOutput)
}
// 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 QuarantineOutput) Vdomparam() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Quarantine) pulumi.StringPtrOutput { return v.Vdomparam }).(pulumi.StringPtrOutput)
}
type QuarantineArrayOutput struct{ *pulumi.OutputState }
func (QuarantineArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Quarantine)(nil)).Elem()
}
func (o QuarantineArrayOutput) ToQuarantineArrayOutput() QuarantineArrayOutput {
return o
}
func (o QuarantineArrayOutput) ToQuarantineArrayOutputWithContext(ctx context.Context) QuarantineArrayOutput {
return o
}
func (o QuarantineArrayOutput) Index(i pulumi.IntInput) QuarantineOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Quarantine {
return vs[0].([]*Quarantine)[vs[1].(int)]
}).(QuarantineOutput)
}
type QuarantineMapOutput struct{ *pulumi.OutputState }
func (QuarantineMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Quarantine)(nil)).Elem()
}
func (o QuarantineMapOutput) ToQuarantineMapOutput() QuarantineMapOutput {
return o
}
func (o QuarantineMapOutput) ToQuarantineMapOutputWithContext(ctx context.Context) QuarantineMapOutput {
return o
}
func (o QuarantineMapOutput) MapIndex(k pulumi.StringInput) QuarantineOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Quarantine {
return vs[0].(map[string]*Quarantine)[vs[1].(string)]
}).(QuarantineOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*QuarantineInput)(nil)).Elem(), &Quarantine{})
pulumi.RegisterInputType(reflect.TypeOf((*QuarantineArrayInput)(nil)).Elem(), QuarantineArray{})
pulumi.RegisterInputType(reflect.TypeOf((*QuarantineMapInput)(nil)).Elem(), QuarantineMap{})
pulumi.RegisterOutputType(QuarantineOutput{})
pulumi.RegisterOutputType(QuarantineArrayOutput{})
pulumi.RegisterOutputType(QuarantineMapOutput{})
}