|
6 | 6 | from azure.cli.core.breaking_change import (register_argument_deprecate, register_command_group_deprecate, |
7 | 7 | register_other_breaking_change) |
8 | 8 |
|
| 9 | +NETWORK_RESOURCE_BREAKING_CHANGE_MESSAGE = ( |
| 10 | + 'This command will stop creating new network resources or altering existing ones which are required ' |
| 11 | + 'for the server to function, such as virtual networks, subnets, IP ranges, etc. It will instead ' |
| 12 | + 'require users to provide the necessary network resources created beforehand using the corresponding ' |
| 13 | + 'commands from the `az network` module. This change will take effect in next breaking change ' |
| 14 | + 'release scheduled for May 2026.' |
| 15 | +) |
| 16 | + |
| 17 | + |
| 18 | +def _register_network_resource_breaking_change(command_name): |
| 19 | + register_other_breaking_change(command_name, message=NETWORK_RESOURCE_BREAKING_CHANGE_MESSAGE) |
| 20 | + register_argument_deprecate(command_name, '--address-prefixes') |
| 21 | + register_argument_deprecate(command_name, '--subnet-prefixes') |
| 22 | + |
| 23 | + |
| 24 | +# These commands will stop creating or altering required network resources and will instead require |
| 25 | +# users to provide those resources up front using the corresponding `az network` commands. |
| 26 | +# Parameters --address-prefixes and --subnet-prefixes will also be deprecated for these commands as part of this change. |
| 27 | +for network_command in ( |
| 28 | + 'postgres flexible-server create', |
| 29 | + 'postgres flexible-server replica create', |
| 30 | + 'postgres flexible-server restore', |
| 31 | + 'postgres flexible-server geo-restore', |
| 32 | + 'postgres flexible-server revive-dropped'): |
| 33 | + _register_network_resource_breaking_change(network_command) |
| 34 | + |
| 35 | + |
9 | 36 | # High availability command argument changes |
10 | 37 | register_argument_deprecate('postgres flexible-server create', '--high-availability', redirect='--zonal-resiliency') |
11 | 38 | register_argument_deprecate('postgres flexible-server update', '--high-availability', redirect='--zonal-resiliency') |
12 | 39 |
|
13 | | -# Index Tuning command argument changes |
| 40 | +# Index Tuning command group renamed to Autonomous Tuning as the feature has expanded to |
| 41 | +# include more types of recommendations beyond just index tuning |
14 | 42 | register_command_group_deprecate(command_group='postgres flexible-server index-tuning', |
15 | 43 | redirect='postgres flexible-server autonomous-tuning', |
16 | 44 | message='Index tuning feature has now expanded its capabilities to support ' |
17 | 45 | 'other automatically generated recommendations which are covered by the ' |
18 | 46 | 'new command.') |
19 | 47 |
|
20 | | -# Long term retention command argument changes |
| 48 | +# Long term retention command group deprecated with no redirect as the functionality will be removed in the future |
21 | 49 | register_command_group_deprecate(command_group='postgres flexible-server long-term-retention', |
22 | 50 | message='Long term retention command group will be removed. ' |
23 | 51 | 'For more information, open a support incident.') |
|
0 commit comments