Skip to content

Commit 6bab05c

Browse files
Copilotdcaro
andcommitted
Fix action-group create parameter help text formatting
Co-authored-by: dcaro <[email protected]>
1 parent a83608b commit 6bab05c

File tree

1 file changed

+48
-118
lines changed

1 file changed

+48
-118
lines changed

src/azure-cli/azure/cli/command_modules/monitor/operations/action_groups.py

Lines changed: 48 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -132,46 +132,22 @@ def _build_arguments_schema(cls, *args, **kwargs):
132132
args_schema.receiver_actions = AAZCustomListArg(
133133
options=["--actions"],
134134
singular_options=["--action", "-a"],
135-
help='''
136-
Add receivers to the action group during the creation.\n\n
137-
Usage: --action TYPE NAME [ARG ...]\n\n
138-
Email:\n\n
139-
Format: --action email NAME EMAIL_ADDRESS [usecommonalertschema]\n\n
140-
Example: --action email bob [email protected]\n\n
141-
SMS:\n\n
142-
Format: --action sms NAME COUNTRY_CODE PHONE_NUMBER\n\n
143-
Example: --action sms charli 1 5551234567\n\n
144-
Webhook:\n\n
145-
Format: --action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema]\n\n
146-
Example: --action webhook alert_hook https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema\n\n
147-
Arm Role:\n\n
148-
Format: --action armrole NAME ROLE_ID [usecommonalertschema]\n\n
149-
Example: --action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635\n\n
150-
Azure App Push:\n\n
151-
Format: --action azureapppush NAME EMAIL_ADDRESS\n\n
152-
Example: --action azureapppush test_apppush [email protected]\n\n
153-
ITSM:\n\n
154-
Format: --action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION\n\n
155-
Example: --action itsm test_itsm test_workspace test_conn ticket_blob useast\n\n
156-
Automation runbook:\n\n
157-
Format: --action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema]\n\n
158-
Example: --action automationrunbook test_runbook test_acc test_book test_webhook test_rsrc http://example.com isglobalrunbook usecommonalertschema\n\n
159-
Voice:\n\n
160-
Format: --action voice NAME COUNTRY_CODE PHONE_NUMBER\n\n
161-
Example: --action voice charli 1 4441234567\n\n
162-
Logic App:\n\n
163-
Format: --action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema]\n\n
164-
Example: --action logicapp test_logicapp test_rsrc http://callback\n\n
165-
Azure Function:\n\n
166-
Format: --action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema]\n\n
167-
Example: --action azurefunction test_function test_rsrc test_func http://trigger usecommonalertschema\n\n
168-
Event Hub:\n\n
169-
Format: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema]\n\n
170-
Example: --action eventhub test_eventhub 5def922a-3ed4-49c1-b9fd-05ec533819a3 eventhubNameSpace testEventHubName usecommonalertschema\n\n
171-
Multiple actions can be specified by using more than one `--add-action` argument.\n\n
172-
'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguements that only need to be passed to set the respective parameter to True.\n\n
173-
If the 'useaadauth' argument is passed, then the OBJECT_ID and IDENTIFIER_URI values are required as well.
174-
''',
135+
help="Add receivers to the action group during the creation. "
136+
"Usage: --action TYPE NAME [ARG ...]. "
137+
"Email: --action email NAME EMAIL_ADDRESS [usecommonalertschema]. "
138+
"SMS: --action sms NAME COUNTRY_CODE PHONE_NUMBER. "
139+
"Webhook: --action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema]. "
140+
"Arm Role: --action armrole NAME ROLE_ID [usecommonalertschema]. "
141+
"Azure App Push: --action azureapppush NAME EMAIL_ADDRESS. "
142+
"ITSM: --action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION. "
143+
"Automation runbook: --action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema]. "
144+
"Voice: --action voice NAME COUNTRY_CODE PHONE_NUMBER. "
145+
"Logic App: --action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema]. "
146+
"Azure Function: --action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema]. "
147+
"Event Hub: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema]. "
148+
"Multiple actions can be specified by using more than one `--action` argument. "
149+
"'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguments that only need to be passed to set the respective parameter to True. "
150+
"If the 'useaadauth' argument is passed, then the OBJECT_ID and IDENTIFIER_URI values are required as well.",
175151
arg_group="Actions",
176152
)
177153
args_schema.receiver_actions.Element = AAZCustomListArg()
@@ -202,45 +178,22 @@ def _build_arguments_schema(cls, *args, **kwargs):
202178
args_schema.receiver_actions = AAZCustomListArg(
203179
options=["--add-actions"],
204180
singular_options=["--add-action", "-a"],
205-
help='''
206-
Add receivers to the action group.\n\n
207-
Usage: --add-action TYPE NAME [ARG ...]\n\n
208-
Email:\n\n
209-
Format: --add-action email NAME EMAIL_ADDRESS [usecommonalertschema]\n\n
210-
Example: --add-action email bob [email protected]\n\n
211-
SMS:\n\n
212-
Format: --add-action sms NAME COUNTRY_CODE PHONE_NUMBER\n\n
213-
Example: --add-action sms charli 1 5551234567\n\n
214-
Webhook:\n\n
215-
Format: --add-action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema]\n\n
216-
Example: --add-action https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema\n\n
217-
Arm Role:\n\n
218-
Format: --add-action armrole NAME ROLE_ID [usecommonalertschema]\n\n
219-
Example: --add-action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635\n\n
220-
Azure App Push:\n\n
221-
Format: --add-action azureapppush NAME EMAIL_ADDRESS\n\n
222-
Example: --add-action azureapppush test_apppush [email protected]\n\n
223-
ITSM:\n\n
224-
Format: --add-action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION\n\n
225-
Example: --add-action itsm test_itsm test_workspace test_conn ticket_blob useast\n\n
226-
Automation runbook:\n\n
227-
Format: --add-action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema]\n\n
228-
Example: --add-action automationrunbook test_runbook test_acc test_book test_webhook test_rsrc http://example.com isglobalrunbook usecommonalertschema\n\n
229-
Voice:\n\n
230-
Format: --add-action voice NAME COUNTRY_CODE PHONE_NUMBER\n\n
231-
Example: --add-action voice charli 1 4441234567\n\n
232-
Logic App:\n\n
233-
Format: --add-action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema]\n\n
234-
Example: --add-action logicapp test_logicapp test_rsrc http://callback\n\n
235-
Azure Function:\n\n
236-
Format: --add-action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema]\n\n
237-
Example: --add-action azurefunction test_function test_rsrc test_func http://trigger usecommonalertschema\n\n
238-
Event Hub:\n\n
239-
Format: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema]\n\n
240-
Example: --action eventhub test_eventhub 5def922a-3ed4-49c1-b9fd-05ec533819a3 eventhubNameSpace testEventHubName usecommonalertschema\n\n
241-
Multiple actions can be specified by using more than one `--add-action` argument.\n\n
242-
'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguements that only need to be passed to set the respective parameter to True.\n\n
243-
If the 'useaadauth' argument is passed, then the OBJECT_ID and IDENTIFIER_URI values are required as well.''',
181+
help="Add receivers to the action group. "
182+
"Usage: --add-action TYPE NAME [ARG ...]. "
183+
"Email: --add-action email NAME EMAIL_ADDRESS [usecommonalertschema]. "
184+
"SMS: --add-action sms NAME COUNTRY_CODE PHONE_NUMBER. "
185+
"Webhook: --add-action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema]. "
186+
"Arm Role: --add-action armrole NAME ROLE_ID [usecommonalertschema]. "
187+
"Azure App Push: --add-action azureapppush NAME EMAIL_ADDRESS. "
188+
"ITSM: --add-action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION. "
189+
"Automation runbook: --add-action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema]. "
190+
"Voice: --add-action voice NAME COUNTRY_CODE PHONE_NUMBER. "
191+
"Logic App: --add-action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema]. "
192+
"Azure Function: --add-action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema]. "
193+
"Event Hub: --add-action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema]. "
194+
"Multiple actions can be specified by using more than one `--add-action` argument. "
195+
"'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguments that only need to be passed to set the respective parameter to True. "
196+
"If the 'useaadauth' argument is passed, then the OBJECT_ID and IDENTIFIER_URI values are required as well.",
244197
arg_group="Actions",
245198
)
246199
args_schema.receiver_actions.Element = AAZListArg()
@@ -338,45 +291,22 @@ def _build_arguments_schema(cls, *args, **kwargs):
338291
args_schema.receiver_actions = AAZCustomListArg(
339292
options=["--add-actions"],
340293
singular_options=["--add-action", "-a"],
341-
help='''
342-
Add receivers to the action group.\n\n
343-
Usage: --add-action TYPE NAME [ARG ...]\n\n
344-
Email:\n\n
345-
Format: --add-action email NAME EMAIL_ADDRESS [usecommonalertschema]\n\n
346-
Example: --add-action email bob [email protected]\n\n
347-
SMS:\n\n
348-
Format: --add-action sms NAME COUNTRY_CODE PHONE_NUMBER\n\n
349-
Example: --add-action sms charli 1 5551234567\n\n
350-
Webhook:\n\n
351-
Format: --add-action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema]\n\n
352-
Example: --add-action https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema\n\n
353-
Arm Role:\n\n
354-
Format: --add-action armrole NAME ROLE_ID [usecommonalertschema]\n\n
355-
Example: --add-action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635\n\n
356-
Azure App Push:\n\n
357-
Format: --add-action azureapppush NAME EMAIL_ADDRESS\n\n
358-
Example: --add-action azureapppush test_apppush [email protected]\n\n
359-
ITSM:\n\n
360-
Format: --add-action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION\n\n
361-
Example: --add-action itsm test_itsm test_workspace test_conn ticket_blob useast\n\n
362-
Automation runbook:\n\n
363-
Format: --add-action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema]\n\n
364-
Example: --add-action automationrunbook test_runbook test_acc test_book test_webhook test_rsrc http://example.com isglobalrunbook usecommonalertschema\n\n
365-
Voice:\n\n
366-
Format: --add-action voice NAME COUNTRY_CODE PHONE_NUMBER\n\n
367-
Example: --add-action voice charli 1 4441234567\n\n
368-
Logic App:\n\n
369-
Format: --add-action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema]\n\n
370-
Example: --add-action logicapp test_logicapp test_rsrc http://callback\n\n
371-
Azure Function:\n\n
372-
Format: --add-action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema]\n\n
373-
Example: --add-action azurefunction test_function test_rsrc test_func http://trigger usecommonalertschema\n\n
374-
Event Hub:\n\n
375-
Format: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema]\n\n
376-
Example: --action eventhub test_eventhub 5def922a-3ed4-49c1-b9fd-05ec533819a3 eventhubNameSpace testEventHubName usecommonalertschema\n\n
377-
Multiple actions can be specified by using more than one `--add-action` argument.\n\n
378-
'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguements that only need to be passed to set the respective parameter to True.\n\n
379-
If the 'useaadauth' argument is passed, then the OBJECT_ID and IDENTIFIER_URI values are required as well.''',
294+
help="Add receivers to the action group. "
295+
"Usage: --add-action TYPE NAME [ARG ...]. "
296+
"Email: --add-action email NAME EMAIL_ADDRESS [usecommonalertschema]. "
297+
"SMS: --add-action sms NAME COUNTRY_CODE PHONE_NUMBER. "
298+
"Webhook: --add-action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema]. "
299+
"Arm Role: --add-action armrole NAME ROLE_ID [usecommonalertschema]. "
300+
"Azure App Push: --add-action azureapppush NAME EMAIL_ADDRESS. "
301+
"ITSM: --add-action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION. "
302+
"Automation runbook: --add-action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema]. "
303+
"Voice: --add-action voice NAME COUNTRY_CODE PHONE_NUMBER. "
304+
"Logic App: --add-action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema]. "
305+
"Azure Function: --add-action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema]. "
306+
"Event Hub: --add-action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema]. "
307+
"Multiple actions can be specified by using more than one `--add-action` argument. "
308+
"'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguments that only need to be passed to set the respective parameter to True. "
309+
"If the 'useaadauth' argument is passed, then the OBJECT_ID and IDENTIFIER_URI values are required as well.",
380310
)
381311
args_schema.receiver_actions.Element = AAZListArg()
382312
args_schema.receiver_actions.Element.Element = AAZStrArg()

0 commit comments

Comments
 (0)