本文整理汇总了Python中azure.servicemanagement.ServiceManagementService.update_storage_account方法的典型用法代码示例。如果您正苦于以下问题:Python ServiceManagementService.update_storage_account方法的具体用法?Python ServiceManagementService.update_storage_account怎么用?Python ServiceManagementService.update_storage_account使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类azure.servicemanagement.ServiceManagementService
的用法示例。
在下文中一共展示了ServiceManagementService.update_storage_account方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: StorageManagementServiceTest
# 需要导入模块: from azure.servicemanagement import ServiceManagementService [as 别名]
# 或者: from azure.servicemanagement.ServiceManagementService import update_storage_account [as 别名]
#.........这里部分代码省略.........
self.assertIsNotNone(result.storage_service_keys.secondary)
self.assertIsNone(result.storage_service_properties)
def test_regenerate_storage_account_keys(self):
# Arrange
self._create_storage_account(self.storage_account_name)
previous = self.sms.get_storage_account_keys(self.storage_account_name)
# Act
result = self.sms.regenerate_storage_account_keys(self.storage_account_name, 'Secondary')
# Assert
self.assertIsNotNone(result)
self.assertIsNotNone(result.url)
self.assertIsNotNone(result.service_name)
self.assertIsNotNone(result.storage_service_keys.primary)
self.assertIsNotNone(result.storage_service_keys.secondary)
self.assertIsNone(result.storage_service_properties)
self.assertEqual(result.storage_service_keys.primary, previous.storage_service_keys.primary)
self.assertNotEqual(result.storage_service_keys.secondary, previous.storage_service_keys.secondary)
def test_create_storage_account(self):
# Arrange
description = self.storage_account_name + 'description'
label = self.storage_account_name + 'label'
# Act
result = self.sms.create_storage_account(self.storage_account_name, description, label, None, 'West US', True, {'ext1':'val1', 'ext2':42})
self._wait_for_async(result.request_id)
# Assert
self.assertTrue(self._storage_account_exists(self.storage_account_name))
def test_update_storage_account(self):
# Arrange
self._create_storage_account(self.storage_account_name)
description = self.storage_account_name + 'descriptionupdate'
label = self.storage_account_name + 'labelupdate'
# Act
result = self.sms.update_storage_account(self.storage_account_name, description, label, False, {'ext1':'val1update', 'ext2':53, 'ext3':'brandnew'})
# Assert
self.assertIsNone(result)
props = self.sms.get_storage_account_properties(self.storage_account_name)
self.assertEqual(props.storage_service_properties.description, description)
self.assertEqual(props.storage_service_properties.label, label)
self.assertEqual(props.extended_properties['ext1'], 'val1update')
self.assertEqual(props.extended_properties['ext2'], '53')
self.assertEqual(props.extended_properties['ext3'], 'brandnew')
def test_delete_storage_account(self):
# Arrange
self._create_storage_account(self.storage_account_name)
# Act
result = self.sms.delete_storage_account(self.storage_account_name)
# Assert
self.assertIsNone(result)
self.assertFalse(self._storage_account_exists(self.storage_account_name))
def test_check_storage_account_name_availability_not_available(self):
# Arrange
self._create_storage_account(self.storage_account_name)