Каков формат условий оповещения метрики монитора Azure в интерфейсе командной строки Azure? - PullRequest
0 голосов
/ 12 июня 2019

Документация для оповещения о показателях монитора az создает , не объясняет формат, используемый для параметра --conditon. Мне кажется, что значение передается в качестве аргумента allOf в конструктор класса MetricAlertSingleResourceMultipleMetricCriteria , как видно из источника Azure CLI для metric_alert.py . Однако это будет означать, что это список MetricCritieria, но примеры документации следующие:

--condition "total transactions > 5 where ResponseType includes Success" 
--condition "avg SuccessE2ELatency > 250 where ApiName includes GetBlob or PutBlob"

, который не похож на допустимый формат для list[MetricCritieria]

1 Ответ

0 голосов
/ 12 июня 2019

Подробное описание формата выдается при вызове с флагом -h:

PS> az monitor metrics alert create -h          
Command
    az monitor metrics alert create : Create a metric-based alert rule.

Arguments
    --condition         [Required] : The condition which triggers the rule.
        Usage:  --conditon {avg,min,max,total,count} [NAMESPACE.]METRIC {=,!=,>,>=,<,<=} THRESHOLD
                           [where DIMENSION {includes,excludes} VALUE [or VALUE ...]
                           [and   DIMENSION {includes,excludes} VALUE [or VALUE ...] ...]]

        Dimensions can be queried by adding the 'where' keyword and multiple dimensions can be
        queried by combining them with the 'and' keyword.

        Values for METRIC, DIMENSION and appropriate THRESHOLD values can be obtained from `az
        monitor metrics list-definition` command.

        Multiple conditons can be specified by using more than one `--condition` argument.
...