取得指定共享的屬性。
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 參數
名稱 |
位於 |
必要 |
類型 |
Description |
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
|
目標訂用帳戶的標識碼。
|
api-version
|
query |
True
|
string
|
用於此作業的 API 版本。
|
$expand
|
query |
|
string
|
選擇性,用來展開共用屬性內的屬性。 有效值為:統計數據。應該以具有分隔符 ',' 的字串傳遞。
|
名稱 |
必要 |
類型 |
Description |
x-ms-snapshot
|
|
string
|
選擇性,用來擷取快照集的屬性。
|
回應
名稱 |
類型 |
Description |
200 OK
|
FileShare
|
確定 -- 順利完成共享作業。
|
Other Status Codes
|
CloudError
|
描述作業失敗原因的錯誤回應。
|
安全性
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名稱 |
Description |
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
名稱 |
類型 |
Description |
expiryTime
|
string
|
存取原則的到期時間
|
permission
|
string
|
縮寫許可權的清單。
|
startTime
|
string
|
存取原則的開始時間
|
CloudError
記憶體服務的錯誤回應。
CloudErrorBody
記憶體服務的錯誤回應。
名稱 |
類型 |
Description |
code
|
string
|
錯誤的識別碼。 程式碼不變,且要以程式設計方式使用。
|
details
|
CloudErrorBody[]
|
錯誤的其他詳細數據清單。
|
message
|
string
|
描述錯誤的訊息,適用於在使用者介面中顯示。
|
target
|
string
|
特定錯誤的目標。 例如,錯誤中的屬性名稱。
|
EnabledProtocols
用於檔案共用的驗證通訊協定。 只能在建立共用時指定。
名稱 |
類型 |
Description |
NFS
|
string
|
|
SMB
|
string
|
|
FileShare
檔案共享的屬性,包括標識符、資源名稱、資源類型、Etag。
名稱 |
類型 |
Description |
etag
|
string
|
資源 Etag。
|
id
|
string
|
資源的完整資源識別碼。 例如 - /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 且小於或等於 5TB (5120)。 對於大型檔案共用,大小上限為 102400。
|
properties.shareUsageBytes
|
integer
|
儲存在共用上的大約數據大小。 請注意,此值可能不會包含最近建立或最近重設大小的檔案。
|
properties.signedIdentifiers
|
SignedIdentifier[]
|
共用上指定的預存存取原則清單。
|
properties.snapshotTime
|
string
|
在清單共用響應中傳回的共用快照集建立時間,其展開參數為「快照集」。
|
properties.version
|
string
|
共用的版本。
|
type
|
string
|
資源類型。 例如“Microsoft.Compute/virtualMachines” 或 “Microsoft.Storage/storageAccounts”
|
LeaseDuration
指定共用上的租用是否為無限期或固定持續時間,只有在租用共用時。
名稱 |
類型 |
Description |
Fixed
|
string
|
|
Infinite
|
string
|
|
LeaseState
共用的租用狀態。
名稱 |
類型 |
Description |
Available
|
string
|
|
Breaking
|
string
|
|
Broken
|
string
|
|
Expired
|
string
|
|
Leased
|
string
|
|
LeaseStatus
共用的租用狀態。
名稱 |
類型 |
Description |
Locked
|
string
|
|
Unlocked
|
string
|
|
RootSquashType
此屬性僅適用於 NFS 共用。 預設值為 NoRootSquash。
名稱 |
類型 |
Description |
AllSquash
|
string
|
|
NoRootSquash
|
string
|
|
RootSquash
|
string
|
|
ShareAccessTier
特定共用的存取層。 GpV2 帳戶可以選擇 TransactionOptimized (預設) 、經常性存取和非經常性存取。 FileStorage 帳戶可以選擇 [進階]。
名稱 |
類型 |
Description |
Cool
|
string
|
|
Hot
|
string
|
|
Premium
|
string
|
|
TransactionOptimized
|
string
|
|
SignedIdentifier
名稱 |
類型 |
Description |
accessPolicy
|
AccessPolicy
|
存取原則
|
id
|
string
|
預存存取原則的唯一標識符。
|