Skip to content
Merged
Prev Previous commit
Next Next commit
updates based on feedback
  • Loading branch information
wiboris committed Jun 28, 2022
commit f3073d332dbb2193f02a1bda81ca6eff21f1dd9f
8 changes: 4 additions & 4 deletions src/azure-cli/azure/cli/command_modules/batch/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

helps['batch account network-profile set'] = """
type: command
short-summary: Sets the Network profile for Batch account.
short-summary: Set the Network profile for Batch account.
"""

helps['batch account network-profile network-rule'] = """
Expand All @@ -96,17 +96,17 @@

helps['batch account network-profile network-rule list'] = """
type: command
short-summary: Lists the Network rules from a Network Profile.
short-summary: List the Network rules from a Network Profile.
"""

helps['batch account network-profile network-rule add'] = """
type: command
short-summary: Adds a Network rule from a Network Profile.
short-summary: Add a Network rule from a Network Profile.
"""

helps['batch account network-profile network-rule delete'] = """
type: command
short-summary: Deletes a Network rule from a Network Profile.
short-summary: Delete a Network rule from a Network Profile.
"""


Expand Down
8 changes: 4 additions & 4 deletions src/azure-cli/azure/cli/command_modules/batch/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def load_arguments(self, _):
c.argument('encryption_key_source', help='Part of the encryption configuration for the Batch account. Type of the key source. Can be either Microsoft.Batch or Microsoft.KeyVault', arg_type=get_enum_type(KeySource))
c.argument('encryption_key_identifier', help='Part of the encryption configuration for the Batch account. '
'Full path to the versioned secret. Example https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053.')
c.argument('identity_type', help="The type of identity used for the Batch account. Possible values include: 'SystemAssigned', 'None'.", arg_type=get_enum_type(ResourceIdentityType))
c.argument('userassigned_identity_id', options_list=('--user-id',), help="The managed User identity fully qualified resource Id. Must be in conjunction with identity_type=UserAssigned")
c.argument('identity_type', help="The type of identity used for the Batch account.", arg_type=get_enum_type(ResourceIdentityType))
c.argument('mi_user_assigned', help="The managed User identity fully qualified resource Id. Must be in conjunction with identity_type=UserAssigned")
c.ignore('keyvault_url')

with self.argument_context('batch account set') as c:
Expand All @@ -82,8 +82,8 @@ def load_arguments(self, _):
c.argument('encryption_key_source', help='Part of the encryption configuration for the Batch account. Type of the key source. Can be either Microsoft.Batch or Microsoft.KeyVault')
c.argument('public_network_access', help="The network access type for accessing Azure Batch account. Values can either be enabled or disabled.", arg_type=get_enum_type(PublicNetworkAccessType))
c.argument('encryption_key_identifier', help='Part of the encryption configuration for the Batch account. Full path to the versioned secret. Example https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053.')
c.argument('identity_type', help="The type of identity used for the Batch account. Possible values include: 'SystemAssigned', 'None'.", arg_type=get_enum_type(ResourceIdentityType))
c.argument('userassigned_identity_id', options_list=('--user-id',), help="The managed User identity fully qualified resource Id. Must be in conjunction with identity_type=UserAssigned")
c.argument('identity_type', help="The type of identity used for the Batch account.", arg_type=get_enum_type(ResourceIdentityType))
c.argument('mi_user_assigned', help="The managed User identity fully qualified resource Id. Must be in conjunction with identity_type=UserAssigned")

with self.argument_context('batch account network-profile show') as c:
c.argument('resource_group_name', resource_group_name_type, help='Name of the resource group. If not specified will display currently set account.', required=False)
Expand Down
12 changes: 6 additions & 6 deletions src/azure-cli/azure/cli/command_modules/batch/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,17 @@ def create_account(client,
resource_group_name, account_name, location, tags=None, storage_account=None,
keyvault=None, keyvault_url=None, no_wait=False, public_network_access=None,
encryption_key_source=None, encryption_key_identifier=None, identity_type=None,
userassigned_identity_id=None):
mi_user_assigned=None):
properties = AutoStorageBaseProperties(storage_account_id=storage_account) \
if storage_account else None

identity = None
if identity_type and identity_type == ResourceIdentityType.SYSTEM_ASSIGNED:
identity = BatchAccountIdentity(type=identity_type)

if userassigned_identity_id and identity_type and identity_type == ResourceIdentityType.USER_ASSIGNED:
if mi_user_assigned and identity_type and identity_type == ResourceIdentityType.USER_ASSIGNED:
useridentity = UserAssignedIdentities()
my_dict = {userassigned_identity_id: useridentity}
my_dict = {mi_user_assigned: useridentity}
identity = BatchAccountIdentity(type=identity_type, user_assigned_identities=my_dict)

if (encryption_key_source and
Expand Down Expand Up @@ -119,7 +119,7 @@ def create_account(client,
@transfer_doc(AutoStorageBaseProperties)
def update_account(client, resource_group_name, account_name,
tags=None, storage_account=None, encryption_key_source=None, public_network_access=None,
encryption_key_identifier=None, identity_type=None, userassigned_identity_id=None):
encryption_key_identifier=None, identity_type=None, mi_user_assigned=None):

properties = AutoStorageBaseProperties(storage_account_id=storage_account) \
if storage_account else None
Expand All @@ -138,9 +138,9 @@ def update_account(client, resource_group_name, account_name,
if identity_type and identity_type == ResourceIdentityType.SYSTEM_ASSIGNED:
identity = BatchAccountIdentity(type=identity_type)

if userassigned_identity_id and identity_type and identity_type == ResourceIdentityType.USER_ASSIGNED:
if mi_user_assigned and identity_type and identity_type == ResourceIdentityType.USER_ASSIGNED:
useridentity = UserAssignedIdentities()
my_dict = {userassigned_identity_id: useridentity}
my_dict = {mi_user_assigned: useridentity}
identity = BatchAccountIdentity(type=identity_type, user_assigned_identities=my_dict)

parameters = BatchAccountUpdateParameters(
Expand Down