英文:
Is there a way to retrieve region information using golang azure blob storage sdk?
问题
有没有任何 API 或其他方法可以在 Golang 中获取 Azure Blob 存储的容器区域信息?我们有服务和容器的 URL。
英文:
Is there any API or other way to get container region information for azure blob storage in golang?
We have service, container URL.
答案1
得分: 1
Azure存储帐户有一个REST API。
由于Blob容器的区域与存储帐户的区域相同,您可以使用Azure存储REST API来获取Blob存储的区域。
您可以使用以下API调用来获取存储帐户属性:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}?api-version=2021-04-01
如果您想要获取存储帐户的特定属性,比如位置,您可以使用扩展属性:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}?api-version=2021-04-01&$expand={$expand}
参考资料:
存储帐户 - 获取属性 - REST API(Azure存储资源提供程序)| Microsoft Docs
Golang REST API参考:
Golang REST API - 入门 - GoLang Docs
英文:
There is REST API for Azure Storage Account.
As the blob containers region is same as the Storage Account region, you can use the Azure Storage REST API to fetch the region of the blob storage.
You can use below API call to fetch the storage account properties :
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}?api-version=2021-04-01
If you want a specific property of a Storage Account like location, you can use expand property :
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}?api-version=2021-04-01&$expand={$expand}
Reference :
Storage Accounts - Get Properties - REST API (Azure Storage Resource Provider) | Microsoft Docs
Golang REST API reference :
Golang REST API - Getting Started - GoLang Docs
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论