Возвращает свойства указанной общей папки.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}?api-version=2024-01-01
С использованием необязательных параметров:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}?api-version=2024-01-01&$expand={$expand}
Параметры URI
Имя |
В |
Обязательно |
Тип |
Описание |
accountName
|
path |
True
|
string
minLength: 3 maxLength: 24 pattern: ^[a-z0-9]+$
|
Имя учетной записи хранения в указанной группе ресурсов. Имена учетных записей хранения должны быть от 3 до 24 символов длиной и использовать только цифры и строчные буквы.
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90 pattern: ^[-\w\._\(\)]+$
|
Имя группы ресурсов в подписке пользователя. Имя не зависит от регистра.
|
shareName
|
path |
True
|
string
minLength: 3 maxLength: 63
|
Имя общей папки в указанной учетной записи хранения. Имена общих папок должны быть от 3 до 63 символов длиной и использовать цифры, строчные буквы и дефисы (-). Каждый тире (-) должен быть немедленно предшествуем и за ним следует буква или число.
|
subscriptionId
|
path |
True
|
string
minLength: 1
|
Идентификатор целевой подписки.
|
api-version
|
query |
True
|
string
minLength: 1
|
Версия API, используемая для данной операции.
|
$expand
|
query |
|
string
|
Необязательный, используемый для расширения свойств общего ресурса. Допустимые значения: статистика. Должен передаваться в виде строки с разделителем ",".
|
Имя |
Обязательно |
Тип |
Описание |
x-ms-snapshot
|
|
string
|
Необязательный, используемый для получения свойств моментального снимка.
|
Ответы
Имя |
Тип |
Описание |
200 OK
|
FileShare
|
ОК- Успешно выполнена операция получения общего доступа.
|
Other Status Codes
|
CloudError
|
Ответ на ошибку, описывающий причину сбоя операции.
|
Безопасность
azure_auth
Поток OAuth2 Azure Active Directory
Тип:
oauth2
Flow:
implicit
URL-адрес авторизации:
https://login.microsoftonline.com/common/oauth2/authorize
Области
Имя |
Описание |
user_impersonation
|
олицетворения учетной записи пользователя
|
Примеры
GetSharePaidBursting
Образец запроса
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634?api-version=2024-01-01
/**
* Samples for FileShares Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet_PaidBursting.
* json
*/
/**
* Sample code: GetSharePaidBursting.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getSharePaidBursting(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_paid_bursting.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/2024-01-01/examples/FileSharesGet_PaidBursting.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/86c6306649b02e542117adb46c61e8019dbd78e9/specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet_PaidBursting.json
func ExampleFileSharesClient_Get_getSharePaidBursting() {
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{
// FileSharePaidBursting: &armstorage.FileSharePropertiesFileSharePaidBursting{
// PaidBurstingEnabled: to.Ptr(true),
// PaidBurstingMaxBandwidthMibps: to.Ptr[int32](10340),
// PaidBurstingMaxIops: to.Ptr[int32](102400),
// },
// 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");
require("dotenv/config");
/**
* 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/2024-01-01/examples/FileSharesGet_PaidBursting.json
*/
async function getSharePaidBursting() {
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Storage.Models;
using Azure.ResourceManager.Storage;
// Generated from example definition: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet_PaidBursting.json
// this example is just showing the usage of "FileShares_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this FileServiceResource created on azure
// for more information of creating FileServiceResource, please refer to the document of FileServiceResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "res9871";
string accountName = "sto6217";
ResourceIdentifier fileServiceResourceId = FileServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
FileServiceResource fileService = client.GetFileServiceResource(fileServiceResourceId);
// get the collection of this FileShareResource
FileShareCollection collection = fileService.GetFileShares();
// invoke the operation
string shareName = "share1634";
NullableResponse<FileShareResource> response = await collection.GetIfExistsAsync(shareName);
FileShareResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
FileShareData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"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,
"fileSharePaidBursting": {
"paidBurstingEnabled": true,
"paidBurstingMaxIops": 102400,
"paidBurstingMaxBandwidthMibps": 10340
}
}
}
GetShareProvisionedV2
Образец запроса
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634?api-version=2024-01-01
/**
* Samples for FileShares Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet_ProvisionedV2.
* json
*/
/**
* Sample code: GetShareProvisionedV2.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getShareProvisionedV2(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_provisioned_v2.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/2024-01-01/examples/FileSharesGet_ProvisionedV2.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/86c6306649b02e542117adb46c61e8019dbd78e9/specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet_ProvisionedV2.json
func ExampleFileSharesClient_Get_getShareProvisionedV2() {
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{
// IncludedBurstIops: to.Ptr[int32](15000),
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-25T01:50:50.000Z"); return t}()),
// MaxBurstCreditsForIops: to.Ptr[int64](36000000),
// NextAllowedProvisionedBandwidthDowngradeTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "2024-10-25T01:48:09.000Z"); return t}()),
// NextAllowedProvisionedIopsDowngradeTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "2024-10-25T01:48:09.000Z"); return t}()),
// NextAllowedQuotaDowngradeTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "2024-10-26T01:50:50.000Z"); return t}()),
// ProvisionedBandwidthMibps: to.Ptr[int32](200),
// ProvisionedIops: to.Ptr[int32](5000),
// ShareQuota: to.Ptr[int32](100),
// },
// }
}
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");
require("dotenv/config");
/**
* 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/2024-01-01/examples/FileSharesGet_ProvisionedV2.json
*/
async function getShareProvisionedV2() {
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Storage.Models;
using Azure.ResourceManager.Storage;
// Generated from example definition: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet_ProvisionedV2.json
// this example is just showing the usage of "FileShares_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this FileServiceResource created on azure
// for more information of creating FileServiceResource, please refer to the document of FileServiceResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "res9871";
string accountName = "sto6217";
ResourceIdentifier fileServiceResourceId = FileServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
FileServiceResource fileService = client.GetFileServiceResource(fileServiceResourceId);
// get the collection of this FileShareResource
FileShareCollection collection = fileService.GetFileShares();
// invoke the operation
string shareName = "share1634";
NullableResponse<FileShareResource> response = await collection.GetIfExistsAsync(shareName);
FileShareResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
FileShareData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"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": "2024-10-25T01:50:50.0000000Z",
"shareQuota": 100,
"provisionedIops": 5000,
"provisionedBandwidthMibps": 200,
"includedBurstIops": 15000,
"maxBurstCreditsForIops": 36000000,
"nextAllowedQuotaDowngradeTime": "Sat, 26 Oct 2024 01:50:50 GMT",
"nextAllowedProvisionedIopsDowngradeTime": "Fri, 25 Oct 2024 01:48:09 GMT",
"nextAllowedProvisionedBandwidthDowngradeTime": "Fri, 25 Oct 2024 01:48:09 GMT"
}
}
GetShares
Образец запроса
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634?api-version=2024-01-01
/**
* Samples for FileShares Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2024-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/2024-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/86c6306649b02e542117adb46c61e8019dbd78e9/specification/storage/resource-manager/Microsoft.Storage/stable/2024-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");
require("dotenv/config");
/**
* 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/2024-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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Storage.Models;
using Azure.ResourceManager.Storage;
// Generated from example definition: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet.json
// this example is just showing the usage of "FileShares_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this FileServiceResource created on azure
// for more information of creating FileServiceResource, please refer to the document of FileServiceResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "res9871";
string accountName = "sto6217";
ResourceIdentifier fileServiceResourceId = FileServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
FileServiceResource fileService = client.GetFileServiceResource(fileServiceResourceId);
// get the collection of this FileShareResource
FileShareCollection collection = fileService.GetFileShares();
// invoke the operation
string shareName = "share1634";
NullableResponse<FileShareResource> response = await collection.GetIfExistsAsync(shareName);
FileShareResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
FileShareData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"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
Образец запроса
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634?api-version=2024-01-01&$expand=stats
/**
* Samples for FileShares Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2024-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/2024-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/86c6306649b02e542117adb46c61e8019dbd78e9/specification/storage/resource-manager/Microsoft.Storage/stable/2024-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");
require("dotenv/config");
/**
* 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/2024-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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Storage.Models;
using Azure.ResourceManager.Storage;
// Generated from example definition: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet_Stats.json
// this example is just showing the usage of "FileShares_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this FileServiceResource created on azure
// for more information of creating FileServiceResource, please refer to the document of FileServiceResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "res9871";
string accountName = "sto6217";
ResourceIdentifier fileServiceResourceId = FileServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
FileServiceResource fileService = client.GetFileServiceResource(fileServiceResourceId);
// get the collection of this FileShareResource
FileShareCollection collection = fileService.GetFileShares();
// invoke the operation
string shareName = "share1634";
string expand = "stats";
NullableResponse<FileShareResource> response = await collection.GetIfExistsAsync(shareName, expand: expand);
FileShareResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
FileShareData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"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
|
|
CloudError
|
Ответ об ошибке из службы хранилища.
|
CloudErrorBody
|
Ответ об ошибке из службы хранилища.
|
EnabledProtocols
|
Протокол проверки подлинности, используемый для общей папки. Можно указать только при создании общей папки.
|
FileShare
|
Свойства общей папки, включая идентификатор, имя ресурса, тип ресурса, Etag.
|
FileSharePaidBursting
|
Свойства платного ускорения общей папки.
|
LeaseDuration
|
Указывает, является ли аренда общей папки бесконечной или фиксированной длительностью, только если общая доля арендовается.
|
LeaseState
|
Состояние аренды общей папки.
|
LeaseStatus
|
Состояние аренды общей папки.
|
RootSquashType
|
Свойство предназначено только для общего ресурса NFS. Значение по умолчанию — NoRootSquash.
|
ShareAccessTier
|
Уровень доступа для определенной общей папки. Учетная запись GpV2 может выбирать между TransactionOptimized (по умолчанию), горячей и холодной. Учетная запись FileStorage может выбрать Premium.
|
SignedIdentifier
|
|
AccessPolicy
Object
Имя |
Тип |
Описание |
expiryTime
|
string
(date-time)
|
Срок действия политики доступа
|
permission
|
string
|
Список сокращенных разрешений.
|
startTime
|
string
(date-time)
|
Время начала политики доступа
|
CloudError
Object
Ответ об ошибке из службы хранилища.
Имя |
Тип |
Описание |
error
|
CloudErrorBody
|
Ответ об ошибке из службы хранилища.
|
CloudErrorBody
Object
Ответ об ошибке из службы хранилища.
Имя |
Тип |
Описание |
code
|
string
|
Идентификатор ошибки. Коды являются инвариантными и предназначены для программного использования.
|
details
|
CloudErrorBody[]
|
Список дополнительных сведений об ошибке.
|
message
|
string
|
Сообщение, описывающее ошибку, предназначенное для отображения в пользовательском интерфейсе.
|
target
|
string
|
Целевой объект конкретной ошибки. Например, имя свойства в ошибке.
|
EnabledProtocols
Перечисление
Протокол проверки подлинности, используемый для общей папки. Можно указать только при создании общей папки.
Значение |
Описание |
SMB
|
|
NFS
|
|
FileShare
Object
Свойства общей папки, включая идентификатор, имя ресурса, тип ресурса, Etag.
Имя |
Тип |
Описание |
etag
|
string
|
Etag ресурса.
|
id
|
string
|
Полный идентификатор ресурса для ресурса. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
name
|
string
|
Имя ресурса
|
properties.accessTier
|
ShareAccessTier
|
Уровень доступа для определенной общей папки. Учетная запись GpV2 может выбирать между TransactionOptimized (по умолчанию), горячей и холодной. Учетная запись FileStorage может выбрать Premium.
|
properties.accessTierChangeTime
|
string
(date-time)
|
Указывает время последнего изменения уровня доступа к общей папке.
|
properties.accessTierStatus
|
string
|
Указывает, существует ли ожидающий переход для уровня доступа.
|
properties.deleted
|
boolean
|
Указывает, была ли удалена общая папка.
|
properties.deletedTime
|
string
(date-time)
|
Время удаления, если общий ресурс был удален.
|
properties.enabledProtocols
|
EnabledProtocols
|
Протокол проверки подлинности, используемый для общей папки. Можно указать только при создании общей папки.
|
properties.fileSharePaidBursting
|
FileSharePaidBursting
|
Свойства платного ускорения общей папки.
|
properties.includedBurstIops
|
integer
(int32)
|
Вычисляемое число операций ввода-вывода в секунду для общей папки. Это свойство предназначено только для общих папок, созданных в разделе "Подготовленные файлы" версии 2.
|
properties.lastModifiedTime
|
string
(date-time)
|
Возвращает дату и время последнего изменения общей папки.
|
properties.leaseDuration
|
LeaseDuration
|
Указывает, является ли аренда общей папки бесконечной или фиксированной длительностью, только если общая доля арендовается.
|
properties.leaseState
|
LeaseState
|
Состояние аренды общей папки.
|
properties.leaseStatus
|
LeaseStatus
|
Состояние аренды общей папки.
|
properties.maxBurstCreditsForIops
|
integer
(int64)
|
Вычисляемые максимальные кредиты на всплеск для общей папки. Это свойство предназначено только для общих папок, созданных в разделе "Подготовленные файлы" версии 2.
|
properties.metadata
|
object
|
Пара "имя-значение", связанная с общей папкой в качестве метаданных.
|
properties.nextAllowedProvisionedBandwidthDowngradeTime
|
string
(date-time-rfc1123)
|
Возвращает следующее разрешенное время понижения пропускной способности для общей папки. Это свойство предназначено только для общих папок, созданных в разделе "Подготовленные файлы" версии 2.
|
properties.nextAllowedProvisionedIopsDowngradeTime
|
string
(date-time-rfc1123)
|
Возвращает следующее разрешенное время понижения уровня операций ввода-вывода в секунду для общей папки. Это свойство предназначено только для общих папок, созданных в разделе "Подготовленные файлы" версии 2.
|
properties.nextAllowedQuotaDowngradeTime
|
string
(date-time-rfc1123)
|
Возвращает следующее разрешенное время понижения размера подготовленного хранилища для общей папки. Это свойство предназначено только для общих папок, созданных в разделе "Файлы, подготовленные версии 1 SSD" и "Подготовленные файлы" версии 2.
|
properties.provisionedBandwidthMibps
|
integer
(int32)
|
Подготовленная пропускная способность общей папки в мбибайтах в секунду. Это свойство предназначено только для общих папок, созданных в разделе "Подготовленные файлы" версии 2. Обратитесь к ответу API GetFileServiceUsage для минимального и максимального допустимого значения подготовленной пропускной способности.
|
properties.provisionedIops
|
integer
(int32)
|
Подготовленные операции ввода-вывода в секунду общего ресурса. Это свойство предназначено только для общих папок, созданных в разделе "Подготовленные файлы" версии 2. Обратитесь к ответу API GetFileServiceUsage минимальное и максимально допустимое значение для подготовленных операций ввода-вывода в секунду.
|
properties.remainingRetentionDays
|
integer
|
Оставшиеся дни хранения для общего ресурса, который был обратимо удален.
|
properties.rootSquash
|
RootSquashType
|
Свойство предназначено только для общего ресурса NFS. Значение по умолчанию — NoRootSquash.
|
properties.shareQuota
|
integer
(int32)
|
Подготовленный размер общей папки в гибибайтах. Должно быть больше 0 и меньше или равно 5TB (5120). Для больших общих папок максимальный размер — 102400. Для общих папок, созданных в разделе "Подготовленные файлы" типа учетной записи версии 2, обратитесь к ответу API GetFileServiceUsage для минимального и максимального допустимого размера подготовленного хранилища.
|
properties.shareUsageBytes
|
integer
(int64)
|
Приблизительный размер данных, хранящихся в общей папке. Обратите внимание, что это значение может не включать все недавно созданные или недавно измененные файлы.
|
properties.signedIdentifiers
|
SignedIdentifier[]
|
Список хранимых политик доступа, указанных в общей папке.
|
properties.snapshotTime
|
string
(date-time)
|
Время создания моментального снимка общего ресурса, возвращенное в ответе на общие папки списка с расширением param "snapshots".
|
properties.version
|
string
|
Версия общей папки.
|
type
|
string
|
Тип ресурса. Например, "Microsoft.Compute/virtualMachines" или "Microsoft.Storage/storageAccounts"
|
FileSharePaidBursting
Object
Свойства платного ускорения общей папки.
Имя |
Тип |
Описание |
paidBurstingEnabled
|
boolean
|
Указывает, включена ли платная вспышка для общей папки. Это свойство предназначено только для общих папок, созданных в разделе "Подготовленные файлы", тип учетной записи SSD версии 1.
|
paidBurstingMaxBandwidthMibps
|
integer
(int32)
|
Максимальная платная пропускная способность для общей папки в мебибайтах в секунду. Это свойство предназначено только для общих папок, созданных в разделе "Подготовленные файлы", тип учетной записи SSD версии 1. Максимально допустимое значение — 10340, которое является максимально допустимой пропускной способностью для общей папки.
|
paidBurstingMaxIops
|
integer
(int32)
|
Максимальное количество платных операций ввода-вывода в секунду для общей папки. Это свойство предназначено только для общих папок, созданных в разделе "Подготовленные файлы", тип учетной записи SSD версии 1. Максимально допустимое значение — 102400, которое является максимальным допустимым числом операций ввода-вывода в секунду для общей папки.
|
LeaseDuration
Перечисление
Указывает, является ли аренда общей папки бесконечной или фиксированной длительностью, только если общая доля арендовается.
Значение |
Описание |
Infinite
|
|
Fixed
|
|
LeaseState
Перечисление
Состояние аренды общей папки.
Значение |
Описание |
Available
|
|
Leased
|
|
Expired
|
|
Breaking
|
|
Broken
|
|
LeaseStatus
Перечисление
Состояние аренды общей папки.
Значение |
Описание |
Locked
|
|
Unlocked
|
|
RootSquashType
Перечисление
Свойство предназначено только для общего ресурса NFS. Значение по умолчанию — NoRootSquash.
Значение |
Описание |
NoRootSquash
|
|
RootSquash
|
|
AllSquash
|
|
ShareAccessTier
Перечисление
Уровень доступа для определенной общей папки. Учетная запись GpV2 может выбирать между TransactionOptimized (по умолчанию), горячей и холодной. Учетная запись FileStorage может выбрать Premium.
Значение |
Описание |
TransactionOptimized
|
|
Hot
|
|
Cool
|
|
Premium
|
|
SignedIdentifier
Object
Имя |
Тип |
Описание |
accessPolicy
|
AccessPolicy
|
Политика доступа
|
id
|
string
|
Уникальный идентификатор хранимой политики доступа.
|