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


Python VncApi.project_read方法代碼示例

本文整理匯總了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')
開發者ID:Ankitja,項目名稱:contrail-test,代碼行數:43,代碼來源:vcenter.py


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