generated from pulumi/pulumi-tf-provider-boilerplate
/
restoreInstance.go
271 lines (221 loc) · 10.9 KB
/
restoreInstance.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
// 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 sqlserver
import (
"context"
"reflect"
"errors"
"github.com/mergtil/pulumi-tencentcloud/sdk/go/tencentcloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type RestoreInstance struct {
pulumi.CustomResourceState
// Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
BackupId pulumi.IntOutput `pulumi:"backupId"`
// TDE encryption, `enable` encrypted, `disable` unencrypted.
Encryptions RestoreInstanceEncryptionArrayOutput `pulumi:"encryptions"`
// Instance ID.
InstanceId pulumi.StringOutput `pulumi:"instanceId"`
// Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left
// empty, all databases will be restored and renamed in the default format.
RenameRestores RestoreInstanceRenameRestoreArrayOutput `pulumi:"renameRestores"`
}
// NewRestoreInstance registers a new resource with the given unique name, arguments, and options.
func NewRestoreInstance(ctx *pulumi.Context,
name string, args *RestoreInstanceArgs, opts ...pulumi.ResourceOption) (*RestoreInstance, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.BackupId == nil {
return nil, errors.New("invalid value for required argument 'BackupId'")
}
if args.InstanceId == nil {
return nil, errors.New("invalid value for required argument 'InstanceId'")
}
if args.RenameRestores == nil {
return nil, errors.New("invalid value for required argument 'RenameRestores'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource RestoreInstance
err := ctx.RegisterResource("tencentcloud:Sqlserver/restoreInstance:RestoreInstance", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRestoreInstance gets an existing RestoreInstance 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 GetRestoreInstance(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RestoreInstanceState, opts ...pulumi.ResourceOption) (*RestoreInstance, error) {
var resource RestoreInstance
err := ctx.ReadResource("tencentcloud:Sqlserver/restoreInstance:RestoreInstance", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RestoreInstance resources.
type restoreInstanceState struct {
// Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
BackupId *int `pulumi:"backupId"`
// TDE encryption, `enable` encrypted, `disable` unencrypted.
Encryptions []RestoreInstanceEncryption `pulumi:"encryptions"`
// Instance ID.
InstanceId *string `pulumi:"instanceId"`
// Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left
// empty, all databases will be restored and renamed in the default format.
RenameRestores []RestoreInstanceRenameRestore `pulumi:"renameRestores"`
}
type RestoreInstanceState struct {
// Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
BackupId pulumi.IntPtrInput
// TDE encryption, `enable` encrypted, `disable` unencrypted.
Encryptions RestoreInstanceEncryptionArrayInput
// Instance ID.
InstanceId pulumi.StringPtrInput
// Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left
// empty, all databases will be restored and renamed in the default format.
RenameRestores RestoreInstanceRenameRestoreArrayInput
}
func (RestoreInstanceState) ElementType() reflect.Type {
return reflect.TypeOf((*restoreInstanceState)(nil)).Elem()
}
type restoreInstanceArgs struct {
// Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
BackupId int `pulumi:"backupId"`
// Instance ID.
InstanceId string `pulumi:"instanceId"`
// Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left
// empty, all databases will be restored and renamed in the default format.
RenameRestores []RestoreInstanceRenameRestore `pulumi:"renameRestores"`
}
// The set of arguments for constructing a RestoreInstance resource.
type RestoreInstanceArgs struct {
// Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
BackupId pulumi.IntInput
// Instance ID.
InstanceId pulumi.StringInput
// Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left
// empty, all databases will be restored and renamed in the default format.
RenameRestores RestoreInstanceRenameRestoreArrayInput
}
func (RestoreInstanceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*restoreInstanceArgs)(nil)).Elem()
}
type RestoreInstanceInput interface {
pulumi.Input
ToRestoreInstanceOutput() RestoreInstanceOutput
ToRestoreInstanceOutputWithContext(ctx context.Context) RestoreInstanceOutput
}
func (*RestoreInstance) ElementType() reflect.Type {
return reflect.TypeOf((**RestoreInstance)(nil)).Elem()
}
func (i *RestoreInstance) ToRestoreInstanceOutput() RestoreInstanceOutput {
return i.ToRestoreInstanceOutputWithContext(context.Background())
}
func (i *RestoreInstance) ToRestoreInstanceOutputWithContext(ctx context.Context) RestoreInstanceOutput {
return pulumi.ToOutputWithContext(ctx, i).(RestoreInstanceOutput)
}
// RestoreInstanceArrayInput is an input type that accepts RestoreInstanceArray and RestoreInstanceArrayOutput values.
// You can construct a concrete instance of `RestoreInstanceArrayInput` via:
//
// RestoreInstanceArray{ RestoreInstanceArgs{...} }
type RestoreInstanceArrayInput interface {
pulumi.Input
ToRestoreInstanceArrayOutput() RestoreInstanceArrayOutput
ToRestoreInstanceArrayOutputWithContext(context.Context) RestoreInstanceArrayOutput
}
type RestoreInstanceArray []RestoreInstanceInput
func (RestoreInstanceArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RestoreInstance)(nil)).Elem()
}
func (i RestoreInstanceArray) ToRestoreInstanceArrayOutput() RestoreInstanceArrayOutput {
return i.ToRestoreInstanceArrayOutputWithContext(context.Background())
}
func (i RestoreInstanceArray) ToRestoreInstanceArrayOutputWithContext(ctx context.Context) RestoreInstanceArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(RestoreInstanceArrayOutput)
}
// RestoreInstanceMapInput is an input type that accepts RestoreInstanceMap and RestoreInstanceMapOutput values.
// You can construct a concrete instance of `RestoreInstanceMapInput` via:
//
// RestoreInstanceMap{ "key": RestoreInstanceArgs{...} }
type RestoreInstanceMapInput interface {
pulumi.Input
ToRestoreInstanceMapOutput() RestoreInstanceMapOutput
ToRestoreInstanceMapOutputWithContext(context.Context) RestoreInstanceMapOutput
}
type RestoreInstanceMap map[string]RestoreInstanceInput
func (RestoreInstanceMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RestoreInstance)(nil)).Elem()
}
func (i RestoreInstanceMap) ToRestoreInstanceMapOutput() RestoreInstanceMapOutput {
return i.ToRestoreInstanceMapOutputWithContext(context.Background())
}
func (i RestoreInstanceMap) ToRestoreInstanceMapOutputWithContext(ctx context.Context) RestoreInstanceMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(RestoreInstanceMapOutput)
}
type RestoreInstanceOutput struct{ *pulumi.OutputState }
func (RestoreInstanceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**RestoreInstance)(nil)).Elem()
}
func (o RestoreInstanceOutput) ToRestoreInstanceOutput() RestoreInstanceOutput {
return o
}
func (o RestoreInstanceOutput) ToRestoreInstanceOutputWithContext(ctx context.Context) RestoreInstanceOutput {
return o
}
// Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
func (o RestoreInstanceOutput) BackupId() pulumi.IntOutput {
return o.ApplyT(func(v *RestoreInstance) pulumi.IntOutput { return v.BackupId }).(pulumi.IntOutput)
}
// TDE encryption, `enable` encrypted, `disable` unencrypted.
func (o RestoreInstanceOutput) Encryptions() RestoreInstanceEncryptionArrayOutput {
return o.ApplyT(func(v *RestoreInstance) RestoreInstanceEncryptionArrayOutput { return v.Encryptions }).(RestoreInstanceEncryptionArrayOutput)
}
// Instance ID.
func (o RestoreInstanceOutput) InstanceId() pulumi.StringOutput {
return o.ApplyT(func(v *RestoreInstance) pulumi.StringOutput { return v.InstanceId }).(pulumi.StringOutput)
}
// Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left
// empty, all databases will be restored and renamed in the default format.
func (o RestoreInstanceOutput) RenameRestores() RestoreInstanceRenameRestoreArrayOutput {
return o.ApplyT(func(v *RestoreInstance) RestoreInstanceRenameRestoreArrayOutput { return v.RenameRestores }).(RestoreInstanceRenameRestoreArrayOutput)
}
type RestoreInstanceArrayOutput struct{ *pulumi.OutputState }
func (RestoreInstanceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RestoreInstance)(nil)).Elem()
}
func (o RestoreInstanceArrayOutput) ToRestoreInstanceArrayOutput() RestoreInstanceArrayOutput {
return o
}
func (o RestoreInstanceArrayOutput) ToRestoreInstanceArrayOutputWithContext(ctx context.Context) RestoreInstanceArrayOutput {
return o
}
func (o RestoreInstanceArrayOutput) Index(i pulumi.IntInput) RestoreInstanceOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RestoreInstance {
return vs[0].([]*RestoreInstance)[vs[1].(int)]
}).(RestoreInstanceOutput)
}
type RestoreInstanceMapOutput struct{ *pulumi.OutputState }
func (RestoreInstanceMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RestoreInstance)(nil)).Elem()
}
func (o RestoreInstanceMapOutput) ToRestoreInstanceMapOutput() RestoreInstanceMapOutput {
return o
}
func (o RestoreInstanceMapOutput) ToRestoreInstanceMapOutputWithContext(ctx context.Context) RestoreInstanceMapOutput {
return o
}
func (o RestoreInstanceMapOutput) MapIndex(k pulumi.StringInput) RestoreInstanceOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RestoreInstance {
return vs[0].(map[string]*RestoreInstance)[vs[1].(string)]
}).(RestoreInstanceOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RestoreInstanceInput)(nil)).Elem(), &RestoreInstance{})
pulumi.RegisterInputType(reflect.TypeOf((*RestoreInstanceArrayInput)(nil)).Elem(), RestoreInstanceArray{})
pulumi.RegisterInputType(reflect.TypeOf((*RestoreInstanceMapInput)(nil)).Elem(), RestoreInstanceMap{})
pulumi.RegisterOutputType(RestoreInstanceOutput{})
pulumi.RegisterOutputType(RestoreInstanceArrayOutput{})
pulumi.RegisterOutputType(RestoreInstanceMapOutput{})
}