MinIO C++ Client SDK for Amazon S3 Compatible Cloud Storage

Overview

NOTE: This project is a work in progress

MinIO C++ Client SDK for Amazon S3 Compatible Cloud Storage Slack Sourcegraph Apache V2 License

The MinIO C++ Client SDK provides simple APIs to access any Amazon S3 compatible object storage.

This quickstart guide will show you how to install the MinIO client SDK, connect to MinIO, and provide a walkthrough for a simple file uploader. For a complete list of APIs and examples, please take a look at the C++ Client API Reference.

This document assumes that you have a working C++ development environment.

NOTE: This library is based on original work https://github.com/cjameshuff/s3tools, but has been completely re-implemented since then.

Build Instructions

In order to build this project, you need the Cross-Platform Make CMake 3.10 or higher. You can download it from http://www.cmake.org/. In order to build miniocpp you need to have the following libraries and their development headers installed.

  • libcurl-dev
  • libssl-dev (OpenSSL 1.1.x, preferably)
  • doxygen
    • dnf install doxygen -y on CentOS 8.x
    • apt install doxygen -y on Ubuntu 20.04
  • pugixml
    • dnf install pugixml-devel -y on CentOS 8.x
    • apt install libpugixml-dev -y on Ubuntu 20.04
git clone https://github.com/minio/minio-cpp
cd minio-cpp; git submodule init; git submodule update; mkdir build; cd build; cmake ../;
make

If building pugixml from source, then in the pugixml directory e.g. /src/pugixml-1.11

cmake .
make

Then you may point PUGIXML to point to custom folders.

git clone https://github.com/minio/minio-cpp
cd minio-cpp; git submodule init; git submodule update; mkdir build; cd build;
cmake -DPUGIXML_INCLUDE_DIR=/src/pugixml-1.11/src \
      -DCMAKE_PREFIX_PATH=/src/pugixml-1.11 ../;
make

Example code

#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <getopt.h>
#include <s3.h>

using namespace Minio;

int
main ( int argc, char** argv )
{
  S3Client s3("https://play.min.io:9000", "minioadmin", "minioadmin");
  S3ClientIO io;
  s3.MakeBucket("newbucket", io);
  if(io.Failure()) {
    std::cerr << "ERROR: failed to create bucket" << endl;
    std::cerr << "response:\n" << io << endl;
    std::cerr << "response body:\n" << io.response.str() << endl;
    return -1;
  }
  return 0;
}

Run an example

Following example runs 'multipart' upload, uploads a single part. You would have to choose a local file to upload for -f, and also remote bucket to upload the object to as -n and final object name in the bucket as -k.

\ -n -k ">
export ACTION="multipart"
export ACCESS_KEY=minioadmin
export SECRET_KEY=minioadmin
export ENDPOINT="https://play.min.io:9000"

./examples/s3 -a ${ACTION} -f 
     
       \
              -n 
      
        -k 
       

       
      
     

