1
- // Copyright (c) 2017, Tencent Inc.
1
+ // Copyright (c) 2017, Tencent Inc.
2
2
// All rights reserved.
3
3
//
4
4
// Author: sevenyou <[email protected] >
@@ -41,7 +41,8 @@ class ObjectOp : public BaseOp {
41
41
42
42
std::string GetResumableUploadID (const PutObjectByFileReq& originReq,
43
43
const std::string& bucket_name,
44
- const std::string& object_name);
44
+ const std::string& object_name,
45
+ bool change_backup_domain = false );
45
46
46
47
bool CheckUploadPart (const PutObjectByFileReq& req,
47
48
const std::string& bucket_name,
@@ -59,7 +60,7 @@ class ObjectOp : public BaseOp {
59
60
// / \param response HeadObject返回
60
61
// /
61
62
// / \return 返回HTTP请求的状态码及错误信息
62
- CosResult HeadObject (const HeadObjectReq& req, HeadObjectResp* resp);
63
+ CosResult HeadObject (const HeadObjectReq& req, HeadObjectResp* resp, bool change_backup_domain = false );
63
64
64
65
// / \brief 下载Bucket中的一个文件至流中
65
66
// /
@@ -68,7 +69,7 @@ class ObjectOp : public BaseOp {
68
69
// /
69
70
// / \return 返回HTTP请求的状态码及错误信息
70
71
CosResult GetObject (const GetObjectByStreamReq& req,
71
- GetObjectByStreamResp* resp);
72
+ GetObjectByStreamResp* resp, bool change_backup_domain = false );
72
73
73
74
// / \brief 下载Bucket中的一个文件到本地
74
75
// /
@@ -77,7 +78,7 @@ class ObjectOp : public BaseOp {
77
78
// /
78
79
// / \return 返回HTTP请求的状态码及错误信息
79
80
CosResult GetObject (const GetObjectByFileReq& req, GetObjectByFileResp* resp,
80
- const SharedTransferHandler& handler = nullptr );
81
+ const SharedTransferHandler& handler = nullptr , bool change_backup_domain = false );
81
82
82
83
// / \brief 多线程下载Bucket中的一个文件到本地
83
84
// /
@@ -95,7 +96,7 @@ class ObjectOp : public BaseOp {
95
96
// /
96
97
// / \return 返回HTTP请求的状态码及错误信息
97
98
CosResult PutObject (const PutObjectByFileReq& req, PutObjectByFileResp* resp,
98
- const SharedTransferHandler& handler = nullptr );
99
+ const SharedTransferHandler& handler = nullptr , bool change_backup_domain = false );
99
100
100
101
// / \brief 将指定流上传至指定Bucket中
101
102
// /
@@ -104,23 +105,23 @@ class ObjectOp : public BaseOp {
104
105
// /
105
106
// / \return 返回HTTP请求的状态码及错误信息
106
107
CosResult PutObject (const PutObjectByStreamReq& req,
107
- PutObjectByStreamResp* resp, const SharedTransferHandler& handler=nullptr );
108
+ PutObjectByStreamResp* resp, const SharedTransferHandler& handler=nullptr , bool change_backup_domain = false );
108
109
109
110
// / \brief 删除Object
110
111
// /
111
112
// / \param req DeleteObject请求
112
113
// / \param resp DeleteObject返回
113
114
// /
114
115
// / \return 本次请求的调用情况(如状态码等)
115
- CosResult DeleteObject (const DeleteObjectReq& req, DeleteObjectResp* resp);
116
+ CosResult DeleteObject (const DeleteObjectReq& req, DeleteObjectResp* resp, bool change_backup_domain = false );
116
117
117
118
// / \brief 批量删除Object
118
119
// /
119
120
// / \param req DeleteObjects请求
120
121
// / \param resp DeleteObjects返回
121
122
// /
122
123
// / \return 本次请求的调用情况(如状态码等)
123
- CosResult DeleteObjects (const DeleteObjectsReq& req, DeleteObjectsResp* resp);
124
+ CosResult DeleteObjects (const DeleteObjectsReq& req, DeleteObjectsResp* resp, bool change_backup_domain = false );
124
125
125
126
// / \brief
126
127
// / 请求实现初始化分片上传,成功执行此请求以后会返回UploadId用于后续的Upload
@@ -131,7 +132,8 @@ class ObjectOp : public BaseOp {
131
132
// /
132
133
// / \return 返回HTTP请求的状态码及错误信息
133
134
CosResult InitMultiUpload (const InitMultiUploadReq& req,
134
- InitMultiUploadResp* resp);
135
+ InitMultiUploadResp* resp,
136
+ bool change_backup_domain = false );
135
137
136
138
// / \brief 初始化以后的分块上传,支持的块的数量为1到10000,块的大小为1MB到5GB
137
139
// /
@@ -140,7 +142,8 @@ class ObjectOp : public BaseOp {
140
142
// /
141
143
// / \return 返回HTTP请求的状态码及错误信息
142
144
CosResult UploadPartData (const UploadPartDataReq& req,
143
- UploadPartDataResp* resp);
145
+ UploadPartDataResp* resp,
146
+ bool change_backup_domain = false );
144
147
145
148
// / \brief
146
149
// / 初始化以后的分块复制,实现将一个文件的分块内容从源路径复制到目标路径。
@@ -152,7 +155,8 @@ class ObjectOp : public BaseOp {
152
155
// /
153
156
// / \return 返回HTTP请求的状态码及错误信息
154
157
CosResult UploadPartCopyData (const UploadPartCopyDataReq& req,
155
- UploadPartCopyDataResp* resp);
158
+ UploadPartCopyDataResp* resp,
159
+ bool change_backup_domain = false );
156
160
157
161
// / \brief 完成整个分块上传。当使用 Upload Parts 上传完所有块以后,
158
162
// / 必须调用该 API 来完成整个文件的分块上传
@@ -162,7 +166,8 @@ class ObjectOp : public BaseOp {
162
166
// /
163
167
// / \return 返回HTTP请求的状态码及错误信息
164
168
CosResult CompleteMultiUpload (const CompleteMultiUploadReq& req,
165
- CompleteMultiUploadResp* resp);
169
+ CompleteMultiUploadResp* resp,
170
+ bool change_backup_domain = false );
166
171
167
172
// / \brief 异步多线程上传
168
173
// / \param request MultiUploadObject请求
@@ -172,7 +177,8 @@ class ObjectOp : public BaseOp {
172
177
// / \return result
173
178
CosResult MultiUploadObject (const PutObjectByFileReq& req,
174
179
MultiPutObjectResp* resp,
175
- const SharedTransferHandler& handler = nullptr );
180
+ const SharedTransferHandler& handler = nullptr ,
181
+ bool change_backup_domain = false );
176
182
177
183
// / \brief 舍弃一个分块上传并删除已上传的块
178
184
// /
@@ -181,23 +187,24 @@ class ObjectOp : public BaseOp {
181
187
// /
182
188
// / \return
183
189
CosResult AbortMultiUpload (const AbortMultiUploadReq& req,
184
- AbortMultiUploadResp* resp);
190
+ AbortMultiUploadResp* resp,
191
+ bool change_backup_domain = false );
185
192
186
193
// / \brief 查询特定分块上传中的已上传的块
187
194
// /
188
195
// / \param req ListParts请求
189
196
// / \param resp ListParts返回
190
197
// /
191
198
// / \return result
192
- CosResult ListParts (const ListPartsReq& req, ListPartsResp* resp);
199
+ CosResult ListParts (const ListPartsReq& req, ListPartsResp* resp, bool change_backup_domain = false );
193
200
194
201
// / \brief 列出Object下的ACL
195
202
// /
196
203
// / \param req GetObjectACL请求
197
204
// / \param resp GetObjectACL返回
198
205
// /
199
206
// / \return 本次请求的调用情况(如状态码等)
200
- CosResult GetObjectACL (const GetObjectACLReq& req, GetObjectACLResp* resp);
207
+ CosResult GetObjectACL (const GetObjectACLReq& req, GetObjectACLResp* resp, bool change_backup_domain = false );
201
208
202
209
// / \brief 增加/替换Object下的ACL, 可以通过Header或者Body传入ACL信息
203
210
// / 注意Header 和 Body 只能选择其中一种,否则响应返回会冲突
@@ -206,7 +213,7 @@ class ObjectOp : public BaseOp {
206
213
// / \param resp PutObjectACL返回
207
214
// /
208
215
// / \return 本次请求的调用情况(如状态码等)
209
- CosResult PutObjectACL (const PutObjectACLReq& req, PutObjectACLResp* resp);
216
+ CosResult PutObjectACL (const PutObjectACLReq& req, PutObjectACLResp* resp, bool change_backup_domain = false );
210
217
211
218
// / \brief 已存在的Object设置标签.
212
219
// /
@@ -241,7 +248,7 @@ class ObjectOp : public BaseOp {
241
248
// / \param resp PutObjectCopy返回
242
249
// /
243
250
// / \return 本次请求的调用情况(如状态码等)
244
- CosResult PutObjectCopy (const PutObjectCopyReq& req, PutObjectCopyResp* resp);
251
+ CosResult PutObjectCopy (const PutObjectCopyReq& req, PutObjectCopyResp* resp, bool change_backup_domain = false );
245
252
246
253
// / \brief 复制文件,实现将一个文件的分块内容从源路径复制到目标路径。
247
254
// / 通过指定 x-cos-copy-source 来指定源文件,x-cos-copy-source-range
@@ -251,7 +258,7 @@ class ObjectOp : public BaseOp {
251
258
// / \param response Copy返回
252
259
// /
253
260
// / \return 返回HTTP请求的状态码及错误信息
254
- CosResult Copy (const CopyReq& req, CopyResp* resp);
261
+ CosResult Copy (const CopyReq& req, CopyResp* resp, bool change_backup_domain = false );
255
262
256
263
// / \brief 对一个通过 COS 归档为 archive 类型的对象进行恢复
257
264
// /
@@ -260,14 +267,16 @@ class ObjectOp : public BaseOp {
260
267
// /
261
268
// / \return 返回HTTP请求的状态码及错误信息
262
269
CosResult PostObjectRestore (const PostObjectRestoreReq& req,
263
- PostObjectRestoreResp* resp);
270
+ PostObjectRestoreResp* resp,
271
+ bool change_backup_domain = false );
264
272
265
273
std::string GeneratePresignedUrl (const GeneratePresignedUrlReq& req);
266
274
267
- CosResult OptionsObject (const OptionsObjectReq& req, OptionsObjectResp* resp);
275
+ CosResult OptionsObject (const OptionsObjectReq& req, OptionsObjectResp* resp, bool change_backup_domain = false );
268
276
269
277
CosResult SelectObjectContent (const SelectObjectContentReq& req,
270
- SelectObjectContentResp* resp);
278
+ SelectObjectContentResp* resp,
279
+ bool change_backup_domain = false );
271
280
272
281
CosResult AppendObject (const AppendObjectReq& req, AppendObjectResp* resp);
273
282
@@ -278,7 +287,8 @@ class ObjectOp : public BaseOp {
278
287
// /
279
288
// / \return 返回HTTP请求的状态码及错误信息
280
289
CosResult PutLiveChannel (const PutLiveChannelReq& req,
281
- PutLiveChannelResp* resp);
290
+ PutLiveChannelResp* resp,
291
+ bool change_backup_domain = false );
282
292
283
293
// / \brief 启用或禁用通道
284
294
// /
@@ -287,7 +297,8 @@ class ObjectOp : public BaseOp {
287
297
// /
288
298
// / \return 返回HTTP请求的状态码及错误信息
289
299
CosResult PutLiveChannelSwitch (const PutLiveChannelSwitchReq& req,
290
- PutLiveChannelSwitchResp* resp);
300
+ PutLiveChannelSwitchResp* resp,
301
+ bool change_backup_domain = false );
291
302
292
303
// / \brief 获取直播通道配置
293
304
// /
@@ -296,7 +307,8 @@ class ObjectOp : public BaseOp {
296
307
// /
297
308
// / \return 返回HTTP请求的状态码及错误信息
298
309
CosResult GetLiveChannel (const GetLiveChannelReq& req,
299
- GetLiveChannelResp* resp);
310
+ GetLiveChannelResp* resp,
311
+ bool change_backup_domain = false );
300
312
301
313
// / \brief 获取直播通道推流历史
302
314
// /
@@ -305,7 +317,8 @@ class ObjectOp : public BaseOp {
305
317
// /
306
318
// / \return 返回HTTP请求的状态码及错误信息
307
319
CosResult GetLiveChannelHistory (const GetLiveChannelHistoryReq& req,
308
- GetLiveChannelHistoryResp* resp);
320
+ GetLiveChannelHistoryResp* resp,
321
+ bool change_backup_domain = false );
309
322
310
323
// / \brief 获取直播通道推流状态
311
324
// /
@@ -314,7 +327,8 @@ class ObjectOp : public BaseOp {
314
327
// /
315
328
// / \return 返回HTTP请求的状态码及错误信息
316
329
CosResult GetLiveChannelStatus (const GetLiveChannelStatusReq& req,
317
- GetLiveChannelStatusResp* resp);
330
+ GetLiveChannelStatusResp* resp,
331
+ bool change_backup_domain = false );
318
332
319
333
// / \brief 删除直播通
320
334
// /
@@ -323,7 +337,8 @@ class ObjectOp : public BaseOp {
323
337
// /
324
338
// / \return 返回HTTP请求的状态码及错误信息
325
339
CosResult DeleteLiveChannel (const DeleteLiveChannelReq& req,
326
- DeleteLiveChannelResp* resp);
340
+ DeleteLiveChannelResp* resp,
341
+ bool change_backup_domain = false );
327
342
328
343
// / \brief 查询指定通道在指定时间段推流生成的播放列表
329
344
// /
@@ -332,7 +347,8 @@ class ObjectOp : public BaseOp {
332
347
// /
333
348
// / \return 返回HTTP请求的状态码及错误信息
334
349
CosResult GetLiveChannelVodPlaylist (const GetLiveChannelVodPlaylistReq& req,
335
- GetLiveChannelVodPlaylistResp* resp);
350
+ GetLiveChannelVodPlaylistResp* resp,
351
+ bool change_backup_domain = false );
336
352
337
353
// / \brief 指定通道生成一个可供点播例用的播放列表
338
354
// /
@@ -341,27 +357,31 @@ class ObjectOp : public BaseOp {
341
357
// /
342
358
// / \return 返回HTTP请求的状态码及错误信息
343
359
CosResult PostLiveChannelVodPlaylist (const PostLiveChannelVodPlaylistReq& req,
344
- PostLiveChannelVodPlaylistResp* resp);
360
+ PostLiveChannelVodPlaylistResp* resp,
361
+ bool change_backup_domain = false );
345
362
346
363
// / \brief 异步多线程下载,handler处理回调
347
364
CosResult MultiThreadDownload (const GetObjectByFileReq& req,
348
365
GetObjectByFileResp* resp,
349
- const SharedTransferHandler& handler = nullptr );
366
+ const SharedTransferHandler& handler = nullptr ,
367
+ bool change_backup_domain = false );
350
368
351
369
/* Resumable接口 */
352
370
353
371
// / \brief 支持断点下载
354
372
CosResult ResumableGetObject (const GetObjectByFileReq& req,
355
373
GetObjectByFileResp* resp,
356
- const SharedTransferHandler& handler = nullptr );
374
+ const SharedTransferHandler& handler = nullptr ,
375
+ bool change_backup_domain = false );
357
376
358
377
/* 批量及目录操作接口*/
359
378
CosResult PutObjects (const PutObjectsByDirectoryReq& req,
360
- PutObjectsByDirectoryResp* resp);
379
+ PutObjectsByDirectoryResp* resp,
380
+ bool change_backup_domain = false );
361
381
362
- CosResult PutDirectory (const PutDirectoryReq& req, PutDirectoryResp* resp);
382
+ CosResult PutDirectory (const PutDirectoryReq& req, PutDirectoryResp* resp, bool change_backup_domain = false );
363
383
364
- CosResult MoveObject (const MoveObjectReq& req);
384
+ CosResult MoveObject (const MoveObjectReq& req, bool change_backup_domain = false );
365
385
366
386
/* 数据处理接口*/
367
387
@@ -404,7 +424,8 @@ class ObjectOp : public BaseOp {
404
424
const std::vector<std::string>& already_exist_parts,
405
425
bool resume_flag, std::vector<std::string>* etags_ptr,
406
426
std::vector<uint64_t >* part_numbers_ptr,
407
- const SharedTransferHandler& handler = nullptr );
427
+ const SharedTransferHandler& handler = nullptr ,
428
+ bool change_backup_domain = false );
408
429
409
430
// / \brief 读取文件内容, 并返回读取的长度
410
431
// uint64_t GetContent(const std::string& src, std::string* file_content) const;
0 commit comments