generated from pulumi/pulumi-tf-provider-boilerplate
/
rollback.go
314 lines (263 loc) · 13.8 KB
/
rollback.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
// 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 mysql
import (
"context"
"reflect"
"errors"
"github.com/mergtil/pulumi-tencentcloud/sdk/go/tencentcloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Rollback struct {
pulumi.CustomResourceState
// The database information to be archived, indicating that the entire database is archived.
Databases RollbackDatabaseArrayOutput `pulumi:"databases"`
// Cloud database instance ID.
InstanceId pulumi.StringOutput `pulumi:"instanceId"`
// Database rollback time, the time format is: yyyy-mm-dd hh:mm:ss.
RollbackTime pulumi.StringOutput `pulumi:"rollbackTime"`
// Rollback strategy. Available values are: table, db, full; the default value is full. table- Extremely fast rollback
// mode, only import the backup and binlog of the selected table level, if there is a cross-table operation, and the
// associated table is not selected at the same time, the rollback will fail. In this mode, the parameter Databases must be
// empty; db- Quick mode, only import the backup and binlog of the selected library level, if there is a cross-database
// operation, and the associated library is not selected at the same time, the rollback will fail; full- normal rollback
// mode, the backup and binlog of the entire instance will be imported, at a slower rate.
Strategy pulumi.StringOutput `pulumi:"strategy"`
// The database table information to be rolled back, indicating that the file is rolled back by table.
Tables RollbackTableArrayOutput `pulumi:"tables"`
}
// NewRollback registers a new resource with the given unique name, arguments, and options.
func NewRollback(ctx *pulumi.Context,
name string, args *RollbackArgs, opts ...pulumi.ResourceOption) (*Rollback, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.InstanceId == nil {
return nil, errors.New("invalid value for required argument 'InstanceId'")
}
if args.RollbackTime == nil {
return nil, errors.New("invalid value for required argument 'RollbackTime'")
}
if args.Strategy == nil {
return nil, errors.New("invalid value for required argument 'Strategy'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Rollback
err := ctx.RegisterResource("tencentcloud:Mysql/rollback:Rollback", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRollback gets an existing Rollback 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 GetRollback(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RollbackState, opts ...pulumi.ResourceOption) (*Rollback, error) {
var resource Rollback
err := ctx.ReadResource("tencentcloud:Mysql/rollback:Rollback", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Rollback resources.
type rollbackState struct {
// The database information to be archived, indicating that the entire database is archived.
Databases []RollbackDatabase `pulumi:"databases"`
// Cloud database instance ID.
InstanceId *string `pulumi:"instanceId"`
// Database rollback time, the time format is: yyyy-mm-dd hh:mm:ss.
RollbackTime *string `pulumi:"rollbackTime"`
// Rollback strategy. Available values are: table, db, full; the default value is full. table- Extremely fast rollback
// mode, only import the backup and binlog of the selected table level, if there is a cross-table operation, and the
// associated table is not selected at the same time, the rollback will fail. In this mode, the parameter Databases must be
// empty; db- Quick mode, only import the backup and binlog of the selected library level, if there is a cross-database
// operation, and the associated library is not selected at the same time, the rollback will fail; full- normal rollback
// mode, the backup and binlog of the entire instance will be imported, at a slower rate.
Strategy *string `pulumi:"strategy"`
// The database table information to be rolled back, indicating that the file is rolled back by table.
Tables []RollbackTable `pulumi:"tables"`
}
type RollbackState struct {
// The database information to be archived, indicating that the entire database is archived.
Databases RollbackDatabaseArrayInput
// Cloud database instance ID.
InstanceId pulumi.StringPtrInput
// Database rollback time, the time format is: yyyy-mm-dd hh:mm:ss.
RollbackTime pulumi.StringPtrInput
// Rollback strategy. Available values are: table, db, full; the default value is full. table- Extremely fast rollback
// mode, only import the backup and binlog of the selected table level, if there is a cross-table operation, and the
// associated table is not selected at the same time, the rollback will fail. In this mode, the parameter Databases must be
// empty; db- Quick mode, only import the backup and binlog of the selected library level, if there is a cross-database
// operation, and the associated library is not selected at the same time, the rollback will fail; full- normal rollback
// mode, the backup and binlog of the entire instance will be imported, at a slower rate.
Strategy pulumi.StringPtrInput
// The database table information to be rolled back, indicating that the file is rolled back by table.
Tables RollbackTableArrayInput
}
func (RollbackState) ElementType() reflect.Type {
return reflect.TypeOf((*rollbackState)(nil)).Elem()
}
type rollbackArgs struct {
// The database information to be archived, indicating that the entire database is archived.
Databases []RollbackDatabase `pulumi:"databases"`
// Cloud database instance ID.
InstanceId string `pulumi:"instanceId"`
// Database rollback time, the time format is: yyyy-mm-dd hh:mm:ss.
RollbackTime string `pulumi:"rollbackTime"`
// Rollback strategy. Available values are: table, db, full; the default value is full. table- Extremely fast rollback
// mode, only import the backup and binlog of the selected table level, if there is a cross-table operation, and the
// associated table is not selected at the same time, the rollback will fail. In this mode, the parameter Databases must be
// empty; db- Quick mode, only import the backup and binlog of the selected library level, if there is a cross-database
// operation, and the associated library is not selected at the same time, the rollback will fail; full- normal rollback
// mode, the backup and binlog of the entire instance will be imported, at a slower rate.
Strategy string `pulumi:"strategy"`
// The database table information to be rolled back, indicating that the file is rolled back by table.
Tables []RollbackTable `pulumi:"tables"`
}
// The set of arguments for constructing a Rollback resource.
type RollbackArgs struct {
// The database information to be archived, indicating that the entire database is archived.
Databases RollbackDatabaseArrayInput
// Cloud database instance ID.
InstanceId pulumi.StringInput
// Database rollback time, the time format is: yyyy-mm-dd hh:mm:ss.
RollbackTime pulumi.StringInput
// Rollback strategy. Available values are: table, db, full; the default value is full. table- Extremely fast rollback
// mode, only import the backup and binlog of the selected table level, if there is a cross-table operation, and the
// associated table is not selected at the same time, the rollback will fail. In this mode, the parameter Databases must be
// empty; db- Quick mode, only import the backup and binlog of the selected library level, if there is a cross-database
// operation, and the associated library is not selected at the same time, the rollback will fail; full- normal rollback
// mode, the backup and binlog of the entire instance will be imported, at a slower rate.
Strategy pulumi.StringInput
// The database table information to be rolled back, indicating that the file is rolled back by table.
Tables RollbackTableArrayInput
}
func (RollbackArgs) ElementType() reflect.Type {
return reflect.TypeOf((*rollbackArgs)(nil)).Elem()
}
type RollbackInput interface {
pulumi.Input
ToRollbackOutput() RollbackOutput
ToRollbackOutputWithContext(ctx context.Context) RollbackOutput
}
func (*Rollback) ElementType() reflect.Type {
return reflect.TypeOf((**Rollback)(nil)).Elem()
}
func (i *Rollback) ToRollbackOutput() RollbackOutput {
return i.ToRollbackOutputWithContext(context.Background())
}
func (i *Rollback) ToRollbackOutputWithContext(ctx context.Context) RollbackOutput {
return pulumi.ToOutputWithContext(ctx, i).(RollbackOutput)
}
// RollbackArrayInput is an input type that accepts RollbackArray and RollbackArrayOutput values.
// You can construct a concrete instance of `RollbackArrayInput` via:
//
// RollbackArray{ RollbackArgs{...} }
type RollbackArrayInput interface {
pulumi.Input
ToRollbackArrayOutput() RollbackArrayOutput
ToRollbackArrayOutputWithContext(context.Context) RollbackArrayOutput
}
type RollbackArray []RollbackInput
func (RollbackArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Rollback)(nil)).Elem()
}
func (i RollbackArray) ToRollbackArrayOutput() RollbackArrayOutput {
return i.ToRollbackArrayOutputWithContext(context.Background())
}
func (i RollbackArray) ToRollbackArrayOutputWithContext(ctx context.Context) RollbackArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(RollbackArrayOutput)
}
// RollbackMapInput is an input type that accepts RollbackMap and RollbackMapOutput values.
// You can construct a concrete instance of `RollbackMapInput` via:
//
// RollbackMap{ "key": RollbackArgs{...} }
type RollbackMapInput interface {
pulumi.Input
ToRollbackMapOutput() RollbackMapOutput
ToRollbackMapOutputWithContext(context.Context) RollbackMapOutput
}
type RollbackMap map[string]RollbackInput
func (RollbackMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Rollback)(nil)).Elem()
}
func (i RollbackMap) ToRollbackMapOutput() RollbackMapOutput {
return i.ToRollbackMapOutputWithContext(context.Background())
}
func (i RollbackMap) ToRollbackMapOutputWithContext(ctx context.Context) RollbackMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(RollbackMapOutput)
}
type RollbackOutput struct{ *pulumi.OutputState }
func (RollbackOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Rollback)(nil)).Elem()
}
func (o RollbackOutput) ToRollbackOutput() RollbackOutput {
return o
}
func (o RollbackOutput) ToRollbackOutputWithContext(ctx context.Context) RollbackOutput {
return o
}
// The database information to be archived, indicating that the entire database is archived.
func (o RollbackOutput) Databases() RollbackDatabaseArrayOutput {
return o.ApplyT(func(v *Rollback) RollbackDatabaseArrayOutput { return v.Databases }).(RollbackDatabaseArrayOutput)
}
// Cloud database instance ID.
func (o RollbackOutput) InstanceId() pulumi.StringOutput {
return o.ApplyT(func(v *Rollback) pulumi.StringOutput { return v.InstanceId }).(pulumi.StringOutput)
}
// Database rollback time, the time format is: yyyy-mm-dd hh:mm:ss.
func (o RollbackOutput) RollbackTime() pulumi.StringOutput {
return o.ApplyT(func(v *Rollback) pulumi.StringOutput { return v.RollbackTime }).(pulumi.StringOutput)
}
// Rollback strategy. Available values are: table, db, full; the default value is full. table- Extremely fast rollback
// mode, only import the backup and binlog of the selected table level, if there is a cross-table operation, and the
// associated table is not selected at the same time, the rollback will fail. In this mode, the parameter Databases must be
// empty; db- Quick mode, only import the backup and binlog of the selected library level, if there is a cross-database
// operation, and the associated library is not selected at the same time, the rollback will fail; full- normal rollback
// mode, the backup and binlog of the entire instance will be imported, at a slower rate.
func (o RollbackOutput) Strategy() pulumi.StringOutput {
return o.ApplyT(func(v *Rollback) pulumi.StringOutput { return v.Strategy }).(pulumi.StringOutput)
}
// The database table information to be rolled back, indicating that the file is rolled back by table.
func (o RollbackOutput) Tables() RollbackTableArrayOutput {
return o.ApplyT(func(v *Rollback) RollbackTableArrayOutput { return v.Tables }).(RollbackTableArrayOutput)
}
type RollbackArrayOutput struct{ *pulumi.OutputState }
func (RollbackArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Rollback)(nil)).Elem()
}
func (o RollbackArrayOutput) ToRollbackArrayOutput() RollbackArrayOutput {
return o
}
func (o RollbackArrayOutput) ToRollbackArrayOutputWithContext(ctx context.Context) RollbackArrayOutput {
return o
}
func (o RollbackArrayOutput) Index(i pulumi.IntInput) RollbackOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Rollback {
return vs[0].([]*Rollback)[vs[1].(int)]
}).(RollbackOutput)
}
type RollbackMapOutput struct{ *pulumi.OutputState }
func (RollbackMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Rollback)(nil)).Elem()
}
func (o RollbackMapOutput) ToRollbackMapOutput() RollbackMapOutput {
return o
}
func (o RollbackMapOutput) ToRollbackMapOutputWithContext(ctx context.Context) RollbackMapOutput {
return o
}
func (o RollbackMapOutput) MapIndex(k pulumi.StringInput) RollbackOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Rollback {
return vs[0].(map[string]*Rollback)[vs[1].(string)]
}).(RollbackOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RollbackInput)(nil)).Elem(), &Rollback{})
pulumi.RegisterInputType(reflect.TypeOf((*RollbackArrayInput)(nil)).Elem(), RollbackArray{})
pulumi.RegisterInputType(reflect.TypeOf((*RollbackMapInput)(nil)).Elem(), RollbackMap{})
pulumi.RegisterOutputType(RollbackOutput{})
pulumi.RegisterOutputType(RollbackArrayOutput{})
pulumi.RegisterOutputType(RollbackMapOutput{})
}