Please choose a that exists.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Issues
  • SDK problems.

    SDK problems.

    Installed latest sdk on updated Ubuntu 18.04.6 LTS, 5.4.0-52-generic via vcpkg install minio-cpp. Compiling the example OK, but running it results in nothing and no error no matter what credentials, however - wrong url results in error. Populated storage according to https://github.com/minio/mc/releases without any issues. Any ideas?

    opened by cumafo 6
  • Build on ubuntu18.04

    Build on ubuntu18.04

    Unable to build due to: CMake Error at CMakeLists.txt:57 (find_package): Could not find a package configuration file provided by "unofficial-curlpp" Cannot find package on linux

    opened by cumafo 3
  • adapt to windows (msvc) and use vcpkg for 3rd libs (include curlpp)

    adapt to windows (msvc) and use vcpkg for 3rd libs (include curlpp)

    Recommended to use vcpkg as a 3rd lib manager.

    1. adapt to windows msvc (2019+): add src/win/getopt.h
    2. use vcpkg instead of traditional find_package
    3. remove curlpp submodule, also use vcpkg
    opened by kkzi 1
  • fix some warnings during compile

    fix some warnings during compile

    [ 25%] Building CXX object src/CMakeFiles/miniocpp.dir/utils.cc.o
    /home/harsha/go/src/github.com/minio/minio-cpp/src/utils.cc: In member function ‘std::string minio::utils::Time::ToISO8601UTC()’:
    /home/harsha/go/src/github.com/minio/minio-cpp/src/utils.cc:270:25: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘__suseconds_t’ {aka ‘long int’} [-Wformat=]
      270 |   snprintf(buf, 64, "%03d", tv_.tv_usec);
          |                      ~~~^   ~~~~~~~~~~~
          |                         |       |
          |                         int     __suseconds_t {aka long int}
          |                      %03ld
    /home/harsha/go/src/github.com/minio/minio-cpp/src/utils.cc: In static member function ‘static minio::utils::Time minio::utils::Time::FromISO8601UTC(const char*)’:
    /home/harsha/go/src/github.com/minio/minio-cpp/src/utils.cc:283:17: warning: format ‘%u’ expects argument of type ‘unsigned int*’, but argument 3 has type ‘suseconds_t*’ {aka ‘long int*’} [-Wformat=]
      283 |   sscanf(rv, ".%u", &tv_usec);
          |                ~^   ~~~~~~~~
          |                 |   |
          |                 |   suseconds_t* {aka long int*}
          |                 unsigned int*
          |                %lu
    [ 27%] Building CXX object src/CMakeFiles/min
    
    opened by harshavardhana 0
  • Refactor S3 client implementation.

    Refactor S3 client implementation.

    Below APIs are added

    • MakeBucket()
    • RemoveBucket()
    • BucketExists()
    • ListBuckets()
    • StatObject()
    • RemoveObject()
    • DownloadObject()
    • GetObject()
    • ListObjects()
    • PutObject()
    • CopyObject()
    • UploadObject()

    Signed-off-by: Bala.FA [email protected]

    opened by balamurugana 0
  • Update s3.cpp

    Update s3.cpp

    I suppose there is some kind of memory leak happening here, because I'm continuously running into malloc memory corrupted issues in this section. I checked the examples in curlpp repo. https://github.com/jpbarrette/curlpp/blob/master/examples/example00.cpp#L18 shows that we need a cleanup object to do the cleanup of heap memory. And post the changes, I'm not facing the memory leak issues anymore.

    opened by basavaraj29 0
  • potential stack buffer overflow

    potential stack buffer overflow

    In http.h line 127 there is a sockaddr_in, which is an IPv4 sockaddr, but in the following line it gets filled with an IPv6 address, which needs more space than an IPv4 address It should be sockaddr_in6 for that purpose.

    opened by ticso24 1
  • Add more credential providers

    Add more credential providers

    depends on https://github.com/minio/minio-cpp/pull/35

    • ChainedProvider
    • EnvAwsProvider
    • EnvMinioProvider
    • AwsConfigProvider
    • MinioClientConfigProvider
    • AssumeRoleProvider
    • ClientGrantsProvider
    • WebIdentityProvider
    • IamAwsProvider
    • LdapIdentityProvider

    Signed-off-by: Bala.FA [email protected]

    opened by balamurugana 0
  • Add bucket and object related APIs

    Add bucket and object related APIs

    • DeleteBucketPolicy

    • GetBucketPolicy

    • SetBucketPolicy

    • DeleteBucketNotification

    • GetBucketNotification

    • SetBucketNotification

    • DeleteBucketEncryption

    • GetBucketEncryption

    • SetBucketEncryption

    • GetBucketVersioning

    • SetBucketVersioning

    • DeleteBucketReplication

    • GetBucketReplication

    • SetBucketReplication

    • DeleteBucketLifecycle

    • GetBucketLifecycle

    • SetBucketLifecycle

    • DeleteBucketTags

    • GetBucketTags

    • SetBucketTags

    • DeleteObjectLockConfig

    • GetObjectLockConfig

    • SetObjectLockConfig

    • DeleteObjectTags

    • GetObjectTags

    • SetObjectTags

    • DisableObjectLegalHold

    • EnableObjectLegalHold

    • IsObjectLegalHoldEnabled

    • GetObjectRetention

    • SetObjectRetention

    • GetPresignedObjectUrl

    • GetPresignedPostFormData

    opened by balamurugana 0
Owner
Multi-Cloud Object Storage
Multi-Cloud Object Storage
A simple console client for pCloud cloud storage.

pCloud Console Client A simple console client for pCloud cloud storage. Project Information pCloud Console Client was forked from the project initiall

Serghei Iakovlev 23 Jun 23, 2022
Spacex Storage is an offchain storage work inspector of Mannheim Network running inside TEE enclave.

Spacex Storage Spacex Storage is an offchain storage work inspector of Mannheim Network running inside TEE enclave. Contribution Thank you for conside

Mannheim Network 8 Mar 22, 2022
Cloud Native Data Plane (CNDP) is a collection of user space libraries to accelerate packet processing for cloud applications.

