|
73 | 73 | create_args_for_complex_type, |
74 | 74 | validate_managed_instance_storage_size, |
75 | 75 | validate_backup_storage_redundancy, |
76 | | - validate_subnet |
| 76 | + validate_subnet, |
| 77 | + validate_soft_delete_retention_days |
77 | 78 | ) |
78 | 79 |
|
79 | 80 | ##### |
@@ -1914,6 +1915,17 @@ def _configure_security_policy_storage_params(arg_ctx): |
1914 | 1915 | options_list=['--federated-client-id', '--fid'], |
1915 | 1916 | help='The federated client id used in cross tenant CMK scenario.') |
1916 | 1917 |
|
| 1918 | + c.argument('soft_delete_retention_days', |
| 1919 | + options_list=['--soft-delete-retention-days', '--sdrd'], |
| 1920 | + type=int, |
| 1921 | + validator=validate_soft_delete_retention_days, |
| 1922 | + is_preview=True, |
| 1923 | + help='Specify the number of days to retain soft deleted server (0-7). ' |
| 1924 | + 'Set to 0 to disable soft delete. ' |
| 1925 | + 'Set to 1-7 days to enable soft delete with the specified retention period. ' |
| 1926 | + 'During the retention period, the server can be restored using ' |
| 1927 | + 'az sql server restore.') |
| 1928 | + |
1917 | 1929 | with self.argument_context('sql server create') as c: |
1918 | 1930 | c.argument('location', |
1919 | 1931 | arg_type=get_location_type_with_default_from_resource_group(self.cli_ctx)) |
@@ -1960,11 +1972,26 @@ def _configure_security_policy_storage_params(arg_ctx): |
1960 | 1972 | c.argument('administrator_login_password', |
1961 | 1973 | help='The administrator login password.') |
1962 | 1974 |
|
| 1975 | + c.argument('soft_delete_retention_days', |
| 1976 | + options_list=['--soft-delete-retention-days', '--sdrd'], |
| 1977 | + type=int, |
| 1978 | + validator=validate_soft_delete_retention_days, |
| 1979 | + is_preview=True, |
| 1980 | + help='Specify the number of days to retain soft deleted server (0-7). ' |
| 1981 | + 'Set to 0 to disable soft delete. ' |
| 1982 | + 'Set to 1-7 days to enable soft delete with the specified retention period.') |
| 1983 | + |
1963 | 1984 | with self.argument_context('sql server show') as c: |
1964 | 1985 | c.argument('expand_ad_admin', |
1965 | 1986 | options_list=['--expand-ad-admin'], |
1966 | 1987 | help='Expand the Active Directory Administrator for the server.') |
1967 | 1988 |
|
| 1989 | + with self.argument_context('sql server restore') as c: |
| 1990 | + c.argument('location', |
| 1991 | + arg_type=get_location_type(self.cli_ctx), |
| 1992 | + required=True, |
| 1993 | + help='Location where the deleted server was originally located.') |
| 1994 | + |
1968 | 1995 | with self.argument_context('sql server list') as c: |
1969 | 1996 | c.argument('expand_ad_admin', |
1970 | 1997 | options_list=['--expand-ad-admin'], |
@@ -2285,6 +2312,25 @@ def _configure_security_policy_storage_params(arg_ctx): |
2285 | 2312 | help='Managed Instance name.', |
2286 | 2313 | arg_group='List By Instance') |
2287 | 2314 |
|
| 2315 | + ############################################### |
| 2316 | + # sql server deleted-server # |
| 2317 | + ############################################### |
| 2318 | + |
| 2319 | + with self.argument_context('sql server deleted-server') as c: |
| 2320 | + c.argument('server_name', options_list=['--name', '-n'], help='Name of the deleted server.') |
| 2321 | + c.argument('location', arg_type=get_location_type(self.cli_ctx), |
| 2322 | + help='Location where the deleted server was originally located.') |
| 2323 | + |
| 2324 | + with self.argument_context('sql server deleted-server show') as c: |
| 2325 | + c.argument('location', arg_type=get_location_type(self.cli_ctx), |
| 2326 | + required=True, |
| 2327 | + help='Location where the deleted server was originally located.') |
| 2328 | + |
| 2329 | + with self.argument_context('sql server deleted-server list') as c: |
| 2330 | + c.argument('location', arg_type=get_location_type(self.cli_ctx), |
| 2331 | + required=True, |
| 2332 | + help='Location where the deleted servers were originally located.') |
| 2333 | + |
2288 | 2334 | ############################################### |
2289 | 2335 | # sql managed instance # |
2290 | 2336 | ############################################### |
|
0 commit comments