AzureSDKForRust icon indicating copy to clipboard operation
AzureSDKForRust copied to clipboard

Complete Azure storage REST API

Open MindFlavor opened this issue 6 years ago • 5 comments

This will be done after https://github.com/MindFlavor/AzureSDKForRust/issues/61:

MindFlavor avatar Aug 12 '18 20:08 MindFlavor

Hello, I've been using your blob functionality successfully, although my usage was only storing blobs. I now need to use Copy Blob From URL

How can I help you implement this API into the SDK?

I guess the first step is to create a new request in "AzureSDKForRust/azure_sdk_storage_blob/src/blob/requests". Is it fine for you if I start looking into it?

mpbraendli avatar Apr 23 '20 15:04 mpbraendli

Yes of course, any help is appreciated! I might be able to take a break from the Cosmos create now (I've been focusing on than lately) and tackle this but I cannot guarantee on the timeline!

As for your question, in order to extend the crate you need:

  1. Create the corresponding request (in your case in blob/request). You can use the bpb tool if you want to start from the json and save yourself a lot of boilerplate code.
  2. Create the corresponding response (in your case in blob/responses). Check other responses for a template.
  3. Have the finalize function return a Result<your_response_from_point_2, AzureError>. Make sure to pass the mandatory and optional headers and construct the URI properly (that's the hard part).
  4. Add the signature to the correct trait (in your case Blob trait in lib.rs).
  5. Implement the trait function in the Client just returning the generator created at point 1.

After that you should be able to use your function in your code!

MindFlavor avatar Apr 25 '20 11:04 MindFlavor

This PR should give you the function you need: https://github.com/MindFlavor/AzureSDKForRust/pull/258. It's almost done, I just need to fix the crate version and I will merge it.

MindFlavor avatar Apr 26 '20 14:04 MindFlavor

Really cool, thank you so much!

mpbraendli avatar May 06 '20 15:05 mpbraendli