当前位置: 首页>>代码示例>>Python>>正文


Python Client.get_client方法代码示例

本文整理汇总了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"
开发者ID:tsuralik,项目名称:softlayer-utils,代码行数:10,代码来源:VmManager.py

示例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")
开发者ID:tsuralik,项目名称:softlayer-utils,代码行数:12,代码来源:test_Account.py

示例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!"
开发者ID:tsuralik,项目名称:softlayer-utils,代码行数:19,代码来源:Run.py

示例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)
开发者ID:tsuralik,项目名称:softlayer-utils,代码行数:5,代码来源:test_Client.py

示例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)
开发者ID:tsuralik,项目名称:softlayer-utils,代码行数:5,代码来源:test_Client.py

示例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)
开发者ID:tsuralik,项目名称:softlayer-utils,代码行数:5,代码来源:test_Client.py

示例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)
开发者ID:tsuralik,项目名称:softlayer-utils,代码行数:5,代码来源:test_Client.py

示例8: getClient

# 需要导入模块: import Client [as 别名]
# 或者: from Client import get_client [as 别名]
 def getClient(self, name):
     return Client.get_client(name)
开发者ID:tsuralik,项目名称:softlayer-utils,代码行数:4,代码来源:Power.py

示例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)
开发者ID:tsuralik,项目名称:softlayer-utils,代码行数:6,代码来源:test_Account.py

示例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)
开发者ID:tsuralik,项目名称:softlayer-utils,代码行数:6,代码来源:test_Account.py

示例11: setUp

# 需要导入模块: import Client [as 别名]
# 或者: from Client import get_client [as 别名]
 def setUp(self):
     self.client = Client.get_client('tsuralik')
     self.account = Account
开发者ID:tsuralik,项目名称:softlayer-utils,代码行数:5,代码来源:test_Account.py


注:本文中的Client.get_client方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。