AzureSDKForRust
AzureSDKForRust copied to clipboard
Complete Azure storage REST API
This will be done after https://github.com/MindFlavor/AzureSDKForRust/issues/61:
- [ ] Put block blob from URL (new since 2018-03-28). See https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url.
- [ ] Undelete blob
- [ ] Get blob properties
- [ ] Set blob properties
- [ ] Get blob metadata
- [ ] Set blob metadata
- [ ] Snapshot blob
- [ ] Copy blob
- [x] Copy blob from URL
- [ ] Abort blob
- [ ] Set blob tier
- [ ] Undelete blob
- [ ] Get page ranges
- [ ] Incremental copy blob (page blob)
- [ ] Append block (append blob)
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?
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:
- 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. - Create the corresponding response (in your case in
blob/responses
). Check other responses for a template. - Have the
finalize
function return aResult<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). - Add the signature to the correct trait (in your case
Blob
trait in lib.rs). - 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!
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.
Really cool, thank you so much!