Skip to content

Commit b1ac2a7

Browse files
author
Matthew Boentoro
committed
[RDBMS] az postgres flexible-server private-endpoint-connection / private-link-resource / server-logs / virtual-endpoint list: Fix linter issue and not exposing IDs parameter on the list command
1 parent 29ed992 commit b1ac2a7

File tree

1 file changed

+13
-4
lines changed
  • src/azure-cli/azure/cli/command_modules/rdbms

1 file changed

+13
-4
lines changed

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,10 @@ def _flexible_server_params(command_group):
823823
argument_context_string = '{} flexible-server virtual-endpoint {}'.format(command_group, scope)
824824
with self.argument_context(argument_context_string) as c:
825825
c.argument('resource_group_name', arg_type=resource_group_name_type)
826-
c.argument('server_name', options_list=['--server-name', '-s'], arg_type=server_name_arg_type)
826+
if scope == 'list':
827+
c.argument('server_name', options_list=['--server-name', '-s'], id_part=None, arg_type=server_name_arg_type)
828+
else:
829+
c.argument('server_name', options_list=['--server-name', '-s'], arg_type=server_name_arg_type)
827830
c.argument('virtual_endpoint_name', options_list=['--name', '-n'], arg_type=virtual_endpoint_arg_type, validator=virtual_endpoint_name_validator)
828831

829832
with self.argument_context('{} flexible-server long-term-retention list'.format(command_group)) as c:
@@ -990,7 +993,10 @@ def _flexible_server_params(command_group):
990993
argument_context_string = '{} flexible-server server-logs {}'.format(command_group, scope)
991994
with self.argument_context(argument_context_string) as c:
992995
c.argument('resource_group_name', arg_type=resource_group_name_type)
993-
c.argument('server_name', id_part='name', options_list=['--server-name', '-s'], arg_type=server_name_arg_type)
996+
if scope == "list":
997+
c.argument('server_name', options_list=['--server-name', '-s'], id_part=None, arg_type=server_name_arg_type)
998+
else:
999+
c.argument('server_name', id_part='name', options_list=['--server-name', '-s'], arg_type=server_name_arg_type)
9941000

9951001
with self.argument_context('{} flexible-server server-logs download'.format(command_group)) as c:
9961002
c.argument('file_name', options_list=['--name', '-n'], nargs='+', help='Space-separated list of log filenames on the server to download.')
@@ -1004,7 +1010,7 @@ def _flexible_server_params(command_group):
10041010
with self.argument_context('{} flexible-server private-endpoint-connection {}'.format(command_group, scope)) as c:
10051011
c.argument('resource_group_name', arg_type=resource_group_name_type)
10061012
if scope == "list":
1007-
c.argument('server_name', options_list=['--server-name', '-s'], id_part='name', arg_type=server_name_arg_type, required=False)
1013+
c.argument('server_name', options_list=['--server-name', '-s'], id_part=None, arg_type=server_name_arg_type, required=False)
10081014
else:
10091015
c.argument('server_name', options_list=['--server-name', '-s'], id_part='name', arg_type=server_name_arg_type, required=False,
10101016
help='Name of the Server. Required if --id is not specified')
@@ -1020,7 +1026,10 @@ def _flexible_server_params(command_group):
10201026
for scope in ['list', 'show']:
10211027
with self.argument_context('{} flexible-server private-link-resource {}'.format(command_group, scope)) as c:
10221028
c.argument('resource_group_name', arg_type=resource_group_name_type)
1023-
c.argument('server_name', options_list=['--server-name', '-s'], id_part='name', arg_type=server_name_arg_type, required=False)
1029+
if scope == 'list':
1030+
c.argument('server_name', options_list=['--server-name', '-s'], id_part=None, arg_type=server_name_arg_type, required=False)
1031+
else:
1032+
c.argument('server_name', options_list=['--server-name', '-s'], id_part='name', arg_type=server_name_arg_type, required=False)
10241033

10251034
# GTID
10261035
if command_group == 'mysql':

0 commit comments

Comments
 (0)