本文整理汇总了Python中Client.get_client方法的典型用法代码示例。如果您正苦于以下问题:Python Client.get_client方法的具体用法?Python Client.get_client怎么用?Python Client.get_client使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client.get_client方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process
# 需要导入模块: import Client [as 别名]
# 或者: from Client import get_client [as 别名]
def process(process_args):
print 'process: {0}'.format(process_args)
if process_args.list:
print "do list"
client = Client.get_client(process_args.client)
list_vms(client)
else:
print "do something else"
示例2: test_show_account_with_a_invalid_account
# 需要导入模块: import Client [as 别名]
# 或者: from Client import get_client [as 别名]
def test_show_account_with_a_invalid_account(self):
client = Client.get_client('mustafa') # from the lion-king
try:
Account.show_account(client)
except SoftLayer.SoftLayerAPIError as slAPIe:
pass
except BaseException as be:
self.assertEquals(be.message, "bad client")
else:
self.fail("expected a SoftLayer.SoftLayerAPIError")
示例3: go
# 需要导入模块: import Client [as 别名]
# 或者: from Client import get_client [as 别名]
def go():
#MyFormatter.print_program_start()
#parser = argparse.ArgumentParser(description='SoftLayer Management Tool')
#parser.add_argument("echo", help="Echo Repeated")
#args = parser.parse_args()
#print args.echo
client = Client.get_client('tsuralik')
if client != None:
account = Account
acct_details = account.get_details(client)
account.show_account(client)
print "Finished!"
示例4: test_get_client_for_tsuralik_returns_with_proper_key
# 需要导入模块: import Client [as 别名]
# 或者: from Client import get_client [as 别名]
def test_get_client_for_tsuralik_returns_with_proper_key(self):
retVal = Client.get_client('tsuralik')
self.assertNotEquals(retVal, None)
示例5: test_get_client_with_bad_data
# 需要导入模块: import Client [as 别名]
# 或者: from Client import get_client [as 别名]
def test_get_client_with_bad_data(self):
retVal = Client.get_client(['array'])
self.assertEquals(retVal, None)
示例6: test_get_unknown_client
# 需要导入模块: import Client [as 别名]
# 或者: from Client import get_client [as 别名]
def test_get_unknown_client(self):
retVal = Client.get_client('Bill Murray - aka Venkman')
self.assertEquals(retVal, None)
示例7: test_get_unspecified_client
# 需要导入模块: import Client [as 别名]
# 或者: from Client import get_client [as 别名]
def test_get_unspecified_client(self):
retVal = Client.get_client()
self.assertEquals(retVal, None)
示例8: getClient
# 需要导入模块: import Client [as 别名]
# 或者: from Client import get_client [as 别名]
def getClient(self, name):
return Client.get_client(name)
示例9: test_show_account_with_a_valid_account
# 需要导入模块: import Client [as 别名]
# 或者: from Client import get_client [as 别名]
def test_show_account_with_a_valid_account(self):
client = Client.get_client('tsuralik')
retVal = Account.show_account(client)
self.assertEquals(retVal, None)
示例10: test_bad_account_
# 需要导入模块: import Client [as 别名]
# 或者: from Client import get_client [as 别名]
def test_bad_account_(self):
bad_client = Client.get_client('mustafa') # from the lion-king
details = Account.get_details(bad_client)
self.assertEquals(details, None)
示例11: setUp
# 需要导入模块: import Client [as 别名]
# 或者: from Client import get_client [as 别名]
def setUp(self):
self.client = Client.get_client('tsuralik')
self.account = Account