Alerts - Get

Pobiera alert dla zakresu według identyfikatora alertu.

GET https://management.azure.com/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}?api-version=2023-11-01

Parametry identyfikatora URI

Nazwa W Wymagane Typ Opis
alertId
path True

string

Identyfikator alertu

scope
path True

string

Zakres skojarzony z operacjami alertów. Obejmuje to ciąg "/subscriptions/{subscriptionId}/" dla zakresu subskrypcji, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}" dla zakresu grupy zasobów, "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}" dla zakresu konta rozliczeniowego i "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departmentId}" dla zakresu działu, "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{ enrollmentAccountId}" dla zakresu EnrollmentAccount, "/providers/Microsoft.Management/managementGroups/{managementGroupId} dla zakresu grupy zarządzania, "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" dla zakresu billingProfile, "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}" dla zakresu fakturySection i "/providers/Microsoft". Rozliczenia/rozliczeniaKonta/{billingAccountId}/customers/{customerId}' specyficzne dla partnerów.

api-version
query True

string

Wersja interfejsu API do użycia dla tej operacji.

Odpowiedzi

Nazwa Typ Opis
200 OK

Alert

OK. Żądanie zakończyło się pomyślnie.

Other Status Codes

ErrorResponse

Odpowiedź na błąd opisująca, dlaczego operacja nie powiodła się.

Zabezpieczenia

azure_auth

Przepływ OAuth2 usługi Azure Active Directory.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Nazwa Opis
user_impersonation personifikacja konta użytkownika

Przykłady

SingleResourceGroupAlerts
SingleSubscriptionAlerts

SingleResourceGroupAlerts

Sample Request

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/22222222-2222-2222-2222-222222222222?api-version=2023-11-01

Sample Response

{
  "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/22222222-2222-2222-2222-222222222222",
  "name": "22222222-2222-2222-2222-222222222222",
  "type": "Microsoft.CostManagement/alerts",
  "properties": {
    "definition": {
      "type": "Budget",
      "category": "Cost",
      "criteria": "CostThresholdExceeded"
    },
    "description": "",
    "source": "Preset",
    "details": {
      "timeGrainType": "Quarterly",
      "periodStartDate": "2020-03-01T00:00:00Z",
      "triggeredBy": "22222222-2222-2222-2222-222222222222_1_01",
      "resourceGroupFilter": [],
      "resourceFilter": [],
      "meterFilter": [],
      "tagFilter": {},
      "threshold": 0.8,
      "operator": "GreaterThan",
      "amount": 200000,
      "unit": "USD",
      "currentSpend": 161000.12,
      "contactEmails": [
        "1234@contoso.com"
      ],
      "contactGroups": [],
      "contactRoles": [],
      "overridingAlert": null
    },
    "costEntityId": "budget1",
    "status": "Active",
    "creationTime": "2020-04-27T11:07:52.7143901Z",
    "closeTime": "0001-01-01T00:00:00",
    "modificationTime": "2020-04-28T11:06:02.8999373Z",
    "statusModificationUserName": null,
    "statusModificationTime": "0001-01-01T00:00:00"
  }
}

SingleSubscriptionAlerts

Sample Request

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/22222222-2222-2222-2222-222222222222?api-version=2023-11-01

Sample Response

{
  "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/22222222-2222-2222-2222-222222222222",
  "name": "22222222-2222-2222-2222-222222222222",
  "type": "Microsoft.CostManagement/alerts",
  "properties": {
    "definition": {
      "type": "Budget",
      "category": "Cost",
      "criteria": "CostThresholdExceeded"
    },
    "description": "",
    "source": "Preset",
    "details": {
      "timeGrainType": "Quarterly",
      "periodStartDate": "2020-03-01T00:00:00Z",
      "triggeredBy": "22222222-2222-2222-2222-222222222222_1_01",
      "resourceGroupFilter": [],
      "resourceFilter": [],
      "meterFilter": [],
      "tagFilter": {},
      "threshold": 0.8,
      "operator": "GreaterThan",
      "amount": 200000,
      "unit": "USD",
      "currentSpend": 161000.12,
      "contactEmails": [
        "1234@contoso.com"
      ],
      "contactGroups": [],
      "contactRoles": [],
      "overridingAlert": null
    },
    "costEntityId": "budget1",
    "status": "Active",
    "creationTime": "2020-04-27T11:07:52.7143901Z",
    "closeTime": "0001-01-01T00:00:00",
    "modificationTime": "2020-04-28T11:06:02.8999373Z",
    "statusModificationUserName": null,
    "statusModificationTime": "0001-01-01T00:00:00"
  }
}

Definicje

Nazwa Opis
Alert

Pojedynczy alert.

AlertCategory

Kategoria alertu

AlertCriteria

Kryteria wyzwalające alert

AlertOperator

operator używany do porównywania wartości currentSpend z kwotą

AlertSource

Źródło alertu

AlertStatus

stan alertu

AlertTimeGrainType

Typ rytmu czasowego

AlertType

typ alertu

Definition

definiuje typ alertu

Details

Szczegóły alertu

ErrorDetails

Szczegóły błędu.

ErrorResponse

Odpowiedź na błąd wskazuje, że usługa nie może przetworzyć żądania przychodzącego. Przyczyna jest podana w komunikacie o błędzie.

Niektóre odpowiedzi na błędy:

  • 429 TooManyRequests — żądanie jest ograniczane. Ponów próbę po upływie czasu określonego w nagłówku "x-ms-ratelimit-microsoft.consumption-retry-after".

  • 503 ServiceUnavailable — usługa jest tymczasowo niedostępna. Poczekaj przez czas określony w nagłówku „Retry-After” i spróbuj ponownie.

