Получить определение правила предупреждения.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}?api-version=2024-03-01-preview
Параметры URI
| Имя |
В |
Обязательно |
Тип |
Описание |
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Имя группы ресурсов. Имя не зависит от регистра.
|
|
ruleName
|
path |
True
|
string
|
Имя правила.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
Идентификатор целевой подписки. Значение должно быть Универсальным Уникальным Идентификатором (UUID).
|
|
api-version
|
query |
True
|
string
minLength: 1
|
Версия API, используемая для данной операции.
|
Ответы
Безопасность
azure_auth
Поток OAuth2 в Azure Active Directory.
Тип:
oauth2
Flow:
implicit
URL-адрес авторизации:
https://login.microsoftonline.com/common/oauth2/authorize
Области
| Имя |
Описание |
|
user_impersonation
|
олицетворения учетной записи пользователя
|
Примеры
Get a dynamic alert rule for multiple resources
Образец запроса
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/MetricAlertOnMultipleResources?api-version=2024-03-01-preview
from azure.identity import DefaultAzureCredential
from azure.mgmt.monitor import MonitorManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-monitor
# USAGE
python get_dynamic_metric_alert_multiple_resource.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 = MonitorManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.metric_alerts.get(
resource_group_name="gigtest",
rule_name="MetricAlertOnMultipleResources",
)
print(response)
# x-ms-original-file: 2024-03-01-preview/getDynamicMetricAlertMultipleResource.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 armmonitor_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
)
// Generated from example definition: 2024-03-01-preview/getDynamicMetricAlertMultipleResource.json
func ExampleMetricAlertsClient_Get_getADynamicAlertRuleForMultipleResources() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricAlertsClient().Get(ctx, "gigtest", "MetricAlertOnMultipleResources", 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 = armmonitor.MetricAlertsClientGetResponse{
// MetricAlertResource: armmonitor.MetricAlertResource{
// Type: to.Ptr("Microsoft.Insights/metricAlerts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertOnMultipleResources"),
// Location: to.Ptr("global"),
// Properties: &armmonitor.MetricAlertProperties{
// Description: to.Ptr("This is the description of the rule1"),
// Actions: []*armmonitor.MetricAlertAction{
// {
// ActionGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
// WebHookProperties: map[string]*string{
// "key11": to.Ptr("value11"),
// "key12": to.Ptr("value12"),
// },
// },
// },
// AutoMitigate: to.Ptr(false),
// Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{
// AllOf: []armmonitor.MultiMetricCriteriaClassification{
// &armmonitor.DynamicMetricCriteria{
// Name: to.Ptr("High_CPU_80"),
// AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium),
// CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion),
// Dimensions: []*armmonitor.MetricDimension{
// },
// FailingPeriods: &armmonitor.DynamicThresholdFailingPeriods{
// MinFailingPeriodsToAlert: to.Ptr[float32](4),
// NumberOfEvaluationPeriods: to.Ptr[float32](4),
// },
// MetricName: to.Ptr("Percentage CPU"),
// MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"),
// Operator: to.Ptr(armmonitor.DynamicThresholdOperatorGreaterOrLessThan),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// Enabled: to.Ptr(true),
// EvaluationFrequency: to.Ptr("PT1M"),
// Scopes: []*string{
// to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1"),
// to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2"),
// },
// Severity: to.Ptr[int32](3),
// TargetResourceRegion: to.Ptr("southcentralus"),
// TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"),
// WindowSize: to.Ptr("PT15M"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MonitorClient } = require("@azure/arm-monitor");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to retrieve an alert rule definition.
*
* @summary retrieve an alert rule definition.
* x-ms-original-file: 2024-03-01-preview/getDynamicMetricAlertMultipleResource.json
*/
async function getADynamicAlertRuleForMultipleResources() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new MonitorClient(credential, subscriptionId);
const result = await client.metricAlerts.get("gigtest", "MetricAlertOnMultipleResources");
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"type": "Microsoft.Insights/metricAlerts",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/microsoft.insights/metricalerts/MetricAlertOnMultipleResources",
"location": "global",
"properties": {
"description": "This is the description of the rule1",
"actions": [
{
"actionGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
"webHookProperties": {
"key11": "value11",
"key12": "value12"
}
}
],
"autoMitigate": false,
"criteria": {
"allOf": [
{
"name": "High_CPU_80",
"alertSensitivity": "Medium",
"criterionType": "DynamicThresholdCriterion",
"dimensions": [],
"failingPeriods": {
"minFailingPeriodsToAlert": 4,
"numberOfEvaluationPeriods": 4
},
"metricName": "Percentage CPU",
"metricNamespace": "microsoft.compute/virtualmachines",
"operator": "GreaterOrLessThan",
"timeAggregation": "Average"
}
],
"odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"
},
"enabled": true,
"evaluationFrequency": "PT1M",
"scopes": [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2"
],
"severity": 3,
"targetResourceRegion": "southcentralus",
"targetResourceType": "Microsoft.Compute/virtualMachines",
"windowSize": "PT15M"
},
"tags": {
"hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
}
}
Get a dynamic alert rule for single resource
Образец запроса
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/chiricutin?api-version=2024-03-01-preview
from azure.identity import DefaultAzureCredential
from azure.mgmt.monitor import MonitorManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-monitor
# USAGE
python get_dynamic_metric_alert_single_resource.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 = MonitorManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.metric_alerts.get(
resource_group_name="gigtest",
rule_name="chiricutin",
)
print(response)
# x-ms-original-file: 2024-03-01-preview/getDynamicMetricAlertSingleResource.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 armmonitor_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
)
// Generated from example definition: 2024-03-01-preview/getDynamicMetricAlertSingleResource.json
func ExampleMetricAlertsClient_Get_getADynamicAlertRuleForSingleResource() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricAlertsClient().Get(ctx, "gigtest", "chiricutin", 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 = armmonitor.MetricAlertsClientGetResponse{
// MetricAlertResource: armmonitor.MetricAlertResource{
// Type: to.Ptr("Microsoft.Insights/metricAlerts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin"),
// Location: to.Ptr("global"),
// Properties: &armmonitor.MetricAlertProperties{
// Description: to.Ptr("This is the description of the rule1"),
// Actions: []*armmonitor.MetricAlertAction{
// {
// ActionGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
// WebHookProperties: map[string]*string{
// "key11": to.Ptr("value11"),
// "key12": to.Ptr("value12"),
// },
// },
// },
// AutoMitigate: to.Ptr(false),
// Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{
// AllOf: []armmonitor.MultiMetricCriteriaClassification{
// &armmonitor.DynamicMetricCriteria{
// Name: to.Ptr("High_CPU_80"),
// AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium),
// CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion),
// Dimensions: []*armmonitor.MetricDimension{
// },
// FailingPeriods: &armmonitor.DynamicThresholdFailingPeriods{
// MinFailingPeriodsToAlert: to.Ptr[float32](4),
// NumberOfEvaluationPeriods: to.Ptr[float32](4),
// },
// MetricName: to.Ptr("Percentage CPU"),
// MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"),
// Operator: to.Ptr(armmonitor.DynamicThresholdOperatorGreaterOrLessThan),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// Enabled: to.Ptr(true),
// EvaluationFrequency: to.Ptr("PT1M"),
// Scopes: []*string{
// to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"),
// },
// Severity: to.Ptr[int32](3),
// WindowSize: to.Ptr("PT15M"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MonitorClient } = require("@azure/arm-monitor");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to retrieve an alert rule definition.
*
* @summary retrieve an alert rule definition.
* x-ms-original-file: 2024-03-01-preview/getDynamicMetricAlertSingleResource.json
*/
async function getADynamicAlertRuleForSingleResource() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new MonitorClient(credential, subscriptionId);
const result = await client.metricAlerts.get("gigtest", "chiricutin");
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"type": "Microsoft.Insights/metricAlerts",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/microsoft.insights/metricalerts/chiricutin",
"location": "global",
"properties": {
"description": "This is the description of the rule1",
"actions": [
{
"actionGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
"webHookProperties": {
"key11": "value11",
"key12": "value12"
}
}
],
"autoMitigate": false,
"criteria": {
"allOf": [
{
"name": "High_CPU_80",
"alertSensitivity": "Medium",
"criterionType": "DynamicThresholdCriterion",
"dimensions": [],
"failingPeriods": {
"minFailingPeriodsToAlert": 4,
"numberOfEvaluationPeriods": 4
},
"ignoreDataBefore": null,
"metricName": "Percentage CPU",
"metricNamespace": "microsoft.compute/virtualmachines",
"operator": "GreaterOrLessThan",
"timeAggregation": "Average"
}
],
"odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"
},
"enabled": true,
"evaluationFrequency": "PT1M",
"scopes": [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"
],
"severity": 3,
"windowSize": "PT15M"
},
"tags": {
"hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
}
}
Get a query based alert rule
Образец запроса
GET https://management.azure.com/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/chiricutin?api-version=2024-03-01-preview
from azure.identity import DefaultAzureCredential
from azure.mgmt.monitor import MonitorManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-monitor
# USAGE
python get_metric_alert_query.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 = MonitorManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.metric_alerts.get(
resource_group_name="gigtest",
rule_name="chiricutin",
)
print(response)
# x-ms-original-file: 2024-03-01-preview/getMetricAlertQuery.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 armmonitor_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
)
// Generated from example definition: 2024-03-01-preview/getMetricAlertQuery.json
func ExampleMetricAlertsClient_Get_getAQueryBasedAlertRule() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricAlertsClient().Get(ctx, "gigtest", "chiricutin", 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 = armmonitor.MetricAlertsClientGetResponse{
// MetricAlertResource: armmonitor.MetricAlertResource{
// Type: to.Ptr("Microsoft.Insights/metricAlerts"),
// ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin"),
// Identity: &armmonitor.Identity{
// Type: to.Ptr(armmonitor.IdentityTypeUserAssigned),
// TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// UserAssignedIdentities: map[string]*armmonitor.UserIdentityProperties{
// "/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": &armmonitor.UserIdentityProperties{
// ClientID: to.Ptr("778f4d04-3c60-4622-a839-5cf05866c983"),
// PrincipalID: to.Ptr("669dd76d-cde8-4dc3-b882-1de566b0c628"),
// },
// },
// },
// Location: to.Ptr("eastus"),
// Properties: &armmonitor.MetricAlertProperties{
// Description: to.Ptr("This is the description of the rule1"),
// Actions: []*armmonitor.MetricAlertAction{
// {
// ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
// WebHookProperties: map[string]*string{
// "key11": to.Ptr("value11"),
// "key12": to.Ptr("value12"),
// },
// },
// },
// Criteria: &armmonitor.PromQLCriteria{
// AllOf: []armmonitor.MultiPromQLCriteriaClassification{
// &armmonitor.StaticPromQLCriteria{
// Name: to.Ptr("Metric1"),
// CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
// Query: to.Ptr("floor(minute(vector(time())) / 10 ) % 2 == 1"),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorPromQLCriteria),
// },
// Enabled: to.Ptr(true),
// EvaluationFrequency: to.Ptr("PT1M"),
// ResolveConfiguration: &armmonitor.ResolveConfiguration{
// AutoResolved: to.Ptr(true),
// TimeToResolve: to.Ptr("PT10M"),
// },
// Scopes: []*string{
// to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.monitor/accounts/gigwadme"),
// },
// Severity: to.Ptr[int32](3),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MonitorClient } = require("@azure/arm-monitor");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to retrieve an alert rule definition.
*
* @summary retrieve an alert rule definition.
* x-ms-original-file: 2024-03-01-preview/getMetricAlertQuery.json
*/
async function getAQueryBasedAlertRule() {
const credential = new DefaultAzureCredential();
const subscriptionId = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7";
const client = new MonitorClient(credential, subscriptionId);
const result = await client.metricAlerts.get("gigtest", "chiricutin");
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"type": "Microsoft.Insights/metricAlerts",
"id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.insights/metricalerts/chiricutin",
"identity": {
"type": "UserAssigned",
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"userAssignedIdentities": {
"/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": {
"clientId": "778f4d04-3c60-4622-a839-5cf05866c983",
"principalId": "669dd76d-cde8-4dc3-b882-1de566b0c628"
}
}
},
"location": "eastus",
"properties": {
"description": "This is the description of the rule1",
"actions": [
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
"webHookProperties": {
"key11": "value11",
"key12": "value12"
}
}
],
"criteria": {
"allOf": [
{
"name": "Metric1",
"criterionType": "StaticThresholdCriterion",
"query": "floor(minute(vector(time())) / 10 ) % 2 == 1"
}
],
"odata.type": "Microsoft.Azure.Monitor.PromQLCriteria"
},
"enabled": true,
"evaluationFrequency": "PT1M",
"resolveConfiguration": {
"autoResolved": true,
"timeToResolve": "PT10M"
},
"scopes": [
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.monitor/accounts/gigwadme"
],
"severity": 3
},
"tags": {
"hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
}
}
Get a web test alert rule
Образец запроса
GET https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789101/resourceGroups/rg-example/providers/Microsoft.Insights/metricAlerts/webtest-name-example?api-version=2024-03-01-preview
from azure.identity import DefaultAzureCredential
from azure.mgmt.monitor import MonitorManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-monitor
# USAGE
python get_web_test_metric_alert.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 = MonitorManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.metric_alerts.get(
resource_group_name="rg-example",
rule_name="webtest-name-example",
)
print(response)
# x-ms-original-file: 2024-03-01-preview/getWebTestMetricAlert.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 armmonitor_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
)
// Generated from example definition: 2024-03-01-preview/getWebTestMetricAlert.json
func ExampleMetricAlertsClient_Get_getAWebTestAlertRule() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("12345678-1234-1234-1234-123456789101", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricAlertsClient().Get(ctx, "rg-example", "webtest-name-example", 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 = armmonitor.MetricAlertsClientGetResponse{
// MetricAlertResource: armmonitor.MetricAlertResource{
// Name: to.Ptr("webtest-name-example"),
// Type: to.Ptr("Microsoft.Insights/metricAlerts"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/metricalerts/webtest-name-example"),
// Location: to.Ptr("global"),
// Properties: &armmonitor.MetricAlertProperties{
// Description: to.Ptr("Automatically created alert rule for availability test \"webtest-name-example\""),
// Actions: []*armmonitor.MetricAlertAction{
// },
// Criteria: &armmonitor.WebtestLocationAvailabilityCriteria{
// ComponentID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example"),
// FailedLocationCount: to.Ptr[float32](2),
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria),
// WebTestID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example"),
// },
// Enabled: to.Ptr(true),
// EvaluationFrequency: to.Ptr("PT1M"),
// Scopes: []*string{
// to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example"),
// to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example"),
// },
// Severity: to.Ptr[int32](4),
// WindowSize: to.Ptr("PT15M"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example": to.Ptr("Resource"),
// "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example": to.Ptr("Resource"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MonitorClient } = require("@azure/arm-monitor");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to retrieve an alert rule definition.
*
* @summary retrieve an alert rule definition.
* x-ms-original-file: 2024-03-01-preview/getWebTestMetricAlert.json
*/
async function getAWebTestAlertRule() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789101";
const client = new MonitorClient(credential, subscriptionId);
const result = await client.metricAlerts.get("rg-example", "webtest-name-example");
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"name": "webtest-name-example",
"type": "Microsoft.Insights/metricAlerts",
"id": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/metricalerts/webtest-name-example",
"location": "global",
"properties": {
"description": "Automatically created alert rule for availability test \"webtest-name-example\"",
"actions": [],
"criteria": {
"componentId": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example",
"failedLocationCount": 2,
"odata.type": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
"webTestId": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example"
},
"enabled": true,
"evaluationFrequency": "PT1M",
"scopes": [
"/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example",
"/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example"
],
"severity": 4,
"windowSize": "PT15M"
},
"tags": {
"hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example": "Resource",
"hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example": "Resource"
}
}
Get an alert rule for multiple resources
Образец запроса
GET https://management.azure.com/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/MetricAlertOnMultipleResources?api-version=2024-03-01-preview
from azure.identity import DefaultAzureCredential
from azure.mgmt.monitor import MonitorManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-monitor
# USAGE
python get_metric_alert_multiple_resource.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 = MonitorManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.metric_alerts.get(
resource_group_name="gigtest",
rule_name="MetricAlertOnMultipleResources",
)
print(response)
# x-ms-original-file: 2024-03-01-preview/getMetricAlertMultipleResource.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 armmonitor_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
)
// Generated from example definition: 2024-03-01-preview/getMetricAlertMultipleResource.json
func ExampleMetricAlertsClient_Get_getAnAlertRuleForMultipleResources() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricAlertsClient().Get(ctx, "gigtest", "MetricAlertOnMultipleResources", 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 = armmonitor.MetricAlertsClientGetResponse{
// MetricAlertResource: armmonitor.MetricAlertResource{
// Type: to.Ptr("Microsoft.Insights/metricAlerts"),
// ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertOnMultipleResources"),
// Location: to.Ptr("global"),
// Properties: &armmonitor.MetricAlertProperties{
// Description: to.Ptr("This is the description of the rule1"),
// Actions: []*armmonitor.MetricAlertAction{
// {
// ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
// WebHookProperties: map[string]*string{
// "key11": to.Ptr("value11"),
// "key12": to.Ptr("value12"),
// },
// },
// },
// AutoMitigate: to.Ptr(false),
// Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{
// AllOf: []armmonitor.MultiMetricCriteriaClassification{
// &armmonitor.MetricCriteria{
// Name: to.Ptr("High_CPU_80"),
// CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
// Dimensions: []*armmonitor.MetricDimension{
// },
// MetricName: to.Ptr("Percentage CPU"),
// MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](80.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// Enabled: to.Ptr(true),
// EvaluationFrequency: to.Ptr("PT1M"),
// Scopes: []*string{
// to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1"),
// to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2"),
// },
// Severity: to.Ptr[int32](3),
// TargetResourceRegion: to.Ptr("southcentralus"),
// TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"),
// WindowSize: to.Ptr("PT15M"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MonitorClient } = require("@azure/arm-monitor");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to retrieve an alert rule definition.
*
* @summary retrieve an alert rule definition.
* x-ms-original-file: 2024-03-01-preview/getMetricAlertMultipleResource.json
*/
async function getAnAlertRuleForMultipleResources() {
const credential = new DefaultAzureCredential();
const subscriptionId = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7";
const client = new MonitorClient(credential, subscriptionId);
const result = await client.metricAlerts.get("gigtest", "MetricAlertOnMultipleResources");
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"type": "Microsoft.Insights/metricAlerts",
"id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.insights/metricalerts/MetricAlertOnMultipleResources",
"location": "global",
"properties": {
"description": "This is the description of the rule1",
"actions": [
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
"webHookProperties": {
"key11": "value11",
"key12": "value12"
}
}
],
"autoMitigate": false,
"criteria": {
"allOf": [
{
"name": "High_CPU_80",
"criterionType": "StaticThresholdCriterion",
"dimensions": [],
"metricName": "Percentage CPU",
"metricNamespace": "microsoft.compute/virtualmachines",
"operator": "GreaterThan",
"threshold": 80.5,
"timeAggregation": "Average"
}
],
"odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"
},
"enabled": true,
"evaluationFrequency": "PT1M",
"scopes": [
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2"
],
"severity": 3,
"targetResourceRegion": "southcentralus",
"targetResourceType": "Microsoft.Compute/virtualMachines",
"windowSize": "PT15M"
},
"tags": {
"hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
}
}
Get an alert rule for single resource
Образец запроса
GET https://management.azure.com/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/chiricutin?api-version=2024-03-01-preview
from azure.identity import DefaultAzureCredential
from azure.mgmt.monitor import MonitorManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-monitor
# USAGE
python get_metric_alert_single_resource.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 = MonitorManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.metric_alerts.get(
resource_group_name="gigtest",
rule_name="chiricutin",
)
print(response)
# x-ms-original-file: 2024-03-01-preview/getMetricAlertSingleResource.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 armmonitor_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
)
// Generated from example definition: 2024-03-01-preview/getMetricAlertSingleResource.json
func ExampleMetricAlertsClient_Get_getAnAlertRuleForSingleResource() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricAlertsClient().Get(ctx, "gigtest", "chiricutin", 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 = armmonitor.MetricAlertsClientGetResponse{
// MetricAlertResource: armmonitor.MetricAlertResource{
// Type: to.Ptr("Microsoft.Insights/metricAlerts"),
// ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin"),
// Location: to.Ptr("global"),
// Properties: &armmonitor.MetricAlertProperties{
// Description: to.Ptr("This is the description of the rule1"),
// Actions: []*armmonitor.MetricAlertAction{
// {
// ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
// WebHookProperties: map[string]*string{
// "key11": to.Ptr("value11"),
// "key12": to.Ptr("value12"),
// },
// },
// },
// AutoMitigate: to.Ptr(false),
// Criteria: &armmonitor.MetricAlertSingleResourceMultipleMetricCriteria{
// AllOf: []*armmonitor.MetricCriteria{
// {
// Name: to.Ptr("High_CPU_80"),
// CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
// Dimensions: []*armmonitor.MetricDimension{
// },
// MetricName: to.Ptr("\\Processor(_Total)\\% Processor Time"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](80.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria),
// },
// Enabled: to.Ptr(true),
// EvaluationFrequency: to.Ptr("PT1M"),
// Scopes: []*string{
// to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"),
// },
// Severity: to.Ptr[int32](3),
// WindowSize: to.Ptr("PT15M"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MonitorClient } = require("@azure/arm-monitor");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to retrieve an alert rule definition.
*
* @summary retrieve an alert rule definition.
* x-ms-original-file: 2024-03-01-preview/getMetricAlertSingleResource.json
*/
async function getAnAlertRuleForSingleResource() {
const credential = new DefaultAzureCredential();
const subscriptionId = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7";
const client = new MonitorClient(credential, subscriptionId);
const result = await client.metricAlerts.get("gigtest", "chiricutin");
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"type": "Microsoft.Insights/metricAlerts",
"id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.insights/metricalerts/chiricutin",
"location": "global",
"properties": {
"description": "This is the description of the rule1",
"actions": [
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
"webHookProperties": {
"key11": "value11",
"key12": "value12"
}
}
],
"autoMitigate": false,
"criteria": {
"allOf": [
{
"name": "High_CPU_80",
"criterionType": "StaticThresholdCriterion",
"dimensions": [],
"metricName": "\\Processor(_Total)\\% Processor Time",
"operator": "GreaterThan",
"threshold": 80.5,
"timeAggregation": "Average"
}
],
"odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"
},
"enabled": true,
"evaluationFrequency": "PT1M",
"scopes": [
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"
],
"severity": 3,
"windowSize": "PT15M"
},
"tags": {
"hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
}
}
Get an alert rule on resource group(s)
Образец запроса
GET https://management.azure.com/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1/providers/Microsoft.Insights/metricAlerts/MetricAlertAtResourceGroupLevel?api-version=2024-03-01-preview
from azure.identity import DefaultAzureCredential
from azure.mgmt.monitor import MonitorManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-monitor
# USAGE
python get_metric_alert_resource_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 = MonitorManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.metric_alerts.get(
resource_group_name="gigtest1",
rule_name="MetricAlertAtResourceGroupLevel",
)
print(response)
# x-ms-original-file: 2024-03-01-preview/getMetricAlertResourceGroup.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 armmonitor_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
)
// Generated from example definition: 2024-03-01-preview/getMetricAlertResourceGroup.json
func ExampleMetricAlertsClient_Get_getAnAlertRuleOnResourceGroupS() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricAlertsClient().Get(ctx, "gigtest1", "MetricAlertAtResourceGroupLevel", 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 = armmonitor.MetricAlertsClientGetResponse{
// MetricAlertResource: armmonitor.MetricAlertResource{
// Type: to.Ptr("Microsoft.Insights/metricAlerts"),
// ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1/providers/providers/microsoft.insights/metricalerts/MetricAlertAtResourceGroupLevel"),
// Location: to.Ptr("global"),
// Properties: &armmonitor.MetricAlertProperties{
// Description: to.Ptr("This is the description of the rule1"),
// Actions: []*armmonitor.MetricAlertAction{
// {
// ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
// WebHookProperties: map[string]*string{
// "key11": to.Ptr("value11"),
// "key12": to.Ptr("value12"),
// },
// },
// },
// AutoMitigate: to.Ptr(false),
// Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{
// AllOf: []armmonitor.MultiMetricCriteriaClassification{
// &armmonitor.MetricCriteria{
// Name: to.Ptr("High_CPU_80"),
// CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
// Dimensions: []*armmonitor.MetricDimension{
// },
// MetricName: to.Ptr("Percentage CPU"),
// MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](80.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// Enabled: to.Ptr(true),
// EvaluationFrequency: to.Ptr("PT1M"),
// Scopes: []*string{
// to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1"),
// to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2"),
// },
// Severity: to.Ptr[int32](3),
// TargetResourceRegion: to.Ptr("southcentralus"),
// TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"),
// WindowSize: to.Ptr("PT15M"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MonitorClient } = require("@azure/arm-monitor");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to retrieve an alert rule definition.
*
* @summary retrieve an alert rule definition.
* x-ms-original-file: 2024-03-01-preview/getMetricAlertResourceGroup.json
*/
async function getAnAlertRuleOnResourceGroupS() {
const credential = new DefaultAzureCredential();
const subscriptionId = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7";
const client = new MonitorClient(credential, subscriptionId);
const result = await client.metricAlerts.get("gigtest1", "MetricAlertAtResourceGroupLevel");
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"type": "Microsoft.Insights/metricAlerts",
"id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1/providers/microsoft.insights/metricalerts/MetricAlertAtResourceGroupLevel",
"location": "global",
"properties": {
"description": "This is the description of the rule1",
"actions": [
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
"webHookProperties": {
"key11": "value11",
"key12": "value12"
}
}
],
"autoMitigate": false,
"criteria": {
"allOf": [
{
"name": "High_CPU_80",
"criterionType": "StaticThresholdCriterion",
"dimensions": [],
"metricName": "Percentage CPU",
"metricNamespace": "microsoft.compute/virtualmachines",
"operator": "GreaterThan",
"threshold": 80.5,
"timeAggregation": "Average"
}
],
"odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"
},
"enabled": true,
"evaluationFrequency": "PT1M",
"scopes": [
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1",
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2"
],
"severity": 3,
"targetResourceRegion": "southcentralus",
"targetResourceType": "Microsoft.Compute/virtualMachines",
"windowSize": "PT15M"
},
"tags": {
"hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
}
}
Get an alert rule on subscription
Образец запроса
GET https://management.azure.com/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Insights/metricAlerts/MetricAlertAtSubscriptionLevel?api-version=2024-03-01-preview
from azure.identity import DefaultAzureCredential
from azure.mgmt.monitor import MonitorManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-monitor
# USAGE
python get_metric_alert_subscription.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 = MonitorManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.metric_alerts.get(
resource_group_name="gigtest",
rule_name="MetricAlertAtSubscriptionLevel",
)
print(response)
# x-ms-original-file: 2024-03-01-preview/getMetricAlertSubscription.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 armmonitor_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
)
// Generated from example definition: 2024-03-01-preview/getMetricAlertSubscription.json
func ExampleMetricAlertsClient_Get_getAnAlertRuleOnSubscription() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricAlertsClient().Get(ctx, "gigtest", "MetricAlertAtSubscriptionLevel", 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 = armmonitor.MetricAlertsClientGetResponse{
// MetricAlertResource: armmonitor.MetricAlertResource{
// Type: to.Ptr("Microsoft.Insights/metricAlerts"),
// ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertAtSubscriptionLevel"),
// Location: to.Ptr("global"),
// Properties: &armmonitor.MetricAlertProperties{
// Description: to.Ptr("This is the description of the rule1"),
// Actions: []*armmonitor.MetricAlertAction{
// {
// ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
// WebHookProperties: map[string]*string{
// "key11": to.Ptr("value11"),
// "key12": to.Ptr("value12"),
// },
// },
// },
// AutoMitigate: to.Ptr(false),
// Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{
// AllOf: []armmonitor.MultiMetricCriteriaClassification{
// &armmonitor.MetricCriteria{
// Name: to.Ptr("High_CPU_80"),
// CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
// Dimensions: []*armmonitor.MetricDimension{
// },
// MetricName: to.Ptr("Percentage CPU"),
// MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](80.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// Enabled: to.Ptr(true),
// EvaluationFrequency: to.Ptr("PT1M"),
// Scopes: []*string{
// to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"),
// },
// Severity: to.Ptr[int32](3),
// TargetResourceRegion: to.Ptr("southcentralus"),
// TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"),
// WindowSize: to.Ptr("PT15M"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MonitorClient } = require("@azure/arm-monitor");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to retrieve an alert rule definition.
*
* @summary retrieve an alert rule definition.
* x-ms-original-file: 2024-03-01-preview/getMetricAlertSubscription.json
*/
async function getAnAlertRuleOnSubscription() {
const credential = new DefaultAzureCredential();
const subscriptionId = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7";
const client = new MonitorClient(credential, subscriptionId);
const result = await client.metricAlerts.get("gigtest", "MetricAlertAtSubscriptionLevel");
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"type": "Microsoft.Insights/metricAlerts",
"id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.insights/metricalerts/MetricAlertAtSubscriptionLevel",
"location": "global",
"properties": {
"description": "This is the description of the rule1",
"actions": [
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
"webHookProperties": {
"key11": "value11",
"key12": "value12"
}
}
],
"autoMitigate": false,
"criteria": {
"allOf": [
{
"name": "High_CPU_80",
"criterionType": "StaticThresholdCriterion",
"dimensions": [],
"metricName": "Percentage CPU",
"metricNamespace": "microsoft.compute/virtualmachines",
"operator": "GreaterThan",
"threshold": 80.5,
"timeAggregation": "Average"
}
],
"odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"
},
"enabled": true,
"evaluationFrequency": "PT1M",
"scopes": [
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"
],
"severity": 3,
"targetResourceRegion": "southcentralus",
"targetResourceType": "Microsoft.Compute/virtualMachines",
"windowSize": "PT15M"
},
"tags": {
"hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": "Resource"
}
}
Определения
AggregationTypeEnum
Перечисление
Типы агрегации времени по критерию. Ранее недокументированные значения могут быть возвращены
| Значение |
Описание |
|
Average
|
Среднее значение
|
|
Count
|
Количество
|
|
Minimum
|
Минимум
|
|
Maximum
|
Maximum
|
|
Total
|
Total
|
createdByType
Перечисление
Тип удостоверения, создавшего ресурс.
| Значение |
Описание |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
DynamicMetricCriteria
Объект
Критерий динамического порога.
| Имя |
Тип |
Описание |
|
alertSensitivity
|
DynamicThresholdSensitivity
|
Степень отклонения, необходимого для активации оповещения. Это повлияет на то, насколько жестко пороговое значение соответствует шаблону ряда метрик. Ранее недокументированные значения могут быть возвращены
|
|
criterionType
|
string:
DynamicThresholdCriterion
|
Указывает тип пороговых критериев. Ранее недокументированные значения могут быть возвращены
|
|
dimensions
|
MetricDimension[]
|
Список условий измерения.
|
|
failingPeriods
|
DynamicThresholdFailingPeriods
|
Минимальное количество нарушений, необходимых в выбранном окне времени обратного просмотра, необходимое для создания оповещения.
|
|
ignoreDataBefore
|
string
(date-time)
|
Используйте этот параметр, чтобы задать дату, с которой начать обучение исторических данных метрик и вычислить динамические пороговые значения (в формате ISO8601)
|
|
metricName
|
string
|
Имя метрики.
|
|
metricNamespace
|
string
|
Пространство имен метрик.
|
|
name
|
string
|
Имя критерия.
|
|
operator
|
DynamicThresholdOperator
|
Оператор, используемый для сравнения значения метрик с пороговым значением. Ранее недокументированные значения могут быть возвращены
|
|
skipMetricValidation
|
boolean
|
Позволяет создавать правило генерации оповещений для пользовательской метрики, которая еще не была вызвана проверкой метрик.
|
|
timeAggregation
|
AggregationTypeEnum
|
Типы агрегации времени по критерию. Ранее недокументированные значения могут быть возвращены
|
DynamicPromQLCriteria
Объект
Критерий для динамического запроса по выпуску.
| Имя |
Тип |
Описание |
|
alertSensitivity
|
DynamicThresholdSensitivity
|
Степень отклонения, необходимого для активации оповещения. Это повлияет на то, насколько жестко пороговое значение соответствует шаблону ряда метрик. Ранее недокументированные значения могут быть возвращены
|
|
criterionType
|
string:
DynamicThresholdCriterion
|
Указывает тип пороговых критериев. Ранее недокументированные значения могут быть возвращены
|
|
ignoreDataBefore
|
string
(date-time)
|
Используйте этот параметр, чтобы задать дату, с которой начать обучение исторических данных метрик и вычислить динамические пороговые значения (в формате ISO8601)
|
|
name
|
string
|
Имя критерия.
|
|
operator
|
DynamicThresholdOperator
|
Оператор, используемый для сравнения значения метрик с пороговым значением. Ранее недокументированные значения могут быть возвращены
|
|
query
|
string
|
Запрос, используемый для оценки правила генерации оповещений
|
DynamicThresholdFailingPeriods
Объект
Минимальное количество нарушений, необходимых в выбранном окне времени обратного просмотра, необходимое для создания оповещения.
| Имя |
Тип |
Описание |
|
minFailingPeriodsToAlert
|
number
(float)
|
Количество нарушений для активации оповещения. Должно быть меньше или равно числуOfEvaluationPeriods.
|
|
numberOfEvaluationPeriods
|
number
(float)
|
Количество агрегированных точек обратного просмотра. Окно времени обратного просмотра вычисляется на основе детализации агрегирования (windowSize) и выбранного числа агрегированных точек.
|
DynamicThresholdOperator
Перечисление
Оператор, используемый для сравнения значения метрик с пороговым значением. Ранее недокументированные значения могут быть возвращены
| Значение |
Описание |
|
GreaterThan
|
GreaterThan
|
|
LessThan
|
LessThan
|
|
GreaterOrLessThan
|
БольшеИлиМеньшеЧем
|
DynamicThresholdSensitivity
Перечисление
Степень отклонения, необходимого для активации оповещения. Это повлияет на то, насколько жестко пороговое значение соответствует шаблону ряда метрик. Ранее недокументированные значения могут быть возвращены
| Значение |
Описание |
|
Low
|
Низкий
|
|
Medium
|
Medium
|
|
High
|
High
|
IdentityType
Перечисление
Тип управляемого удостоверения службы.
| Значение |
Описание |
|
SystemAssigned
|
Системное назначение
|
|
UserAssigned
|
UserAssigned
|
|
None
|
None
|
MetricAlertAction
Объект
Действие оповещения.
| Имя |
Тип |
Описание |
|
actionGroupId
|
string
|
Идентификатор используемой группы действий.
|
|
webHookProperties
|
object
|
Это поле позволяет указывать настраиваемые свойства, которые будут добавлены в полезные данные оповещения, отправленные в качестве входных данных в веб-перехватчик.
|
MetricAlertErrorResponse
Объект
Описывает формат ответа на ошибку.
MetricAlertMultipleResourceMultipleMetricCriteria
Объект
Задаёт критерии оповещения метрик для нескольких ресурсов с несколькими критериями.
| Имя |
Тип |
Описание |
|
allOf
|
MultiMetricCriteria[]:
|
Список нескольких метрических критериев для этой операции «все».
|
|
odata.type
|
string:
Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
|
Указывает тип критерия оповещения. Ранее недокументированные значения могут быть возвращены
|
MetricAlertResource
Объект
Ресурс метрического оповещения.
| Имя |
Тип |
Описание |
|
id
|
string
(arm-id)
|
Полный идентификатор ресурса для ресурса. Например, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
identity
|
Microsoft.Common.Identity
|
Удостоверение ресурса.
|
|
location
|
string
|
Географическое расположение, в котором находится ресурс
|
|
name
|
string
|
Имя ресурса
|
|
properties.actionProperties
|
object
|
Свойства действия.
|
|
properties.actions
|
MetricAlertAction[]
|
Массив действий, выполняемых при активации правила генерации оповещений, и при разрешении условия генерации оповещений.
|
|
properties.autoMitigate
|
boolean
|
Флаг, указывающий, должно ли оповещение быть автоматически устранено или нет. Значение по умолчанию — true.
|
|
properties.criteria
|
MetricAlertCriteria:
|
Определяет конкретные сведения о критериях оповещения.
|
|
properties.customProperties
|
object
|
Свойства полезных данных оповещения.
|
|
properties.description
|
string
|
Описание оповещения о метрике, которое будет включено в сообщение электронной почты.
|
|
properties.enabled
|
boolean
|
Флаг, указывающий, включено ли оповещение о метрике.
|
|
properties.evaluationFrequency
|
string
(duration)
|
Частота оценки оповещения метрики представлена в формате длительности ISO 8601.
|
|
properties.isMigrated
|
boolean
|
Значение, указывающее, было ли это правило оповещения перенесено.
|
|
properties.lastUpdatedTime
|
string
(date-time)
|
В прошлый раз правило обновлялось в ISO8601 формате.
|
|
properties.resolveConfiguration
|
ResolveConfiguration
|
Конфигурация для разрешения предупреждения. Применимо для PromQLCriteria.
|
|
properties.scopes
|
string[]
|
Список идентификаторов ресурсов, к которым относится это оповещение о метрике. Невозможно изменить область правила метрик на основе журналов.
|
|
properties.severity
|
integer
(int32)
|
Уровень серьезности оповещений {0, 1, 2, 3, 4}
|
|
properties.targetResourceRegion
|
string
|
Регион целевых ресурсов, на которых создается или обновляется оповещение. Обязательно, если область содержит подписку, группу ресурсов или несколько ресурсов.
|
|
properties.targetResourceType
|
string
|
Тип целевого ресурса (ресурсов), на котором создается или обновляется оповещение. Обязательно, если область содержит подписку, группу ресурсов или несколько ресурсов.
|
|
properties.windowSize
|
string
(duration)
|
Период времени (в формате длительности ISO 8601), который используется для мониторинга активности оповещений на основе порогового значения.
|
|
systemData
|
systemData
|
Метаданные Azure Resource Manager, содержащие данные createdBy и modifiedBy.
|
|
tags
|
object
|
Теги ресурсов.
|
|
type
|
string
|
Тип ресурса. Например, «Microsoft. Compute/virtualMachines» или «Microsoft. Аккаунты хранения/хранения»
|
MetricAlertSingleResourceMultipleMetricCriteria
Объект
Задаёт критерии оповещения метрик для одного ресурса с несколькими критериями.
| Имя |
Тип |
Описание |
|
allOf
|
MetricCriteria[]
|
Список критериев метрик для этой операции "все".
|
|
odata.type
|
string:
Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria
|
Указывает тип критерия оповещения. Ранее недокументированные значения могут быть возвращены
|
MetricCriteria
Объект
Criterion для фильтрации метрик.
| Имя |
Тип |
Описание |
|
criterionType
|
string:
StaticThresholdCriterion
|
Указывает тип пороговых критериев. Ранее недокументированные значения могут быть возвращены
|
|
dimensions
|
MetricDimension[]
|
Список условий измерения.
|
|
metricName
|
string
|
Имя метрики.
|
|
metricNamespace
|
string
|
Пространство имен метрик.
|
|
name
|
string
|
Имя критерия.
|
|
operator
|
Operator
|
Оператор условий. Ранее недокументированные значения могут быть возвращены
|
|
skipMetricValidation
|
boolean
|
Позволяет создавать правило генерации оповещений для пользовательской метрики, которая еще не была вызвана проверкой метрик.
|
|
threshold
|
number
(double)
|
Пороговое значение критерия, при котором активируется оповещение.
|
|
timeAggregation
|
AggregationTypeEnum
|
Типы агрегации времени по критерию. Ранее недокументированные значения могут быть возвращены
|
MetricDimension
Объект
Задаёт метрическую размерность.
| Имя |
Тип |
Описание |
|
name
|
string
|
Имя измерения.
|
|
operator
|
string
|
Оператор размерности. Поддерживаются только "Включить" и "Исключить"
|
|
values
|
string[]
|
Список значений измерения.
|
Microsoft.Common.ErrorDetail
Объект
Описывает детали ответа на ошибку.
| Имя |
Тип |
Описание |
|
additionalInfo
|
Microsoft.Common.ErrorDetailAdditionalInfoItem[]
|
Массив объектов с свойствами 'type' и 'info'. Схема «info» зависит от сервиса и зависит от строки «type».
|
|
code
|
string
|
Нелокализованная строка, которая может использоваться для программного определения ошибки.
|
|
message
|
string
|
Подробно описывает ошибку и предоставляет информацию для отладки.
|
|
target
|
string
|
Цель конкретной ошибки (например, имя ошибочного свойства).
|
Microsoft.Common.ErrorDetailAdditionalInfoItem
Объект
| Имя |
Тип |
Описание |
|
info
|
|
Дополнительная информация, специфичная для типа.
|
|
type
|
string
|
Тип дополнительной информации.
|
Microsoft.Common.ErrorResponseError
Объект
| Имя |
Тип |
Описание |
|
additionalInfo
|
Microsoft.Common.ErrorResponseErrorAdditionalInfoItem[]
|
Массив объектов с свойствами 'type' и 'info'. Схема «info» зависит от сервиса и зависит от строки «type».
|
|
code
|
string
|
Нелокализованная строка, которая может использоваться для программного определения ошибки.
|
|
details
|
Microsoft.Common.ErrorDetail[]
|
Массив дополнительных вложенных объектов сведений об ответе на ошибки, как описано в этом контракте.
|
|
message
|
string
|
Подробно описывает ошибку и предоставляет информацию для отладки. Если Accept-Language установлен в запросе, он должен быть локализован на этом языке.
|
|
target
|
string
|
Цель конкретной ошибки (например, имя ошибочного свойства).
|
Microsoft.Common.ErrorResponseErrorAdditionalInfoItem
Объект
| Имя |
Тип |
Описание |
|
info
|
|
Дополнительная информация, специфичная для типа.
|
|
type
|
string
|
Тип дополнительной информации.
|
Microsoft.Common.Identity
Объект
Удостоверение ресурса.
| Имя |
Тип |
Описание |
|
principalId
|
string
|
Идентификатор субъекта удостоверения ресурса.
|
|
tenantId
|
string
|
Идентификатор клиента ресурса.
|
|
type
|
IdentityType
|
Тип управляемого удостоверения службы.
|
|
userAssignedIdentities
|
<string,
Microsoft.Common.UserIdentityProperties>
|
Список удостоверений пользователей, связанных с ресурсом. Ссылки на ключ словаря удостоверений пользователя будут идентификаторами ресурсов ARM в форме: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}".
|
Microsoft.Common.UserIdentityProperties
Объект
Свойства присвоенной пользователю идентичности.
| Имя |
Тип |
Описание |
|
clientId
|
string
|
Идентификатор клиента идентификатора ресурса.
|
|
principalId
|
string
|
Идентификатор субъекта удостоверения ресурса.
|
Odatatype
Перечисление
Указывает тип критерия оповещения. Ранее недокументированные значения могут быть возвращены
| Значение |
Описание |
|
Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria
|
Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria
|
|
Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
|
Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
|
|
Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria
|
Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria
|
|
Microsoft.Azure.Monitor.PromQLCriteria
|
Microsoft.Azure.Monitor.PromQLCriteria
|
Operator
Перечисление
Оператор условий. Ранее недокументированные значения могут быть возвращены
| Значение |
Описание |
|
Equals
|
Равно
|
|
GreaterThan
|
GreaterThan
|
|
GreaterThanOrEqual
|
БольшеИлиРавно
|
|
LessThan
|
LessThan
|
|
LessThanOrEqual
|
LessThanOrEqual
|
PromQLCriteria
Объект
Определяет критерии PromQL для ресурса метрических оповещений.
| Имя |
Тип |
Описание |
|
allOf
|
MultiPromQLCriteria[]:
|
Список критериев promQL. Тревога будет поднята, когда все условия будут выполнены.
|
|
failingPeriods
|
QueryFailingPeriods
|
Настройка периодов сбоя в оповещениях на основе запросов.
|
|
odata.type
|
string:
Microsoft.Azure.Monitor.PromQLCriteria
|
Указывает тип критерия оповещения. Ранее недокументированные значения могут быть возвращены
|
QueryFailingPeriods
Объект
Настройка периодов сбоя в оповещениях на основе запросов.
| Имя |
Тип |
Описание |
|
for
|
string
(duration)
|
Количество времени (в формате длительности ISO 8601) должно быть активным перед срабатыванием.
|
ResolveConfiguration
Объект
| Имя |
Тип |
Описание |
|
autoResolved
|
boolean
|
Указывает, должно ли оповещение быть устранено автоматически
|
|
timeToResolve
|
string
(duration)
|
Время (в формате ISO 8601), по истечении которого предупреждение должно быть автоматически устранено
|
StaticPromQLCriteria
Объект
Критерий для статического запроса на выпускной.
| Имя |
Тип |
Описание |
|
criterionType
|
string:
StaticThresholdCriterion
|
Указывает тип пороговых критериев. Ранее недокументированные значения могут быть возвращены
|
|
name
|
string
|
Имя критерия.
|
|
query
|
string
|
Запрос, используемый для оценки правила генерации оповещений
|
systemData
Объект
Метаданные, относящиеся к созданию и последнему изменении ресурса.
| Имя |
Тип |
Описание |
|
createdAt
|
string
(date-time)
|
Метка времени создания ресурса (UTC).
|
|
createdBy
|
string
|
Удостоверение, создающее ресурс.
|
|
createdByType
|
createdByType
|
Тип удостоверения, создавшего ресурс.
|
|
lastModifiedAt
|
string
(date-time)
|
Метка времени последнего изменения ресурса (UTC)
|
|
lastModifiedBy
|
string
|
Идентификатор, который последний раз изменил ресурс.
|
|
lastModifiedByType
|
createdByType
|
Тип удостоверения, который последний раз изменил ресурс.
|
WebtestLocationAvailabilityCriteria
Объект
Задаёт критерии правила оповещения метрик для веб-тестового ресурса.
| Имя |
Тип |
Описание |
|
componentId
|
string
|
Идентификатор ресурса Application Insights.
|
|
failedLocationCount
|
number
(float)
|
Количество неудачных расположений.
|
|
odata.type
|
string:
Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria
|
Указывает тип критерия оповещения. Ранее недокументированные значения могут быть возвращены
|
|
webTestId
|
string
|
Идентификатор веб-теста Application Insights.
|