From a83608b19aebfb081f0dbe5870bf013b1e2ecd31 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Dec 2025 06:20:25 +0000 Subject: [PATCH 1/2] Initial plan From 6bab05ccc50eae765e589c7427a919024b843397 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Dec 2025 06:28:19 +0000 Subject: [PATCH 2/2] Fix action-group create parameter help text formatting Co-authored-by: dcaro <6418658+dcaro@users.noreply.github.com> --- .../monitor/operations/action_groups.py | 166 +++++------------- 1 file changed, 48 insertions(+), 118 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/monitor/operations/action_groups.py b/src/azure-cli/azure/cli/command_modules/monitor/operations/action_groups.py index f25bcaa605f..5e136ef7660 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/operations/action_groups.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/operations/action_groups.py @@ -132,46 +132,22 @@ def _build_arguments_schema(cls, *args, **kwargs): args_schema.receiver_actions = AAZCustomListArg( options=["--actions"], singular_options=["--action", "-a"], - help=''' - Add receivers to the action group during the creation.\n\n - Usage: --action TYPE NAME [ARG ...]\n\n - Email:\n\n - Format: --action email NAME EMAIL_ADDRESS [usecommonalertschema]\n\n - Example: --action email bob bob@contoso.com\n\n - SMS:\n\n - Format: --action sms NAME COUNTRY_CODE PHONE_NUMBER\n\n - Example: --action sms charli 1 5551234567\n\n - Webhook:\n\n - Format: --action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema]\n\n - Example: --action webhook alert_hook https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema\n\n - Arm Role:\n\n - Format: --action armrole NAME ROLE_ID [usecommonalertschema]\n\n - Example: --action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635\n\n - Azure App Push:\n\n - Format: --action azureapppush NAME EMAIL_ADDRESS\n\n - Example: --action azureapppush test_apppush bob@contoso.com\n\n - ITSM:\n\n - Format: --action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION\n\n - Example: --action itsm test_itsm test_workspace test_conn ticket_blob useast\n\n - Automation runbook:\n\n - Format: --action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema]\n\n - Example: --action automationrunbook test_runbook test_acc test_book test_webhook test_rsrc http://example.com isglobalrunbook usecommonalertschema\n\n - Voice:\n\n - Format: --action voice NAME COUNTRY_CODE PHONE_NUMBER\n\n - Example: --action voice charli 1 4441234567\n\n - Logic App:\n\n - Format: --action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema]\n\n - Example: --action logicapp test_logicapp test_rsrc http://callback\n\n - Azure Function:\n\n - Format: --action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema]\n\n - Example: --action azurefunction test_function test_rsrc test_func http://trigger usecommonalertschema\n\n - Event Hub:\n\n - Format: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema]\n\n - Example: --action eventhub test_eventhub 5def922a-3ed4-49c1-b9fd-05ec533819a3 eventhubNameSpace testEventHubName usecommonalertschema\n\n - Multiple actions can be specified by using more than one `--add-action` argument.\n\n - 'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguements that only need to be passed to set the respective parameter to True.\n\n - If the 'useaadauth' argument is passed, then the OBJECT_ID and IDENTIFIER_URI values are required as well. - ''', + help="Add receivers to the action group during the creation. " + "Usage: --action TYPE NAME [ARG ...]. " + "Email: --action email NAME EMAIL_ADDRESS [usecommonalertschema]. " + "SMS: --action sms NAME COUNTRY_CODE PHONE_NUMBER. " + "Webhook: --action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema]. " + "Arm Role: --action armrole NAME ROLE_ID [usecommonalertschema]. " + "Azure App Push: --action azureapppush NAME EMAIL_ADDRESS. " + "ITSM: --action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION. " + "Automation runbook: --action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema]. " + "Voice: --action voice NAME COUNTRY_CODE PHONE_NUMBER. " + "Logic App: --action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema]. " + "Azure Function: --action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema]. " + "Event Hub: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema]. " + "Multiple actions can be specified by using more than one `--action` argument. " + "'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguments that only need to be passed to set the respective parameter to True. " + "If the 'useaadauth' argument is passed, then the OBJECT_ID and IDENTIFIER_URI values are required as well.", arg_group="Actions", ) args_schema.receiver_actions.Element = AAZCustomListArg() @@ -202,45 +178,22 @@ def _build_arguments_schema(cls, *args, **kwargs): args_schema.receiver_actions = AAZCustomListArg( options=["--add-actions"], singular_options=["--add-action", "-a"], - help=''' - Add receivers to the action group.\n\n - Usage: --add-action TYPE NAME [ARG ...]\n\n - Email:\n\n - Format: --add-action email NAME EMAIL_ADDRESS [usecommonalertschema]\n\n - Example: --add-action email bob bob@contoso.com\n\n - SMS:\n\n - Format: --add-action sms NAME COUNTRY_CODE PHONE_NUMBER\n\n - Example: --add-action sms charli 1 5551234567\n\n - Webhook:\n\n - Format: --add-action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema]\n\n - Example: --add-action https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema\n\n - Arm Role:\n\n - Format: --add-action armrole NAME ROLE_ID [usecommonalertschema]\n\n - Example: --add-action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635\n\n - Azure App Push:\n\n - Format: --add-action azureapppush NAME EMAIL_ADDRESS\n\n - Example: --add-action azureapppush test_apppush bob@contoso.com\n\n - ITSM:\n\n - Format: --add-action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION\n\n - Example: --add-action itsm test_itsm test_workspace test_conn ticket_blob useast\n\n - Automation runbook:\n\n - Format: --add-action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema]\n\n - Example: --add-action automationrunbook test_runbook test_acc test_book test_webhook test_rsrc http://example.com isglobalrunbook usecommonalertschema\n\n - Voice:\n\n - Format: --add-action voice NAME COUNTRY_CODE PHONE_NUMBER\n\n - Example: --add-action voice charli 1 4441234567\n\n - Logic App:\n\n - Format: --add-action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema]\n\n - Example: --add-action logicapp test_logicapp test_rsrc http://callback\n\n - Azure Function:\n\n - Format: --add-action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema]\n\n - Example: --add-action azurefunction test_function test_rsrc test_func http://trigger usecommonalertschema\n\n - Event Hub:\n\n - Format: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema]\n\n - Example: --action eventhub test_eventhub 5def922a-3ed4-49c1-b9fd-05ec533819a3 eventhubNameSpace testEventHubName usecommonalertschema\n\n - Multiple actions can be specified by using more than one `--add-action` argument.\n\n - 'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguements that only need to be passed to set the respective parameter to True.\n\n - If the 'useaadauth' argument is passed, then the OBJECT_ID and IDENTIFIER_URI values are required as well.''', + help="Add receivers to the action group. " + "Usage: --add-action TYPE NAME [ARG ...]. " + "Email: --add-action email NAME EMAIL_ADDRESS [usecommonalertschema]. " + "SMS: --add-action sms NAME COUNTRY_CODE PHONE_NUMBER. " + "Webhook: --add-action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema]. " + "Arm Role: --add-action armrole NAME ROLE_ID [usecommonalertschema]. " + "Azure App Push: --add-action azureapppush NAME EMAIL_ADDRESS. " + "ITSM: --add-action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION. " + "Automation runbook: --add-action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema]. " + "Voice: --add-action voice NAME COUNTRY_CODE PHONE_NUMBER. " + "Logic App: --add-action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema]. " + "Azure Function: --add-action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema]. " + "Event Hub: --add-action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema]. " + "Multiple actions can be specified by using more than one `--add-action` argument. " + "'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguments that only need to be passed to set the respective parameter to True. " + "If the 'useaadauth' argument is passed, then the OBJECT_ID and IDENTIFIER_URI values are required as well.", arg_group="Actions", ) args_schema.receiver_actions.Element = AAZListArg() @@ -338,45 +291,22 @@ def _build_arguments_schema(cls, *args, **kwargs): args_schema.receiver_actions = AAZCustomListArg( options=["--add-actions"], singular_options=["--add-action", "-a"], - help=''' - Add receivers to the action group.\n\n - Usage: --add-action TYPE NAME [ARG ...]\n\n - Email:\n\n - Format: --add-action email NAME EMAIL_ADDRESS [usecommonalertschema]\n\n - Example: --add-action email bob bob@contoso.com\n\n - SMS:\n\n - Format: --add-action sms NAME COUNTRY_CODE PHONE_NUMBER\n\n - Example: --add-action sms charli 1 5551234567\n\n - Webhook:\n\n - Format: --add-action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema]\n\n - Example: --add-action https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema\n\n - Arm Role:\n\n - Format: --add-action armrole NAME ROLE_ID [usecommonalertschema]\n\n - Example: --add-action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635\n\n - Azure App Push:\n\n - Format: --add-action azureapppush NAME EMAIL_ADDRESS\n\n - Example: --add-action azureapppush test_apppush bob@contoso.com\n\n - ITSM:\n\n - Format: --add-action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION\n\n - Example: --add-action itsm test_itsm test_workspace test_conn ticket_blob useast\n\n - Automation runbook:\n\n - Format: --add-action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema]\n\n - Example: --add-action automationrunbook test_runbook test_acc test_book test_webhook test_rsrc http://example.com isglobalrunbook usecommonalertschema\n\n - Voice:\n\n - Format: --add-action voice NAME COUNTRY_CODE PHONE_NUMBER\n\n - Example: --add-action voice charli 1 4441234567\n\n - Logic App:\n\n - Format: --add-action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema]\n\n - Example: --add-action logicapp test_logicapp test_rsrc http://callback\n\n - Azure Function:\n\n - Format: --add-action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema]\n\n - Example: --add-action azurefunction test_function test_rsrc test_func http://trigger usecommonalertschema\n\n - Event Hub:\n\n - Format: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema]\n\n - Example: --action eventhub test_eventhub 5def922a-3ed4-49c1-b9fd-05ec533819a3 eventhubNameSpace testEventHubName usecommonalertschema\n\n - Multiple actions can be specified by using more than one `--add-action` argument.\n\n - 'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguements that only need to be passed to set the respective parameter to True.\n\n - If the 'useaadauth' argument is passed, then the OBJECT_ID and IDENTIFIER_URI values are required as well.''', + help="Add receivers to the action group. " + "Usage: --add-action TYPE NAME [ARG ...]. " + "Email: --add-action email NAME EMAIL_ADDRESS [usecommonalertschema]. " + "SMS: --add-action sms NAME COUNTRY_CODE PHONE_NUMBER. " + "Webhook: --add-action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema]. " + "Arm Role: --add-action armrole NAME ROLE_ID [usecommonalertschema]. " + "Azure App Push: --add-action azureapppush NAME EMAIL_ADDRESS. " + "ITSM: --add-action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION. " + "Automation runbook: --add-action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema]. " + "Voice: --add-action voice NAME COUNTRY_CODE PHONE_NUMBER. " + "Logic App: --add-action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema]. " + "Azure Function: --add-action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema]. " + "Event Hub: --add-action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema]. " + "Multiple actions can be specified by using more than one `--add-action` argument. " + "'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguments that only need to be passed to set the respective parameter to True. " + "If the 'useaadauth' argument is passed, then the OBJECT_ID and IDENTIFIER_URI values are required as well.", ) args_schema.receiver_actions.Element = AAZListArg() args_schema.receiver_actions.Element.Element = AAZStrArg()