當前位置: 首頁>>代碼示例>>Python>>正文


Python server.Server類代碼示例

本文整理匯總了Python中profab.server.Server的典型用法代碼示例。如果您正苦於以下問題:Python Server類的具體用法?Python Server怎麽用?Python Server使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Server類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_connect_and_configure

 def test_connect_and_configure(self):
     server = Server.connect("test", "ec2-host")
     server.add_role("munin", "monitor.example.com")
     server.add_role("eip", "10.43.56.9")
開發者ID:AttakornP,項目名稱:profab,代碼行數:4,代碼來源:test_server.py

示例2: test_start_with_roles

 def test_start_with_roles(self):
     server = Server.start('test', 'postgres', 'smarthost')
     self.assertEquals(str(server),
         u"ec2-host -- running (host) [default] {}")
開發者ID:Proteus-tech,項目名稱:profab,代碼行數:4,代碼來源:test_server.py

示例3: test_start_with_region

 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')
開發者ID:Proteus-tech,項目名稱:profab,代碼行數:4,代碼來源:test_server.py

示例4: test_try_connect_to_invalid_host

 def test_try_connect_to_invalid_host(self):
     server = Server.connect('test', 'not-a-host')
     self.assertIs(server, None)
開發者ID:Proteus-tech,項目名稱:profab,代碼行數:3,代碼來源:test_server.py

示例5: test_server_role_not_found

 def test_server_role_not_found(self):
     server = Server.connect('test', 'ec2-host')
     with self.assertRaises(ImportError):
         server.add_role('not-a-role')
開發者ID:Proteus-tech,項目名稱:profab,代碼行數:4,代碼來源:test_server.py

示例6: test_connect_and_restart

 def test_connect_and_restart(self):
     server = Server.connect('test', 'r-reservation')
     server.restart()
開發者ID:Proteus-tech,項目名稱:profab,代碼行數:3,代碼來源:test_server.py

示例7: test_connect_and_add_role

 def test_connect_and_add_role(self):
     server = Server.connect('test', 'ec2-host')
     server.add_role('postgres')
     server.add_role('wsgi')
開發者ID:Proteus-tech,項目名稱:profab,代碼行數:4,代碼來源:test_server.py

示例8: test_start_with_size

 def test_start_with_size(self):
     server = Server.start("test", ("size", "c1.xlarge"))
     self.assertEqual(server.instance.instance_type, "c1.xlarge")
開發者ID:AttakornP,項目名稱:profab,代碼行數:3,代碼來源:test_server.py

示例9: test_start_with_roles

 def test_start_with_roles(self):
     server = Server.start("test", "postgres", "smarthost")
     self.assertEquals(str(server), u"ec2-host -- running (host) [default] {}")
開發者ID:AttakornP,項目名稱:profab,代碼行數:3,代碼來源:test_server.py

示例10: test_start_with_ami

 def test_start_with_ami(self):
     server = Server.start("test", ("ami", "test-ami"))
     self.assertEqual(server.instance.image_id, "test-ami")
開發者ID:AttakornP,項目名稱:profab,代碼行數:3,代碼來源:test_server.py

示例11: test_get_servers

 def test_get_servers(self):
     servers = Server.get_all("test")
開發者ID:AttakornP,項目名稱:profab,代碼行數:2,代碼來源:test_server.py

示例12: test_security_groups

 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'])
開發者ID:Proteus-tech,項目名稱:profab,代碼行數:3,代碼來源:test_server.py

示例13: test_start_customise_bits

 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")
開發者ID:AttakornP,項目名稱:profab,代碼行數:4,代碼來源:test_server.py

示例14: test_connect_and_stop

 def test_connect_and_stop(self):
     server = Server.connect('test', 'ec2-host')
     server.stop()
開發者ID:Proteus-tech,項目名稱:profab,代碼行數:3,代碼來源:test_server.py

示例15: test_munin

 def test_munin(self):
     server = Server.connect('test', 'ec2-host')
     server.add_role('munin')
     server.add_role('munin', 'monitor.example.com')
開發者ID:AttakornP,項目名稱:profab,代碼行數:4,代碼來源:test_roles.py


注:本文中的profab.server.Server類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。