CNDP - Cloud Native Data Plane Overview Cloud Native Data Plane (CNDP) is a collection of userspace libraries for accelerating packet processing for c

Cloud Native Data Plane 19 Jun 28, 2022
Sensory Cloud C++ SDK

Sensory Cloud C++ SDK This repository contains the source code for the Sensory Cloud C++ SDK. Requirements This project uses CMake as the primary buil

SensoryCloud 2 Jan 10, 2022
The Raspberry Pi Pico SDK (henceforth the SDK) provides the headers, libraries and build system necessary

The Raspberry Pi Pico SDK (henceforth the SDK) provides the headers, libraries and build system necessary to write programs for the RP2040-based devices such as the Raspberry Pi Pico in C, C++ or assembly language.

Raspberry Pi 1.4k Jun 21, 2022
The Gecko SDK (GSDK) combines all Silicon Labs 32-bit IoT product software development kits (SDKs) based on Gecko Platform into a single, integrated SDK.

Silicon Labs Gecko SDK (GSDK) The Gecko SDK (GSDK) combines Silicon Labs wireless software development kits (SDKs) and Gecko Platform into a single, i

Silicon Labs 91 Jun 16, 2022
Poseidon OS (POS) is a light-weight storage OS

Poseidon OS Poseidon OS (POS) is a light-weight storage OS that offers the best performance and valuable features over storage network. POS exploits t

null 45 Jun 23, 2022
XTAO Unified Distributed Storage

Anna - A branch project from CEPH Anna is a XTAO project branched from CEPH distributed storage. CEPH is a nice opensource project for unified distrib

XTAO Technolgy 3 Nov 12, 2021
An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.

中文版本请参看这里 MMKV is an efficient, small, easy-to-use mobile key-value storage framework used in the WeChat application. It's currently available on Andr

Tencent 14.7k Jun 27, 2022
Modern transactional key-value/row storage library.

Sophia is advanced transactional MVCC key-value/row storage library. How does it differ from other storages? Sophia is RAM-Disk hybrid storage. It is

Dmitry Simonenko 1.8k Jun 25, 2022
The OpenEXR project provides the specification and reference implementation of the EXR file format, the professional-grade image storage format of the motion picture industry.

OpenEXR OpenEXR provides the specification and reference implementation of the EXR file format, the professional-grade image storage format of the mot

Academy Software Foundation 1.2k Jun 27, 2022
A demonstration PoC for CVE-2022-21877 (storage spaces controller memory leak)

POC CVE-2022-21877 This repository contains a POC for the CVE-2022-21877, found by Quang Linh, working at STAR Labs. This is an information leak found

null 4 Mar 8, 2022
PlotFS is a fuse filesystem for efficient storage of Chia plot files.

PlotFS PlotFS is a fuse filesystem for efficient storage of Chia plot files. PlotFS is not a traditional filesystem. It is mounted read only for farmi

Matthew Szatmary 44 Jun 20, 2022
C++ implementation for a binary data storage format.

bsmlib- A C++ library for loading and writing binary data to and from files. bsmlib provides functions for loading, modifying, and saving BSM (Binary

Colleen 3 May 23, 2022
This repository was created in order to keep local data with code in the cloud.

Airplane Ino Данный репозиторий был создан для совсместной комфортной работы над проектом. В данном файле(README.md) будет размещена основная полезная

surpri6e 1 Nov 26, 2021
This code converts a point cloud obtained by a Velodyne VLP16 3D-Lidar sensor into a depth image mono16.

pc2image This code converts a point cloud obtained by a Velodyne VLP16 3D-Lidar sensor into a depth image mono16. Requisites ROS Kinetic or Melodic Ve

Edison Velasco Sánchez 6 May 18, 2022
This repository uses a ROS node to subscribe to camera (hikvision) and lidar (livox) data. After the node merges the data, it publishes the colored point cloud and displays it in rviz.

fusion-lidar-camera-ROS 一、介绍 本仓库是一个ROS工作空间,其中ws_fusion_camera/src有一个工具包color_pc ws_fusion_camera │ README.md │ └───src │ └───package: c

hongyu wang 14 Jun 15, 2022
This project is used for lidar point cloud undistortion.

livox_cloud_undistortion This project is used for lidar point cloud undistortion. During the recording process, the lidar point cloud has naturally th

livox 42 Jun 16, 2022
Cloud-native high-performance edge/middle/service proxy

Cloud-native high-performance edge/middle/service proxy Envoy is hosted by the Cloud Native Computing Foundation (CNCF). If you are a company that wan

Envoy Proxy - CNCF 19.9k Jun 25, 2022