TagFilter

tagi do filtrowania według

Alert

Pojedynczy alert.

Nazwa Typ Opis
eTag

string

eTag zasobu. Aby obsłużyć scenariusz aktualizacji współbieżnych, to pole będzie używane do określenia, czy użytkownik aktualizuje najnowszą wersję, czy nie.

id

string

Identyfikator zasobu.

name

string

Nazwa zasobu.

properties.closeTime

string

dateTime, w którym alert został zamknięty

properties.costEntityId

string

powiązany budżet

properties.creationTime

string

dateTime, w którym został utworzony alert

properties.definition

Definition

definiuje typ alertu

properties.description

string

Opis alertu

properties.details

Details

Szczegóły alertu

properties.modificationTime

string

dateTime, w którym alert został ostatnio zmodyfikowany

properties.source

AlertSource

Źródło alertu

properties.status

AlertStatus

stan alertu

properties.statusModificationTime

string

dateTime, w którym stan alertu został ostatnio zmodyfikowany

properties.statusModificationUserName

string

Użytkownik, który ostatnio zmodyfikował alert

type

string

Typ zasobu.

AlertCategory

Kategoria alertu

Nazwa Typ Opis
Billing

string

Cost

string

System

string

Usage

string

AlertCriteria

Kryteria wyzwalające alert

Nazwa Typ Opis
CostThresholdExceeded

string

CreditThresholdApproaching

string

CreditThresholdReached

string

CrossCloudCollectionError

string

CrossCloudNewDataAvailable

string

ForecastCostThresholdExceeded

string

ForecastUsageThresholdExceeded

string

GeneralThresholdError

string

InvoiceDueDateApproaching

string

InvoiceDueDateReached

string

MultiCurrency

string

QuotaThresholdApproaching

string

QuotaThresholdReached

string

UsageThresholdExceeded

string

AlertOperator

operator używany do porównywania wartości currentSpend z kwotą

Nazwa Typ Opis
EqualTo

string

GreaterThan

string

GreaterThanOrEqualTo

string

LessThan

string

LessThanOrEqualTo

string

None

string

AlertSource

Źródło alertu

Nazwa Typ Opis
Preset

string

User

string

AlertStatus

stan alertu

Nazwa Typ Opis
Active

string

Dismissed

string

None

string

Overridden

string

Resolved

string

AlertTimeGrainType

Typ rytmu czasowego

Nazwa Typ Opis
Annually

string

BillingAnnual

string

BillingMonth

string

BillingQuarter

string

Monthly

string

None

string

Quarterly

string

AlertType

typ alertu

Nazwa Typ Opis
Budget

string

BudgetForecast

string

Credit

string

General

string

Invoice

string

Quota

string

xCloud

string

Definition

definiuje typ alertu

Nazwa Typ Opis
category

AlertCategory

Kategoria alertu

criteria

AlertCriteria

Kryteria wyzwalające alert

type

AlertType

typ alertu

Details

Szczegóły alertu

Nazwa Typ Opis
amount

number

kwota progu budżetu

companyName

string

nazwa firmy

contactEmails

string[]

lista wiadomości e-mail do kontaktu

contactGroups

string[]

lista grup akcji do emisji do

contactRoles

string[]

lista ról kontaktów

currentSpend

number

bieżące wydatki

departmentName

string

nazwa działu

enrollmentEndDate

string

data/godzina rejestracjiEndDate

enrollmentNumber

string

numer rejestracji

enrollmentStartDate

string

data/godzina rejestracjiStartDate

invoicingThreshold

number

próg fakturowania

meterFilter

AlertProperties.details.MeterFilter[]

tablica mierników do filtrowania według

operator

AlertOperator

operator używany do porównywania wartości currentSpend z kwotą

overridingAlert

string

zastępowanie alertu

periodStartDate

string

data/godzina okresuStartDate

resourceFilter

AlertProperties.details.ResourceFilter[]

tablica zasobów do filtrowania według

resourceGroupFilter

AlertProperties.details.ResourceGroupFilter[]

tablica grup zasobów do filtrowania według

tagFilter

TagFilter

tagi do filtrowania według

threshold

number

wartość procentowa progu powiadomienia jako liczba dziesiętna, która uaktywniła ten alert

timeGrainType

AlertTimeGrainType

Typ rytmu czasowego

triggeredBy

string

notificationId, który wyzwolił ten alert

unit

string

jednostka używanej waluty

ErrorDetails

Szczegóły błędu.

Nazwa Typ Opis
code

string

Kod błędu.

message

string

Komunikat o błędzie wskazujący, dlaczego operacja nie powiodła się.

ErrorResponse

Odpowiedź na błąd wskazuje, że usługa nie może przetworzyć żądania przychodzącego. Przyczyna jest podana w komunikacie o błędzie.

Niektóre odpowiedzi na błędy:

  • 429 TooManyRequests — żądanie jest ograniczane. Ponów próbę po upływie czasu określonego w nagłówku "x-ms-ratelimit-microsoft.consumption-retry-after".

  • 503 ServiceUnavailable — usługa jest tymczasowo niedostępna. Poczekaj przez czas określony w nagłówku „Retry-After” i spróbuj ponownie.

Nazwa Typ Opis
error

ErrorDetails

Szczegóły błędu.

TagFilter

tagi do filtrowania według