forked from muhlba91/pulumi-proxmoxve
/
hosts.go
268 lines (217 loc) · 7.58 KB
/
hosts.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
// 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 proxmoxve
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Hosts struct {
pulumi.CustomResourceState
// The addresses
Addresses pulumi.StringArrayOutput `pulumi:"addresses"`
// The SHA1 digest
Digest pulumi.StringOutput `pulumi:"digest"`
// The host entries
Entries HostsEntryArrayOutput `pulumi:"entries"`
// The hostnames
Hostnames pulumi.StringArrayArrayOutput `pulumi:"hostnames"`
// The node name
NodeName pulumi.StringOutput `pulumi:"nodeName"`
}
// NewHosts registers a new resource with the given unique name, arguments, and options.
func NewHosts(ctx *pulumi.Context,
name string, args *HostsArgs, opts ...pulumi.ResourceOption) (*Hosts, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Entries == nil {
return nil, errors.New("invalid value for required argument 'Entries'")
}
if args.NodeName == nil {
return nil, errors.New("invalid value for required argument 'NodeName'")
}
opts = pkgResourceDefaultOpts(opts)
var resource Hosts
err := ctx.RegisterResource("proxmoxve:index/hosts:Hosts", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetHosts gets an existing Hosts 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 GetHosts(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *HostsState, opts ...pulumi.ResourceOption) (*Hosts, error) {
var resource Hosts
err := ctx.ReadResource("proxmoxve:index/hosts:Hosts", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Hosts resources.
type hostsState struct {
// The addresses
Addresses []string `pulumi:"addresses"`
// The SHA1 digest
Digest *string `pulumi:"digest"`
// The host entries
Entries []HostsEntry `pulumi:"entries"`
// The hostnames
Hostnames [][]string `pulumi:"hostnames"`
// The node name
NodeName *string `pulumi:"nodeName"`
}
type HostsState struct {
// The addresses
Addresses pulumi.StringArrayInput
// The SHA1 digest
Digest pulumi.StringPtrInput
// The host entries
Entries HostsEntryArrayInput
// The hostnames
Hostnames pulumi.StringArrayArrayInput
// The node name
NodeName pulumi.StringPtrInput
}
func (HostsState) ElementType() reflect.Type {
return reflect.TypeOf((*hostsState)(nil)).Elem()
}
type hostsArgs struct {
// The host entries
Entries []HostsEntry `pulumi:"entries"`
// The node name
NodeName string `pulumi:"nodeName"`
}
// The set of arguments for constructing a Hosts resource.
type HostsArgs struct {
// The host entries
Entries HostsEntryArrayInput
// The node name
NodeName pulumi.StringInput
}
func (HostsArgs) ElementType() reflect.Type {
return reflect.TypeOf((*hostsArgs)(nil)).Elem()
}
type HostsInput interface {
pulumi.Input
ToHostsOutput() HostsOutput
ToHostsOutputWithContext(ctx context.Context) HostsOutput
}
func (*Hosts) ElementType() reflect.Type {
return reflect.TypeOf((**Hosts)(nil)).Elem()
}
func (i *Hosts) ToHostsOutput() HostsOutput {
return i.ToHostsOutputWithContext(context.Background())
}
func (i *Hosts) ToHostsOutputWithContext(ctx context.Context) HostsOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostsOutput)
}
// HostsArrayInput is an input type that accepts HostsArray and HostsArrayOutput values.
// You can construct a concrete instance of `HostsArrayInput` via:
//
// HostsArray{ HostsArgs{...} }
type HostsArrayInput interface {
pulumi.Input
ToHostsArrayOutput() HostsArrayOutput
ToHostsArrayOutputWithContext(context.Context) HostsArrayOutput
}
type HostsArray []HostsInput
func (HostsArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Hosts)(nil)).Elem()
}
func (i HostsArray) ToHostsArrayOutput() HostsArrayOutput {
return i.ToHostsArrayOutputWithContext(context.Background())
}
func (i HostsArray) ToHostsArrayOutputWithContext(ctx context.Context) HostsArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostsArrayOutput)
}
// HostsMapInput is an input type that accepts HostsMap and HostsMapOutput values.
// You can construct a concrete instance of `HostsMapInput` via:
//
// HostsMap{ "key": HostsArgs{...} }
type HostsMapInput interface {
pulumi.Input
ToHostsMapOutput() HostsMapOutput
ToHostsMapOutputWithContext(context.Context) HostsMapOutput
}
type HostsMap map[string]HostsInput
func (HostsMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Hosts)(nil)).Elem()
}
func (i HostsMap) ToHostsMapOutput() HostsMapOutput {
return i.ToHostsMapOutputWithContext(context.Background())
}
func (i HostsMap) ToHostsMapOutputWithContext(ctx context.Context) HostsMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostsMapOutput)
}
type HostsOutput struct{ *pulumi.OutputState }
func (HostsOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Hosts)(nil)).Elem()
}
func (o HostsOutput) ToHostsOutput() HostsOutput {
return o
}
func (o HostsOutput) ToHostsOutputWithContext(ctx context.Context) HostsOutput {
return o
}
// The addresses
func (o HostsOutput) Addresses() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Hosts) pulumi.StringArrayOutput { return v.Addresses }).(pulumi.StringArrayOutput)
}
// The SHA1 digest
func (o HostsOutput) Digest() pulumi.StringOutput {
return o.ApplyT(func(v *Hosts) pulumi.StringOutput { return v.Digest }).(pulumi.StringOutput)
}
// The host entries
func (o HostsOutput) Entries() HostsEntryArrayOutput {
return o.ApplyT(func(v *Hosts) HostsEntryArrayOutput { return v.Entries }).(HostsEntryArrayOutput)
}
// The hostnames
func (o HostsOutput) Hostnames() pulumi.StringArrayArrayOutput {
return o.ApplyT(func(v *Hosts) pulumi.StringArrayArrayOutput { return v.Hostnames }).(pulumi.StringArrayArrayOutput)
}
// The node name
func (o HostsOutput) NodeName() pulumi.StringOutput {
return o.ApplyT(func(v *Hosts) pulumi.StringOutput { return v.NodeName }).(pulumi.StringOutput)
}
type HostsArrayOutput struct{ *pulumi.OutputState }
func (HostsArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Hosts)(nil)).Elem()
}
func (o HostsArrayOutput) ToHostsArrayOutput() HostsArrayOutput {
return o
}
func (o HostsArrayOutput) ToHostsArrayOutputWithContext(ctx context.Context) HostsArrayOutput {
return o
}
func (o HostsArrayOutput) Index(i pulumi.IntInput) HostsOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Hosts {
return vs[0].([]*Hosts)[vs[1].(int)]
}).(HostsOutput)
}
type HostsMapOutput struct{ *pulumi.OutputState }
func (HostsMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Hosts)(nil)).Elem()
}
func (o HostsMapOutput) ToHostsMapOutput() HostsMapOutput {
return o
}
func (o HostsMapOutput) ToHostsMapOutputWithContext(ctx context.Context) HostsMapOutput {
return o
}
func (o HostsMapOutput) MapIndex(k pulumi.StringInput) HostsOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Hosts {
return vs[0].(map[string]*Hosts)[vs[1].(string)]
}).(HostsOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*HostsInput)(nil)).Elem(), &Hosts{})
pulumi.RegisterInputType(reflect.TypeOf((*HostsArrayInput)(nil)).Elem(), HostsArray{})
pulumi.RegisterInputType(reflect.TypeOf((*HostsMapInput)(nil)).Elem(), HostsMap{})
pulumi.RegisterOutputType(HostsOutput{})
pulumi.RegisterOutputType(HostsArrayOutput{})
pulumi.RegisterOutputType(HostsMapOutput{})
}