Skip to content

[Storage] list_containers for BlobServiceClient #2692

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vincenttran-msft
Copy link
Member

WIP

Current sysout:

Is Deleted Option Some: false
Is Metadata Option Some: false
Is Name Option Some: false
Is Properties Option Some: false
Is Version Option Some: false

Issue seems to be related to deserializing into ContainerItem as the fields do exist on the response, but don't seem to be properly set on the item.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/xml
Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id: 1267e11b-601e-001b-0940-dac970000000
x-ms-client-request-id: 0e8c8184-9e79-43a2-855b-04ae13ffc650
x-ms-version: 2025-01-05
Date: Tue, 10 Jun 2025 19:46:07 GMT
Content-Length: 115153


<?xml version="1.0" encoding="utf-8"?>
<EnumerationResults ServiceEndpoint="https://ruststoragedev.blob.core.windows.net/">
	<Containers>
		<Container>
			<Name>container0oqovzx8</Name>
			<Properties>
				<Last-Modified>Fri, 02 May 2025 22:01:10 GMT</Last-Modified>
				<Etag>"0x8DD89C4D92560B5"</Etag>
				<LeaseStatus>unlocked</LeaseStatus>
				<LeaseState>available</LeaseState>
				<DefaultEncryptionScope>$account-encryption-key</DefaultEncryptionScope>
				<DenyEncryptionScopeOverride>false</DenyEncryptionScopeOverride>
				<HasImmutabilityPolicy>false</HasImmutabilityPolicy>
				<HasLegalHold>false</HasLegalHold>
				<ImmutableStorageWithVersioningEnabled>false</ImmutableStorageWithVersioningEnabled>
			</Properties>
		</Container>

@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label Jun 10, 2025
Comment on lines +72 to +86
let mut pager_response = service_client.list_containers(None)?;
while let Some(page) = pager_response.next().await {
let current_page = page.unwrap().into_body().await?;
let container_list = current_page.container_items;
for container in container_list {
println!("Is Deleted Option Some: {}", container.delete.is_some());
println!("Is Metadata Option Some: {}", container.metadata.is_some());
println!("Is Name Option Some: {}", container.name.is_some());
println!(
"Is Properties Option Some: {}",
container.properties.is_some()
);
println!("Is Version Option Some: {}", container.version.is_some());
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main area of concern- here I would expect is_some() to return something, for at the very very least name but also the other fields.

Copy link
Member

@jhendrixMSFT jhendrixMSFT Jun 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be fixed as part of https://github.com/Azure/typespec-rust/pull/455

Copy link

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure_storage_blob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants