-
Notifications
You must be signed in to change notification settings - Fork 273
/
create_project.go
341 lines (309 loc) · 21.1 KB
/
create_project.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
package oceanbasepro
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)
// CreateProject invokes the oceanbasepro.CreateProject API synchronously
func (client *Client) CreateProject(request *CreateProjectRequest) (response *CreateProjectResponse, err error) {
response = CreateCreateProjectResponse()
err = client.DoAction(request, response)
return
}
// CreateProjectWithChan invokes the oceanbasepro.CreateProject API asynchronously
func (client *Client) CreateProjectWithChan(request *CreateProjectRequest) (<-chan *CreateProjectResponse, <-chan error) {
responseChan := make(chan *CreateProjectResponse, 1)
errChan := make(chan error, 1)
err := client.AddAsyncTask(func() {
defer close(responseChan)
defer close(errChan)
response, err := client.CreateProject(request)
if err != nil {
errChan <- err
} else {
responseChan <- response
}
})
if err != nil {
errChan <- err
close(responseChan)
close(errChan)
}
return responseChan, errChan
}
// CreateProjectWithCallback invokes the oceanbasepro.CreateProject API asynchronously
func (client *Client) CreateProjectWithCallback(request *CreateProjectRequest, callback func(response *CreateProjectResponse, err error)) <-chan int {
result := make(chan int, 1)
err := client.AddAsyncTask(func() {
var response *CreateProjectResponse
var err error
defer close(result)
response, err = client.CreateProject(request)
callback(response, err)
result <- 1
})
if err != nil {
defer close(result)
callback(nil, err)
result <- 0
}
return result
}
// CreateProjectRequest is the request struct for api CreateProject
type CreateProjectRequest struct {
*requests.RpcRequest
SinkEndpointId string `position:"Body" name:"SinkEndpointId"`
UseOss requests.Boolean `position:"Body" name:"UseOss"`
OssKey string `position:"Body" name:"OssKey"`
SourceEndpointId string `position:"Body" name:"SourceEndpointId"`
Type string `position:"Body" name:"Type"`
FullTransferConfig CreateProjectFullTransferConfig `position:"Body" name:"FullTransferConfig" type:"Struct"`
EnableStructTransfer requests.Boolean `position:"Body" name:"EnableStructTransfer"`
TransferMapping CreateProjectTransferMapping `position:"Body" name:"TransferMapping" type:"Struct"`
WorkerGradeId string `position:"Body" name:"WorkerGradeId"`
CommonTransferConfig CreateProjectCommonTransferConfig `position:"Body" name:"CommonTransferConfig" type:"Struct"`
StructTransferConfig CreateProjectStructTransferConfig `position:"Body" name:"StructTransferConfig" type:"Struct"`
EnableIncrTransfer requests.Boolean `position:"Body" name:"EnableIncrTransfer"`
EnableFullTransfer requests.Boolean `position:"Body" name:"EnableFullTransfer"`
EnableFullVerify requests.Boolean `position:"Body" name:"EnableFullVerify"`
Name string `position:"Body" name:"Name"`
LabelIds *[]string `position:"Body" name:"LabelIds" type:"Json"`
IncrTransferConfig CreateProjectIncrTransferConfig `position:"Body" name:"IncrTransferConfig" type:"Struct"`
EnableReverseIncrTransfer requests.Boolean `position:"Body" name:"EnableReverseIncrTransfer"`
}
// CreateProjectFullTransferConfig is a repeated param struct in CreateProjectRequest
type CreateProjectFullTransferConfig struct {
NonePkUkTruncateDstTable string `name:"NonePkUkTruncateDstTable"`
FullVerifySpeedMode string `name:"FullVerifySpeedMode"`
FullTransferSpeedMode string `name:"FullTransferSpeedMode"`
AllowDestTableNotEmpty string `name:"AllowDestTableNotEmpty"`
}
// CreateProjectTransferMapping is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMapping struct {
Mode string `name:"Mode"`
Databases *[]CreateProjectTransferMappingDatabasesItem `name:"Databases" type:"Repeated"`
TableAndViewBlackList *[]string `name:"TableAndViewBlackList" type:"Repeated"`
DatabasesBlack *[]CreateProjectTransferMappingDatabasesBlackItem `name:"DatabasesBlack" type:"Repeated"`
TableAndViewWhiteList *[]string `name:"TableAndViewWhiteList" type:"Repeated"`
}
// CreateProjectCommonTransferConfig is a repeated param struct in CreateProjectRequest
type CreateProjectCommonTransferConfig struct {
RocketMqSendMsgTimeout string `name:"RocketMqSendMsgTimeout"`
MqPartition string `name:"MqPartition"`
TableCategory string `name:"TableCategory"`
ActiveActive string `name:"ActiveActive"`
DatahubTopicType string `name:"DatahubTopicType"`
RocketMqMsgTags string `name:"RocketMqMsgTags"`
RocketMqEnableMsgTrace string `name:"RocketMqEnableMsgTrace"`
DataWorksBusinessName string `name:"DataWorksBusinessName"`
RocketMqProducerGroup string `name:"RocketMqProducerGroup"`
MqSerializerType string `name:"MqSerializerType"`
MqPartitionMode string `name:"MqPartitionMode"`
}
// CreateProjectStructTransferConfig is a repeated param struct in CreateProjectRequest
type CreateProjectStructTransferConfig struct {
ByteCharConvertStrategy string `name:"ByteCharConvertStrategy"`
DeferIndexCreation string `name:"DeferIndexCreation"`
}
// CreateProjectIncrTransferConfig is a repeated param struct in CreateProjectRequest
type CreateProjectIncrTransferConfig struct {
EnableSequencingWithinTxn string `name:"EnableSequencingWithinTxn"`
StoreLogKeptHour string `name:"StoreLogKeptHour"`
StartTimestamp string `name:"StartTimestamp"`
RecordTypeWhiteList *[]string `name:"RecordTypeWhiteList" type:"Repeated"`
IncrSyncConcurrency string `name:"IncrSyncConcurrency"`
EnableIncrSyncStatistics string `name:"EnableIncrSyncStatistics"`
}
// CreateProjectTransferMappingDatabasesItem is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesItem struct {
MappedName string `name:"MappedName"`
SpecificViews *[]CreateProjectTransferMappingDatabasesItemSpecificViewsItem `name:"SpecificViews" type:"Repeated"`
Tables *[]CreateProjectTransferMappingDatabasesItemTablesItem `name:"Tables" type:"Repeated"`
ClusterName string `name:"ClusterName"`
Name string `name:"Name"`
TenantName string `name:"TenantName"`
Id string `name:"Id"`
SpecificTables *[]CreateProjectTransferMappingDatabasesItemSpecificTablesItem `name:"SpecificTables" type:"Repeated"`
Views *[]CreateProjectTransferMappingDatabasesItemViewsItem `name:"Views" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesBlackItem is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesBlackItem struct {
MappedName string `name:"MappedName"`
SpecificViews *[]CreateProjectTransferMappingDatabasesBlackItemSpecificViewsItem `name:"SpecificViews" type:"Repeated"`
Tables *[]CreateProjectTransferMappingDatabasesBlackItemTablesItem `name:"Tables" type:"Repeated"`
ClusterName string `name:"ClusterName"`
Name string `name:"Name"`
TenantName string `name:"TenantName"`
Id string `name:"Id"`
SpecificTables *[]CreateProjectTransferMappingDatabasesBlackItemSpecificTablesItem `name:"SpecificTables" type:"Repeated"`
Views *[]CreateProjectTransferMappingDatabasesBlackItemViewsItem `name:"Views" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesItemSpecificViewsItem is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesItemSpecificViewsItem struct {
MappedName string `name:"MappedName"`
FilterColumns *[]string `name:"FilterColumns" type:"Repeated"`
AdbTableSchema CreateProjectTransferMappingDatabasesItemSpecificViewsItemAdbTableSchema `name:"AdbTableSchema" type:"Struct"`
Name string `name:"Name"`
WhereClause string `name:"WhereClause"`
Id string `name:"Id"`
ShardColumns *[]string `name:"ShardColumns" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesItemTablesItem is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesItemTablesItem struct {
MappedName string `name:"MappedName"`
FilterColumns *[]string `name:"FilterColumns" type:"Repeated"`
AdbTableSchema CreateProjectTransferMappingDatabasesItemTablesItemAdbTableSchema `name:"AdbTableSchema" type:"Struct"`
Name string `name:"Name"`
WhereClause string `name:"WhereClause"`
Id string `name:"Id"`
ShardColumns *[]string `name:"ShardColumns" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesItemSpecificTablesItem is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesItemSpecificTablesItem struct {
MappedName string `name:"MappedName"`
FilterColumns *[]string `name:"FilterColumns" type:"Repeated"`
AdbTableSchema CreateProjectTransferMappingDatabasesItemSpecificTablesItemAdbTableSchema `name:"AdbTableSchema" type:"Struct"`
Name string `name:"Name"`
WhereClause string `name:"WhereClause"`
Id string `name:"Id"`
ShardColumns *[]string `name:"ShardColumns" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesItemViewsItem is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesItemViewsItem struct {
MappedName string `name:"MappedName"`
FilterColumns *[]string `name:"FilterColumns" type:"Repeated"`
AdbTableSchema CreateProjectTransferMappingDatabasesItemViewsItemAdbTableSchema `name:"AdbTableSchema" type:"Struct"`
Name string `name:"Name"`
WhereClause string `name:"WhereClause"`
Id string `name:"Id"`
ShardColumns *[]string `name:"ShardColumns" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesBlackItemSpecificViewsItem is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesBlackItemSpecificViewsItem struct {
MappedName string `name:"MappedName"`
FilterColumns *[]string `name:"FilterColumns" type:"Repeated"`
AdbTableSchema CreateProjectTransferMappingDatabasesBlackItemSpecificViewsItemAdbTableSchema `name:"AdbTableSchema" type:"Struct"`
Name string `name:"Name"`
WhereClause string `name:"WhereClause"`
Id string `name:"Id"`
ShardColumns *[]string `name:"ShardColumns" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesBlackItemTablesItem is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesBlackItemTablesItem struct {
MappedName string `name:"MappedName"`
FilterColumns *[]string `name:"FilterColumns" type:"Repeated"`
AdbTableSchema CreateProjectTransferMappingDatabasesBlackItemTablesItemAdbTableSchema `name:"AdbTableSchema" type:"Struct"`
Name string `name:"Name"`
WhereClause string `name:"WhereClause"`
Id string `name:"Id"`
ShardColumns *[]string `name:"ShardColumns" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesBlackItemSpecificTablesItem is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesBlackItemSpecificTablesItem struct {
MappedName string `name:"MappedName"`
FilterColumns *[]string `name:"FilterColumns" type:"Repeated"`
AdbTableSchema CreateProjectTransferMappingDatabasesBlackItemSpecificTablesItemAdbTableSchema `name:"AdbTableSchema" type:"Struct"`
Name string `name:"Name"`
WhereClause string `name:"WhereClause"`
Id string `name:"Id"`
ShardColumns *[]string `name:"ShardColumns" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesBlackItemViewsItem is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesBlackItemViewsItem struct {
MappedName string `name:"MappedName"`
FilterColumns *[]string `name:"FilterColumns" type:"Repeated"`
AdbTableSchema CreateProjectTransferMappingDatabasesBlackItemViewsItemAdbTableSchema `name:"AdbTableSchema" type:"Struct"`
Name string `name:"Name"`
WhereClause string `name:"WhereClause"`
Id string `name:"Id"`
ShardColumns *[]string `name:"ShardColumns" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesItemSpecificViewsItemAdbTableSchema is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesItemSpecificViewsItemAdbTableSchema struct {
PrimaryKeys *[]string `name:"PrimaryKeys" type:"Repeated"`
PartitionStatement string `name:"PartitionStatement"`
PartitionLifeCycle string `name:"PartitionLifeCycle"`
DistributedKeys *[]string `name:"DistributedKeys" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesItemTablesItemAdbTableSchema is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesItemTablesItemAdbTableSchema struct {
PrimaryKeys *[]string `name:"PrimaryKeys" type:"Repeated"`
PartitionStatement string `name:"PartitionStatement"`
PartitionLifeCycle string `name:"PartitionLifeCycle"`
DistributedKeys *[]string `name:"DistributedKeys" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesItemSpecificTablesItemAdbTableSchema is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesItemSpecificTablesItemAdbTableSchema struct {
PrimaryKeys *[]string `name:"PrimaryKeys" type:"Repeated"`
PartitionStatement string `name:"PartitionStatement"`
PartitionLifeCycle string `name:"PartitionLifeCycle"`
DistributedKeys *[]string `name:"DistributedKeys" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesItemViewsItemAdbTableSchema is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesItemViewsItemAdbTableSchema struct {
PrimaryKeys *[]string `name:"PrimaryKeys" type:"Repeated"`
PartitionStatement string `name:"PartitionStatement"`
PartitionLifeCycle string `name:"PartitionLifeCycle"`
DistributedKeys *[]string `name:"DistributedKeys" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesBlackItemSpecificViewsItemAdbTableSchema is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesBlackItemSpecificViewsItemAdbTableSchema struct {
PrimaryKeys *[]string `name:"PrimaryKeys" type:"Repeated"`
PartitionStatement string `name:"PartitionStatement"`
PartitionLifeCycle string `name:"PartitionLifeCycle"`
DistributedKeys *[]string `name:"DistributedKeys" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesBlackItemTablesItemAdbTableSchema is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesBlackItemTablesItemAdbTableSchema struct {
PrimaryKeys *[]string `name:"PrimaryKeys" type:"Repeated"`
PartitionStatement string `name:"PartitionStatement"`
PartitionLifeCycle string `name:"PartitionLifeCycle"`
DistributedKeys *[]string `name:"DistributedKeys" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesBlackItemSpecificTablesItemAdbTableSchema is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesBlackItemSpecificTablesItemAdbTableSchema struct {
PrimaryKeys *[]string `name:"PrimaryKeys" type:"Repeated"`
PartitionStatement string `name:"PartitionStatement"`
PartitionLifeCycle string `name:"PartitionLifeCycle"`
DistributedKeys *[]string `name:"DistributedKeys" type:"Repeated"`
}
// CreateProjectTransferMappingDatabasesBlackItemViewsItemAdbTableSchema is a repeated param struct in CreateProjectRequest
type CreateProjectTransferMappingDatabasesBlackItemViewsItemAdbTableSchema struct {
PrimaryKeys *[]string `name:"PrimaryKeys" type:"Repeated"`
PartitionStatement string `name:"PartitionStatement"`
PartitionLifeCycle string `name:"PartitionLifeCycle"`
DistributedKeys *[]string `name:"DistributedKeys" type:"Repeated"`
}
// CreateProjectResponse is the response struct for api CreateProject
type CreateProjectResponse struct {
*responses.BaseResponse
}
// CreateCreateProjectRequest creates a request to invoke CreateProject API
func CreateCreateProjectRequest() (request *CreateProjectRequest) {
request = &CreateProjectRequest{
RpcRequest: &requests.RpcRequest{},
}
request.InitWithApiInfo("OceanBasePro", "2019-09-01", "CreateProject", "oceanbase", "openAPI")
request.Method = requests.POST
return
}
// CreateCreateProjectResponse creates a response to parse from CreateProject response
func CreateCreateProjectResponse() (response *CreateProjectResponse) {
response = &CreateProjectResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}