Skip to content
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

Add getName for the resource like blob/container/file #4916

Closed
sima-zhu opened this issue Aug 8, 2019 · 5 comments
Closed

Add getName for the resource like blob/container/file #4916

sima-zhu opened this issue Aug 8, 2019 · 5 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files)

Comments

@sima-zhu
Copy link
Contributor

sima-zhu commented Aug 8, 2019

Xstore team requests us to add a getName() API for resource name.
It will provide rich information for logging and debugging.

Better to have convenience feature of getting the parent as well.

@sima-zhu sima-zhu added Storage Storage Service (Queues, Blobs, Files) Client This issue points to a problem in the data-plane of the library. labels Aug 8, 2019
@tg-msft
Copy link
Member

tg-msft commented Aug 12, 2019

What will getName() return? The blob's name on a BlobClient? Would we want a way to get access to the container name as well? For .NET we've got a work item to make our various UriBuilders public so customers can get access to any part of this info. Does that satisfy the same need?

@rakshith91
Copy link

We don't really need this in python, although it's not a bad thing to have either.
BlobClient.blob_name will return the name Similarly for others too.

@kurtzeborn
Copy link
Member

After discussing with xstore team, we think the best route is to expose getname() on blobs as well as getContainerName() (and probably getName() on containers). This provides the ability to walk up and down the hierarchy.

The reason the "ContainerName" pattern is more interesting than "ParentName" is to accommodate ADLS scenarios which will be exposed through the same APIs.

@annatisch
Copy link
Member

As @rakshith91 mentions above - for Python we publicly expose all the path components on each of the clients as properties, for example:

BlobServiceClient.primary_hostname
BlobServiceClient.secondary_hostname
ContainerClient.container_name
BlobClient.container_name
BlobClient.blob_name
BlobClient.snapshot

@jeremymeng
Copy link
Member

JS has Azure/azure-sdk-for-js#5007 tracking this.

@alzimmermsft alzimmermsft removed their assignment Sep 16, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

7 participants