获取指定共享的属性。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}?api-version=2023-01-01
With optional parameters:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}?api-version=2023-01-01&$expand={$expand}
URI 参数
名称 |
在 |
必需 |
类型 |
说明 |
accountName
|
path |
True
|
string
|
指定资源组中存储帐户的名称。 存储帐户名称长度必须为 3 到 24 个字符,并且只能使用数字和小写字母。
Regex pattern: ^[a-z0-9]+$
|
resourceGroupName
|
path |
True
|
string
|
用户订阅中资源组的名称。 此名称不区分大小写。
Regex pattern: ^[-\w\._\(\)]+$
|
shareName
|
path |
True
|
string
|
指定存储帐户中文件共享的名称。 文件共享名称的长度必须介于 3 到 63 个字符之间,并且只能使用数字、小写字母和短划线 ( ) 。 每个短划线(-)字符的前后必须紧跟字母或数字。
|
subscriptionId
|
path |
True
|
string
|
目标订阅的 ID。
|
api-version
|
query |
True
|
string
|
要用于此操作的 API 版本。
|
$expand
|
query |
|
string
|
可选,用于扩展共享属性中的属性。 有效值为:stats。应作为带分隔符“,”的字符串传递。
|
名称 |
必需 |
类型 |
说明 |
x-ms-snapshot
|
|
string
|
可选,用于检索快照的属性。
|
响应
安全性
azure_auth
Azure Active Directory OAuth2 流
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名称 |
说明 |
user_impersonation
|
模拟用户帐户
|
示例
GetShares
Sample Request
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634?api-version=2023-01-01
/** Samples for FileShares Get. */
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/FileSharesGet.json
*/
/**
* Sample code: GetShares.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getShares(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getFileShares().getWithResponse("res9871", "sto6217",
"share1634", null, null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.storage import StorageManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-storage
# USAGE
python file_shares_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = StorageManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.file_shares.get(
resource_group_name="res9871",
account_name="sto6217",
share_name="share1634",
)
print(response)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/FileSharesGet.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armstorage_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0baf811c3c76c87b3c127d098519bd97141222dd/specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/FileSharesGet.json
func ExampleFileSharesClient_Get_getShares() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armstorage.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewFileSharesClient().Get(ctx, "res9871", "sto6217", "share1634", &armstorage.FileSharesClientGetOptions{Expand: nil,
XMSSnapshot: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.FileShare = armstorage.FileShare{
// Name: to.Ptr("share1634"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634"),
// Etag: to.Ptr("\"0x8D592D74CC20EBA\""),
// FileShareProperties: &armstorage.FileShareProperties{
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-26T05:06:14.000Z"); return t}()),
// ShareQuota: to.Ptr[int32](1024),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { StorageManagementClient } = require("@azure/arm-storage");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets properties of a specified share.
*
* @summary Gets properties of a specified share.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/FileSharesGet.json
*/
async function getShares() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "res9871";
const accountName = "sto6217";
const shareName = "share1634";
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const result = await client.fileShares.get(resourceGroupName, accountName, shareName);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634",
"name": "share1634",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D592D74CC20EBA\"",
"properties": {
"lastModifiedTime": "2019-05-26T05:06:14Z",
"shareQuota": 1024
}
}
GetShareStats
Sample Request
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634?api-version=2023-01-01&$expand=stats
/** Samples for FileShares Get. */
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/FileSharesGet_Stats.json
*/
/**
* Sample code: GetShareStats.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getShareStats(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getFileShares().getWithResponse("res9871", "sto6217",
"share1634", "stats", null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.storage import StorageManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-storage
# USAGE
python file_shares_get_stats.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = StorageManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.file_shares.get(
resource_group_name="res9871",
account_name="sto6217",
share_name="share1634",
)
print(response)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/FileSharesGet_Stats.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armstorage_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0baf811c3c76c87b3c127d098519bd97141222dd/specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/FileSharesGet_Stats.json
func ExampleFileSharesClient_Get_getShareStats() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armstorage.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewFileSharesClient().Get(ctx, "res9871", "sto6217", "share1634", &armstorage.FileSharesClientGetOptions{Expand: to.Ptr("stats"),
XMSSnapshot: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.FileShare = armstorage.FileShare{
// Name: to.Ptr("share1634"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634"),
// Etag: to.Ptr("\"0x8D592D74CC20EBA\""),
// FileShareProperties: &armstorage.FileShareProperties{
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-26T05:06:14.000Z"); return t}()),
// ShareQuota: to.Ptr[int32](1024),
// ShareUsageBytes: to.Ptr[int64](652945),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { StorageManagementClient } = require("@azure/arm-storage");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets properties of a specified share.
*
* @summary Gets properties of a specified share.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/FileSharesGet_Stats.json
*/
async function getShareStats() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "res9871";
const accountName = "sto6217";
const shareName = "share1634";
const expand = "stats";
const options = { expand };
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const result = await client.fileShares.get(resourceGroupName, accountName, shareName, options);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634",
"name": "share1634",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D592D74CC20EBA\"",
"properties": {
"lastModifiedTime": "2019-05-26T05:06:14Z",
"shareQuota": 1024,
"shareUsageBytes": 652945
}
}
定义
AccessPolicy
名称 |
类型 |
说明 |
expiryTime
|
string
|
访问策略的到期时间
|
permission
|
string
|
缩写权限的列表。
|
startTime
|
string
|
访问策略的开始时间
|
CloudError
存储服务的错误响应。
CloudErrorBody
存储服务的错误响应。
名称 |
类型 |
说明 |
code
|
string
|
错误的标识符。 代码是固定的,旨在以编程方式使用。
|
details
|
CloudErrorBody[]
|
有关错误的其他详细信息的列表。
|
message
|
string
|
描述错误的消息,该消息适用于在用户界面中显示。
|
target
|
string
|
特定错误的目标。 例如,属性的名称出错。
|
EnabledProtocols
用于文件共享的身份验证协议。 只能在创建共享时指定。
名称 |
类型 |
说明 |
NFS
|
string
|
|
SMB
|
string
|
|
FileShare
文件共享的属性,包括 ID、资源名称、资源类型、Etag。
名称 |
类型 |
说明 |
etag
|
string
|
资源 Etag。
|
id
|
string
|
资源的完全限定的资源 ID。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
name
|
string
|
资源的名称
|
properties.accessTier
|
ShareAccessTier
|
特定共享的访问层。 GpV2 帐户可以在 TransactionOptimized (默认) 、热和冷之间进行选择。 FileStorage 帐户可以选择“高级”。
|
properties.accessTierChangeTime
|
string
|
指示共享访问层的上次修改时间。
|
properties.accessTierStatus
|
string
|
指示访问层是否存在挂起的转换。
|
properties.deleted
|
boolean
|
指示共享是否已被删除。
|
properties.deletedTime
|
string
|
如果共享已被删除,则为删除的时间。
|
properties.enabledProtocols
|
EnabledProtocols
|
用于文件共享的身份验证协议。 只能在创建共享时指定。
|
properties.lastModifiedTime
|
string
|
返回上次修改共享的日期和时间。
|
properties.leaseDuration
|
LeaseDuration
|
指定共享上的租约是无限期还是固定持续时间,仅当共享被租用时。
|
properties.leaseState
|
LeaseState
|
共享的租用状态。
|
properties.leaseStatus
|
LeaseStatus
|
共享的租用状态。
|
properties.metadata
|
object
|
作为元数据与共享关联的名称-值对。
|
properties.remainingRetentionDays
|
integer
|
软删除的共享的剩余保留天数。
|
properties.rootSquash
|
RootSquashType
|
属性仅适用于 NFS 共享。 默认值为 NoRootSquash。
|
properties.shareQuota
|
integer
|
共享的最大大小(以 GB 为单位)。 必须大于 0 且小于或等于 5 TB (5120)。 对于大型文件共享,最大大小为 102400。
|
properties.shareUsageBytes
|
integer
|
存储在共享上的数据的大致大小。 请注意,此值可能不包括最近创建或最近调整大小的所有文件。
|
properties.signedIdentifiers
|
SignedIdentifier[]
|
共享上指定的存储访问策略的列表。
|
properties.snapshotTime
|
string
|
共享的创建时间快照包含展开参数“snapshots”的列表共享的响应中返回。
|
properties.version
|
string
|
共享的版本。
|
type
|
string
|
资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”
|
LeaseDuration
指定共享上的租约是无限期还是固定持续时间,仅当共享被租用时。
名称 |
类型 |
说明 |
Fixed
|
string
|
|
Infinite
|
string
|
|
LeaseState
共享的租用状态。
名称 |
类型 |
说明 |
Available
|
string
|
|
Breaking
|
string
|
|
Broken
|
string
|
|
Expired
|
string
|
|
Leased
|
string
|
|
LeaseStatus
共享的租用状态。
名称 |
类型 |
说明 |
Locked
|
string
|
|
Unlocked
|
string
|
|
RootSquashType
属性仅适用于 NFS 共享。 默认值为 NoRootSquash。
名称 |
类型 |
说明 |
AllSquash
|
string
|
|
NoRootSquash
|
string
|
|
RootSquash
|
string
|
|
ShareAccessTier
特定共享的访问层。 GpV2 帐户可以在 TransactionOptimized (默认) 、热和冷之间进行选择。 FileStorage 帐户可以选择“高级”。
名称 |
类型 |
说明 |
Cool
|
string
|
|
Hot
|
string
|
|
Premium
|
string
|
|
TransactionOptimized
|
string
|
|
SignedIdentifier
名称 |
类型 |
说明 |
accessPolicy
|
AccessPolicy
|
访问策略
|
id
|
string
|
存储访问策略的唯一标识符。
|