Toont de gebruiksgegevens voor het gedefinieerde bereik. Gebruiksgegevens zijn alleen beschikbaar via deze API voor 1 mei 2014 of hoger.
Opmerking: Microsoft zal de API voor verbruiksgebruiksgegevens op een bepaald moment in de toekomst buiten gebruik stellen. We raden u niet aan om een nieuwe afhankelijkheid van deze API te nemen. Gebruik in plaats daarvan de API voor Kostendetails. We stellen klanten op de hoogte zodra een datum voor buitengebruikstelling is vastgesteld. Zie voor meer informatie Rapport Kostendetails genereren - Bewerking maken
GET https://management.azure.com/{scope}/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
Met optionele parameters:
GET https://management.azure.com/{scope}/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01&$expand={$expand}&$filter={$filter}&$skiptoken={$skiptoken}&$top={$top}&metric={metric}
URI-parameters
| Name |
In |
Vereist |
Type |
Description |
|
scope
|
path |
True
|
string
|
De volledig gekwalificeerde Azure Resource Manager-id van de resource.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
De API-versie die voor deze bewerking moet worden gebruikt.
|
|
$expand
|
query |
|
string
|
Kan worden gebruikt om de eigenschappen/additionalInfo of properties/meterDetails in een lijst met gebruiksgegevens uit te vouwen. Deze velden worden standaard niet opgenomen bij het weergeven van gebruiksgegevens.
|
|
$filter
|
query |
|
string
|
Kan worden gebruikt om usageDetails te filteren op properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType of tags. Het filter ondersteunt 'eq', 'lt', 'gt', 'le', 'ge' en 'and'. Het biedt momenteel geen ondersteuning voor 'ne', 'or', of 'niet'. Tagfilter is een tekenreeks voor sleutel-waardeparen waarbij de sleutel en waarde worden gescheiden door een dubbele punt (:). PublisherType Filter accepteert twee waarden in Azure en Marketplace en wordt momenteel ondersteund voor het type Web Direct-aanbieding
|
|
$skiptoken
|
query |
|
string
|
Skiptoken wordt alleen gebruikt als een vorige bewerking een gedeeltelijk resultaat heeft geretourneerd. Als een eerder antwoord een nextLink-element bevat, bevat de waarde van het nextLink-element een skiptokenparameter die een beginpunt aangeeft dat moet worden gebruikt voor volgende aanroepen.
|
|
$top
|
query |
|
integer
(int32)
minimum: 1 maximum: 1000
|
Kan worden gebruikt om het aantal resultaten te beperken tot de meest recente N usageDetails.
|
|
metric
|
query |
|
Metrictype
|
Hiermee kunt u verschillende typen kosten-/gebruiksrecords selecteren.
|
Antwoorden
| Name |
Type |
Description |
|
200 OK
|
UsageDetailsListResult
|
De aanvraag is voltooid.
|
|
204 No Content
|
|
Operatie succesvol afgerond.
|
|
Other Status Codes
|
ErrorResponse
|
Een onverwachte foutreactie.
|
Beveiliging
azure_auth
OAuth2-stroom voor Azure Active Directory.
Type:
oauth2
Stroom:
implicit
Autorisatie-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiken
| Name |
Description |
|
user_impersonation
|
Uw gebruikersaccount imiteren
|
Voorbeelden
BillingAccountUsageDetailsList-Legacy
Voorbeeldaanvraag
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_by_billing_account.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="providers/Microsoft.Billing/BillingAccounts/1234",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListByBillingAccount.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 armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListByBillingAccount.json
func ExampleUsageDetailsClient_NewListPager_billingAccountUsageDetailsListLegacy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("providers/Microsoft.Billing/BillingAccounts/1234", 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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("Account Name 1"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Account Name 1"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Account Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-30T00:00:00.0000000Z"); return t}()),
// InvoiceSection: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferID: to.Ptr("Offer Id 1"),
// PartNumber: to.Ptr("Part Number 1"),
// Product: to.Ptr("Product Name 1"),
// ResourceGroup: to.Ptr("Resource Group 1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceName: to.Ptr("Resource Name 1"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "legacy",
"properties": {
"accountName": "Account Name 1",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"cost": 0.000295194820065,
"costCenter": "DEV",
"date": "2019-03-30T00:00:00.0000000Z",
"effectivePrice": 0.000402776395232,
"invoiceSection": "Invoice Section 1",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerId": "Offer Id 1",
"partNumber": "Part Number 1",
"product": "Product Name 1",
"quantity": 0.7329,
"resourceGroup": "Resource Group 1",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceLocation": "USEast",
"resourceName": "Resource Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"unitPrice": 4.38
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
BillingAccountUsageDetailsList-Modern
Voorbeeldaanvraag
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234:56789/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_by_mca_billing_account.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="providers/Microsoft.Billing/BillingAccounts/1234:56789",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListByMCABillingAccount.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 armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListByMCABillingAccount.json
func ExampleUsageDetailsClient_NewListPager_billingAccountUsageDetailsListModern() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("providers/Microsoft.Billing/BillingAccounts/1234:56789", 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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.ModernUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/1234:56789/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindModern),
// Properties: &armconsumption.ModernUsageDetailProperties{
// AdditionalInfo: to.Ptr("{ \"UsageType\": \"ComputeHR\", \"ImageType\": \"Windows Client BYOL\", \"ServiceType\": \"Standard_D1\", \"VMName\": null, \"VMProperties\": null, \"VCPUs\": 1, \"CPUs\": 0}"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("1234:56789"),
// BillingAccountName: to.Ptr("Account Name 1"),
// BillingCurrencyCode: to.Ptr("USD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("2468"),
// BillingProfileName: to.Ptr("Account Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// CustomerName: to.Ptr("Modern Azure Customer 1"),
// CustomerTenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-30T00:00:00.0000000Z"); return t}()),
// ExchangeRate: to.Ptr("1"),
// ExchangeRateDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-30T00:00:00Z"); return t}()),
// Frequency: to.Ptr("UsageBased"),
// InstanceName: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1"),
// InvoiceID: to.Ptr(""),
// InvoiceSectionID: to.Ptr("98765"),
// InvoiceSectionName: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PartnerEarnedCreditApplied: to.Ptr("0"),
// PartnerName: to.Ptr("Partner Name 1"),
// PartnerTenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PreviousInvoiceID: to.Ptr(""),
// PricingCurrencyCode: to.Ptr("USD"),
// Product: to.Ptr("Virtual Machines D Series - D1 - US East"),
// ProductIdentifier: to.Ptr("DZH318Z0BQ4B00FV"),
// ProductOrderID: to.Ptr("a3db7880-70eb-4b4c-6a79-1425a058df5a"),
// ProductOrderName: to.Ptr("Azure plan"),
// PublisherID: to.Ptr(""),
// PublisherName: to.Ptr("Microsoft"),
// PublisherType: to.Ptr("Microsoft"),
// ResellerMpnID: to.Ptr(""),
// ResellerName: to.Ptr("Reseller Name 1"),
// ReservationID: to.Ptr(""),
// ReservationName: to.Ptr(""),
// ResourceGroup: to.Ptr("Resource Group 1"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceLocationNormalized: to.Ptr("US East"),
// ServiceInfo1: to.Ptr(""),
// ServiceInfo2: to.Ptr("Windows Client BYOL"),
// ServicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00Z"); return t}()),
// ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-01T00:00:00Z"); return t}()),
// SubscriptionGUID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// Term: to.Ptr(""),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/providers/Microsoft.Billing/BillingAccounts/1234:56789/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "modern",
"properties": {
"additionalInfo": "{ \"UsageType\": \"ComputeHR\", \"ImageType\": \"Windows Client BYOL\", \"ServiceType\": \"Standard_D1\", \"VMName\": null, \"VMProperties\": null, \"VCPUs\": 1, \"CPUs\": 0}",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "1234:56789",
"billingAccountName": "Account Name 1",
"billingCurrencyCode": "USD",
"billingPeriodEndDate": "2019-10-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-09-01T00:00:00.0000000Z",
"billingProfileId": "2468",
"billingProfileName": "Account Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"costCenter": "DEV",
"costInBillingCurrency": 1.84763819095477,
"costInPricingCurrency": 1.84763819095477,
"costInUSD": 1.84763819095477,
"customerName": "Modern Azure Customer 1",
"customerTenantId": "00000000-0000-0000-0000-000000000000",
"date": "2019-10-30T00:00:00.0000000Z",
"exchangeRate": "1",
"exchangeRateDate": "2019-09-30T00:00:00Z",
"exchangeRatePricingToBilling": 0.077,
"frequency": "UsageBased",
"instanceName": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"invoiceId": "",
"invoiceSectionId": "98765",
"invoiceSectionName": "Invoice Section 1",
"isAzureCreditEligible": false,
"marketPrice": 0.077,
"meterId": "00000000-0000-0000-0000-000000000000",
"partnerEarnedCreditApplied": "0",
"partnerEarnedCreditRate": 0.077,
"partnerName": "Partner Name 1",
"partnerTenantId": "00000000-0000-0000-0000-000000000000",
"paygCostInBillingCurrency": 1.848,
"paygCostInUSD": 1.848,
"previousInvoiceId": "",
"pricingCurrencyCode": "USD",
"product": "Virtual Machines D Series - D1 - US East",
"productIdentifier": "DZH318Z0BQ4B00FV",
"productOrderId": "a3db7880-70eb-4b4c-6a79-1425a058df5a",
"productOrderName": "Azure plan",
"publisherId": "",
"publisherName": "Microsoft",
"publisherType": "Microsoft",
"quantity": 0.7329,
"resellerMpnId": "",
"resellerName": "Reseller Name 1",
"reservationId": "",
"reservationName": "",
"resourceGroup": "Resource Group 1",
"resourceLocation": "USEast",
"resourceLocationNormalized": "US East",
"serviceInfo1": "",
"serviceInfo2": "Windows Client BYOL",
"servicePeriodEndDate": "2019-12-01T00:00:00Z",
"servicePeriodStartDate": "2019-09-01T00:00:00Z",
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"term": "",
"unitPrice": 4.38
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
BillingAccountUsageDetailsListForBillingPeriod-Legacy
Voorbeeldaanvraag
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_for_billing_period_by_billing_account.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="providers/Microsoft.Billing/BillingAccounts/1234",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListForBillingPeriodByBillingAccount.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 armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListForBillingPeriodByBillingAccount.json
func ExampleUsageDetailsClient_NewListPager_billingAccountUsageDetailsListForBillingPeriodLegacy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("providers/Microsoft.Billing/BillingAccounts/1234", 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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("Account Name 1"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Account Name 1"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Account Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-30T00:00:00.0000000Z"); return t}()),
// InvoiceSection: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferID: to.Ptr("Offer Id 1"),
// PartNumber: to.Ptr("Part Number 1"),
// Product: to.Ptr("Product Name 1"),
// ResourceGroup: to.Ptr("Resource Group 1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceName: to.Ptr("Resource Name 1"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "legacy",
"properties": {
"accountName": "Account Name 1",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"cost": 0.000342194841184,
"costCenter": "DEV",
"date": "2019-03-30T00:00:00.0000000Z",
"effectivePrice": 0.010534556373432,
"invoiceSection": "Invoice Section 1",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerId": "Offer Id 1",
"partNumber": "Part Number 1",
"product": "Product Name 1",
"quantity": 0.8234,
"resourceGroup": "Resource Group 1",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceLocation": "USEast",
"resourceName": "Resource Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"unitPrice": 3.74
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
BillingProfileUsageDetailsList-Modern
Voorbeeldaanvraag
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_by_mca_billing_profile.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListByMCABillingProfile.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 armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListByMCABillingProfile.json
func ExampleUsageDetailsClient_NewListPager_billingProfileUsageDetailsListModern() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468", 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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.ModernUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindModern),
// Properties: &armconsumption.ModernUsageDetailProperties{
// AdditionalInfo: to.Ptr("{ \"UsageType\": \"ComputeHR\", \"ImageType\": \"Windows Client BYOL\", \"ServiceType\": \"Standard_D1\", \"VMName\": null, \"VMProperties\": null, \"VCPUs\": 1, \"CPUs\": 0}"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("1234:56789"),
// BillingAccountName: to.Ptr("Account Name 1"),
// BillingCurrencyCode: to.Ptr("USD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("2468"),
// BillingProfileName: to.Ptr("Account Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// CustomerName: to.Ptr("Modern Azure Customer 1"),
// CustomerTenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-30T00:00:00.0000000Z"); return t}()),
// ExchangeRate: to.Ptr("1"),
// ExchangeRateDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-30T00:00:00Z"); return t}()),
// Frequency: to.Ptr("UsageBased"),
// InstanceName: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1"),
// InvoiceID: to.Ptr(""),
// InvoiceSectionID: to.Ptr("98765"),
// InvoiceSectionName: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PartnerEarnedCreditApplied: to.Ptr("0"),
// PartnerName: to.Ptr("Partner Name 1"),
// PartnerTenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PreviousInvoiceID: to.Ptr(""),
// PricingCurrencyCode: to.Ptr("USD"),
// Product: to.Ptr("Virtual Machines D Series - D1 - US East"),
// ProductIdentifier: to.Ptr("DZH318Z0BQ4B00FV"),
// ProductOrderID: to.Ptr("a3db7880-70eb-4b4c-6a79-1425a058df5a"),
// ProductOrderName: to.Ptr("Azure plan"),
// PublisherID: to.Ptr(""),
// PublisherName: to.Ptr("Microsoft"),
// PublisherType: to.Ptr("Microsoft"),
// ResellerMpnID: to.Ptr(""),
// ResellerName: to.Ptr("Reseller Name 1"),
// ReservationID: to.Ptr(""),
// ReservationName: to.Ptr(""),
// ResourceGroup: to.Ptr("Resource Group 1"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceLocationNormalized: to.Ptr("US East"),
// ServiceInfo1: to.Ptr(""),
// ServiceInfo2: to.Ptr("Windows Client BYOL"),
// ServicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00Z"); return t}()),
// ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-01T00:00:00Z"); return t}()),
// SubscriptionGUID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// Term: to.Ptr(""),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "modern",
"properties": {
"additionalInfo": "{ \"UsageType\": \"ComputeHR\", \"ImageType\": \"Windows Client BYOL\", \"ServiceType\": \"Standard_D1\", \"VMName\": null, \"VMProperties\": null, \"VCPUs\": 1, \"CPUs\": 0}",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "1234:56789",
"billingAccountName": "Account Name 1",
"billingCurrencyCode": "USD",
"billingPeriodEndDate": "2019-10-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-09-01T00:00:00.0000000Z",
"billingProfileId": "2468",
"billingProfileName": "Account Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"costCenter": "DEV",
"costInBillingCurrency": 1.84763819095477,
"costInPricingCurrency": 1.84763819095477,
"costInUSD": 1.84763819095477,
"customerName": "Modern Azure Customer 1",
"customerTenantId": "00000000-0000-0000-0000-000000000000",
"date": "2019-10-30T00:00:00.0000000Z",
"exchangeRate": "1",
"exchangeRateDate": "2019-09-30T00:00:00Z",
"exchangeRatePricingToBilling": 0.077,
"frequency": "UsageBased",
"instanceName": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"invoiceId": "",
"invoiceSectionId": "98765",
"invoiceSectionName": "Invoice Section 1",
"isAzureCreditEligible": false,
"marketPrice": 0.077,
"meterId": "00000000-0000-0000-0000-000000000000",
"partnerEarnedCreditApplied": "0",
"partnerEarnedCreditRate": 0.077,
"partnerName": "Partner Name 1",
"partnerTenantId": "00000000-0000-0000-0000-000000000000",
"paygCostInBillingCurrency": 1.848,
"paygCostInUSD": 1.848,
"previousInvoiceId": "",
"pricingCurrencyCode": "USD",
"product": "Virtual Machines D Series - D1 - US East",
"productIdentifier": "DZH318Z0BQ4B00FV",
"productOrderId": "a3db7880-70eb-4b4c-6a79-1425a058df5a",
"productOrderName": "Azure plan",
"publisherId": "",
"publisherName": "Microsoft",
"publisherType": "Microsoft",
"quantity": 0.7329,
"resellerMpnId": "",
"resellerName": "Reseller Name 1",
"reservationId": "",
"reservationName": "",
"resourceGroup": "Resource Group 1",
"resourceLocation": "USEast",
"resourceLocationNormalized": "US East",
"serviceInfo1": "",
"serviceInfo2": "Windows Client BYOL",
"servicePeriodEndDate": "2019-12-01T00:00:00Z",
"servicePeriodStartDate": "2019-09-01T00:00:00Z",
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"term": "",
"unitPrice": 4.38
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
CustomerUsageDetailsList-Modern
Voorbeeldaanvraag
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_by_mca_customer.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/00000000-0000-0000-0000-000000000000",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListByMCACustomer.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 armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListByMCACustomer.json
func ExampleUsageDetailsClient_NewListPager_customerUsageDetailsListModern() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/00000000-0000-0000-0000-000000000000", 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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.ModernUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindModern),
// Properties: &armconsumption.ModernUsageDetailProperties{
// AdditionalInfo: to.Ptr("{ \"UsageType\": \"ComputeHR\", \"ImageType\": \"Windows Client BYOL\", \"ServiceType\": \"Standard_D1\", \"VMName\": null, \"VMProperties\": null, \"VCPUs\": 1, \"CPUs\": 0}"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("1234:56789"),
// BillingAccountName: to.Ptr("Account Name 1"),
// BillingCurrencyCode: to.Ptr("USD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("2468"),
// BillingProfileName: to.Ptr("Account Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// CustomerName: to.Ptr("Modern Azure Customer 1"),
// CustomerTenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-30T00:00:00.0000000Z"); return t}()),
// ExchangeRate: to.Ptr("1"),
// ExchangeRateDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-30T00:00:00Z"); return t}()),
// Frequency: to.Ptr("UsageBased"),
// InstanceName: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1"),
// InvoiceID: to.Ptr(""),
// InvoiceSectionID: to.Ptr("98765"),
// InvoiceSectionName: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PartnerEarnedCreditApplied: to.Ptr("0"),
// PartnerName: to.Ptr("Partner Name 1"),
// PartnerTenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PreviousInvoiceID: to.Ptr(""),
// PricingCurrencyCode: to.Ptr("USD"),
// Product: to.Ptr("Virtual Machines D Series - D1 - US East"),
// ProductIdentifier: to.Ptr("DZH318Z0BQ4B00FV"),
// ProductOrderID: to.Ptr("a3db7880-70eb-4b4c-6a79-1425a058df5a"),
// ProductOrderName: to.Ptr("Azure plan"),
// PublisherID: to.Ptr(""),
// PublisherName: to.Ptr("Microsoft"),
// PublisherType: to.Ptr("Microsoft"),
// ResellerMpnID: to.Ptr(""),
// ResellerName: to.Ptr("Reseller Name 1"),
// ReservationID: to.Ptr(""),
// ReservationName: to.Ptr(""),
// ResourceGroup: to.Ptr("Resource Group 1"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceLocationNormalized: to.Ptr("US East"),
// ServiceInfo1: to.Ptr(""),
// ServiceInfo2: to.Ptr("Windows Client BYOL"),
// ServicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00Z"); return t}()),
// ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-01T00:00:00Z"); return t}()),
// SubscriptionGUID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// Term: to.Ptr(""),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "modern",
"properties": {
"additionalInfo": "{ \"UsageType\": \"ComputeHR\", \"ImageType\": \"Windows Client BYOL\", \"ServiceType\": \"Standard_D1\", \"VMName\": null, \"VMProperties\": null, \"VCPUs\": 1, \"CPUs\": 0}",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "1234:56789",
"billingAccountName": "Account Name 1",
"billingCurrencyCode": "USD",
"billingPeriodEndDate": "2019-10-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-09-01T00:00:00.0000000Z",
"billingProfileId": "2468",
"billingProfileName": "Account Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"costCenter": "DEV",
"costInBillingCurrency": 1.84763819095477,
"costInPricingCurrency": 1.84763819095477,
"costInUSD": 1.84763819095477,
"customerName": "Modern Azure Customer 1",
"customerTenantId": "00000000-0000-0000-0000-000000000000",
"date": "2019-10-30T00:00:00.0000000Z",
"exchangeRate": "1",
"exchangeRateDate": "2019-09-30T00:00:00Z",
"exchangeRatePricingToBilling": 0.077,
"frequency": "UsageBased",
"instanceName": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"invoiceId": "",
"invoiceSectionId": "98765",
"invoiceSectionName": "Invoice Section 1",
"isAzureCreditEligible": false,
"marketPrice": 0.077,
"meterId": "00000000-0000-0000-0000-000000000000",
"partnerEarnedCreditApplied": "0",
"partnerEarnedCreditRate": 0.077,
"partnerName": "Partner Name 1",
"partnerTenantId": "00000000-0000-0000-0000-000000000000",
"paygCostInBillingCurrency": 1.848,
"paygCostInUSD": 1.848,
"previousInvoiceId": "",
"pricingCurrencyCode": "USD",
"product": "Virtual Machines D Series - D1 - US East",
"productIdentifier": "DZH318Z0BQ4B00FV",
"productOrderId": "a3db7880-70eb-4b4c-6a79-1425a058df5a",
"productOrderName": "Azure plan",
"publisherId": "",
"publisherName": "Microsoft",
"publisherType": "Microsoft",
"quantity": 0.7329,
"resellerMpnId": "",
"resellerName": "Reseller Name 1",
"reservationId": "",
"reservationName": "",
"resourceGroup": "Resource Group 1",
"resourceLocation": "USEast",
"resourceLocationNormalized": "US East",
"serviceInfo1": "",
"serviceInfo2": "Windows Client BYOL",
"servicePeriodEndDate": "2019-12-01T00:00:00Z",
"servicePeriodStartDate": "2019-09-01T00:00:00Z",
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"term": "",
"unitPrice": 4.38
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
DepartmentUsageDetailsList-Legacy
Voorbeeldaanvraag
GET https://management.azure.com/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_by_department.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="providers/Microsoft.Billing/Departments/1234",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListByDepartment.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 armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListByDepartment.json
func ExampleUsageDetailsClient_NewListPager_departmentUsageDetailsListLegacy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("providers/Microsoft.Billing/Departments/1234", 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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("Account Name 1"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Account Name 1"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Account Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-30T00:00:00.0000000Z"); return t}()),
// InvoiceSection: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferID: to.Ptr("Offer Id 1"),
// PartNumber: to.Ptr("Part Number 1"),
// Product: to.Ptr("Product Name 1"),
// ResourceGroup: to.Ptr("Resource Group 1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceName: to.Ptr("Resource Name 1"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "legacy",
"properties": {
"accountName": "Account Name 1",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"cost": 0.000295194820065,
"costCenter": "DEV",
"date": "2019-03-30T00:00:00.0000000Z",
"effectivePrice": 0.000402776395232,
"invoiceSection": "Invoice Section 1",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerId": "Offer Id 1",
"partNumber": "Part Number 1",
"product": "Product Name 1",
"quantity": 0.7329,
"resourceGroup": "Resource Group 1",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceLocation": "USEast",
"resourceName": "Resource Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"unitPrice": 4.38
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
DepartmentUsageDetailsListForBillingPeriod-Legacy
Voorbeeldaanvraag
GET https://management.azure.com/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_for_billing_period_by_department.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="providers/Microsoft.Billing/Departments/1234",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListForBillingPeriodByDepartment.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 armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListForBillingPeriodByDepartment.json
func ExampleUsageDetailsClient_NewListPager_departmentUsageDetailsListForBillingPeriodLegacy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("providers/Microsoft.Billing/Departments/1234", 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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("Account Name 1"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Account Name 1"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Account Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-30T00:00:00.0000000Z"); return t}()),
// InvoiceSection: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferID: to.Ptr("Offer Id 1"),
// PartNumber: to.Ptr("Part Number 1"),
// Product: to.Ptr("Product Name 1"),
// ResourceGroup: to.Ptr("Resource Group 1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceName: to.Ptr("Resource Name 1"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "legacy",
"properties": {
"accountName": "Account Name 1",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"cost": 0.000342194841184,
"costCenter": "DEV",
"date": "2019-03-30T00:00:00.0000000Z",
"effectivePrice": 0.010534556373432,
"invoiceSection": "Invoice Section 1",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerId": "Offer Id 1",
"partNumber": "Part Number 1",
"product": "Product Name 1",
"quantity": 0.8234,
"resourceGroup": "Resource Group 1",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceLocation": "USEast",
"resourceName": "Resource Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"unitPrice": 3.74
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
EnrollmentAccountUsageDetailsList-Legacy
Voorbeeldaanvraag
GET https://management.azure.com/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_by_enrollment_account.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="providers/Microsoft.Billing/EnrollmentAccounts/1234",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListByEnrollmentAccount.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 armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListByEnrollmentAccount.json
func ExampleUsageDetailsClient_NewListPager_enrollmentAccountUsageDetailsListLegacy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("providers/Microsoft.Billing/EnrollmentAccounts/1234", 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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("Account Name 1"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Account Name 1"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Account Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-30T00:00:00.0000000Z"); return t}()),
// InvoiceSection: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferID: to.Ptr("Offer Id 1"),
// PartNumber: to.Ptr("Part Number 1"),
// Product: to.Ptr("Product Name 1"),
// ResourceGroup: to.Ptr("Resource Group 1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceName: to.Ptr("Resource Name 1"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "legacy",
"properties": {
"accountName": "Account Name 1",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"cost": 0.000295194820065,
"costCenter": "DEV",
"date": "2019-03-30T00:00:00.0000000Z",
"effectivePrice": 0.000402776395232,
"invoiceSection": "Invoice Section 1",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerId": "Offer Id 1",
"partNumber": "Part Number 1",
"product": "Product Name 1",
"quantity": 0.7329,
"resourceGroup": "Resource Group 1",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceLocation": "USEast",
"resourceName": "Resource Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"unitPrice": 4.38
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
EnrollmentAccountUsageDetailsListForBillingPeriod-Legacy
Voorbeeldaanvraag
GET https://management.azure.com/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_for_billing_period_by_enrollment_account.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="providers/Microsoft.Billing/EnrollmentAccounts/1234",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListForBillingPeriodByEnrollmentAccount.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 armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListForBillingPeriodByEnrollmentAccount.json
func ExampleUsageDetailsClient_NewListPager_enrollmentAccountUsageDetailsListForBillingPeriodLegacy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("providers/Microsoft.Billing/EnrollmentAccounts/1234", 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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("Account Name 1"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Account Name 1"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Account Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-30T00:00:00.0000000Z"); return t}()),
// InvoiceSection: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferID: to.Ptr("Offer Id 1"),
// PartNumber: to.Ptr("Part Number 1"),
// Product: to.Ptr("Product Name 1"),
// ResourceGroup: to.Ptr("Resource Group 1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceName: to.Ptr("Resource Name 1"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "legacy",
"properties": {
"accountName": "Account Name 1",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"cost": 0.000342194841184,
"costCenter": "DEV",
"date": "2019-03-30T00:00:00.0000000Z",
"effectivePrice": 0.010534556373432,
"invoiceSection": "Invoice Section 1",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerId": "Offer Id 1",
"partNumber": "Part Number 1",
"product": "Product Name 1",
"quantity": 0.8234,
"resourceGroup": "Resource Group 1",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceLocation": "USEast",
"resourceName": "Resource Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"unitPrice": 3.74
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
InvoiceSectionUsageDetailsList-Modern
Voorbeeldaanvraag
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_by_mca_invoice_section.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListByMCAInvoiceSection.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 armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListByMCAInvoiceSection.json
func ExampleUsageDetailsClient_NewListPager_invoiceSectionUsageDetailsListModern() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765", 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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.ModernUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindModern),
// Properties: &armconsumption.ModernUsageDetailProperties{
// AdditionalInfo: to.Ptr("{ \"UsageType\": \"ComputeHR\", \"ImageType\": \"Windows Client BYOL\", \"ServiceType\": \"Standard_D1\", \"VMName\": null, \"VMProperties\": null, \"VCPUs\": 1, \"CPUs\": 0}"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("1234:56789"),
// BillingAccountName: to.Ptr("Account Name 1"),
// BillingCurrencyCode: to.Ptr("USD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("2468"),
// BillingProfileName: to.Ptr("Account Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// CustomerName: to.Ptr("Modern Azure Customer 1"),
// CustomerTenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-30T00:00:00.0000000Z"); return t}()),
// ExchangeRate: to.Ptr("1"),
// ExchangeRateDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-30T00:00:00Z"); return t}()),
// Frequency: to.Ptr("UsageBased"),
// InstanceName: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1"),
// InvoiceID: to.Ptr(""),
// InvoiceSectionID: to.Ptr("98765"),
// InvoiceSectionName: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PartnerEarnedCreditApplied: to.Ptr("0"),
// PartnerName: to.Ptr("Partner Name 1"),
// PartnerTenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PreviousInvoiceID: to.Ptr(""),
// PricingCurrencyCode: to.Ptr("USD"),
// Product: to.Ptr("Virtual Machines D Series - D1 - US East"),
// ProductIdentifier: to.Ptr("DZH318Z0BQ4B00FV"),
// ProductOrderID: to.Ptr("a3db7880-70eb-4b4c-6a79-1425a058df5a"),
// ProductOrderName: to.Ptr("Azure plan"),
// PublisherID: to.Ptr(""),
// PublisherName: to.Ptr("Microsoft"),
// PublisherType: to.Ptr("Microsoft"),
// ResellerMpnID: to.Ptr(""),
// ResellerName: to.Ptr("Reseller Name 1"),
// ReservationID: to.Ptr(""),
// ReservationName: to.Ptr(""),
// ResourceGroup: to.Ptr("Resource Group 1"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceLocationNormalized: to.Ptr("US East"),
// ServiceInfo1: to.Ptr(""),
// ServiceInfo2: to.Ptr("Windows Client BYOL"),
// ServicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00Z"); return t}()),
// ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-01T00:00:00Z"); return t}()),
// SubscriptionGUID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// Term: to.Ptr(""),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "modern",
"properties": {
"additionalInfo": "{ \"UsageType\": \"ComputeHR\", \"ImageType\": \"Windows Client BYOL\", \"ServiceType\": \"Standard_D1\", \"VMName\": null, \"VMProperties\": null, \"VCPUs\": 1, \"CPUs\": 0}",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "1234:56789",
"billingAccountName": "Account Name 1",
"billingCurrencyCode": "USD",
"billingPeriodEndDate": "2019-10-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-09-01T00:00:00.0000000Z",
"billingProfileId": "2468",
"billingProfileName": "Account Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"costCenter": "DEV",
"costInBillingCurrency": 1.84763819095477,
"costInPricingCurrency": 1.84763819095477,
"costInUSD": 1.84763819095477,
"customerName": "Modern Azure Customer 1",
"customerTenantId": "00000000-0000-0000-0000-000000000000",
"date": "2019-10-30T00:00:00.0000000Z",
"exchangeRate": "1",
"exchangeRateDate": "2019-09-30T00:00:00Z",
"exchangeRatePricingToBilling": 0.077,
"frequency": "UsageBased",
"instanceName": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"invoiceId": "",
"invoiceSectionId": "98765",
"invoiceSectionName": "Invoice Section 1",
"isAzureCreditEligible": false,
"marketPrice": 0.077,
"meterId": "00000000-0000-0000-0000-000000000000",
"partnerEarnedCreditApplied": "0",
"partnerEarnedCreditRate": 0.077,
"partnerName": "Partner Name 1",
"partnerTenantId": "00000000-0000-0000-0000-000000000000",
"paygCostInBillingCurrency": 1.848,
"paygCostInUSD": 1.848,
"previousInvoiceId": "",
"pricingCurrencyCode": "USD",
"product": "Virtual Machines D Series - D1 - US East",
"productIdentifier": "DZH318Z0BQ4B00FV",
"productOrderId": "a3db7880-70eb-4b4c-6a79-1425a058df5a",
"productOrderName": "Azure plan",
"publisherId": "",
"publisherName": "Microsoft",
"publisherType": "Microsoft",
"quantity": 0.7329,
"resellerMpnId": "",
"resellerName": "Reseller Name 1",
"reservationId": "",
"reservationName": "",
"resourceGroup": "Resource Group 1",
"resourceLocation": "USEast",
"resourceLocationNormalized": "US East",
"serviceInfo1": "",
"serviceInfo2": "Windows Client BYOL",
"servicePeriodEndDate": "2019-12-01T00:00:00Z",
"servicePeriodStartDate": "2019-09-01T00:00:00Z",
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"term": "",
"unitPrice": 4.38
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
ManagementGroupUsageDetailsList-Legacy
Voorbeeldaanvraag
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_by_management_group.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="subscriptions/00000000-0000-0000-0000-000000000000",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListByManagementGroup.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 armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListByManagementGroup.json
func ExampleUsageDetailsClient_NewListPager_managementGroupUsageDetailsListLegacy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000", 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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("Account Name 1"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Account Name 1"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Account Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-30T00:00:00.0000000Z"); return t}()),
// InvoiceSection: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferID: to.Ptr("Offer Id 1"),
// PartNumber: to.Ptr("Part Number 1"),
// Product: to.Ptr("Product Name 1"),
// ResourceGroup: to.Ptr("Resource Group 1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceName: to.Ptr("Resource Name 1"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id2"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/scope/providers/Microsoft.Billing/billingPeriods/20180801/providers/Microsoft.Consumption/usageDetails/usageDetails_Id2"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("Account Name 1"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Account Name 2"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Account Name 2"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-30T00:00:00.0000000Z"); return t}()),
// InvoiceSection: to.Ptr("Invoice Section 2"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// OfferID: to.Ptr("Offer Id 2"),
// PartNumber: to.Ptr("Part Number 2"),
// Product: to.Ptr("Product Name 2"),
// ResourceGroup: to.Ptr("Resource Group 2"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 2/providers/Microsoft.Storage/storageAccounts/Resource Name 2"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceName: to.Ptr("Resource Name 2"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "legacy",
"properties": {
"accountName": "Account Name 1",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"cost": 0.000342194841184,
"costCenter": "DEV",
"date": "2019-03-30T00:00:00.0000000Z",
"effectivePrice": 0.010534556373432,
"invoiceSection": "Invoice Section 1",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerId": "Offer Id 1",
"partNumber": "Part Number 1",
"product": "Product Name 1",
"quantity": 0.8234,
"resourceGroup": "Resource Group 1",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceLocation": "USEast",
"resourceName": "Resource Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"unitPrice": 3.74
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
},
{
"name": "usageDetails_Id2",
"type": "Microsoft.Consumption/usageDetails",
"id": "/scope/providers/Microsoft.Billing/billingPeriods/20180801/providers/Microsoft.Consumption/usageDetails/usageDetails_Id2",
"kind": "legacy",
"properties": {
"accountName": "Account Name 1",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 2",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 2",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"cost": 0.000295194820065,
"costCenter": "DEV",
"date": "2019-03-30T00:00:00.0000000Z",
"effectivePrice": 0.000402776395232,
"invoiceSection": "Invoice Section 2",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "11111111-1111-1111-1111-111111111111",
"offerId": "Offer Id 2",
"partNumber": "Part Number 2",
"product": "Product Name 2",
"quantity": 0.7329,
"resourceGroup": "Resource Group 2",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 2/providers/Microsoft.Storage/storageAccounts/Resource Name 2",
"resourceLocation": "USEast",
"resourceName": "Resource Name 2",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"unitPrice": 4.38
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
ManagementGroupUsageDetailsListForBillingPeriod-Legacy
Voorbeeldaanvraag
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_for_billing_period_by_management_group.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="subscriptions/00000000-0000-0000-0000-000000000000",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListForBillingPeriodByManagementGroup.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 armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListForBillingPeriodByManagementGroup.json
func ExampleUsageDetailsClient_NewListPager_managementGroupUsageDetailsListForBillingPeriodLegacy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000", 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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("Account Name 1"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Account Name 1"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Account Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-30T00:00:00.0000000Z"); return t}()),
// InvoiceSection: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferID: to.Ptr("Offer Id 1"),
// PartNumber: to.Ptr("Part Number 1"),
// Product: to.Ptr("Product Name 1"),
// ResourceGroup: to.Ptr("Resource Group 1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceName: to.Ptr("Resource Name 1"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id2"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/scope/providers/Microsoft.Billing/billingPeriods/billingPeriodName/providers/Microsoft.Consumption/usageDetails/usageDetails_Id2"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("Account Name 2"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Account Name 2"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Account Name 2"),
// ChargeType: to.Ptr("UnusedReservation"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-30T00:00:00.0000000Z"); return t}()),
// InvoiceSection: to.Ptr("Invoice Section 2"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// OfferID: to.Ptr("Offer Id 2"),
// PartNumber: to.Ptr("Part Number 2"),
// Product: to.Ptr("Product Name 2"),
// ResourceGroup: to.Ptr("Resource Group 2"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 2/providers/Microsoft.Storage/storageAccounts/Resource Name 2"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceName: to.Ptr("Resource Name 2"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 2"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "legacy",
"properties": {
"accountName": "Account Name 1",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"cost": 0.000342194841184,
"costCenter": "DEV",
"date": "2019-03-30T00:00:00.0000000Z",
"effectivePrice": 0.010534556373432,
"invoiceSection": "Invoice Section 1",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerId": "Offer Id 1",
"partNumber": "Part Number 1",
"product": "Product Name 1",
"quantity": 0.8234,
"resourceGroup": "Resource Group 1",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceLocation": "USEast",
"resourceName": "Resource Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"unitPrice": 3.74
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
},
{
"name": "usageDetails_Id2",
"type": "Microsoft.Consumption/usageDetails",
"id": "/scope/providers/Microsoft.Billing/billingPeriods/billingPeriodName/providers/Microsoft.Consumption/usageDetails/usageDetails_Id2",
"kind": "legacy",
"properties": {
"accountName": "Account Name 2",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 2",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 2",
"chargeType": "UnusedReservation",
"consumedService": "Microsoft.Storage",
"cost": 0.000821821271948,
"costCenter": "DEV",
"date": "2019-03-30T00:00:00.0000000Z",
"effectivePrice": 0.073488920944598,
"invoiceSection": "Invoice Section 2",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "11111111-1111-1111-1111-111111111111",
"offerId": "Offer Id 2",
"partNumber": "Part Number 2",
"product": "Product Name 2",
"quantity": 0.4759,
"resourceGroup": "Resource Group 2",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 2/providers/Microsoft.Storage/storageAccounts/Resource Name 2",
"resourceLocation": "USEast",
"resourceName": "Resource Name 2",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 2",
"unitPrice": 5.74
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
UsageDetailsExpand-Legacy
Voorbeeldaanvraag
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01&$expand=meterDetails,additionalInfo&$filter=tags eq 'dev:tools'&$top=1
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_expand.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="subscriptions/00000000-0000-0000-0000-000000000000",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsExpand.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 armconsumption_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/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsExpand.json
func ExampleUsageDetailsClient_NewListPager_usageDetailsExpandLegacy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000", &armconsumption.UsageDetailsClientListOptions{
Expand: to.Ptr("meterDetails,additionalInfo"),
Filter: to.Ptr("tags eq 'dev:tools'"),
Top: to.Ptr[int32](1)})
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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("Account Name 1"),
// AdditionalInfo: to.Ptr("{\"MyType\":\"\",\"ServiceType\":\"\",\"VMName\":\"\",\"UsageType\":\"MyUsage\"}"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Account Name 1"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Account Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-30T00:00:00.0000000Z"); return t}()),
// Frequency: to.Ptr("UsageBased"),
// InvoiceSection: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterDetails: &armconsumption.MeterDetailsResponse{
// MeterCategory: to.Ptr("Networking"),
// MeterName: to.Ptr("Data Transfer Out (GB)"),
// MeterSubCategory: to.Ptr("ExpressRoute"),
// ServiceFamily: to.Ptr("Compute"),
// UnitOfMeasure: to.Ptr("GB"),
// },
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferID: to.Ptr("Offer Id 1"),
// PartNumber: to.Ptr("Part Number 1"),
// Product: to.Ptr("Product Name 1"),
// ResourceGroup: to.Ptr("Resource Group 1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceName: to.Ptr("Resource Name 1"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "legacy",
"properties": {
"accountName": "Account Name 1",
"additionalInfo": "{\"MyType\":\"\",\"ServiceType\":\"\",\"VMName\":\"\",\"UsageType\":\"MyUsage\"}",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"cost": 0.000342194841184,
"costCenter": "DEV",
"date": "2019-03-30T00:00:00.0000000Z",
"effectivePrice": 0.010464556322455,
"frequency": "UsageBased",
"invoiceSection": "Invoice Section 1",
"isAzureCreditEligible": false,
"meterDetails": {
"meterCategory": "Networking",
"meterName": "Data Transfer Out (GB)",
"meterSubCategory": "ExpressRoute",
"serviceFamily": "Compute",
"unitOfMeasure": "GB"
},
"meterId": "00000000-0000-0000-0000-000000000000",
"offerId": "Offer Id 1",
"partNumber": "Part Number 1",
"product": "Product Name 1",
"quantity": 0.8234,
"resourceGroup": "Resource Group 1",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceLocation": "USEast",
"resourceName": "Resource Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"unitPrice": 3.54
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
UsageDetailsList-Legacy
Voorbeeldaanvraag
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="subscriptions/00000000-0000-0000-0000-000000000000",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsList.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 armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsList.json
func ExampleUsageDetailsClient_NewListPager_usageDetailsListLegacy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000", 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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("AccountName"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Customer Name 1"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-30T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Customer Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.ClassicStorage"),
// CostCenter: to.Ptr("BAS"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-09T00:00:00.0000000Z"); return t}()),
// Frequency: to.Ptr("UsageBased"),
// InvoiceSection: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferID: to.Ptr("Offer Id 1"),
// PartNumber: to.Ptr("Part Number 1"),
// Product: to.Ptr("Product1"),
// ResourceGroup: to.Ptr("Resource-Group-westus"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1"),
// ResourceLocation: to.Ptr("uswest"),
// ResourceName: to.Ptr("ResourceName1"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("SubscriptionName 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "legacy",
"properties": {
"accountName": "AccountName",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Customer Name 1",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-04-30T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-04-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Customer Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.ClassicStorage",
"cost": 1.980949998E-06,
"costCenter": "BAS",
"date": "2019-04-09T00:00:00.0000000Z",
"effectivePrice": 0.054693034210767,
"frequency": "UsageBased",
"invoiceSection": "Invoice Section 1",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerId": "Offer Id 1",
"partNumber": "Part Number 1",
"product": "Product1",
"quantity": 3.6E-05,
"resourceGroup": "Resource-Group-westus",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1",
"resourceLocation": "uswest",
"resourceName": "ResourceName1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "SubscriptionName 1",
"unitPrice": 5.47
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
UsageDetailsListByMetricActualCost-Legacy
Voorbeeldaanvraag
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01&metric=actualcost
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_by_metric_actual_cost.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="subscriptions/00000000-0000-0000-0000-000000000000",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListByMetricActualCost.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 armconsumption_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/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListByMetricActualCost.json
func ExampleUsageDetailsClient_NewListPager_usageDetailsListByMetricActualCostLegacy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000", &armconsumption.UsageDetailsClientListOptions{
Metric: to.Ptr(armconsumption.MetrictypeActualCostMetricType)})
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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("AccountName"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Customer Name 1"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-30T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Customer Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.ClassicStorage"),
// CostCenter: to.Ptr("BAS"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-09T00:00:00.0000000Z"); return t}()),
// InvoiceSection: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferID: to.Ptr("Offer Id 1"),
// PartNumber: to.Ptr("Part Number 1"),
// Product: to.Ptr("Product1"),
// ResourceGroup: to.Ptr("Resource-Group-westus"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1"),
// ResourceLocation: to.Ptr("uswest"),
// ResourceName: to.Ptr("ResourceName1"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("SubscriptionName 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "legacy",
"properties": {
"accountName": "AccountName",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Customer Name 1",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-04-30T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-04-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Customer Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.ClassicStorage",
"cost": 1.968949998E-06,
"costCenter": "BAS",
"date": "2019-04-09T00:00:00.0000000Z",
"effectivePrice": 0.054693055510767,
"invoiceSection": "Invoice Section 1",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerId": "Offer Id 1",
"partNumber": "Part Number 1",
"product": "Product1",
"quantity": 3.6E-05,
"resourceGroup": "Resource-Group-westus",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1",
"resourceLocation": "uswest",
"resourceName": "ResourceName1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "SubscriptionName 1",
"unitPrice": 5.47
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
UsageDetailsListByMetricAmortizedCost-Legacy
Voorbeeldaanvraag
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01&metric=amortizedcost
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_by_metric_amortized_cost.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="subscriptions/00000000-0000-0000-0000-000000000000",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListByMetricAmortizedCost.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 armconsumption_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/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListByMetricAmortizedCost.json
func ExampleUsageDetailsClient_NewListPager_usageDetailsListByMetricAmortizedCostLegacy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000", &armconsumption.UsageDetailsClientListOptions{
Metric: to.Ptr(armconsumption.MetrictypeAmortizedCostMetricType)})
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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("AccountName"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Customer Name 1"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-30T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Customer Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.ClassicStorage"),
// CostCenter: to.Ptr("BAS"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-09T00:00:00.0000000Z"); return t}()),
// Frequency: to.Ptr("UsageBased"),
// InvoiceSection: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferID: to.Ptr("Offer Id 1"),
// PartNumber: to.Ptr("Part Number 1"),
// Product: to.Ptr("Product1"),
// ResourceGroup: to.Ptr("Resource-Group-westus"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1"),
// ResourceLocation: to.Ptr("uswest"),
// ResourceName: to.Ptr("ResourceName1"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("SubscriptionName 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "legacy",
"properties": {
"accountName": "AccountName",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Customer Name 1",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-04-30T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-04-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Customer Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.ClassicStorage",
"cost": 1.968949998E-06,
"costCenter": "BAS",
"date": "2019-04-09T00:00:00.0000000Z",
"effectivePrice": 0.054693055510767,
"frequency": "UsageBased",
"invoiceSection": "Invoice Section 1",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerId": "Offer Id 1",
"partNumber": "Part Number 1",
"product": "Product1",
"quantity": 3.6E-05,
"resourceGroup": "Resource-Group-westus",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1",
"resourceLocation": "uswest",
"resourceName": "ResourceName1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "SubscriptionName 1",
"unitPrice": 5.47
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
UsageDetailsListByMetricUsage-Legacy
Voorbeeldaanvraag
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01&metric=usage
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_by_metric_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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="subscriptions/00000000-0000-0000-0000-000000000000",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListByMetricUsage.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 armconsumption_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/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListByMetricUsage.json
func ExampleUsageDetailsClient_NewListPager_usageDetailsListByMetricUsageLegacy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000", &armconsumption.UsageDetailsClientListOptions{
Metric: to.Ptr(armconsumption.MetrictypeUsageMetricType)})
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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("AccountName"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Customer Name 1"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-30T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Customer Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.ClassicStorage"),
// CostCenter: to.Ptr("BAS"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-09T00:00:00.0000000Z"); return t}()),
// InvoiceSection: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferID: to.Ptr("Offer Id 1"),
// PartNumber: to.Ptr("Part Number 1"),
// Product: to.Ptr("Product1"),
// ResourceGroup: to.Ptr("Resource-Group-westus"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1"),
// ResourceLocation: to.Ptr("uswest"),
// ResourceName: to.Ptr("ResourceName1"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("SubscriptionName 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "legacy",
"properties": {
"accountName": "AccountName",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Customer Name 1",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-04-30T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-04-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Customer Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.ClassicStorage",
"cost": 1.968949998E-06,
"costCenter": "BAS",
"date": "2019-04-09T00:00:00.0000000Z",
"effectivePrice": 0.054693055510767,
"invoiceSection": "Invoice Section 1",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerId": "Offer Id 1",
"partNumber": "Part Number 1",
"product": "Product1",
"quantity": 3.6E-05,
"resourceGroup": "Resource-Group-westus",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1",
"resourceLocation": "uswest",
"resourceName": "ResourceName1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "SubscriptionName 1",
"unitPrice": 5.47
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
UsageDetailsListFilterByTag-Legacy
Voorbeeldaanvraag
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01&$filter=tags eq 'dev:tools'
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_filter_by_tag.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="subscriptions/00000000-0000-0000-0000-000000000000",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListFilterByTag.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 armconsumption_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/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListFilterByTag.json
func ExampleUsageDetailsClient_NewListPager_usageDetailsListFilterByTagLegacy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000", &armconsumption.UsageDetailsClientListOptions{
Filter: to.Ptr("tags eq 'dev:tools'")})
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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("Account Name 1"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Account Name 1"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Account Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-30T00:00:00.0000000Z"); return t}()),
// InvoiceSection: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferID: to.Ptr("Offer Id 1"),
// PartNumber: to.Ptr("Part Number 1"),
// Product: to.Ptr("Product Name 1"),
// ResourceGroup: to.Ptr("Resource Group 1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceName: to.Ptr("Resource Name 1"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "legacy",
"properties": {
"accountName": "Account Name 1",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"cost": 0.000342194841184,
"costCenter": "DEV",
"date": "2019-03-30T00:00:00.0000000Z",
"effectivePrice": 0.010534556373432,
"invoiceSection": "Invoice Section 1",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerId": "Offer Id 1",
"partNumber": "Part Number 1",
"product": "Product Name 1",
"quantity": 0.8234,
"resourceGroup": "Resource Group 1",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceLocation": "USEast",
"resourceName": "Resource Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"unitPrice": 3.74
},
"tags": {
"dev": "tools"
}
}
]
}
UsageDetailsListForBillingPeriod-Legacy
Voorbeeldaanvraag
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.consumption import ConsumptionManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-consumption
# USAGE
python usage_details_list_for_billing_period.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 = ConsumptionManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.usage_details.list(
scope="subscriptions/00000000-0000-0000-0000-000000000000",
)
for item in response:
print(item)
# x-ms-original-file: 2024-08-01/UsageDetailsListForBillingPeriod.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 armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/UsageDetailsListForBillingPeriod.json
func ExampleUsageDetailsClient_NewListPager_usageDetailsListForBillingPeriodLegacy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsageDetailsClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000", 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 = armconsumption.UsageDetailsClientListResponse{
// UsageDetailsListResult: armconsumption.UsageDetailsListResult{
// Value: []armconsumption.UsageDetailClassification{
// &armconsumption.LegacyUsageDetail{
// Name: to.Ptr("usageDetails_Id1"),
// Type: to.Ptr("Microsoft.Consumption/usageDetails"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1"),
// Kind: to.Ptr(armconsumption.UsageDetailsKindLegacy),
// Properties: &armconsumption.LegacyUsageDetailProperties{
// AccountName: to.Ptr("Account Name 1"),
// BenefitID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// BenefitName: to.Ptr("Reservation_purchase_03-09-2018_10-59"),
// BillingAccountID: to.Ptr("xxxxxxxx"),
// BillingAccountName: to.Ptr("Account Name 1"),
// BillingCurrency: to.Ptr("CAD"),
// BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-31T00:00:00.0000000Z"); return t}()),
// BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.0000000Z"); return t}()),
// BillingProfileID: to.Ptr("xxxxxxxx"),
// BillingProfileName: to.Ptr("Account Name 1"),
// ChargeType: to.Ptr("Usage"),
// ConsumedService: to.Ptr("Microsoft.Storage"),
// CostCenter: to.Ptr("DEV"),
// Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-30T00:00:00.0000000Z"); return t}()),
// InvoiceSection: to.Ptr("Invoice Section 1"),
// IsAzureCreditEligible: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferID: to.Ptr("Offer Id 1"),
// PartNumber: to.Ptr("Part Number 1"),
// Product: to.Ptr("Product Name 1"),
// ResourceGroup: to.Ptr("Resource Group 1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1"),
// ResourceLocation: to.Ptr("USEast"),
// ResourceName: to.Ptr("Resource Name 1"),
// SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("Subscription Name 1"),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"value": [
{
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"kind": "legacy",
"properties": {
"accountName": "Account Name 1",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59",
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingCurrency": "CAD",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"chargeType": "Usage",
"consumedService": "Microsoft.Storage",
"cost": 0.000342194841184,
"costCenter": "DEV",
"date": "2019-03-30T00:00:00.0000000Z",
"effectivePrice": 0.010534556373432,
"invoiceSection": "Invoice Section 1",
"isAzureCreditEligible": false,
"meterDetails": null,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerId": "Offer Id 1",
"partNumber": "Part Number 1",
"product": "Product Name 1",
"quantity": 0.8234,
"resourceGroup": "Resource Group 1",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceLocation": "USEast",
"resourceName": "Resource Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"unitPrice": 3.74
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
Definities
createdByType
Opsomming
Het type identiteit waarmee de resource is gemaakt.
| Waarde |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
ErrorAdditionalInfo
Object
Aanvullende informatie over de resourcebeheerfout.
| Name |
Type |
Description |
|
info
|
object
|
De aanvullende informatie.
|
|
type
|
string
|
Het extra informatietype.
|
ErrorDetail
Object
De foutdetails.
| Name |
Type |
Description |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
De fout bevat aanvullende informatie.
|
|
code
|
string
|
De foutcode.
|
|
details
|
ErrorDetail[]
|
De foutdetails.
|
|
message
|
string
|
Het foutbericht.
|
|
target
|
string
|
Het foutdoel.
|
ErrorResponse
Object
Foutreactie
| Name |
Type |
Description |
|
error
|
ErrorDetail
|
Het foutobject.
|
LegacyUsageDetail
Object
Verouderde gebruiksgegevens.
| Name |
Type |
Description |
|
etag
|
string
|
De etag voor de resource.
|
|
id
|
string
|
Volledig gekwalificeerde resource-id voor de resource. Vb.: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
kind
|
string:
legacy
|
Hiermee geeft u het soort gebruiksgegevens op.
|
|
name
|
string
|
De naam van de resource
|
|
properties.accountName
|
string
|
Accountnaam.
|
|
properties.accountOwnerId
|
string
|
Id van accounteigenaar.
|
|
properties.additionalInfo
|
string
|
Aanvullende informatie over dit gebruiksitem. Dit is standaard niet ingevuld, tenzij deze is opgegeven in $expand. Gebruik dit veld om specifieke details over gebruiksregelitems op te halen, zoals de werkelijke VM-grootte (ServiceType) of de verhouding waarin de reserveringskorting wordt toegepast.
|
|
properties.benefitId
|
string
|
Unieke id voor het toepasselijke voordeel.
|
|
properties.benefitName
|
string
|
Naam van het toepasselijke voordeel.
|
|
properties.billingAccountId
|
string
|
Factureringsrekening-id.
|
|
properties.billingAccountName
|
string
|
Naam van factureringsaccount.
|
|
properties.billingCurrency
|
string
|
Factureringsvaluta.
|
|
properties.billingPeriodEndDate
|
string
(date-time)
|
De einddatum van de factureringsperiode.
|
|
properties.billingPeriodStartDate
|
string
(date-time)
|
De begindatum van de factureringsperiode.
|
|
properties.billingProfileId
|
string
|
Factureringsprofiel-id.
|
|
properties.billingProfileName
|
string
|
Naam van factureringsprofiel.
|
|
properties.chargeType
|
string
|
Hiermee wordt aangegeven dat er kosten in rekening worden gebracht voor tegoeden, gebruik, een Marketplace-aankoop, een reserveringskosten of een restitutie.
|
|
properties.consumedService
|
string
|
Naam van verbruikte service. Naam van de Azure-resourceprovider die het gebruik verzendt of is gekocht. Deze waarde is niet opgegeven voor marketplace-gebruik.
|
|
properties.cost
|
number
(decimal)
|
Het bedrag aan kosten vóór belasting.
|
|
properties.costCenter
|
string
|
De kostenplaats van deze afdeling als het een afdeling is en een kostenplaats wordt verstrekt.
|
|
properties.date
|
string
(date-time)
|
Datum voor de gebruiksrecord.
|
|
properties.effectivePrice
|
number
(decimal)
|
Effectieve prijs die in rekening wordt gebracht voor het gebruik.
|
|
properties.frequency
|
string
|
Geeft aan hoe vaak deze kosten optreden. OneTime voor aankopen die slechts eenmaal plaatsvinden, maandelijks voor kosten die elke maand opnieuw worden uitgevoerd en UsageBased voor kosten op basis van hoeveel een service wordt gebruikt.
|
|
properties.invoiceSection
|
string
|
Factuursectienaam.
|
|
properties.isAzureCreditEligible
|
boolean
|
Komt Azure-tegoed in aanmerking.
|
|
properties.meterDetails
|
MeterDetailsResponse
|
De details over de meter. Dit is standaard niet ingevuld, tenzij deze is opgegeven in $expand.
|
|
properties.meterId
|
string
(uuid)
|
De meter-id (GUID). Niet beschikbaar voor Marketplace. Voor een gereserveerde instantie vertegenwoordigt dit de primaire meter waarvoor de reservering is gekocht. Zie productOrderName voor de werkelijke VM-grootte waarvoor de reservering is gekocht.
|
|
properties.offerId
|
string
|
Aanbiedings-id. Bijvoorbeeld: MS-AZR-0017P, MS-AZR-0148P.
|
|
properties.partNumber
|
string
|
Onderdeelnummer van de gebruikte service. Kan worden gebruikt om deel te nemen aan het prijzenoverzicht. Niet beschikbaar voor Marketplace.
|
|
properties.payGPrice
|
number
(decimal)
|
Verkoopprijs voor de resource.
|
|
properties.planName
|
string
|
Plannaam.
|
|
properties.pricingModel
|
PricingModelType
|
Id die aangeeft hoe de meter wordt geprijsd.
|
|
properties.product
|
string
|
Productnaam voor de verbruikte service of aankoop. Niet beschikbaar voor Marketplace.
|
|
properties.productOrderId
|
string
|
Productorder-id. Voor reserveringen is dit de reserveringsorder-id.
|
|
properties.productOrderName
|
string
|
Productordernaam. Voor reserveringen is dit de SKU die is gekocht.
|
|
properties.publisherName
|
string
|
Naam van uitgever.
|
|
properties.publisherType
|
string
|
Type uitgever.
|
|
properties.quantity
|
number
(decimal)
|
De gebruikshoeveelheid.
|
|
properties.reservationId
|
string
|
ARM-resource-id van de reservering. Alleen van toepassing op records die relevant zijn voor reserveringen.
|
|
properties.reservationName
|
string
|
De gebruiker heeft de weergavenaam van de reservering opgegeven. De achternaam voor een bepaalde dag wordt ingevuld in de dagelijkse gegevens. Alleen van toepassing op records die relevant zijn voor reserveringen.
|
|
properties.resourceGroup
|
string
|
Naam van resourcegroep.
|
|
properties.resourceId
|
string
|
Unieke id van de Resource Manager-gebruiksgegevensresource van Azure Resource Manager.
|
|
properties.resourceLocation
|
string
|
Resourcelocatie.
|
|
properties.resourceName
|
string
|
Resourcenaam.
|
|
properties.serviceInfo1
|
string
|
Servicespecifieke metagegevens.
|
|
properties.serviceInfo2
|
string
|
Verouderd veld met optionele servicespecifieke metagegevens.
|
|
properties.subscriptionId
|
string
|
Abonnements-GUID.
|
|
properties.subscriptionName
|
string
|
Abonnementsnaam.
|
|
properties.term
|
string
|
Termijn (in maanden). 1 maand voor maandelijks terugkerende aankoop. 12 maanden voor een reservering van 1 jaar. 36 maanden voor een reservering van 3 jaar.
|
|
properties.unitPrice
|
number
(decimal)
|
Eenheidsprijs is de prijs die voor u van toepassing is. (uw EA- of andere contractprijs).
|
|
systemData
|
systemData
|
Azure Resource Manager-metagegevens met createdBy- en modifiedBy-gegevens.
|
|
tags
|
object
|
Resourcetags.
|
|
type
|
string
|
Het type bron. Bijvoorbeeld 'Microsoft.Compute/virtualMachines' of 'Microsoft.Storage/storageAccounts'
|
MeterDetailsResponse
Object
De eigenschappen van de meterdetails.
| Name |
Type |
Description |
|
meterCategory
|
string
|
De categorie van de meter, bijvoorbeeld 'Cloudservices', 'Netwerken', enzovoort.
|
|
meterName
|
string
|
De naam van de meter, binnen de opgegeven metercategorie
|
|
meterSubCategory
|
string
|
De subcategorie van de meter, bijvoorbeeld 'A6 Cloudservices', 'ExpressRoute (IXP)', enzovoort.
|
|
serviceFamily
|
string
|
De servicefamilie.
|
|
unitOfMeasure
|
string
|
De eenheid waarin het meterverbruik wordt in rekening gebracht, bijvoorbeeld 'Uren', 'GB', enzovoort.
|
Metrictype
Opsomming
| Waarde |
Description |
|
actualcost
|
Werkelijke kostengegevens.
|
|
amortizedcost
|
Afgeschreven kostengegevens.
|
|
usage
|
Gebruiksgegevens.
|
ModernUsageDetail
Object
Details van modern gebruik.
| Name |
Type |
Description |
|
etag
|
string
|
De etag voor de resource.
|
|
id
|
string
|
Volledig gekwalificeerde resource-id voor de resource. Vb.: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
kind
|
string:
modern
|
Hiermee geeft u het soort gebruiksgegevens op.
|
|
name
|
string
|
De naam van de resource
|
|
properties.additionalInfo
|
string
|
Aanvullende informatie over dit gebruiksitem. Gebruik dit veld om specifieke details over gebruiksregelitems op te halen, zoals de werkelijke VM-grootte (ServiceType) of de verhouding waarin de reserveringskorting wordt toegepast.
|
|
properties.benefitId
|
string
|
Unieke id voor het toepasselijke voordeel.
|
|
properties.benefitName
|
string
|
Naam van het toepasselijke voordeel.
|
|
properties.billingAccountId
|
string
|
Factureringsrekening-id.
|
|
properties.billingAccountName
|
string
|
Naam van de factureringsrekening.
|
|
properties.billingCurrencyCode
|
string
|
De valuta waarmee de gefactureerde kosten worden gedefinieerd.
|
|
properties.billingPeriodEndDate
|
string
(date-time)
|
Einddatum van factureringsperiode zoals in de factuur.
|
|
properties.billingPeriodStartDate
|
string
(date-time)
|
Begindatum van factureringsperiode zoals in de factuur.
|
|
properties.billingProfileId
|
string
|
Id voor het factureringsprofiel dat kosten groepeert op facturen in de enkele factureringsvaluta voor de klanten die de Microsoft-klantovereenkomst hebben toegevoegd en de klanten in CSP die rechtenaankopen hebben gedaan, zoals SaaS, Marketplace, RI, enzovoort.
|
|
properties.billingProfileName
|
string
|
Naam van het factureringsprofiel dat kosten groepeert op facturen in de enkele factureringsvaluta voor de klanten die de Microsoft-klantovereenkomst hebben onboarded en de klanten in CSP die rechten hebben gekocht, zoals SaaS, Marketplace, RI, enzovoort.
|
|
properties.chargeType
|
string
|
Hiermee wordt aangegeven dat er kosten in rekening worden gebracht voor tegoeden, gebruik, een Marketplace-aankoop, een reserveringskosten of een restitutie.
|
|
properties.consumedService
|
string
|
Naam van verbruikte service. Naam van de Azure-resourceprovider die het gebruik verzendt of is gekocht. Deze waarde is niet opgegeven voor marketplace-gebruik.
|
|
properties.costAllocationRuleName
|
string
|
Naam voor kostentoewijzingsregel.
|
|
properties.costCenter
|
string
|
De kostenplaats van deze afdeling als het een afdeling is en een kostenplaats wordt verstrekt.
|
|
properties.costInBillingCurrency
|
number
(decimal)
|
ExtendedCost of gemengde kosten vóór belasting in gefactureerde valuta.
|
|
properties.costInPricingCurrency
|
number
(decimal)
|
ExtendedCost of gemengde kosten vóór belasting in prijsvaluta om te correleren met prijzen.
|
|
properties.costInUSD
|
number
(decimal)
|
Geschatte extendedCost- of gemengde kosten vóór belasting in USD.
|
|
properties.customerName
|
string
|
Naam van de AAD-tenant van de klant.
|
|
properties.customerTenantId
|
string
|
Id van de AAD-tenant van de klant.
|
|
properties.date
|
string
(date-time)
|
Datum voor de gebruiksrecord.
|
|
properties.effectivePrice
|
number
(decimal)
|
Effectieve prijs die in rekening wordt gebracht voor het gebruik.
|
|
properties.exchangeRate
|
string
|
Wisselkoers die wordt gebruikt in conversie van prijsvaluta naar factureringsvaluta.
|
|
properties.exchangeRateDate
|
string
(date-time)
|
Datum waarop de wisselkoers die wordt gebruikt in conversie van prijsvaluta naar factureringsvaluta.
|
|
properties.exchangeRatePricingToBilling
|
number
(decimal)
|
Wisselkoers van prijsvaluta tot factureringsvaluta.
|
|
properties.frequency
|
string
|
Geeft aan hoe vaak deze kosten optreden. OneTime voor aankopen die slechts eenmaal plaatsvinden, maandelijks voor kosten die elke maand opnieuw worden uitgevoerd en UsageBased voor kosten op basis van hoeveel een service wordt gebruikt.
|
|
properties.instanceName
|
string
|
Exemplaarnaam.
|
|
properties.invoiceId
|
string
|
Factuur-id zoals op de factuur waar de specifieke transactie wordt weergegeven.
|
|
properties.invoiceSectionId
|
string
|
Id van het project dat in rekening wordt gebracht op de factuur. Niet van toepassing op Microsoft-klantovereenkomsten die door partners worden voorbereid.
|
|
properties.invoiceSectionName
|
string
|
De naam van het project dat in rekening wordt gebracht op de factuur. Niet van toepassing op Microsoft-klantovereenkomsten die door partners worden voorbereid.
|
|
properties.isAzureCreditEligible
|
boolean
|
Bepaalt of de kosten in aanmerking komen om te worden betaald voor het gebruik van Azure-tegoed.
|
|
properties.marketPrice
|
number
(decimal)
|
Marktprijs die in rekening wordt gebracht voor het gebruik.
|
|
properties.meterCategory
|
string
|
Identificeert de service op het hoogste niveau voor het gebruik.
|
|
properties.meterId
|
string
(uuid)
|
De meter-id (GUID). Niet beschikbaar voor Marketplace. Voor een gereserveerde instantie vertegenwoordigt dit de primaire meter waarvoor de reservering is gekocht. Zie productOrderName voor de werkelijke VM-grootte waarvoor de reservering is gekocht.
|
|
properties.meterName
|
string
|
Hiermee geeft u de naam van de meter aan waarmee het verbruik wordt gemeten.
|
|
properties.meterRegion
|
string
|
De datacenterlocatie voor bepaalde services waarbij de prijs is gebaseerd op de datacenterlocatie.
|
|
properties.meterSubCategory
|
string
|
Hiermee definieert u het type of de subcategorie van de Azure-service die van invloed kan zijn op de snelheid.
|
|
properties.partnerEarnedCreditApplied
|
string
|
Vlag om aan te geven of het verdiende tegoed van de partner is toegepast of niet.
|
|
properties.partnerEarnedCreditRate
|
number
(decimal)
|
Het kortingspercentage dat wordt toegepast als er een verdiend tegoed (PEC) van een partner is op basis van de koppelingstoegang van de partner.
|
|
properties.partnerName
|
string
|
Naam van de AAD-tenant van de partner.
|
|
properties.partnerTenantId
|
string
|
Id voor de AAD-tenant van de partner.
|
|
properties.payGPrice
|
number
(decimal)
|
Verkoopprijs voor de resource.
|
|
properties.paygCostInBillingCurrency
|
number
(decimal)
|
Het bedrag van de kosten voor betalen per gebruik vóór belasting in factureringsvaluta.
|
|
properties.paygCostInUSD
|
number
(decimal)
|
Het bedrag van de payg-kosten vóór belasting in amerikaanse dollarvaluta.
|
|
properties.previousInvoiceId
|
string
|
Naslaginformatie over een oorspronkelijke factuur is er een restitutie (negatieve kosten). Dit wordt alleen ingevuld wanneer er een restitutie is.
|
|
properties.pricingCurrencyCode
|
string
|
Factureringsvaluta voor prijzen.
|
|
properties.pricingModel
|
PricingModelType
|
Id die aangeeft hoe de meter wordt geprijsd
|
|
properties.product
|
string
|
Naam van het product dat kosten heeft opgebouwd per verbruik of aankoop, zoals vermeld in de factuur. Niet beschikbaar voor Marketplace.
|
|
properties.productIdentifier
|
string
|
Id voor het product dat kosten heeft opgebouwd per verbruik of aankoop. Dit is de samengevoegde sleutel van productId en SkuId in het partnercentrum.
|
|
properties.productOrderId
|
string
|
De id voor de naam van het asset- of Azure-plan waartoe het abonnement behoort. Bijvoorbeeld: Azure Plan. Voor reserveringen is dit de reserveringsorder-id.
|
|
properties.productOrderName
|
string
|
Productordernaam. Voor reserveringen is dit de SKU die is gekocht.
|
|
properties.provider
|
string
|
Id voor productcategorie of Line-Of-Business, Ex - Azure, Microsoft 365, AWS e.t.c
|
|
properties.publisherId
|
string
|
Uitgever-id.
|
|
properties.publisherName
|
string
|
Naam van de uitgever van de service, waaronder Uitgevers van Microsoft of Derden.
|
|
properties.publisherType
|
string
|
Type uitgever dat aangeeft of de uitgever de eerste partij, de externe wederverkoper of het agentschap van derden is.
|
|
properties.quantity
|
number
(decimal)
|
Meet de gekochte of verbruikte hoeveelheid. Het bedrag van de meter dat tijdens de factureringsperiode wordt gebruikt.
|
|
properties.resellerMpnId
|
string
|
MPNId voor de reseller die is gekoppeld aan het abonnement.
|
|
properties.resellerName
|
string
|
Naam van reseller.
|
|
properties.reservationId
|
string
|
ARM-resource-id van de reservering. Alleen van toepassing op records die relevant zijn voor reserveringen.
|
|
properties.reservationName
|
string
|
De gebruiker heeft de weergavenaam van de reservering opgegeven. De achternaam voor een bepaalde dag wordt ingevuld in de dagelijkse gegevens. Alleen van toepassing op records die relevant zijn voor reserveringen.
|
|
properties.resourceGroup
|
string
|
Naam van de Azure-resourcegroep die wordt gebruikt voor cohesief levenscyclusbeheer van resources.
|
|
properties.resourceLocation
|
string
|
Naam van de resourcelocatie.
|
|
properties.resourceLocationNormalized
|
string
|
Resourcelocatie genormaliseerd.
|
|
properties.serviceFamily
|
string
|
Vermeld de servicefamilie voor het product dat is gekocht of in rekening wordt gebracht (bijvoorbeeld: Opslag; Compute).
|
|
properties.serviceInfo1
|
string
|
Servicespecifieke metagegevens.
|
|
properties.serviceInfo2
|
string
|
Verouderd veld met optionele servicespecifieke metagegevens.
|
|
properties.servicePeriodEndDate
|
string
(date-time)
|
Einddatum voor de periode waarin het servicegebruik is beoordeeld voor kosten. De prijzen voor Azure-services worden bepaald op basis van de beoordelingsperiode.
|
|
properties.servicePeriodStartDate
|
string
(date-time)
|
Begindatum voor de beoordelingsperiode waarop het servicegebruik is beoordeeld voor kosten. De prijzen voor Azure-services worden bepaald voor de beoordelingsperiode.
|
|
properties.subscriptionGuid
|
string
|
Unieke door Microsoft gegenereerde id voor het Azure-abonnement.
|
|
properties.subscriptionName
|
string
|
Naam van het Azure-abonnement.
|
|
properties.term
|
string
|
Termijn (in maanden). Geeft de looptijd weer voor de geldigheid van de aanbieding. Bijvoorbeeld. In het geval van gereserveerde instanties wordt 12 maanden weergegeven voor een jaarlijkse termijn van gereserveerde instanties. Voor eenmalige aankopen of terugkerende aankopen worden de voorwaarden 1 maand weergegeven; Dit is niet van toepassing op Azure-verbruik.
|
|
properties.unitOfMeasure
|
string
|
Identificeert de eenheid waarin de service wordt in rekening gebracht. Bijvoorbeeld GB, uren, 10.000 s.
|
|
properties.unitPrice
|
number
(decimal)
|
Eenheidsprijs is de prijs die voor u van toepassing is. (uw EA- of andere contractprijs).
|
|
systemData
|
systemData
|
Azure Resource Manager-metagegevens met createdBy- en modifiedBy-gegevens.
|
|
tags
|
object
|
Resourcetags.
|
|
type
|
string
|
Het type bron. Bijvoorbeeld 'Microsoft.Compute/virtualMachines' of 'Microsoft.Storage/storageAccounts'
|
PricingModelType
Opsomming
Id die aangeeft hoe de meter wordt geprijsd.
| Waarde |
Description |
|
On Demand
|
|
|
Reservation
|
|
|
Spot
|
|
systemData
Object
Metagegevens met betrekking tot het maken en de laatste wijziging van de resource.
| Name |
Type |
Description |
|
createdAt
|
string
(date-time)
|
De tijdstempel van het maken van resources (UTC).
|
|
createdBy
|
string
|
De identiteit waarmee de resource is gemaakt.
|
|
createdByType
|
createdByType
|
Het type identiteit waarmee de resource is gemaakt.
|
|
lastModifiedAt
|
string
(date-time)
|
De tijdstempel van de laatste wijziging van de resource (UTC)
|
|
lastModifiedBy
|
string
|
De identiteit die de resource voor het laatst heeft gewijzigd.
|
|
lastModifiedByType
|
createdByType
|
Het type identiteit dat de resource voor het laatst heeft gewijzigd.
|
UsageDetailsKind
Opsomming
Hiermee geeft u het soort gebruiksgegevens op.
| Waarde |
Description |
|
legacy
|
|
|
modern
|
|
UsageDetailsListResult
Object
Resultaat van het weergeven van gebruiksgegevens. Het bevat een lijst met beschikbare gebruiksgegevens in omgekeerde chronologische volgorde per factureringsperiode.
| Name |
Type |
Description |
|
nextLink
|
string
|
De koppeling (URL) naar de volgende pagina met resultaten.
|
|
value
|
UsageDetail[]:
|
De lijst met gebruiksgegevens.
|