本文整理汇总了Python中profitbricks.client.ProfitBricksService.update_image方法的典型用法代码示例。如果您正苦于以下问题:Python ProfitBricksService.update_image方法的具体用法?Python ProfitBricksService.update_image怎么用?Python ProfitBricksService.update_image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类profitbricks.client.ProfitBricksService
的用法示例。
在下文中一共展示了ProfitBricksService.update_image方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestImage
# 需要导入模块: from profitbricks.client import ProfitBricksService [as 别名]
# 或者: from profitbricks.client.ProfitBricksService import update_image [as 别名]
class TestImage(unittest.TestCase):
def setUp(self):
self.image = ProfitBricksService(
username='username', password='password')
def test_list_images(self):
images = self.image.list_images()
self.assertEqual(len(images), 4)
self.assertEqual(
images['items'][0]['id'], '7df81087-5835-41c6-a10b-3e098593bbd2')
def test_get_image(self):
image_id = '7df81087-5835-41c6-a10b-3e098593bbd2'
image = self.image.get_image(image_id)
self.assertEqual(image['properties']['name'], 'Ubuntu 14.04')
def test_delete_image(self):
image_id = '7df81087-5835-41c6-a10b-3e098593bbd2'
image = self.image.delete_image(image_id)
self.assertTrue(image)
def test_update_image(self):
image_id = '7df81087-5835-41c6-a10b-3e098593bbd2'
image = self.image.update_image(
image_id,
name='New name')
self.assertEqual(image['properties']['name'], 'New name')
示例2: ProfitBricksService
# 需要导入模块: from profitbricks.client import ProfitBricksService [as 别名]
# 或者: from profitbricks.client.ProfitBricksService import update_image [as 别名]
* disc_scsi_hot_plug (bool)
* disc_scsi_hot_unplug (bool)
"""
from profitbricks.client import ProfitBricksService
client = ProfitBricksService(
username='username', password='password')
image_id = '7df81087-5835-41c6-a10b-3e098593bbd2'
image = client.update_image(
image_id,
name='New name',
description="Centos 7 with NGnix",
licence_type='LINUX',
cpu_hot_plug=True,
ram_hot_plug=True,
nic_hot_plug=True,
nic_hot_unplug=True,
disc_virtio_hot_plug=True,
disc_virtio_hot_unplug=True)
"""Delete Image
"""
from profitbricks.client import ProfitBricksService
client = ProfitBricksService(
username='username', password='password')
image_id = '7df81087-5835-41c6-a10b-3e098593bbd2'
示例3: ProfitBricksService
# 需要导入模块: from profitbricks.client import ProfitBricksService [as 别名]
# 或者: from profitbricks.client.ProfitBricksService import update_image [as 别名]
"""List Images
"""
from profitbricks.client import ProfitBricksService
client = ProfitBricksService(username="username", password="password")
images = client.list_images()
print(images)
"""Update Image
"""
from profitbricks.client import ProfitBricksService
client = ProfitBricksService(username="username", password="password")
image_id = "7df81087-5835-41c6-a10b-3e098593bbd2"
image = client.update_image(image_id, name="New name")
"""Delete Image
"""
from profitbricks.client import ProfitBricksService
client = ProfitBricksService(username="username", password="password")
image_id = "7df81087-5835-41c6-a10b-3e098593bbd2"
image = client.delete_image(image_id)