Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Interfaces/ObjectStorage/Gateways/gtwAWSS3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ bool gtwAWSS3::storeFile(
<< "]"
);

TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__ << "QFile::exists");
if (QFile::exists(_fullFileName) == false)
throw exTargomanBase(QString("File %1 not found").arg(_fullFileName));

// QString Bucket = _uploadGateway.ugwMetaInfo[AWSS3MetaInfoJsonKey::Bucket].toString();
// QString EndpointUrl = _uploadGateway.ugwMetaInfo[AWSS3MetaInfoJsonKey::EndpointUrl].toString();

Expand Down Expand Up @@ -101,8 +105,9 @@ bool gtwAWSS3::storeFile(
TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__);
Request.SetBucket(_uploadGateway.ugwBucket.toStdString());

TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__);
Request.SetKey(QString("%1/%2").arg(_path).arg(_fileName).toStdString());
QString Key = QString("%1/%2").arg(_path).arg(_fileName);
TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__ << Key);
Request.SetKey(Key.toStdString());

TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__);
Request.SetACL(S3::Model::ObjectCannedACL::public_read);
Expand All @@ -117,7 +122,7 @@ bool gtwAWSS3::storeFile(
Request.SetBody(InputData);

//----------------------------------------
TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__);
TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__ << "S3Client.PutObject");
S3::Model::PutObjectOutcome Outcome = S3Client.PutObject(Request);

TargomanLogDebug(5, "*** gtwAWSS3::storeFile: #" << __LINE__);
Expand Down
10 changes: 7 additions & 3 deletions Interfaces/ObjectStorage/Gateways/gtwAWSS3.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,18 @@ using namespace Aws;
15.2) zypper ar -no-gpgcheck https://download.opensuse.org/repositories/home:/targoman/openSUSE_Leap_15.2/home:targoman.repo
15.3) zypper ar -no-gpgcheck https://download.opensuse.org/repositories/home:/targoman/15.3/home:targoman.repo

zypper in aws-sdk-cpp-s3-devel
- zypper in aws-sdk-cpp-s3-devel
- OR
- zypper in aws-sdk-cpp-s3
*/

/** installing AmazonAWS S3 from source ************************************************************
git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp
mkdir aws-build.s3
cd aws-build.s3
cmake ../aws-sdk-cpp -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=/usr -DBUILD_ONLY="s3"
- cmake ../aws-sdk-cpp -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=/usr -DBUILD_ONLY="s3"
- OR
- cmake ../aws-sdk-cpp -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=/usr -DBUILD_ONLY="s3"
make
sudo make install
*/
Expand All @@ -75,7 +79,7 @@ struct __static_s3_initializer__ {
//An instance of Aws::SDKOptions is passed to the Aws::InitAPI and
//Aws::ShutdownAPI methods. The same instance should be sent to both methods.
#ifdef QT_DEBUG
options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;
options.loggingOptions.logLevel = Utils::Logging::LogLevel::Trace;
#else
options.loggingOptions.logLevel = Utils::Logging::LogLevel::Off;
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* Migration File: m20220905_153042_Interfaces_ObjectStorage_make_gateway_name_unique.sql */
/* CAUTION: don't forget to use {{dbprefix}} for schemas */

USE `{{dbprefix}}{{Schema}}`;

ALTER TABLE `tblUploadGateways`
ADD UNIQUE INDEX `ugwName` (`ugwName`);