Skip to content

Commit 3696e11

Browse files
pixccGazizonoki
authored andcommitted
Moved commit "Add import ACL from S3 for tables" from ydb repo
1 parent 9390e96 commit 3696e11

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

include/ydb-cpp-sdk/client/import/import.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ struct TImportFromS3Settings : public TOperationRequestSettings<TImportFromS3Set
4141
FLUENT_SETTING_VECTOR(TItem, Item);
4242
FLUENT_SETTING_OPTIONAL(std::string, Description);
4343
FLUENT_SETTING_OPTIONAL(uint32_t, NumberOfRetries);
44+
FLUENT_SETTING_OPTIONAL(bool, NoACL);
4445
};
4546

4647
class TImportFromS3Response : public TOperation {

src/api/protos/ydb_import.proto

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ message ImportFromS3Settings {
4242
The object name begins with 'source_prefix'.
4343
This prefix is followed by:
4444
* '/data_PartNumber', where 'PartNumber' represents the index of the part, starting at zero;
45-
* '/scheme.pb' - object with information about scheme, indexes, etc.
45+
* '/scheme.pb' - object with information about scheme, indexes, etc;
46+
* '/permissions.pb' - object with information about ACL and owner.
4647
*/
4748
string source_prefix = 1 [(required) = true];
4849

@@ -67,6 +68,10 @@ message ImportFromS3Settings {
6768
// details: https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html
6869
// it is especially useful for custom s3 implementations
6970
bool disable_virtual_addressing = 10;
71+
72+
// Prevent importing of ACL and owner. If true, objects are created with empty ACL
73+
// and their owner will be the user who started the import.
74+
bool no_acl = 11;
7075
}
7176

7277
message ImportFromS3Result {

src/client/import/import.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ TFuture<TImportFromS3Response> TImportClient::ImportFromS3(const TImportFromS3Se
154154
request.mutable_settings()->set_number_of_retries(settings.NumberOfRetries_.value());
155155
}
156156

157+
if (settings.NoACL_) {
158+
request.mutable_settings()->set_no_acl(settings.NoACL_.value());
159+
}
160+
157161
request.mutable_settings()->set_disable_virtual_addressing(!settings.UseVirtualAddressing_);
158162

159163
return Impl_->ImportFromS3(std::move(request), settings);

0 commit comments

Comments
 (0)