Skip to content

Commit a53db05

Browse files
authored
[Sql] az sql ltr-policy set: Remove ltr backup policy unused parameter --access-tier (#31466)
1 parent 9b9d313 commit a53db05

File tree

4 files changed

+4
-25
lines changed

4 files changed

+4
-25
lines changed

src/azure-cli/azure/cli/command_modules/sql/_help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
short-summary: Update long term retention settings for a database.
243243
examples:
244244
- name: Set long term retention for a database.
245-
text: az sql db ltr-policy set -g mygroup -s myserver -n mydb --weekly-retention "P1W" --monthly-retention "P6M" --yearly-retention "P1Y" --week-of-year 26 --access-tier "Archive" --make-backups-immutable true
245+
text: az sql db ltr-policy set -g mygroup -s myserver -n mydb --weekly-retention "P1W" --monthly-retention "P6M" --yearly-retention "P1Y" --week-of-year 26 --make-backups-immutable true
246246
"""
247247

248248
helps['sql db ltr-policy show'] = """

src/azure-cli/azure/cli/command_modules/sql/_params.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,8 +1312,7 @@ def _configure_security_policy_storage_params(arg_ctx):
13121312
'monthly_retention',
13131313
'yearly_retention',
13141314
'week_of_year',
1315-
'make_backups_immutable',
1316-
'backup_storage_access_tier'])
1315+
'make_backups_immutable'])
13171316

13181317
c.argument('weekly_retention',
13191318
help='Retention for the weekly backup. '
@@ -1337,12 +1336,6 @@ def _configure_security_policy_storage_params(arg_ctx):
13371336
help='Whether to make the LTR backups immutable.',
13381337
arg_type=get_three_state_flag())
13391338

1340-
c.argument('backup_storage_access_tier',
1341-
options_list=['--access-tier', '--backup-storage-access-tier'],
1342-
arg_type=get_enum_type(["Hot", "Archive"]),
1343-
help='The access tier of a LTR backup.'
1344-
'Possible values = [Hot, Archive]')
1345-
13461339
with self.argument_context('sql db ltr-backup') as c:
13471340
c.argument('location_name',
13481341
required=True,

src/azure-cli/azure/cli/command_modules/sql/custom.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@
9797

9898
logger = get_logger(__name__)
9999

100-
BACKUP_STORAGE_ACCESS_TIERS = ["hot",
101-
"archive"]
102-
103100
###############################################
104101
# Common funcs #
105102
###############################################
@@ -3103,7 +3100,6 @@ def update_long_term_retention(
31033100
yearly_retention=None,
31043101
week_of_year=None,
31053102
make_backups_immutable=None,
3106-
backup_storage_access_tier=None,
31073103
**kwargs):
31083104
'''
31093105
Updates long term retention for managed database
@@ -3121,10 +3117,6 @@ def update_long_term_retention(
31213117
if not confirmation:
31223118
return
31233119

3124-
if backup_storage_access_tier and backup_storage_access_tier.lower() not in BACKUP_STORAGE_ACCESS_TIERS:
3125-
raise CLIError('Please specify a valid backup storage access tier type for backup storage access tier.'
3126-
'See \'--help\' for more details.')
3127-
31283120
kwargs['weekly_retention'] = weekly_retention
31293121

31303122
kwargs['monthly_retention'] = monthly_retention
@@ -3135,8 +3127,6 @@ def update_long_term_retention(
31353127

31363128
kwargs['make_backups_immutable'] = make_backups_immutable
31373129

3138-
kwargs['backup_storage_access_tier'] = backup_storage_access_tier
3139-
31403130
policy = client.begin_create_or_update(
31413131
database_name=database_name,
31423132
server_name=server_name,

src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,6 @@ def test_sql_db_long_term_retention(
12771277
'yearly_retention': 'P2M',
12781278
'week_of_year': 12,
12791279
'make_backups_immutable': 'False',
1280-
'backup_storage_access_tier': 'Archive',
12811280
'encryption_protector' : 'https://test123343strehan.vault.azure.net/keys/testk1/604b0e26e2a24eeaab30b80c8d7bb1c1',
12821281
'keys' : '"https://test123343strehan.vault.azure.net/keys/k2/66f51a6e70f04067af8eaf77805e88b1" "https://test123343strehan.vault.azure.net/keys/testk1/604b0e26e2a24eeaab30b80c8d7bb1c1" "https://test123343strehan.vault.azure.net/keys/testk1/96151496df864e32aa62a3c1857b2931"',
12831282
'umi' : '/subscriptions/e1775f9f-a286-474d-b6f0-29c42ac74554/resourcegroups/ArmTemplate/providers/Microsoft.ManagedIdentity/userAssignedIdentities/shobhittest'
@@ -1289,14 +1288,12 @@ def test_sql_db_long_term_retention(
12891288
' --weekly-retention {weekly_retention} --monthly-retention {monthly_retention}'
12901289
' --yearly-retention {yearly_retention} --week-of-year {week_of_year}'
12911290
' --make-backups-immutable {make_backups_immutable}',
1292-
' --access-tier {backup_storage_access_tier}',
12931291
checks=[
12941292
self.check('resourceGroup', '{rg}'),
12951293
self.check('weeklyRetention', '{weekly_retention}'),
12961294
self.check('monthlyRetention', '{monthly_retention}'),
12971295
self.check('yearlyRetention', '{yearly_retention}'),
1298-
self.check('makeBackupsImmutable', '{make_backups_immutable}'),
1299-
self.check('backupStorageAccessTier', '{backup_storage_access_tier}')])
1296+
self.check('makeBackupsImmutable', '{make_backups_immutable}')])
13001297

13011298
# test get long term retention policy on live database
13021299
self.cmd(
@@ -1306,8 +1303,7 @@ def test_sql_db_long_term_retention(
13061303
self.check('weeklyRetention', '{weekly_retention}'),
13071304
self.check('monthlyRetention', '{monthly_retention}'),
13081305
self.check('yearlyRetention', '{yearly_retention}'),
1309-
self.check('makeBackupsImmutable', '{make_backups_immutable}'),
1310-
self.check('backupStorageAccessTier', '{backup_storage_access_tier}')])
1306+
self.check('makeBackupsImmutable', '{make_backups_immutable}')])
13111307

13121308
# test list long term retention backups for location
13131309
# with resource group

0 commit comments

Comments
 (0)