microsoft / storage-as-a-service

MIT License
12 stars 9 forks source link

Add API for determining if a container exists in a storage account #88

Closed SvenAelterman closed 2 years ago

SvenAelterman commented 2 years ago

Request

HTTP GET https://endpoint/api/FileSystems/storage-account/container-name Headers:

Response

SvenAelterman commented 2 years ago

I considered including the container owner in the response body. Please discuss if this would be useful.

johnbradley commented 2 years ago

It would be useful to know who owned the container. My use case is delivering(copying) files to a recipient user's container. For my use case if the recipient user doesn't own the destination container we wouldn't want to perform the copy.


Another option would be to create an endpoint that returns the list of containers a user owns within a storage account. Using that endpoint would help me to prompt the recipient with a list of valid container names to select from.

SvenAelterman commented 2 years ago

@johnbradley Option 2 is not a short-term possibility. For the current option, the owner would be derived from the metadata that was put on the container when it was created. This means that you would disallow a lab member from delivering, only the PI could. Is that desired?

johnbradley commented 2 years ago

This means that you would disallow a lab member from delivering, only the PI could. Is that desired?

This is how I would want it to work. For our use case only the PI can take ownership of the data. Lab members can't claim ownership on the PI's behalf. In the end the PI is responsible for the data and we want to make the ownership transfer clear to the PI.

SvenAelterman commented 2 years ago

In the body of the response, you will receive the folder details object.

{
    "name": "",
    "createdOn": null,
    "accessTier": null,
    "size": "NA",
    "cost": "NA",
    "fundCode": "7.9.7",
    "owner": "admin@researchuniversity.onmicrosoft.com",
    "region": "Not Implemented",
    "uri": "https://<snip>.dfs.core.windows.net/research-lab-07337108",
    "userAccess": [],
    "storageExplorerURI": "storageexplorer://?v=2&tenantId=<snip>&type=fileSystemPath&container=research-lab-07337108&serviceEndpoint=https%3a%2f%2f<snip>.dfs.core.windows.net%2fresearch-lab-07337108&path="
}

Note that a container's name property is an empty string.