本文整理汇总了Python中vnc_api.vnc_api.VncApi.project_read方法的典型用法代码示例。如果您正苦于以下问题:Python VncApi.project_read方法的具体用法?Python VncApi.project_read怎么用?Python VncApi.project_read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vnc_api.vnc_api.VncApi
的用法示例。
在下文中一共展示了VncApi.project_read方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: VcenterAuth
# 需要导入模块: from vnc_api.vnc_api import VncApi [as 别名]
# 或者: from vnc_api.vnc_api.VncApi import project_read [as 别名]
class VcenterAuth(OrchestratorAuth):
def __init__(self, user, passwd, project_name, inputs, domain='default-domain'):
self.inputs = inputs
self.user = user
self.passwd = passwd
self.domain = domain
self.project_name = project_name
use_ssl = self.inputs.api_protocol == 'https'
self.vnc = VncApi(username=user, password=passwd,
tenant_name=project_name,
api_server_host=self.inputs.cfgm_ip,
api_server_port=self.inputs.api_server_port,
api_server_use_ssl=use_ssl)
def get_project_id(self, project_name=None, domain_id=None):
if not project_name:
project_name = self.project_name
fq_name = [unicode(self.domain), unicode(project_name)]
obj = self.vnc.project_read(fq_name=fq_name)
if obj:
return obj.get_uuid()
return None
def reauth(self):
raise Exception('Unimplemented interface')
def create_project(self, name):
raise Exception('Unimplemented interface')
def delete_project(self, name):
raise Exception('Unimplemented interface')
def create_user(self, user, passwd):
raise Exception('Unimplemented interface')
def delete_user(self, user):
raise Exception('Unimplemented interface')
def add_user_to_project(self, user, project):
raise Exception('Unimplemented interface')