本文整理匯總了Python中profitbricks.client.ProfitBricksService.get_attached_cdroms方法的典型用法代碼示例。如果您正苦於以下問題:Python ProfitBricksService.get_attached_cdroms方法的具體用法?Python ProfitBricksService.get_attached_cdroms怎麽用?Python ProfitBricksService.get_attached_cdroms使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類profitbricks.client.ProfitBricksService
的用法示例。
在下文中一共展示了ProfitBricksService.get_attached_cdroms方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: TestServer
# 需要導入模塊: from profitbricks.client import ProfitBricksService [as 別名]
# 或者: from profitbricks.client.ProfitBricksService import get_attached_cdroms [as 別名]
#.........這裏部分代碼省略.........
datacenter_id=datacenter_id,
server_id=server_id,
volume_id=volume_id)
self.assertTrue(server)
def test_attach_volume(self):
volume_id = '700e1cab-99b2-4c30-ba8c-1d273ddba025'
server = self.server.attach_volume(
datacenter_id=datacenter_id,
server_id=server_id,
volume_id=volume_id)
self.assertEqual(server['id'], volume_id)
self.assertEqual(server['properties']['name'], 'my boot volume for server 1')
self.assertEqual(server['properties']['size'], 80)
self.assertEqual(server['properties']['bus'], 'VIRTIO')
self.assertEqual(server['properties']['image'], None)
self.assertEqual(server['properties']['imagePassword'], None)
self.assertEqual(server['properties']['type'], 'HDD')
self.assertEqual(server['properties']['licenceType'], 'WINDOWS')
self.assertFalse(server['properties']['cpuHotPlug'])
self.assertFalse(server['properties']['cpuHotUnplug'])
self.assertFalse(server['properties']['ramHotPlug'])
self.assertFalse(server['properties']['ramHotUnplug'])
self.assertFalse(server['properties']['nicHotPlug'])
self.assertFalse(server['properties']['nicHotUnplug'])
self.assertFalse(server['properties']['discVirtioHotPlug'])
self.assertFalse(server['properties']['discVirtioHotUnplug'])
self.assertFalse(server['properties']['discScsiHotPlug'])
self.assertFalse(server['properties']['discScsiHotUnplug'])
def test_get_attached_cdroms(self):
servers = self.server.get_attached_cdroms(
datacenter_id=datacenter_id,
server_id=server_id)
self.assertEqual(len(servers), 4)
self.assertEqual(servers['items'][0]['id'], '7df81087-5835-41c6-a10b-3e098593bbd2')
self.assertEqual(servers['items'][0]['properties']['name'], 'Ubuntu 14.04')
self.assertEqual(servers['items'][0]['properties']['size'], 28)
self.assertEqual(servers['items'][0]['properties']['description'],
'Ubuntu image description')
self.assertEqual(servers['items'][0]['properties']['location'], 'de/fkb')
self.assertEqual(servers['items'][0]['properties']['imageType'], 'CDROM')
self.assertEqual(servers['items'][0]['properties']['licenceType'], 'UNKNOWN')
self.assertFalse(servers['items'][0]['properties']['public'])
self.assertFalse(servers['items'][0]['properties']['cpuHotPlug'])
self.assertFalse(servers['items'][0]['properties']['cpuHotUnplug'])
self.assertFalse(servers['items'][0]['properties']['ramHotPlug'])
self.assertFalse(servers['items'][0]['properties']['ramHotUnplug'])
self.assertFalse(servers['items'][0]['properties']['nicHotPlug'])
self.assertFalse(servers['items'][0]['properties']['nicHotUnplug'])
self.assertFalse(servers['items'][0]['properties']['discVirtioHotPlug'])
self.assertFalse(servers['items'][0]['properties']['discVirtioHotUnplug'])
self.assertFalse(servers['items'][0]['properties']['discScsiHotPlug'])
self.assertFalse(servers['items'][0]['properties']['discScsiHotUnplug'])
def test_get_attached_cdrom(self):
cdrom_id = '7df81087-5835-41c6-a10b-3e098593bbd2'
server = self.server.get_attached_cdrom(
datacenter_id=datacenter_id,
server_id=server_id,
cdrom_id=cdrom_id)