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


Python VncKubernetesConfig.pod_ipam_fq_name方法代碼示例

本文整理匯總了Python中vnc_kubernetes_config.VncKubernetesConfig.pod_ipam_fq_name方法的典型用法代碼示例。如果您正苦於以下問題:Python VncKubernetesConfig.pod_ipam_fq_name方法的具體用法?Python VncKubernetesConfig.pod_ipam_fq_name怎麽用?Python VncKubernetesConfig.pod_ipam_fq_name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vnc_kubernetes_config.VncKubernetesConfig的用法示例。


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

示例1: _get_pod_ipam_subnet_uuid

# 需要導入模塊: from vnc_kubernetes_config import VncKubernetesConfig [as 別名]
# 或者: from vnc_kubernetes_config.VncKubernetesConfig import pod_ipam_fq_name [as 別名]
 def _get_pod_ipam_subnet_uuid(self, vn_obj):
     pod_ipam_subnet_uuid = None
     fq_name = vnc_kube_config.pod_ipam_fq_name()
     vn = VirtualNetworkKM.find_by_name_or_uuid(vn_obj.get_uuid())
     pod_ipam_subnet_uuid = vn.get_ipam_subnet_uuid(fq_name)
     if pod_ipam_subnet_uuid is None:
         self._logger.error("%s - %s Not Found" %(self._name, fq_name))
     return pod_ipam_subnet_uuid
開發者ID:cijohnson,項目名稱:contrail-controller,代碼行數:10,代碼來源:vnc_ingress.py

示例2: _create_isolated_ns_virtual_network

# 需要導入模塊: from vnc_kubernetes_config import VncKubernetesConfig [as 別名]
# 或者: from vnc_kubernetes_config.VncKubernetesConfig import pod_ipam_fq_name [as 別名]
    def _create_isolated_ns_virtual_network(self, ns_name, vn_name, proj_obj):
        """
        Create a virtual network for this namespace.
        """
        vn = VirtualNetwork(name=vn_name, parent_obj=proj_obj,
            virtual_network_properties=VirtualNetworkType(forwarding_mode='l3'),
            address_allocation_mode='flat-subnet-only')

        # Add annotatins on this isolated virtual-network.
        VirtualNetworkKM.add_annotations(self, vn, namespace=ns_name,
            name=ns_name, isolated='True')

        try:
            vn_uuid = self._vnc_lib.virtual_network_create(vn)
        except RefsExistError:
            vn_obj = self._vnc_lib.virtual_network_read(
                fq_name=vn.get_fq_name())
            vn_uuid = vn_obj.uuid

        # Instance-Ip for pods on this VN, should be allocated from
        # cluster pod ipam. Attach the cluster pod-ipam object
        # to this virtual network.
        ipam_obj = self._vnc_lib.network_ipam_read(
            fq_name=vnc_kube_config.pod_ipam_fq_name())
        vn.add_network_ipam(ipam_obj, VnSubnetsType([]))

        # Update VN.
        self._vnc_lib.virtual_network_update(vn)

        # Cache the virtual network.
        VirtualNetworkKM.locate(vn_uuid)

        # Cache network info in namespace entry.
        self._set_namespace_virtual_network(ns_name, vn.get_fq_name())

        return vn_uuid
開發者ID:cijohnson,項目名稱:contrail-controller,代碼行數:38,代碼來源:vnc_namespace.py


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