-
Notifications
You must be signed in to change notification settings - Fork 283
Create azure_storage_blobs crate from azure_storage::blob #499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks @johnbatty, appreciate your efforts! |
I can't find the |
@thovoll Ah - thanks for the |
Anytime @johnbatty, I am only slowly getting better at navigating the legacy, new, track 1, track 2, version 11, version 12, etc, etc jungle :) There's also the generated code to be aware of. |
I'm looking forward to these being split up. There is a conflict. |
454a522
to
2a54a09
Compare
2a54a09
to
9c607f0
Compare
I've noticed that there are some inconsistencies in the examples for the storage APIs. I'd like to make them more consistent, so would like to get agreement on the style before I do so. A typical example that uses storage does this (from identity/examples/device_code_flow.rs): let http_client = azure_core::new_http_client();
let storage_account_client = StorageAccountClient::new_bearer_token(
http_client.clone(),
&storage_account_name,
authorization.access_token().secret() as &str,
);
let blob_service_client = storage_account_client.as_blob_service_client();
let containers = blob_service_client.list_containers().execute().await?; Another example (from storage_blobs/examples/blob_00.rs): let http_client = azure_core::new_http_client();
let storage_account_client =
StorageAccountClient::new_access_key(http_client.clone(), &account, &master_key);
let storage_client = storage_account_client.as_storage_client();
let blob = storage_client
.as_container_client(&container)
.as_blob_client(&blob);
let response = blob
.get()
.range(Range::new(0, 1024))
.execute()
.await?; Issues:
Any thoughts/comments appreciated.
|
@MindFlavor @cataggar I have rebased onto the latest main, and fixed up the remaining issues, so please could you review. Apologies for taking so long to get this fixed up! Notes:
I propose that we (I) split out the remaining storage crates and we then review what is left in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Thanks for making these easy to review.
As per: #483
This is work in progress.I've created the new crate, and the main code buildsbut there is some cleanup to do. I have moved the blob examples and the unit tests work.I had similar issues as I did when creating the
azure_messaging_queues
crate (#493).azure_storage_blobs
crate andazure_storage
, asStorageClient
implemented alist_containers
method. I resolved in a similar way as I did forazure_messaging_queues
- created a new service clientBaseBlobService
(name based on the equivalent object in the Python SDK) inazure_storage_blobs
that is just a wrapper aroundStorageClient
, then moved thelist_containers
method to that.BaseBlobService
name. It is a "client", and all the other clients haveClient
in the name. However I opted for matching the Python SDK naming.azure_storage
that had to be madepub
to allow access from the new crate.