Skip to content

Commit 05b7aed

Browse files
authored
Disabled import from s3 directory feature on windows (#899)
1 parent 24e9824 commit 05b7aed

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

ydb/public/lib/ydb_cli/commands/ydb_service_import.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ int TCommandImportFromS3::Run(TConfig& config) {
131131
}
132132

133133
settings.NumberOfRetries(NumberOfRetries);
134-
134+
#if defined(_win32_)
135+
for (const auto& item : Items) {
136+
settings.AppendItem({item.Source, item.Destination});
137+
}
138+
#else
135139
InitAwsAPI();
136140
try {
137141
auto s3Client = CreateS3ClientWrapper(settings);
@@ -162,6 +166,7 @@ int TCommandImportFromS3::Run(TConfig& config) {
162166
throw;
163167
}
164168
ShutdownAwsAPI();
169+
#endif
165170

166171
TImportClient client(CreateDriver(config));
167172
TImportFromS3Response response = client.ImportFromS3(std::move(settings)).GetValueSync();

ydb/public/lib/ydb_cli/common/aws.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
#include <ydb/public/sdk/cpp/client/ydb_import/import.h>
44

5+
#if !defined(_win32_)
56
#include <aws/core/Aws.h>
67
#include <aws/core/auth/AWSCredentialsProvider.h>
78
#include <aws/s3/S3Client.h>
89
#include <aws/s3/model/ListObjectsV2Request.h>
10+
#endif
911

1012
namespace NYdb::NConsoleClient {
1113

@@ -41,6 +43,19 @@ TString TCommandWithAwsCredentials::ReadIniKey(const TString& iniKey) {
4143
}
4244
}
4345

46+
#if defined(_win32_)
47+
std::unique_ptr<IS3ClientWrapper> CreateS3ClientWrapper(const NImport::TImportFromS3Settings& settings) {
48+
throw yexception() << "AWS API is not supported for windows platform";
49+
}
50+
51+
void InitAwsAPI() {
52+
throw yexception() << "AWS API is not supported for windows platform";
53+
}
54+
55+
void ShutdownAwsAPI() {
56+
throw yexception() << "AWS API is not supported for windows platform";
57+
}
58+
#else
4459
class TS3ClientWrapper : public IS3ClientWrapper {
4560
public:
4661
TS3ClientWrapper(const NImport::TImportFromS3Settings& settings)
@@ -100,5 +115,6 @@ void InitAwsAPI() {
100115
void ShutdownAwsAPI() {
101116
Aws::ShutdownAPI(Aws::SDKOptions());
102117
}
118+
#endif
103119

104120
}

0 commit comments

Comments
 (0)