Using C++ client to connect to LeoFS

39 views
Skip to first unread message

Narasimha Bhat

unread,
May 23, 2017, 9:06:38 AM5/23/17
to LeoProject.LeoFS
Hi,

 We are evaluating using LeoFS for our storage needs. But we have a requirement to be able to save and retrieve data using C++ . For that we are trying to use AWS CPP SDK. But we are facing issues with it. Which is the preferred C++ client library to use with LeoFS S3 interface? Are there any alternatives?
Thank you in advance.
regards,
Narasimha Bhat

yoshiyuki kanno

unread,
May 24, 2017, 12:21:56 AM5/24/17
to Narasimha Bhat, LeoProject.LeoFS
Hi,

https://github.com/aws/aws-sdk-cpp should work for you.
The below gist is the sample code to interact with LeoFS running on localhost.
https://gist.github.com/mocchira/0bb570f240cbad3c8d97191fa0d6d68b

The points you should take care are

- need to set an endpoint that refers to where your leo_gateway is
running through
http://sdk.amazonaws.com/cpp/api/LATEST/struct_aws_1_1_client_1_1_client_configuration.html#a83b1e084eb22cebcc86e2a8f57b1954b
- need to set a scheme (protocol: http or https) through
http://sdk.amazonaws.com/cpp/api/LATEST/namespace_aws_1_1_http.html#af29e56bf3a0346061a5ecd57158ba59d

and also please take a look at
https://leo-project.net/leofs/docs/admin/system_operations/s3/ for
more detail on how LeoFS deal with endpoints.
ex)
```
If your leo_gateway is running on
- scheme: http
- host: yourhost
- port: 80

you need
- call `leofs-adm add-endpoint yourhost` on your terminal.
- modify the sample code
- opts.endpointOverride = "yourhost:80";
```

Please let me know if you face any problem.

Best,
Kanno.
> --
> You received this message because you are subscribed to the Google Groups
> "LeoProject.LeoFS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to leoproject_leo...@googlegroups.com.
> To post to this group, send email to leoproje...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/leoproject_leofs/f63c27f4-5b68-4e89-8758-5d5bc81e82c1%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Yoshiyuki Kanno
LeoFS Committer(http://www.leofs.org)
--------------------------------------------------
Stoic Corp.
URL: http://www.stoic.co.jp/
E-mail: yoshiyu...@stoic.co.jp

Narasimha Bhat

unread,
May 24, 2017, 1:17:18 AM5/24/17
to yoshiyuki kanno, LeoProject.LeoFS
Hi Kanno san,
Thank you for helping with this. As you pointed we created a endpoint. Now we are able to use aws cpp sdk. Thanks again.
regards,
Narasimha

You received this message because you are subscribed to a topic in the Google Groups "LeoProject.LeoFS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/leoproject_leofs/jNXNBhahfbs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to leoproject_leo...@googlegroups.com.

To post to this group, send email to leoproje...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages