This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/CI/install-test/main.cpp

30 lines
796 B
C++

#include <aws/core/Aws.h>
#include <aws/core/utils/logging/LogLevel.h>
#include <aws/s3/S3Client.h>
#include <iostream>
using namespace Aws;
int main(int argc, char *argv[])
{
SDKOptions options;
options.loggingOptions.logLevel = Utils::Logging::LogLevel::Warn;
InitAPI(options);
{
S3::S3Client client;
auto outcome = client.ListBuckets();
if (outcome.IsSuccess()) {
std::cout << "Found " << outcome.GetResult().GetBuckets().size() << " buckets\n";
for (auto&& b : outcome.GetResult().GetBuckets()) {
std::cout << b.GetName() << std::endl;
}
} else {
std::cout << "Failed with error: " << outcome.GetError() << std::endl;
}
}
ShutdownAPI(options);
return 0;
}