S3 client interface. Functions to send S3 requests, and perform parallel uploading and downloading data from memory and files.
More...
|
S3Credentials | sss::GetS3Credentials (const std::string &fileName, std::string awsProfile) |
| read S3 credentials from file in AWS S3 format (Toml ).
|
|
BucketValidation | sss::ValidateBucket (const std::string name) |
| Validate bucket name. Bucket name restrictions: see https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-s3-bucket-naming-requirements.html.
|
|
Headers | sss::ToMeta (const std::map< std::string, std::string > &metaData) |
| Translate metadata (key,value) pairs to amz- format and return header map which can be merged with other headers using the std::map::merge method, since C++17.
|
|
void | sss::Validate (const S3ClientConfig &s) |
| Validate S3 client request parameters.
|
|
WebClient | sss::SendS3Request (S3ClientConfig cfg) |
| Send S3 request to endpoint.
|
|
ETag | sss::Upload (const S3DataTransferConfig &cfg, const MetaDataMap &mm={}, bool sync=false) |
| Parallel upload If cfg.data not NULL data is read from memory, from file specified in cfg.file instead.
|
|
void | sss::Download (const S3DataTransferConfig &cfg, bool sync=false, const std::string &versionId="") |
| Parallel upload If cfg.data not NULL data is written into cfg.data buffer, to file specified in cfg.file instead.
|
|
S3 client interface. Functions to send S3 requests, and perform parallel uploading and downloading data from memory and files.
◆ Download()
void sss::Download |
( |
const S3DataTransferConfig & |
cfg, |
|
|
bool |
sync = false , |
|
|
const std::string & |
versionId = "" |
|
) |
| |
Parallel upload If cfg.data
not NULL
data is written into cfg.data
buffer, to file specified in cfg.file
instead.
- Parameters
-
[in] | cfg | data transfer configuration, |
- See also
- S3DataTransferConfig
- Parameters
-
[in] | sync | if sync==true perform serial transfer |
[in] | versionId | version id or blank for latest version or in case versioning not enabled |
◆ GetS3Credentials()
S3Credentials sss::GetS3Credentials |
( |
const std::string & |
fileName, |
|
|
std::string |
awsProfile |
|
) |
| |
read S3 credentials from file in AWS S3 format (Toml
).
Read S3 credentials from file.
- Parameters
-
[in] | fileName | input file, if empty will try to read from $HOME/.aws/credentials |
[in] | awsProfile | AWS profile, if empty select default profile; not a reference because could be modified internally |
- Returns
- S3Credentials instance
- See also
- S3Credentials
- Parameters
-
[in] | fileName | name of configuration file in AWS TOML format |
[in] | awsProfile | profile |
◆ ToMeta()
Map sss::ToMeta |
( |
const std::map< std::string, std::string > & |
metaData | ) |
|
Translate metadata (key,value) pairs to amz-
format and return header map which can be merged with other headers using the std::map::merge
method, since C++17.
Adds x-amz-meta-
prefix to map keys and checks that total size is less than maximum metadata header size (currently 2kB).
◆ Upload()
◆ ValidateBucket()