From 4f1cd8a6d56a6784bf938e5ac27d14389aa42a59 Mon Sep 17 00:00:00 2001 From: AllyW Date: Fri, 30 Aug 2024 16:56:56 +0800 Subject: [PATCH] format long summary --- .../monitor/operations/action_groups.py | 241 +++++++++--------- .../monitor/operations/autoscale_settings.py | 30 ++- 2 files changed, 144 insertions(+), 127 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 99e26de846b..177335c13da 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 @@ -144,45 +144,48 @@ 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." + ''' - Usage: --action TYPE NAME [ARG ...] - Email: - Format: --action email NAME EMAIL_ADDRESS [usecommonalertschema] - Example: --action email bob bob@contoso.com - SMS: - Format: --action sms NAME COUNTRY_CODE PHONE_NUMBER - Example: --action sms charli 1 5551234567 - Webhook: - Format: --action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema] - Example: --action webhook alert_hook https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema - Arm Role: - Format: --action armrole NAME ROLE_ID [usecommonalertschema] - Example: --action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635 - Azure App Push: - Format: --action azureapppush NAME EMAIL_ADDRESS - Example: --action azureapppush test_apppush bob@contoso.com - ITSM: - Format: --action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION - Example: --action itsm test_itsm test_workspace test_conn ticket_blob useast - Automation runbook: - Format: --action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema] - Example: --action automationrunbook test_runbook test_acc test_book test_webhook test_rsrc http://example.com isglobalrunbook usecommonalertschema - Voice: - Format: --action voice NAME COUNTRY_CODE PHONE_NUMBER - Example: --action voice charli 1 4441234567 - Logic App: - Format: --action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema] - Example: --action logicapp test_logicapp test_rsrc http://callback - Azure Function: - Format: --action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema] - Example: --action azurefunction test_function test_rsrc test_func http://trigger usecommonalertschema - Event Hub: - Format: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema] - Example: --action eventhub test_eventhub 5def922a-3ed4-49c1-b9fd-05ec533819a3 eventhubNameSpace testEventHubName usecommonalertschema - Multiple actions can be specified by using more than one `--add-action` argument. - 'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguements 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. - ''', + help={ + "short-summary": "Add receivers to the action group during the creation.", + "long-summary": ''' + Usage: --action TYPE NAME [ARG ...] + Email: + Format: --action email NAME EMAIL_ADDRESS [usecommonalertschema] + Example: --action email bob bob@contoso.com + SMS: + Format: --action sms NAME COUNTRY_CODE PHONE_NUMBER + Example: --action sms charli 1 5551234567 + Webhook: + Format: --action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema] + Example: --action webhook alert_hook https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema + Arm Role: + Format: --action armrole NAME ROLE_ID [usecommonalertschema] + Example: --action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635 + Azure App Push: + Format: --action azureapppush NAME EMAIL_ADDRESS + Example: --action azureapppush test_apppush bob@contoso.com + ITSM: + Format: --action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION + Example: --action itsm test_itsm test_workspace test_conn ticket_blob useast + Automation runbook: + Format: --action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema] + Example: --action automationrunbook test_runbook test_acc test_book test_webhook test_rsrc http://example.com isglobalrunbook usecommonalertschema + Voice: + Format: --action voice NAME COUNTRY_CODE PHONE_NUMBER + Example: --action voice charli 1 4441234567 + Logic App: + Format: --action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema] + Example: --action logicapp test_logicapp test_rsrc http://callback + Azure Function: + Format: --action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema] + Example: --action azurefunction test_function test_rsrc test_func http://trigger usecommonalertschema + Event Hub: + Format: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema] + Example: --action eventhub test_eventhub 5def922a-3ed4-49c1-b9fd-05ec533819a3 eventhubNameSpace testEventHubName usecommonalertschema + Multiple actions can be specified by using more than one `--add-action` argument. + 'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguements 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() @@ -225,44 +228,48 @@ 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." + ''' - Usage: --add-action TYPE NAME [ARG ...] - Email: - Format: --add-action email NAME EMAIL_ADDRESS [usecommonalertschema] - Example: --add-action email bob bob@contoso.com - SMS: - Format: --add-action sms NAME COUNTRY_CODE PHONE_NUMBER - Example: --add-action sms charli 1 5551234567 - Webhook: - Format: --add-action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema] - Example: --add-action https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema - Arm Role: - Format: --add-action armrole NAME ROLE_ID [usecommonalertschema] - Example: --add-action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635 - Azure App Push: - Format: --add-action azureapppush NAME EMAIL_ADDRESS - Example: --add-action azureapppush test_apppush bob@contoso.com - ITSM: - Format: --add-action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION - Example: --add-action itsm test_itsm test_workspace test_conn ticket_blob useast - Automation runbook: - Format: --add-action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema] - Example: --add-action automationrunbook test_runbook test_acc test_book test_webhook test_rsrc http://example.com isglobalrunbook usecommonalertschema - Voice: - Format: --add-action voice NAME COUNTRY_CODE PHONE_NUMBER - Example: --add-action voice charli 1 4441234567 - Logic App: - Format: --add-action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema] - Example: --add-action logicapp test_logicapp test_rsrc http://callback - Azure Function: - Format: --add-action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema] - Example: --add-action azurefunction test_function test_rsrc test_func http://trigger usecommonalertschema - Event Hub: - Format: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema] - Example: --action eventhub test_eventhub 5def922a-3ed4-49c1-b9fd-05ec533819a3 eventhubNameSpace testEventHubName usecommonalertschema - Multiple actions can be specified by using more than one `--add-action` argument. - 'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguements 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.''', + help={ + "short-summary": "Add receivers to the action group.", + "long-summary": ''' + Usage: --add-action TYPE NAME [ARG ...] + Email: + Format: --add-action email NAME EMAIL_ADDRESS [usecommonalertschema] + Example: --add-action email bob bob@contoso.com + SMS: + Format: --add-action sms NAME COUNTRY_CODE PHONE_NUMBER + Example: --add-action sms charli 1 5551234567 + Webhook: + Format: --add-action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema] + Example: --add-action https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema + Arm Role: + Format: --add-action armrole NAME ROLE_ID [usecommonalertschema] + Example: --add-action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635 + Azure App Push: + Format: --add-action azureapppush NAME EMAIL_ADDRESS + Example: --add-action azureapppush test_apppush bob@contoso.com + ITSM: + Format: --add-action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION + Example: --add-action itsm test_itsm test_workspace test_conn ticket_blob useast + Automation runbook: + Format: --add-action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema] + Example: --add-action automationrunbook test_runbook test_acc test_book test_webhook test_rsrc http://example.com isglobalrunbook usecommonalertschema + Voice: + Format: --add-action voice NAME COUNTRY_CODE PHONE_NUMBER + Example: --add-action voice charli 1 4441234567 + Logic App: + Format: --add-action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema] + Example: --add-action logicapp test_logicapp test_rsrc http://callback + Azure Function: + Format: --add-action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema] + Example: --add-action azurefunction test_function test_rsrc test_func http://trigger usecommonalertschema + Event Hub: + Format: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema] + Example: --action eventhub test_eventhub 5def922a-3ed4-49c1-b9fd-05ec533819a3 eventhubNameSpace testEventHubName usecommonalertschema + Multiple actions can be specified by using more than one `--add-action` argument. + 'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguements 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() @@ -356,44 +363,48 @@ 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." + ''' - Usage: --add-action TYPE NAME [ARG ...] - Email: - Format: --add-action email NAME EMAIL_ADDRESS [usecommonalertschema] - Example: --add-action email bob bob@contoso.com - SMS: - Format: --add-action sms NAME COUNTRY_CODE PHONE_NUMBER - Example: --add-action sms charli 1 5551234567 - Webhook: - Format: --add-action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema] - Example: --add-action https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema - Arm Role: - Format: --add-action armrole NAME ROLE_ID [usecommonalertschema] - Example: --add-action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635 - Azure App Push: - Format: --add-action azureapppush NAME EMAIL_ADDRESS - Example: --add-action azureapppush test_apppush bob@contoso.com - ITSM: - Format: --add-action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION - Example: --add-action itsm test_itsm test_workspace test_conn ticket_blob useast - Automation runbook: - Format: --add-action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema] - Example: --add-action automationrunbook test_runbook test_acc test_book test_webhook test_rsrc http://example.com isglobalrunbook usecommonalertschema - Voice: - Format: --add-action voice NAME COUNTRY_CODE PHONE_NUMBER - Example: --add-action voice charli 1 4441234567 - Logic App: - Format: --add-action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema] - Example: --add-action logicapp test_logicapp test_rsrc http://callback - Azure Function: - Format: --add-action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema] - Example: --add-action azurefunction test_function test_rsrc test_func http://trigger usecommonalertschema - Event Hub: - Format: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema] - Example: --action eventhub test_eventhub 5def922a-3ed4-49c1-b9fd-05ec533819a3 eventhubNameSpace testEventHubName usecommonalertschema - Multiple actions can be specified by using more than one `--add-action` argument. - 'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguements 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.''', + help={ + "short-summary": "Add receivers to the action group.", + "long-summary": ''' + Usage: --add-action TYPE NAME [ARG ...] + Email: + Format: --add-action email NAME EMAIL_ADDRESS [usecommonalertschema] + Example: --add-action email bob bob@contoso.com + SMS: + Format: --add-action sms NAME COUNTRY_CODE PHONE_NUMBER + Example: --add-action sms charli 1 5551234567 + Webhook: + Format: --add-action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema] + Example: --add-action https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema + Arm Role: + Format: --add-action armrole NAME ROLE_ID [usecommonalertschema] + Example: --add-action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635 + Azure App Push: + Format: --add-action azureapppush NAME EMAIL_ADDRESS + Example: --add-action azureapppush test_apppush bob@contoso.com + ITSM: + Format: --add-action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION + Example: --add-action itsm test_itsm test_workspace test_conn ticket_blob useast + Automation runbook: + Format: --add-action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema] + Example: --add-action automationrunbook test_runbook test_acc test_book test_webhook test_rsrc http://example.com isglobalrunbook usecommonalertschema + Voice: + Format: --add-action voice NAME COUNTRY_CODE PHONE_NUMBER + Example: --add-action voice charli 1 4441234567 + Logic App: + Format: --add-action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema] + Example: --add-action logicapp test_logicapp test_rsrc http://callback + Azure Function: + Format: --add-action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema] + Example: --add-action azurefunction test_function test_rsrc test_func http://trigger usecommonalertschema + Event Hub: + Format: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema] + Example: --action eventhub test_eventhub 5def922a-3ed4-49c1-b9fd-05ec533819a3 eventhubNameSpace testEventHubName usecommonalertschema + Multiple actions can be specified by using more than one `--add-action` argument. + 'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguements 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() diff --git a/src/azure-cli/azure/cli/command_modules/monitor/operations/autoscale_settings.py b/src/azure-cli/azure/cli/command_modules/monitor/operations/autoscale_settings.py index 5410e338dc1..61b3c9c6c2d 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/operations/autoscale_settings.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/operations/autoscale_settings.py @@ -109,13 +109,16 @@ def _build_arguments_schema(cls, *args, **kwargs): args_schema.add_actions = AAZCustomListArg( options=["--add-actions"], singular_options=['--add-action', '-a'], - help="Add an action to fire when a scaling event occurs." + ''' - Usage: --add-action TYPE KEY [ARG ...] - Email: --add-action email bob@contoso.com ann@contoso.com - Webhook: --add-action webhook https://www.contoso.com/alert apiKey=value - Webhook: --add-action webhook https://www.contoso.com/alert?apiKey=value - Multiple actions can be specified by using more than one `--add-action` argument. - ''', + help={ + "short-summary": "Add an action to fire when a scaling event occurs.", + "long-summary": ''' + Usage: --add-action TYPE KEY [ARG ...] + Email: --add-action email bob@contoso.com ann@contoso.com + Webhook: --add-action webhook https://www.contoso.com/alert apiKey=value + Webhook: --add-action webhook https://www.contoso.com/alert?apiKey=value + Multiple actions can be specified by using more than one `--add-action` argument. + ''' + }, arg_group="Notification", ) args_schema.add_actions.Element = AAZCustomListArg() @@ -124,11 +127,14 @@ def _build_arguments_schema(cls, *args, **kwargs): args_schema.remove_actions = AAZCustomListArg( options=["--remove-actions"], singular_options=['--remove-action', '-r'], - help="Remove one or more actions." + ''' - Usage: --remove-action TYPE KEY [KEY ...] - Email: --remove-action email bob@contoso.com ann@contoso.com - Webhook: --remove-action webhook https://contoso.com/alert https://alerts.contoso.com. - ''', + help={ + "short-summary": "Remove one or more actions.", + "long-summary": ''' + Usage: --remove-action TYPE KEY [KEY ...] + Email: --remove-action email bob@contoso.com ann@contoso.com + Webhook: --remove-action webhook https://contoso.com/alert https://alerts.contoso.com. + ''' + }, arg_group="Notification", ) args_schema.remove_actions.Element = AAZCustomListArg()