AWS SDK

Andre Pany andre at s-e-a-p.de
Wed Oct 18 20:05:28 UTC 2017


On Wednesday, 18 October 2017 at 19:28:30 UTC, aberba wrote:
> What's up with proprietary stuff in this? At least give us the 
> setup for us to generate the apis on our own if you have your 
> private stuff in there. I have been waiting for a D AWS SDK for 
> "years"... At least any cloud SDK. The generated api approach 
> seem like the way to go cus its a lot of work to build and 
> maintain a D API by hand.
>
> I wanted to just do an S3 api plus some few services to use in 
> some of our microservices. We opted to use Nodejs because it 
> already has all the Cloud SDK for almost every provider. 
> Technically D is much better...
>
> You know, cloud and microservices is the way to build any 
> "scalable" server-side services in 2017 yet it seem those using 
> D for server-side dev are still writing monoliths.

Although I wrote the generator, it is property of my employer. I 
am unfortunately not allowed to make it public.

The implementation is straight forward. For every api definition 
(e.g. 
https://github.com/aws/aws-sdk-js/blob/master/apis/iam-2010-05-08.normal.json) create a module with a class. Read the json file with std.json and for every operation in the json create a method with the same name in the class.
For every shape in the json create a struct with the same name.

Every operation defines either an input shape, output shape, or 
both. During the method call serialize the input struct to json, 
call the aws client with the json and deserialize the output json 
to the output struct.

Kind regards
André





More information about the Digitalmars-d mailing list