Skip to content
Merged
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,14 +39,6 @@ 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')

# Index Tuning command group renamed to Autonomous Tuning as the feature has expanded to
# include more types of recommendations beyond just index tuning
register_command_group_deprecate(command_group='postgres flexible-server index-tuning',
redirect='postgres flexible-server autonomous-tuning',
message='Index tuning feature has now expanded its capabilities to support '
'other automatically generated recommendations which are covered by the '
'new command.')

# 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. '
Expand Down
53 changes: 0 additions & 53 deletions src/azure-cli/azure/cli/command_modules/postgresql/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1182,59 +1182,6 @@
text: az postgres flexible-server fabric-mirroring update-databases -g testgroup -s testsvr --database-names testdb2 testdb3
"""

helps['postgres flexible-server index-tuning'] = """
type: group
short-summary: Index tuning analyzes read queries captured in Query Store and recommends index changes to optimize these queries.
"""

helps['postgres flexible-server index-tuning update'] = """
type: command
short-summary: Update index tuning to be enabled/disabled for a PostgreSQL flexible server.
examples:
- name: Update index tuning to be enabled/disabled for a PostgreSQL flexible server.
text: az postgres flexible-server index-tuning update -g testgroup -s testsvr --enabled True
"""

helps['postgres flexible-server index-tuning show'] = """
type: command
short-summary: Show state of index tuning for a PostgreSQL flexible server.
examples:
- name: Show state of index tuning for a PostgreSQL flexible server.
text: az postgres flexible-server index-tuning show -g testgroup -s testsvr
"""

helps['postgres flexible-server index-tuning list-settings'] = """
type: command
short-summary: Get tuning settings associated for a PostgreSQL flexible server.
examples:
- name: Get tuning settings for a PostgreSQL flexible server.
text: az postgres flexible-server index-tuning list-settings -g testgroup -s testsvr
"""

helps['postgres flexible-server index-tuning show-settings'] = """
type: command
short-summary: Get a tuning setting for a PostgreSQL flexible server.
examples:
- name: Get a tuning setting for a PostgreSQL flexible server.
text: az postgres flexible-server index-tuning show-settings -g testgroup -s testsvr --name setting-name
"""

helps['postgres flexible-server index-tuning set-settings'] = """
type: command
short-summary: Update a tuning setting for a PostgreSQL flexible server.
examples:
- name: Update a tuning setting for a PostgreSQL flexible server.
text: az postgres flexible-server index-tuning set-settings -g testgroup -s testsvr --name setting-name --value setting-value
"""

helps['postgres flexible-server index-tuning list-recommendations'] = """
type: command
short-summary: Get available tuning index recommendations associated with a PostgreSQL flexible server.
examples:
- name: Get tuning index recommendations for a PostgreSQL flexible server. Filter by selected type.
text: az postgres flexible-server index-tuning list-recommendations -g testgroup -s testsvr --recommendation-type CreateIndex
"""

helps['postgres flexible-server autonomous-tuning'] = """
type: group
short-summary: Autonomous tuning analyzes read queries captured in query store and recommends operations on tables or index changes to optimize these queries.
Expand Down
30 changes: 0 additions & 30 deletions src/azure-cli/azure/cli/command_modules/postgresql/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,36 +743,6 @@ def _flexible_server_params(command_group):
with self.argument_context('{} flexible-server private-link-resource {}'.format(command_group, scope)) as c:
c.argument('server_name', arg_type=server_name_resource_arg_type)

# index tuning
for scope in ['update', 'show', 'list-settings', 'show-settings', 'set-settings', 'list-recommendations']:
argument_context_string = '{} flexible-server index-tuning {}'.format(command_group, scope)
with self.argument_context(argument_context_string) as c:
c.argument('server_name', arg_type=server_name_resource_arg_type)

with self.argument_context('{} flexible-server index-tuning update'.format(command_group)) as c:
c.argument('index_tuning_enabled',
options_list=['--enabled'],
required=True,
help='Enable or disable index tuning feature.',
arg_type=get_enum_type(['True', 'False']))

with self.argument_context('{} flexible-server index-tuning list-recommendations'.format(command_group)) as c:
c.argument('recommendation_type',
options_list=['--recommendation-type', '-r'],
help='Retrieve recommendations based on type.',
arg_type=get_enum_type(['CreateIndex', 'DropIndex', 'ReIndex']))

for scope in ['show-settings', 'set-settings']:
argument_context_string = '{} flexible-server index-tuning {}'.format(command_group, scope)
with self.argument_context(argument_context_string) as c:
c.argument('setting_name', options_list=['--name', '-n'], required=True,
arg_type=get_enum_type(get_autonomous_tuning_settings_map().keys()),
help='The name of the tuning setting.')

with self.argument_context('{} flexible-server index-tuning set-settings'.format(command_group)) as c:
c.argument('value', options_list=['--value', '-v'],
help='Value of the tuning setting.')

# autonomous tuning
for scope in ['update', 'show', 'list-settings', 'show-settings', 'set-settings', 'list-table-recommendations', 'list-index-recommendations']:
argument_context_string = '{} flexible-server autonomous-tuning {}'.format(command_group, scope)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,6 @@ def load_flexibleserver_command_table(self, _):

autonomous_tuning_commands = CliCommandType(
operations_tmpl='azure.cli.command_modules.postgresql.commands.autonomous_tuning_commands#{}')
with self.command_group('postgres flexible-server index-tuning', postgres_flexible_config_sdk,
custom_command_type=autonomous_tuning_commands,
client_factory=cf_postgres_flexible_config) as g:
g.custom_command('update', 'index_tuning_update')
g.custom_show_command('show', 'index_tuning_show')
g.custom_command('list-settings', 'index_tuning_settings_list')
g.custom_command('show-settings', 'index_tuning_settings_get')
g.custom_command('set-settings', 'index_tuning_settings_set')
g.custom_command('list-recommendations', 'index_tuning_recommendations_list')

with self.command_group('postgres flexible-server autonomous-tuning', postgres_flexible_config_sdk,
custom_command_type=autonomous_tuning_commands,
client_factory=cf_postgres_flexible_config) as g:
Expand Down
Loading
Loading