Lekéri az előfizetés alatti hely erőforrásainak aktuális használati számát és korlátját.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/locations/{location}/usages?api-version=2016-11-01
URI-paraméterek
Name |
In |
Kötelező |
Típus |
Description |
location
|
path |
True
|
string
|
Az erőforrás helye szóköz nélkül.
|
subscriptionId
|
path |
True
|
string
|
Lekéri az előfizetés hitelesítő adatait, amelyek egyedileg azonosítják a Microsoft Azure-előfizetést. Az előfizetés azonosítója minden szolgáltatáshíváshoz az URI részét képezi.
|
api-version
|
query |
True
|
string
|
Ügyfél API-verziója.
|
Válaszok
Name |
Típus |
Description |
200 OK
|
UsageListResult
|
OK – aktuális használat száma és korlátja, amely beolvasva és sikeresen visszaadva.
|
Biztonság
azure_auth
Azure Active Directory OAuth2 Flow
Típus:
oauth2
Folyamat:
implicit
Engedélyezési URL:
https://login.microsoftonline.com/common/oauth2/authorize
Hatókörök
Name |
Description |
user_impersonation
|
a felhasználói fiók megszemélyesítése
|
Példák
UsageList
Mintakérelem
GET https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.DataLakeStore/locations/WestUS/usages?api-version=2016-11-01
/**
* Samples for Locations GetUsage.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/
* Locations_GetUsage.json
*/
/**
* Sample code: UsageList.
*
* @param manager Entry point to DataLakeStoreManager.
*/
public static void usageList(com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) {
manager.locations().getUsage("WestUS", 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.datalake.store import DataLakeStoreAccountManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-datalake-store
# USAGE
python locations_get_usage.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 = DataLakeStoreAccountManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.locations.get_usage(
location="WestUS",
)
for item in response:
print(item)
# x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Locations_GetUsage.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 armdatalakestore_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datalake-store/armdatalakestore"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Locations_GetUsage.json
func ExampleLocationsClient_NewGetUsagePager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdatalakestore.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewLocationsClient().NewGetUsagePager("WestUS", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.UsageListResult = armdatalakestore.UsageListResult{
// Value: []*armdatalakestore.Usage{
// {
// Name: &armdatalakestore.UsageName{
// LocalizedValue: to.Ptr("Data Lake Store Accounts"),
// Value: to.Ptr("DataLakeStoreAccounts"),
// },
// CurrentValue: to.Ptr[int32](69),
// ID: to.Ptr("/subscriptions/0f936178-0d48-4777-a7ab-47860b604941/providers/Microsoft.DataLakeStore/locations/WestUS/usages/DataLakeStoreAccounts"),
// Limit: to.Ptr[int32](-1),
// Unit: to.Ptr(armdatalakestore.UsageUnitCount),
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
{
"value": [
{
"unit": "Count",
"id": "/subscriptions/0f936178-0d48-4777-a7ab-47860b604941/providers/Microsoft.DataLakeStore/locations/WestUS/usages/DataLakeStoreAccounts",
"currentValue": 69,
"limit": -1,
"name": {
"value": "DataLakeStoreAccounts",
"localizedValue": "Data Lake Store Accounts"
}
}
]
}
Definíciók
Usage
Objektum
Az erőforrás-használatot ismerteti.
Name |
Típus |
Description |
currentValue
|
integer
(int32)
|
Lekéri az előfizetésben lefoglalt erőforrások aktuális számát.
|
id
|
string
|
Erőforrás-azonosító.
|
limit
|
integer
(int32)
|
Lekéri az előfizetésben lefoglalható erőforrások maximális számát.
|
name
|
UsageName
|
Lekéri a használat típusának nevét.
|
unit
|
UsageUnit
|
Lekéri a mértékegységet.
|
UsageListResult
Objektum
A Listahasználatok művelet válasza.
Name |
Típus |
Description |
value
|
Usage[]
|
Lekéri vagy beállítja a tárerőforrás-használatok listáját.
|
UsageName
Objektum
A használható használati nevek.
Name |
Típus |
Description |
localizedValue
|
string
|
Lekéri az erőforrás nevét leíró honosított sztringet.
|
value
|
string
|
Lekéri az erőforrás nevét leíró sztringet.
|
UsageUnit
Enumerálás
Lekéri a mértékegységet.
Érték |
Description |
Bytes
|
|
BytesPerSecond
|
|
Count
|
|
CountsPerSecond
|
|
Percent
|
|
Seconds
|
|