Skip to content

Commit 8f09fd8

Browse files
authored
[Batch] az batch: Remove deprecated commands and add new parameter --enable-accelerated-networking for az batch pool create command to enable accelerated networking (#26766)
1 parent 32ab698 commit 8f09fd8

23 files changed

+2207
-1397
lines changed

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

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -234,17 +234,6 @@
234234
short-summary: Manage Batch jobs.
235235
"""
236236

237-
helps['batch job all-statistics'] = """
238-
type: group
239-
short-summary: View statistics of all jobs under a Batch account.
240-
"""
241-
242-
helps['batch job all-statistics show'] = """
243-
type: command
244-
short-summary: Get lifetime summary statistics for all of the jobs in a Batch account.
245-
long-summary: Statistics are aggregated across all jobs that have ever existed in the account, from account creation to the last update time of the statistics.
246-
"""
247-
248237
helps['batch job create'] = """
249238
type: command
250239
short-summary: Add a job to a Batch account.
@@ -408,17 +397,6 @@
408397
short-summary: Manage Batch pools.
409398
"""
410399

411-
helps['batch pool all-statistics'] = """
412-
type: group
413-
short-summary: View statistics of all pools under a Batch account.
414-
"""
415-
416-
helps['batch pool all-statistics show'] = """
417-
type: command
418-
short-summary: Get lifetime summary statistics for all of the pools in a Batch account.
419-
long-summary: Statistics are aggregated across all pools that have ever existed in the account, from account creation to the last update time of the statistics.
420-
"""
421-
422400
helps['batch pool autoscale'] = """
423401
type: group
424402
short-summary: Manage automatic scaling of Batch pools.

src/azure-cli/azure/cli/command_modules/batch/_parameter_format.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@
8080
'task_scheduling_policy',
8181
'container_settings',
8282
'user_identity',
83-
'network_configuration',
83+
'network_configuration.dynamic_vnet_assignment_scope',
84+
'network_configuration.public_ip_address_configuration',
85+
'network_configuration.subnet_id',
8486
'enable_auto_scale',
8587
'cloud_service_configuration.target_os_version',
8688
'pool.auto_scale_evaluation_interval',

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919
NodeCommunicationMode)
2020

2121
from azure.cli.core.commands.parameters import (
22-
tags_type,
22+
file_type,
23+
get_enum_type,
2324
get_location_type,
24-
resource_group_name_type,
2525
get_resource_name_completion_list,
26-
file_type,
27-
get_enum_type)
26+
get_three_state_flag,
27+
resource_group_name_type,
28+
tags_type)
2829

2930
from azure.cli.command_modules.batch._completers import load_supported_images
3031
from azure.cli.command_modules.batch._validators import (
@@ -243,6 +244,8 @@ def load_arguments(self, _):
243244
c.argument('target_node_communication_mode', options_list=['--target-communication'],
244245
help="The desired node communication mode for the pool. If this element is present, it replaces the existing targetNodeCommunicationMode configured on the Pool. If omitted, any existing metadata is left unchanged.",
245246
arg_type=get_enum_type(NodeCommunicationMode))
247+
c.extra('enable_accelerated_networking', arg_type=get_three_state_flag(), options_list=['--accelerated-networking'], arg_group="Pool: Network Configuration",
248+
help='Whether this pool should enable accelerated networking. Accelerated networking enables single root I/O virtualization (SR-IOV) to a VM, which may lead to improved networking performance. For more details, see: https://learn.microsoft.com/azure/virtual- network/accelerated-networking-overview. Set true to enable.')
246249

247250
with self.argument_context('batch pool set') as c:
248251
c.argument('target_node_communication_mode', options_list=['--target-communication'],

src/azure-cli/azure/cli/command_modules/batch/commands.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def get_data_factory(name):
116116
with self.command_group('batch pool node-counts', get_data_type('account')) as g:
117117
g.batch_command('list', 'list_pool_node_counts')
118118

119-
with self.command_group('batch certificate', get_data_type('certificate'), client_factory=get_data_factory('certificate')) as g:
119+
with self.command_group('batch certificate', get_data_type('certificate'), client_factory=get_data_factory('certificate'), deprecate_info=self.deprecate()) as g:
120120
g.custom_command('create', 'create_certificate')
121121
g.custom_command('delete', 'delete_certificate', confirmation=True)
122122
g.batch_command('show', 'get', validator=validate_cert_settings)
@@ -125,7 +125,6 @@ def get_data_factory(name):
125125
pool_type = get_data_type('pool')
126126
with self.command_group('batch pool', pool_type, client_factory=get_data_factory('pool')) as g:
127127
g.batch_command('usage-metrics list', 'list_usage_metrics')
128-
g.batch_command('all-statistics show', 'get_all_lifetime_statistics')
129128
g.batch_command('create', 'add', validator=validate_pool_settings, flatten=10)
130129
g.batch_command('list', 'list')
131130
g.batch_command('delete', 'delete')
@@ -141,7 +140,6 @@ def get_data_factory(name):
141140
g.batch_command('delete', 'remove_nodes')
142141

143142
with self.command_group('batch job', get_data_type('job'), client_factory=get_data_factory('job')) as g:
144-
g.batch_command('all-statistics show', 'get_all_lifetime_statistics')
145143
g.batch_command('create', 'add')
146144
g.batch_command('delete', 'delete')
147145
g.batch_command('show', 'get')

0 commit comments

Comments
 (0)