本文整理匯總了Python中profab.server.Server.start方法的典型用法代碼示例。如果您正苦於以下問題:Python Server.start方法的具體用法?Python Server.start怎麽用?Python Server.start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類profab.server.Server
的用法示例。
在下文中一共展示了Server.start方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_security_groups
# 需要導入模塊: from profab.server import Server [as 別名]
# 或者: from profab.server.Server import start [as 別名]
def test_security_groups(self):
server = Server.start('kirit', ('security_group', 'web'), ('security_group', 'ssh'))
self.assertItemsEqual([g.id for g in server.instance.groups], ['web', 'ssh'])
示例2: test_start_basic
# 需要導入模塊: from profab.server import Server [as 別名]
# 或者: from profab.server.Server import start [as 別名]
def test_start_basic(self):
server = Server.start('test')
self.assertEquals(str(server),
u"ec2-host -- running (host) [default] {}")
示例3: test_start_customise_bits
# 需要導入模塊: from profab.server import Server [as 別名]
# 或者: from profab.server.Server import start [as 別名]
def test_start_customise_bits(self):
server = Server.start("test", ("size", "t1.micro"), ("bits", "64"))
self.assertEqual(server.instance.instance_type, "t1.micro")
self.assertEqual(server.instance.image_id, "ami-63be790a")
示例4: test_start_customise_bits
# 需要導入模塊: from profab.server import Server [as 別名]
# 或者: from profab.server.Server import start [as 別名]
def test_start_customise_bits(self):
server = Server.start('test', ('size', 't1.micro'), ('bits', '64'), ('ami.precise', None))
self.assertEqual(server.instance.instance_type, 't1.micro')
self.assertEqual(server.instance.image_id, 'ami-f8d4f9ef')
示例5: test_start_with_size
# 需要導入模塊: from profab.server import Server [as 別名]
# 或者: from profab.server.Server import start [as 別名]
def test_start_with_size(self):
server = Server.start("test", ("size", "c1.xlarge"))
self.assertEqual(server.instance.instance_type, "c1.xlarge")
示例6: test_start_with_roles
# 需要導入模塊: from profab.server import Server [as 別名]
# 或者: from profab.server.Server import start [as 別名]
def test_start_with_roles(self):
server = Server.start("test", "postgres", "smarthost")
self.assertEquals(str(server), u"ec2-host -- running (host) [default] {}")
示例7: test_start_with_region
# 需要導入模塊: from profab.server import Server [as 別名]
# 或者: from profab.server.Server import start [as 別名]
def test_start_with_region(self):
server = Server.start('test', ('region', 'bangkok'), ('ami', 'test-ami'))
self.assertEqual(server.instance.region.name, 'bangkok')
self.assertEqual(server.instance.image_id, 'test-ami')
示例8: test_start_oneiric
# 需要導入模塊: from profab.server import Server [as 別名]
# 或者: from profab.server.Server import start [as 別名]
def test_start_oneiric(self):
server = Server.start("test", "ami.oneiric")
self.assertEqual(server.instance.image_id, "ami-0bcb0262")
示例9: test_start_natty
# 需要導入模塊: from profab.server import Server [as 別名]
# 或者: from profab.server.Server import start [as 別名]
def test_start_natty(self):
server = Server.start("test", "ami.natty")
self.assertEqual(server.instance.image_id, "ami-639b530a")
示例10: test_start_lucid
# 需要導入模塊: from profab.server import Server [as 別名]
# 或者: from profab.server.Server import start [as 別名]
def test_start_lucid(self):
server = Server.start("test", "ami.lucid")
self.assertEqual(server.instance.image_id, "ami-2cc83145")
示例11: test_start_with_roles
# 需要導入模塊: from profab.server import Server [as 別名]
# 或者: from profab.server.Server import start [as 別名]
def test_start_with_roles(self):
server = Server.start('test', 'postgres', 'smarthost')
self.assertEquals(str(server),
u"ec2-host -- running (host) [default] {}")
示例12: test_start_with_ami
# 需要導入模塊: from profab.server import Server [as 別名]
# 或者: from profab.server.Server import start [as 別名]
def test_start_with_ami(self):
server = Server.start("test", ("ami", "test-ami"))
self.assertEqual(server.instance.image_id, "test-ami")
示例13: test_create
# 需要導入模塊: from profab.server import Server [as 別名]
# 或者: from profab.server.Server import start [as 別名]
def test_create(self):
server = Server.start('test-volume')
volume = Volume.create(server, 2)
self.assertTrue(volume.attached)