Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,9 @@ def _register_network_resource_breaking_change(command_name):
register_argument_deprecate('postgres flexible-server create', '--high-availability', redirect='--zonal-resiliency')
register_argument_deprecate('postgres flexible-server update', '--high-availability', redirect='--zonal-resiliency')

# Long term retention command group deprecated with no redirect as the functionality will be removed in the future
register_command_group_deprecate(command_group='postgres flexible-server long-term-retention',
message='Long term retention command group will be removed. '
'For more information, open a support incident.')

# LTR command argument changes
register_other_breaking_change('postgres flexible-server long-term-retention',
message='The --backup-name/-b argument has been deprecated and will be removed '
'in next breaking change release(2.86.0) scheduled for May 2026.')
register_other_breaking_change('postgres flexible-server long-term-retention',
message='The --name/-n argument will be repurposed to specify the backup name. '
'The --server-name/-s argument will be introduced to specify the server name '
# Name of new backup no longer required in backup create command
register_other_breaking_change('postgres flexible-server backup create',
message='The argument for backup name will no longer be required '
'in next breaking change release(2.86.0) scheduled for May 2026.')

# Backup command argument changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ def cf_postgres_flexible_backups(cli_ctx, _):
return get_postgresql_flexible_management_client(cli_ctx).backups_automatic_and_on_demand


def cf_postgres_flexible_ltr_backups(cli_ctx, _):
return get_postgresql_flexible_management_client(cli_ctx).backups_long_term_retention


def cf_postgres_flexible_operations(cli_ctx, _):
return get_postgresql_flexible_management_client(cli_ctx).operations

Expand Down
37 changes: 0 additions & 37 deletions src/azure-cli/azure/cli/command_modules/postgresql/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,43 +784,6 @@
text: az postgres flexible-server backup delete -g testgroup -n testsvr --backup-name testbackup
"""

helps['postgres flexible-server long-term-retention'] = """
type: group
short-summary: Manage flexible server long-term-retention backups.
"""

helps['postgres flexible-server long-term-retention pre-check'] = """
type: command
short-summary: Performs all the checks that are needed for the subsequent long-term-retention backup operation to succeed.
examples:
- name: Precheck if we can perform long-term-retention command on server 'server-name' on resource group 'resource-group-name' with backup name 'backup-name'.
text: az postgres flexible-server long-term-retention pre-check -g resource-group-name -b backup-name -n server-name
"""

helps['postgres flexible-server long-term-retention start'] = """
type: command
short-summary: Start long-term-retention backup for a flexible server. SAS URL parameter refers to the container SAS URL, inside the storage account, where the backups will be uploaded.
examples:
- name: Create a backup with name 'backup-name' of server 'server-name' in resource group 'resource-group-name', using container with SAS URL '<sas-url>'.
text: az postgres flexible-server long-term-retention start -g resource-group-name -b backup-name -n server-name -u <sas-url>
"""

helps['postgres flexible-server long-term-retention show'] = """
type: command
short-summary: Show the details of a specific long-term-retention backup for a given server.
examples:
- name: Show the details of long-term-retention backup 'testbackup' for 'testsvr'.
text: az postgres flexible-server long-term-retention show -g resource-group-name -n server-name -b backup-name
"""

helps['postgres flexible-server long-term-retention list'] = """
type: command
short-summary: List all the long-term-retention backups for a given server.
examples:
- name: List all long-term-retention backups for 'testsvr'.
text: az postgres flexible-server long-term-retention list -g resource-group-name -n server-name
"""

helps['postgres flexible-server replica'] = """
type: group
short-summary: Manage read replicas.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,15 +585,6 @@ def _flexible_server_params(command_group):
with self.argument_context('{} flexible-server virtual-endpoint delete'.format(command_group)) as c:
c.argument('yes', arg_type=yes_arg_type)

# long-term-retention
for scope in ['show', 'start', 'pre-check']:
argument_context_string = '{} flexible-server long-term-retention {}'.format(command_group, scope)
with self.argument_context(argument_context_string) as c:
c.argument('backup_name', options_list=['--backup-name', '-b'], help='Long-term retention backup name.')

with self.argument_context('{} flexible-server long-term-retention start'.format(command_group)) as c:
c.argument('sas_url', options_list=['--sas-url', '-u'], help='Container SAS URL.')

for scope in ['create', 'update']:
argument_context_string = '{} flexible-server virtual-endpoint {}'.format(command_group, scope)
with self.argument_context(argument_context_string) as c:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,35 +44,6 @@ def backup_create_func(client, resource_group_name, server_name, backup_name=Non
backup_name)


def ltr_precheck_func(client, resource_group_name, server_name, backup_name):
validate_resource_group(resource_group_name)

return client.check_prerequisites(
resource_group_name=resource_group_name,
server_name=server_name,
parameters={"backupSettings": {"backupName": backup_name}}
)


def ltr_start_func(client, resource_group_name, server_name, backup_name, sas_url):
validate_resource_group(resource_group_name)

parameters = {
"backupSettings": {
"backupName": backup_name
},
"targetDetails": {
"sasUriList": [sas_url]
}
}

return client.begin_start(
resource_group_name=resource_group_name,
server_name=server_name,
parameters=parameters
)


def backup_delete_func(client, resource_group_name, server_name, backup_name, yes=False):
validate_resource_group(resource_group_name)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
cf_postgres_flexible_db,
cf_postgres_flexible_location_capabilities,
cf_postgres_flexible_backups,
cf_postgres_flexible_ltr_backups,
cf_postgres_flexible_replica,
cf_postgres_flexible_admin,
cf_postgres_flexible_migrations,
Expand Down Expand Up @@ -67,11 +66,6 @@ def load_flexibleserver_command_table(self, _):
client_factory=cf_postgres_flexible_backups
)

postgres_flexible_ltr_backup_sdk = CliCommandType(
operations_tmpl='azure.mgmt.postgresqlflexibleservers.operations#BackupsLongTermRetentionOperations.{}',
client_factory=cf_postgres_flexible_ltr_backups
)

postgres_flexible_replica_sdk = CliCommandType(
operations_tmpl='azure.mgmt.postgresqlflexibleservers.operations#ReplicasOperations.{}',
client_factory=cf_postgres_flexible_replica
Expand Down Expand Up @@ -241,14 +235,6 @@ def load_flexibleserver_command_table(self, _):
g.custom_command('create', 'backup_create_func')
g.custom_command('delete', 'backup_delete_func')

with self.command_group('postgres flexible-server long-term-retention', postgres_flexible_ltr_backup_sdk,
custom_command_type=backup_commands,
client_factory=cf_postgres_flexible_ltr_backups) as g:
g.command('list', 'list_by_server', transform=transform_backups_list)
g.show_command('show', 'get', transform=transform_backup)
g.custom_command('pre-check', 'ltr_precheck_func')
g.custom_command('start', 'ltr_start_func')

replica_commands = CliCommandType(
operations_tmpl='azure.cli.command_modules.postgresql.commands.replica_commands#{}')
with self.command_group('postgres flexible-server replica', postgres_flexible_replica_sdk,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ postgres flexible-server firewall-rule list:
postgres flexible-server identity list:
rule_exclusions:
- no_ids_for_list_commands
postgres flexible-server long-term-retention list:
rule_exclusions:
- no_ids_for_list_commands
postgres flexible-server microsoft-entra-admin list:
rule_exclusions:
- no_ids_for_list_commands
Expand Down

This file was deleted.

This file was deleted.

Loading