Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/azure-cli/azure/cli/command_modules/mysql/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,14 @@
text: az mysql flexible-server backup create -g testgroup -n testsvr --backup-name testbackup
"""

helps['mysql flexible-server backup delete'] = """
type: command
short-summary: Delete a backup for a given server with specified backup name.
examples:
- name: Delete a backup for 'testsvr' with backup name 'testbackup'.
text: az mysql flexible-server backup delete -g testgroup -n testsvr --backup-name testbackup
"""

helps['mysql flexible-server identity'] = """
type: group
short-summary: Manage server user assigned identities.
Expand Down
17 changes: 12 additions & 5 deletions src/azure-cli/azure/cli/command_modules/mysql/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def load_arguments(self, _): # pylint: disable=too-many-statements, too-many-
c.argument('public_access', arg_type=public_access_create_arg_type)
c.argument('vnet', arg_type=vnet_arg_type)
c.argument('vnet_address_prefix', arg_type=vnet_address_prefix_arg_type)
c.argument('storage_redundancy', arg_type=storage_redundancy_arg_type, default="LocalRedundancy")
c.argument('storage_redundancy', arg_type=storage_redundancy_arg_type, default="LocalRedundancy", deprecate_info=c.deprecate(hide=True))
Comment thread
honghr marked this conversation as resolved.
Outdated
c.argument('subnet', arg_type=subnet_arg_type)
c.argument('subnet_address_prefix', arg_type=subnet_address_prefix_arg_type)
c.argument('private_dns_zone_arguments', private_dns_zone_arguments_arg_type)
Expand Down Expand Up @@ -431,7 +431,7 @@ def load_arguments(self, _): # pylint: disable=too-many-statements, too-many-
c.argument('vnet_address_prefix', arg_type=vnet_address_prefix_arg_type)
c.argument('subnet', arg_type=subnet_arg_type)
c.argument('subnet_address_prefix', arg_type=subnet_address_prefix_arg_type)
c.argument('storage_redundancy', arg_type=storage_redundancy_arg_type)
c.argument('storage_redundancy', arg_type=storage_redundancy_arg_type, deprecate_info=c.deprecate(hide=True))
c.argument('private_dns_zone_arguments', private_dns_zone_arguments_arg_type)
c.argument('zone', arg_type=zone_arg_type)
c.argument('tags', tags_type)
Expand Down Expand Up @@ -464,7 +464,7 @@ def load_arguments(self, _): # pylint: disable=too-many-statements, too-many-
c.argument('storage_gb', arg_type=storage_gb_arg_type)
c.argument('auto_grow', arg_type=auto_grow_arg_type)
c.argument('accelerated_logs', arg_type=accelerated_logs_arg_type)
c.argument('storage_redundancy', arg_type=storage_redundancy_arg_type)
c.argument('storage_redundancy', arg_type=storage_redundancy_arg_type, deprecate_info=c.deprecate(hide=True))
c.argument('backup_retention', arg_type=mysql_backup_retention_arg_type)
c.argument('geo_redundant_backup', arg_type=geo_redundant_backup_arg_type)
c.argument('public_access', options_list=['--public-access'], arg_type=get_enum_type(['Enabled', 'Disabled']), help='Determines the public access. ')
Expand Down Expand Up @@ -594,7 +594,7 @@ def load_arguments(self, _): # pylint: disable=too-many-statements, too-many-
c.argument('sku_name', arg_type=sku_name_arg_type)
c.argument('storage_gb', arg_type=storage_gb_arg_type)
c.argument('iops', arg_type=iops_arg_type)
c.argument('storage_redundancy', arg_type=storage_redundancy_arg_type, default="LocalRedundancy")
c.argument('storage_redundancy', arg_type=storage_redundancy_arg_type, default="LocalRedundancy", deprecate_info=c.deprecate(hide=True))
c.argument('faster_provisioning', arg_type=faster_provisioning_arg_type)
c.argument('database_port', arg_type=database_port_arg_type)
c.argument('backup_retention', arg_type=mysql_backup_retention_arg_type)
Expand Down Expand Up @@ -633,8 +633,15 @@ def load_arguments(self, _): # pylint: disable=too-many-statements, too-many-
with self.argument_context('mysql flexible-server backup create') as c:
c.argument('backup_name', options_list=['--backup-name', '-b'], help='The name of the new backup.')

with self.argument_context('mysql flexible-server backup delete') as c:
c.argument('resource_group_name', arg_type=resource_group_name_type)
c.argument('server_name', id_part=None, arg_type=server_name_arg_type)
c.argument('backup_name', options_list=['--backup-name', '-b'], help='The name of the backup.')

with self.argument_context('mysql flexible-server backup show') as c:
c.argument('backup_name', id_part='child_name_1', options_list=['--backup-name', '-b'], help='The name of the backup.')
c.argument('resource_group_name', arg_type=resource_group_name_type)
c.argument('server_name', id_part=None, arg_type=server_name_arg_type)
c.argument('backup_name', options_list=['--backup-name', '-b'], help='The name of the backup.')

with self.argument_context('mysql flexible-server backup list') as c:
c.argument('server_name', id_part=None, arg_type=server_name_arg_type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def load_command_table(self, _):
with self.command_group('mysql flexible-server backup', mysql_flexible_long_running_backup_sdk,
client_factory=cf_mysql_flexible_backup) as g:
g.command('create', 'begin_create')
g.command('delete', 'begin_delete')
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newly added backup delete command lacks test coverage. The existing test file test_mysql_scenario.py has a test for backup create in the _test_backups_mgmt method, but there is no corresponding test for the delete functionality. Consider adding test coverage for this new command to ensure it functions correctly.

Copilot uses AI. Check for mistakes.

with self.command_group('mysql flexible-server backup', mysql_flexible_long_running_backups_sdk,
client_factory=cf_mysql_flexible_backups) as g:
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Loading