|
32 | 32 | short-summary: Manage activity log alert rules. |
33 | 33 | """ |
34 | 34 |
|
35 | | -helps['monitor activity-log alert action-group'] = """ |
36 | | -type: group |
37 | | -short-summary: Manage action groups for activity log alert rules. |
38 | | -""" |
39 | | - |
40 | | -helps['monitor activity-log alert action-group add'] = """ |
41 | | -type: command |
42 | | -short-summary: Add action groups to this activity log alert rule. It can also be used to overwrite existing webhook properties of particular action groups. |
43 | | -parameters: |
44 | | - - name: --name -n |
45 | | - short-summary: Name of the activity log alert rule. |
46 | | - - name: --action-group -a |
47 | | - short-summary: The names or the resource ids of the action groups to be added. |
48 | | - - name: --reset |
49 | | - short-summary: Remove all the existing action groups before add new conditions. |
50 | | - - name: --webhook-properties -w |
51 | | - short-summary: > |
52 | | - Space-separated webhook properties in 'key[=value]' format. These properties will be associated with |
53 | | - the action groups added in this command. |
54 | | - long-summary: > |
55 | | - For any webhook receiver in these action group, these data are appended to the webhook payload. |
56 | | - To attach different webhook properties to different action groups, add the action groups in separate update-action commands. |
57 | | - - name: --strict |
58 | | - short-summary: Fails the command if an action group to be added will change existing webhook properties. |
59 | | -examples: |
60 | | - - name: Add an action group and specify webhook properties. |
61 | | - text: | |
62 | | - az monitor activity-log alert action-group add -n {AlertName} -g {ResourceGroup} \\ |
63 | | - --action /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/microsoft.insights/actionGroups/{ActionGroup} \\ |
64 | | - --webhook-properties usage=test owner=jane |
65 | | - - name: Overwite an existing action group's webhook properties. |
66 | | - text: | |
67 | | - az monitor activity-log alert action-group add -n {AlertName} -g {ResourceGroup} \\ |
68 | | - -a /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/microsoft.insights/actionGroups/{ActionGroup} \\ |
69 | | - --webhook-properties usage=test owner=john |
70 | | - - name: Remove webhook properties from an existing action group. |
71 | | - text: | |
72 | | - az monitor activity-log alert action-group add -n {AlertName} -g {ResourceGroup} \\ |
73 | | - -a /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/microsoft.insights/actionGroups/{ActionGroup} |
74 | | - - name: Add new action groups but prevent the command from accidently overwrite existing webhook properties |
75 | | - text: | |
76 | | - az monitor activity-log alert action-group add -n {AlertName} -g {ResourceGroup} --strict \\ |
77 | | - --action-group {ResourceIDList} |
78 | | -""" |
79 | | - |
80 | | -helps['monitor activity-log alert action-group remove'] = """ |
81 | | -type: command |
82 | | -short-summary: Remove action groups from this activity log alert rule. |
83 | | -parameters: |
84 | | - - name: --name -n |
85 | | - short-summary: Name of the activity log alert rule. |
86 | | - - name: --action-group -a |
87 | | - short-summary: The names or the resource ids of the action groups to be removed. |
88 | | -""" |
89 | | - |
90 | | -helps['monitor activity-log alert create'] = """ |
91 | | -type: command |
92 | | -short-summary: Create a default activity log alert rule. |
93 | | -long-summary: This command will create a default activity log with one condition which compares if the activities logs 'category' field equals to 'ServiceHealth'. The newly created activity log alert does not have any action groups attached to it. |
94 | | -parameters: |
95 | | - - name: --name -n |
96 | | - short-summary: Name of the activity log alert rule. |
97 | | - - name: --scope -s |
98 | | - short-summary: A list of strings that will be used as prefixes. |
99 | | - long-summary: > |
100 | | - The alert rule will only apply to activity logs with resourceIDs that fall under one of these prefixes. |
101 | | - If not provided, the path to the resource group will be used. |
102 | | - - name: --disable |
103 | | - short-summary: Disable the activity log alert rule after it is created. |
104 | | - - name: --description |
105 | | - short-summary: A description of this activity log alert rule. |
106 | | - - name: --condition -c |
107 | | - short-summary: The condition that will cause the alert rule to activate. The format is FIELD=VALUE[ and FIELD=VALUE...]. |
108 | | - long-summary: > |
109 | | - The possible values for the field are 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', |
110 | | - 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties.'. |
111 | | - - name: --action-group -a |
112 | | - short-summary: > |
113 | | - Add an action group. Accepts space-separated action group identifiers. The identifier can be the action group's name |
114 | | - or its resource ID. |
115 | | - - name: --webhook-properties -w |
116 | | - short-summary: > |
117 | | - Space-separated webhook properties in 'key[=value]' format. These properties are associated with the action groups |
118 | | - added in this command. |
119 | | - long-summary: > |
120 | | - For any webhook receiver in these action group, this data is appended to the webhook payload. To attach different webhook |
121 | | - properties to different action groups, add the action groups in separate update-action commands. |
122 | | -examples: |
123 | | - - name: Create an alert rule with default settings. |
124 | | - text: > |
125 | | - az monitor activity-log alert create -n {AlertName} -g {ResourceGroup} |
126 | | - - name: Create an alert rule with condition about error level service health log. |
127 | | - text: > |
128 | | - az monitor activity-log alert create -n {AlertName} -g {ResourceGroup} \\ |
129 | | - --condition category=ServiceHealth and level=Error |
130 | | - - name: Create an alert rule with an action group and specify webhook properties. |
131 | | - text: > |
132 | | - az monitor activity-log alert create -n {AlertName} -g {ResourceGroup} \\ |
133 | | - -a /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/microsoft.insights/actionGroups/{ActionGroup} \\ |
134 | | - -w usage=test owner=jane |
135 | | - - name: Create an alert rule which is initially disabled. |
136 | | - text: > |
137 | | - az monitor activity-log alert create -n {AlertName} -g {ResourceGroup} --disable |
138 | | -""" |
139 | | - |
140 | 35 | helps['monitor activity-log alert list'] = """ |
141 | 36 | type: command |
142 | 37 | short-summary: List activity log alert rules under a resource group or the current subscription. |
|
145 | 40 | short-summary: Name of the resource group under which the activity log alert rules are being listed. If it is omitted, all the activity log alert rules under the current subscription are listed. |
146 | 41 | """ |
147 | 42 |
|
148 | | -helps['monitor activity-log alert scope'] = """ |
149 | | -type: group |
150 | | -short-summary: Manage scopes for activity log alert rules. |
151 | | -""" |
152 | | - |
153 | | -helps['monitor activity-log alert scope add'] = """ |
154 | | -type: command |
155 | | -short-summary: Add scopes to this activity log alert rule. |
156 | | -parameters: |
157 | | - - name: --name -n |
158 | | - short-summary: Name of the activity log alert rule. |
159 | | - - name: --scope -s |
160 | | - short-summary: List of scopes to add. Each scope could be a resource ID, a resource group ID or a subscription ID. |
161 | | - - name: --reset |
162 | | - short-summary: Remove all the existing scopes before add new scopes. |
163 | | -examples: |
164 | | - - name: Add scopes to this activity log alert rule. (autogenerated) |
165 | | - text: | |
166 | | - az monitor activity-log alert scope add --name MyActivityLogAlerts --resource-group MyResourceGroup --scope /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myRG /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myRG/Microsoft.KeyVault/vaults/mykey |
167 | | - crafted: true |
168 | | -""" |
169 | | - |
170 | | -helps['monitor activity-log alert scope remove'] = """ |
171 | | -type: command |
172 | | -short-summary: Removes scopes from this activity log alert rule. |
173 | | -parameters: |
174 | | - - name: --name -n |
175 | | - short-summary: Name of the activity log alert rule. |
176 | | - - name: --scope -s |
177 | | - short-summary: The scopes to remove |
178 | | -""" |
179 | | - |
180 | | -helps['monitor activity-log alert update'] = """ |
181 | | -type: command |
182 | | -short-summary: Update the details of this activity log alert rule. |
183 | | -parameters: |
184 | | - - name: --description |
185 | | - short-summary: A description of this activity log alert rule. |
186 | | - - name: --condition -c |
187 | | - short-summary: The conditional expression that will cause the alert rule to activate. The format is FIELD=VALUE[ and FIELD=VALUE...]. |
188 | | - long-summary: > |
189 | | - The possible values for the field are 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', |
190 | | - 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties.'. |
191 | | -examples: |
192 | | - - name: Update the condition |
193 | | - text: > |
194 | | - az monitor activity-log alert update -n {AlertName} -g {ResourceGroup} \\ |
195 | | - --condition category=ServiceHealth and level=Error |
196 | | - - name: Disable an alert rule. |
197 | | - text: > |
198 | | - az monitor activity-log alert update -n {AlertName} -g {ResourceGroup} --enable false |
199 | | - - name: Update the details of this activity log alert rule. (autogenerated) |
200 | | - text: | |
201 | | - az monitor activity-log alert update --enabled true --name MyActivityLogAlerts --resource-group MyResourceGroup --subscription MySubscription |
202 | | - crafted: true |
203 | | - - name: Update the details of this activity log alert. (autogenerated) |
204 | | - text: | |
205 | | - az monitor activity-log alert update --name MyActivityLogAlerts --resource-group MyResourceGroup --tags key=value |
206 | | - crafted: true |
207 | | -""" |
208 | | - |
209 | 43 | helps['monitor activity-log list'] = """ |
210 | 44 | type: command |
211 | 45 | short-summary: List and query activity log events. |
|
242 | 76 | text: az monitor activity-log list -g {ResourceGroup} --offset 1h |
243 | 77 | """ |
244 | 78 |
|
245 | | -helps['monitor activity-log list-categories'] = """ |
246 | | -type: command |
247 | | -short-summary: List the event categories of activity logs. |
248 | | -""" |
249 | | - |
250 | 79 | helps['monitor autoscale'] = """ |
251 | 80 | type: group |
252 | 81 | short-summary: Manage autoscale settings. |
|
0 commit comments