Listet die Warnungen für den definierten Bereich auf.
GET https://management.azure.com/{scope}/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
URI-Parameter
| Name |
In |
Erforderlich |
Typ |
Beschreibung |
|
scope
|
path |
True
|
string
|
Der Bereich, der Warnungsvorgängen zugeordnet ist. Dies schließt "/subscriptions/{subscriptionId}/" für den Abonnementbereich ein, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' für resourceGroup-Bereich, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' für Abrechnungskontobereich und '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' für Abteilungsbereich, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{ enrollmentAccountId}' für enrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}, for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' für billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' für invoiceSection scope, and '/providers/Microsoft. Billing/billingAccounts/{billingAccountId}/customers/{customerId}' speziell für Partner.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
Die API-Version, die für diesen Vorgang verwendet werden soll.
|
Antworten
| Name |
Typ |
Beschreibung |
|
200 OK
|
AlertsResult
|
Der Azure-Vorgang wurde erfolgreich abgeschlossen.
|
|
Other Status Codes
|
ErrorResponse
|
Unerwartete Fehlerantwort.
|
Sicherheit
azure_auth
Azure Active Directory-OAuth2-Flow.
Typ:
oauth2
Ablauf:
implicit
Autorisierungs-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiche
| Name |
Beschreibung |
|
user_impersonation
|
Identitätswechsel ihres Benutzerkontos
|
Beispiele
BillingAccountAlerts
Beispielanforderung
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345-6789/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-costmanagement
# USAGE
python billing_account_alerts.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 = CostManagementClient(
credential=DefaultAzureCredential(),
)
response = client.alerts.list(
scope="providers/Microsoft.Billing/billingAccounts/12345-6789",
)
print(response)
# x-ms-original-file: 2025-03-01/BillingAccountAlerts.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 armcostmanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v3"
)
// Generated from example definition: 2025-03-01/BillingAccountAlerts.json
func ExampleAlertsClient_List_billingAccountAlerts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12345-6789", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcostmanagement.AlertsClientListResponse{
// AlertsResult: armcostmanagement.AlertsResult{
// Value: []*armcostmanagement.Alert{
// {
// Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345-6789/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// {
// Name: to.Ptr("11111111-1111-1111-111111111111"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345-6789/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"nextLink": null,
"value": [
{
"name": "00000000-0000-0000-0000-000000000000",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345-6789/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2020-04-27T11:07:52.7143901Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2020-04-28T11:06:02.8999373Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 161000.12,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
"unit": "USD"
}
}
},
{
"name": "11111111-1111-1111-111111111111",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345-6789/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2019-06-24T05:51:52.8713179Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2019-08-31T17:51:55.1808807Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 171000.32,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "11111111-1111-1111-111111111111_1_01",
"unit": "USD"
}
}
}
]
}
BillingProfileAlerts
Beispielanforderung
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-costmanagement
# USAGE
python billing_profile_alerts.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 = CostManagementClient(
credential=DefaultAzureCredential(),
)
response = client.alerts.list(
scope="providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579",
)
print(response)
# x-ms-original-file: 2025-03-01/BillingProfileAlerts.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 armcostmanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v3"
)
// Generated from example definition: 2025-03-01/BillingProfileAlerts.json
func ExampleAlertsClient_List_billingProfileAlerts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcostmanagement.AlertsClientListResponse{
// AlertsResult: armcostmanagement.AlertsResult{
// Value: []*armcostmanagement.Alert{
// {
// Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// {
// Name: to.Ptr("11111111-1111-1111-111111111111"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"nextLink": null,
"value": [
{
"name": "00000000-0000-0000-0000-000000000000",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2020-04-27T11:07:52.7143901Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2020-04-28T11:06:02.8999373Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 161000.12,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
"unit": "USD"
}
}
},
{
"name": "11111111-1111-1111-111111111111",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345-6789/billingProfiles/13579/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2019-06-24T05:51:52.8713179Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2019-08-31T17:51:55.1808807Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 171000.32,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "11111111-1111-1111-111111111111_1_01",
"unit": "USD"
}
}
}
]
}
DepartmentAlerts
Beispielanforderung
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-costmanagement
# USAGE
python department_alerts.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 = CostManagementClient(
credential=DefaultAzureCredential(),
)
response = client.alerts.list(
scope="providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123",
)
print(response)
# x-ms-original-file: 2025-03-01/DepartmentAlerts.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 armcostmanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v3"
)
// Generated from example definition: 2025-03-01/DepartmentAlerts.json
func ExampleAlertsClient_List_departmentAlerts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcostmanagement.AlertsClientListResponse{
// AlertsResult: armcostmanagement.AlertsResult{
// Value: []*armcostmanagement.Alert{
// {
// Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// {
// Name: to.Ptr("11111111-1111-1111-111111111111"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"nextLink": null,
"value": [
{
"name": "00000000-0000-0000-0000-000000000000",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2020-04-27T11:07:52.7143901Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2020-04-28T11:06:02.8999373Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 161000.12,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
"unit": "USD"
}
}
},
{
"name": "11111111-1111-1111-111111111111",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2019-06-24T05:51:52.8713179Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2019-08-31T17:51:55.1808807Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 171000.32,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "11111111-1111-1111-111111111111_1_01",
"unit": "USD"
}
}
}
]
}
EnrollmentAccountAlerts
Beispielanforderung
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-costmanagement
# USAGE
python enrollment_account_alerts.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 = CostManagementClient(
credential=DefaultAzureCredential(),
)
response = client.alerts.list(
scope="providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456",
)
print(response)
# x-ms-original-file: 2025-03-01/EnrollmentAccountAlerts.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 armcostmanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v3"
)
// Generated from example definition: 2025-03-01/EnrollmentAccountAlerts.json
func ExampleAlertsClient_List_enrollmentAccountAlerts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcostmanagement.AlertsClientListResponse{
// AlertsResult: armcostmanagement.AlertsResult{
// Value: []*armcostmanagement.Alert{
// {
// Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// {
// Name: to.Ptr("11111111-1111-1111-111111111111"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"nextLink": null,
"value": [
{
"name": "00000000-0000-0000-0000-000000000000",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2020-04-27T11:07:52.7143901Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2020-04-28T11:06:02.8999373Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 161000.12,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
"unit": "USD"
}
}
},
{
"name": "11111111-1111-1111-111111111111",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2019-06-24T05:51:52.8713179Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2019-08-31T17:51:55.1808807Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 171000.32,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "11111111-1111-1111-111111111111_1_01",
"unit": "USD"
}
}
}
]
}
InvoiceSectionAlerts
Beispielanforderung
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-costmanagement
# USAGE
python invoice_section_alerts.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 = CostManagementClient(
credential=DefaultAzureCredential(),
)
response = client.alerts.list(
scope="providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876",
)
print(response)
# x-ms-original-file: 2025-03-01/InvoiceSectionAlerts.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 armcostmanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v3"
)
// Generated from example definition: 2025-03-01/InvoiceSectionAlerts.json
func ExampleAlertsClient_List_invoiceSectionAlerts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcostmanagement.AlertsClientListResponse{
// AlertsResult: armcostmanagement.AlertsResult{
// Value: []*armcostmanagement.Alert{
// {
// Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// {
// Name: to.Ptr("11111111-1111-1111-111111111111"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"nextLink": null,
"value": [
{
"name": "00000000-0000-0000-0000-000000000000",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2020-04-27T11:07:52.7143901Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2020-04-28T11:06:02.8999373Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 161000.12,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
"unit": "USD"
}
}
},
{
"name": "11111111-1111-1111-111111111111",
"type": "Microsoft.CostManagement/alerts",
"id": "/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2019-06-24T05:51:52.8713179Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2019-08-31T17:51:55.1808807Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 171000.32,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "11111111-1111-1111-111111111111_1_01",
"unit": "USD"
}
}
}
]
}
ResourceGroupAlerts
Beispielanforderung
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-costmanagement
# USAGE
python resource_group_alerts.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 = CostManagementClient(
credential=DefaultAzureCredential(),
)
response = client.alerts.list(
scope="subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer",
)
print(response)
# x-ms-original-file: 2025-03-01/ResourceGroupAlerts.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 armcostmanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v3"
)
// Generated from example definition: 2025-03-01/ResourceGroupAlerts.json
func ExampleAlertsClient_List_resourceGroupAlerts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcostmanagement.AlertsClientListResponse{
// AlertsResult: armcostmanagement.AlertsResult{
// Value: []*armcostmanagement.Alert{
// {
// Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// {
// Name: to.Ptr("11111111-1111-1111-111111111111"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"nextLink": null,
"value": [
{
"name": "00000000-0000-0000-0000-000000000000",
"type": "Microsoft.CostManagement/alerts",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2020-04-27T11:07:52.7143901Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2020-04-28T11:06:02.8999373Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 161000.12,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
"unit": "USD"
}
}
},
{
"name": "11111111-1111-1111-111111111111",
"type": "Microsoft.CostManagement/alerts",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2019-06-24T05:51:52.8713179Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2019-08-31T17:51:55.1808807Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 171000.32,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "11111111-1111-1111-111111111111_1_01",
"unit": "USD"
}
}
}
]
}
SubscriptionAlerts
Beispielanforderung
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.costmanagement import CostManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-costmanagement
# USAGE
python subscription_alerts.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 = CostManagementClient(
credential=DefaultAzureCredential(),
)
response = client.alerts.list(
scope="subscriptions/00000000-0000-0000-0000-000000000000",
)
print(response)
# x-ms-original-file: 2025-03-01/SubscriptionAlerts.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 armcostmanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v3"
)
// Generated from example definition: 2025-03-01/SubscriptionAlerts.json
func ExampleAlertsClient_List_subscriptionAlerts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcostmanagement.AlertsClientListResponse{
// AlertsResult: armcostmanagement.AlertsResult{
// Value: []*armcostmanagement.Alert{
// {
// Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// {
// Name: to.Ptr("11111111-1111-1111-111111111111"),
// Type: to.Ptr("Microsoft.CostManagement/alerts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// Properties: &armcostmanagement.AlertProperties{
// Description: to.Ptr(""),
// CloseTime: to.Ptr("0001-01-01T00:00:00"),
// CostEntityID: to.Ptr("budget1"),
// CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// Definition: &armcostmanagement.AlertPropertiesDefinition{
// Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// },
// ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// Status: to.Ptr(armcostmanagement.AlertStatusActive),
// StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// Details: &armcostmanagement.AlertPropertiesDetails{
// ContactEmails: []*string{
// to.Ptr("1234@contoso.com"),
// },
// ContactGroups: []*string{
// },
// ContactRoles: []*string{
// },
// MeterFilter: []any{
// },
// Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// ResourceFilter: []any{
// },
// ResourceGroupFilter: []any{
// },
// TagFilter: map[string]any{
// },
// TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// Unit: to.Ptr("USD"),
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"nextLink": null,
"value": [
{
"name": "00000000-0000-0000-0000-000000000000",
"type": "Microsoft.CostManagement/alerts",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2020-04-27T11:07:52.7143901Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2020-04-28T11:06:02.8999373Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 161000.12,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "00000000-0000-0000-0000-000000000000_1_01",
"unit": "USD"
}
}
},
{
"name": "11111111-1111-1111-111111111111",
"type": "Microsoft.CostManagement/alerts",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111",
"properties": {
"description": "",
"closeTime": "0001-01-01T00:00:00",
"costEntityId": "budget1",
"creationTime": "2019-06-24T05:51:52.8713179Z",
"definition": {
"type": "Budget",
"category": "Cost",
"criteria": "CostThresholdExceeded"
},
"modificationTime": "2019-08-31T17:51:55.1808807Z",
"source": "Preset",
"status": "Active",
"statusModificationTime": "0001-01-01T00:00:00",
"statusModificationUserName": null,
"details": {
"amount": 200000,
"contactEmails": [
"1234@contoso.com"
],
"contactGroups": [],
"contactRoles": [],
"currentSpend": 171000.32,
"meterFilter": [],
"operator": "GreaterThan",
"overridingAlert": null,
"periodStartDate": "2020-03-01T00:00:00Z",
"resourceFilter": [],
"resourceGroupFilter": [],
"tagFilter": {},
"threshold": 0.8,
"timeGrainType": "Quarterly",
"triggeredBy": "11111111-1111-1111-111111111111_1_01",
"unit": "USD"
}
}
}
]
}
Definitionen
| Name |
Beschreibung |
|
Alert
|
Eine einzelne Warnung.
|
|
AlertCategory
|
Kategorie „Warnung“
|
|
AlertCriteria
|
Kriterien, die Warnung ausgelöst haben
|
|
AlertOperator
|
Operator, der verwendet wird, um currentSpend mit Betrag zu vergleichen
|
|
AlertPropertiesDefinition
|
definiert den Typ der Warnung.
|
|
AlertPropertiesDetails
|
Warnungsdetails
|
|
AlertSource
|
Quelle der Warnung
|
|
AlertsResult
|
Ergebnis von Warnungen.
|
|
AlertStatus
|
Warnungsstatus
|
|
AlertTimeGrainType
|
Art des Zeitgrainrhythmus
|
|
AlertType
|
Warnungstyp
|
|
createdByType
|
Der Identitätstyp, der die Ressource erstellt hat.
|
|
ErrorDetails
|
Die Details des Fehlers.
|
|
ErrorResponse
|
Fehlerantwort gibt an, dass der Dienst die eingehende Anforderung nicht verarbeiten kann. Der Grund wird in der Fehlermeldung angegeben. \n\nEinige Fehlerantworten: \n\n * 429 TooManyRequests – Anfrage wird gedrosselt. Wiederholen Sie den Vorgang nach dem Warten auf die im Header "x-ms-ratelimit-microsoft.consumption-retry-after" angegebene Zeit. \n\n * 503 Service Nicht verfügbar – Service ist vorübergehend nicht verfügbar. Wiederholen Sie den Vorgang nach dem Warten auf die im Header "Retry-After" angegebene Zeit.
|
|
systemData
|
Metadaten zur Erstellung und letzten Änderung der Ressource.
|
Alert
Objekt
Eine einzelne Warnung.
| Name |
Typ |
Beschreibung |
|
eTag
|
string
|
eTag der Ressource. Um das Szenario für gleichzeitige Updates zu behandeln, wird dieses Feld verwendet, um zu bestimmen, ob der Benutzer die neueste Version aktualisiert oder nicht.
|
|
id
|
string
(arm-id)
|
Vollqualifizierte Ressourcen-ID für die Ressource. Z. B. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
name
|
string
|
Der Name der Ressource
|
|
properties.closeTime
|
string
|
dateTime, in der die Warnung geschlossen wurde
|
|
properties.costEntityId
|
string
|
Verwandtes Budget
|
|
properties.creationTime
|
string
|
dateTime, in der die Warnung erstellt wurde
|
|
properties.definition
|
AlertPropertiesDefinition
|
definiert den Typ der Warnung.
|
|
properties.description
|
string
|
Warnungsbeschreibung
|
|
properties.details
|
AlertPropertiesDetails
|
Warnungsdetails
|
|
properties.modificationTime
|
string
|
dateTime, in der die Warnung zuletzt geändert wurde
|
|
properties.source
|
AlertSource
|
Quelle der Warnung
|
|
properties.status
|
AlertStatus
|
Warnungsstatus
|
|
properties.statusModificationTime
|
string
|
dateTime, in der der Warnungsstatus zuletzt geändert wurde
|
|
properties.statusModificationUserName
|
string
|
Benutzer, der die Benachrichtigung zuletzt geändert hat
|
|
systemData
|
systemData
|
Azure Resource Manager-Metadaten, die createdBy- und modifiedBy-Informationen enthalten.
|
|
type
|
string
|
Der Typ der Ressource. Z. B. "Microsoft.Compute/virtualMachines" oder "Microsoft.Storage/storageAccounts"
|
AlertCategory
Enumeration
Kategorie „Warnung“
| Wert |
Beschreibung |
|
Cost
|
|
|
Usage
|
|
|
Billing
|
|
|
System
|
|
AlertCriteria
Enumeration
Kriterien, die Warnung ausgelöst haben
| Wert |
Beschreibung |
|
CostThresholdExceeded
|
|
|
UsageThresholdExceeded
|
|
|
CreditThresholdApproaching
|
|
|
CreditThresholdReached
|
|
|
QuotaThresholdApproaching
|
|
|
QuotaThresholdReached
|
|
|
MultiCurrency
|
|
|
ForecastCostThresholdExceeded
|
|
|
ForecastUsageThresholdExceeded
|
|
|
InvoiceDueDateApproaching
|
|
|
InvoiceDueDateReached
|
|
|
CrossCloudNewDataAvailable
|
|
|
CrossCloudCollectionError
|
|
|
GeneralThresholdError
|
|
AlertOperator
Enumeration
Operator, der verwendet wird, um currentSpend mit Betrag zu vergleichen
| Wert |
Beschreibung |
|
None
|
|
|
EqualTo
|
|
|
GreaterThan
|
|
|
GreaterThanOrEqualTo
|
|
|
LessThan
|
|
|
LessThanOrEqualTo
|
|
AlertPropertiesDefinition
Objekt
definiert den Typ der Warnung.
AlertPropertiesDetails
Objekt
Warnungsdetails
| Name |
Typ |
Beschreibung |
|
amount
|
number
(decimal)
|
Budgetschwellenwert
|
|
companyName
|
string
|
Name des Unternehmens
|
|
contactEmails
|
string[]
|
Liste der zu kontaktierenden E-Mails
|
|
contactGroups
|
string[]
|
Liste der zu übertragenden Aktionsgruppen
|
|
contactRoles
|
string[]
|
Liste der Kontaktrollen
|
|
currentSpend
|
number
(decimal)
|
aktuelle Ausgaben
|
|
departmentName
|
string
|
Abteilungsname
|
|
enrollmentEndDate
|
string
|
DatumUhrzeit der EinschreibungEndeDatum
|
|
enrollmentNumber
|
string
|
Registrierungsnummer
|
|
enrollmentStartDate
|
string
|
DatumUhrzeit der EinschreibungStartDatum
|
|
invoicingThreshold
|
number
(decimal)
|
Rechnungsschwellenwert
|
|
meterFilter
|
MeterFilter[]
|
Array von Zählern, nach der gefiltert werden soll
|
|
operator
|
AlertOperator
|
Operator, der verwendet wird, um currentSpend mit Betrag zu vergleichen
|
|
overridingAlert
|
string
|
Außerkraftsetzungswarnung
|
|
periodStartDate
|
string
|
DatumUhrzeit des ZeitraumsStartDatum
|
|
resourceFilter
|
ResourceFilter[]
|
Array von Ressourcen, nach der gefiltert werden soll
|
|
resourceGroupFilter
|
ResourceGroupFilter[]
|
Array von resourceGroups, nach der gefiltert werden soll
|
|
tagFilter
|
|
zu filternde Tags nach
|
|
threshold
|
number
(decimal)
|
Prozentsatz des Benachrichtigungsschwellenwerts als Dezimalzahl, die diese Warnung aktiviert hat
|
|
timeGrainType
|
AlertTimeGrainType
|
Art des Zeitgrainrhythmus
|
|
triggeredBy
|
string
|
notificationId, die diese Warnung ausgelöst hat
|
|
unit
|
string
|
Währungseinheit, die verwendet wird
|
AlertSource
Enumeration
Quelle der Warnung
| Wert |
Beschreibung |
|
Preset
|
|
|
User
|
|
AlertsResult
Objekt
Ergebnis von Warnungen.
| Name |
Typ |
Beschreibung |
|
nextLink
|
string
|
URL zum Abrufen des nächsten Satzes von Warnungsergebnissen, falls vorhanden.
|
|
value
|
Alert[]
|
Liste der Warnungen.
|
AlertStatus
Enumeration
Warnungsstatus
| Wert |
Beschreibung |
|
None
|
|
|
Active
|
|
|
Overridden
|
|
|
Resolved
|
|
|
Dismissed
|
|
AlertTimeGrainType
Enumeration
Art des Zeitgrainrhythmus
| Wert |
Beschreibung |
|
None
|
|
|
Monthly
|
|
|
Quarterly
|
|
|
Annually
|
|
|
BillingMonth
|
|
|
BillingQuarter
|
|
|
BillingAnnual
|
|
AlertType
Enumeration
Warnungstyp
| Wert |
Beschreibung |
|
Budget
|
|
|
Invoice
|
|
|
Credit
|
|
|
Quota
|
|
|
General
|
|
|
xCloud
|
|
|
BudgetForecast
|
|
createdByType
Enumeration
Der Identitätstyp, der die Ressource erstellt hat.
| Wert |
Beschreibung |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
ErrorDetails
Objekt
Die Details des Fehlers.
| Name |
Typ |
Beschreibung |
|
code
|
string
|
Fehlercode.
|
|
message
|
string
|
Fehlermeldung, die angibt, warum der Vorgang fehlgeschlagen ist.
|
ErrorResponse
Objekt
Fehlerantwort gibt an, dass der Dienst die eingehende Anforderung nicht verarbeiten kann. Der Grund wird in der Fehlermeldung angegeben. \n\nEinige Fehlerantworten: \n\n * 429 TooManyRequests – Anfrage wird gedrosselt. Wiederholen Sie den Vorgang nach dem Warten auf die im Header "x-ms-ratelimit-microsoft.consumption-retry-after" angegebene Zeit. \n\n * 503 Service Nicht verfügbar – Service ist vorübergehend nicht verfügbar. Wiederholen Sie den Vorgang nach dem Warten auf die im Header "Retry-After" angegebene Zeit.
| Name |
Typ |
Beschreibung |
|
error
|
ErrorDetails
|
Die Details des Fehlers.
|
systemData
Objekt
Metadaten zur Erstellung und letzten Änderung der Ressource.
| Name |
Typ |
Beschreibung |
|
createdAt
|
string
(date-time)
|
Der Zeitstempel der Ressourcenerstellung (UTC).
|
|
createdBy
|
string
|
Die Identität, die die Ressource erstellt hat.
|
|
createdByType
|
createdByType
|
Der Identitätstyp, der die Ressource erstellt hat.
|
|
lastModifiedAt
|
string
(date-time)
|
Der Zeitstempel der letzten Änderung der Ressource (UTC)
|
|
lastModifiedBy
|
string
|
Die Identität, die die Ressource zuletzt geändert hat.
|
|
lastModifiedByType
|
createdByType
|
Der Identitätstyp, der die Ressource zuletzt geändert hat.
|