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


Python PMachineList.get_pmachines方法代碼示例

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


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

示例1: _find_ovs_model_pmachine_guid_by_hostname

# 需要導入模塊: from ovs.dal.lists.pmachinelist import PMachineList [as 別名]
# 或者: from ovs.dal.lists.pmachinelist.PMachineList import get_pmachines [as 別名]
 def _find_ovs_model_pmachine_guid_by_hostname(self, hostname):
     """Find OVS pmachine guid based on storagerouter name
     :return guid: GUID
     """
     hostname = self._get_real_hostname(hostname)
     LOG.debug("[_FIND OVS PMACHINE] Hostname %s" % (hostname))
     mapping = [(pm.guid, str(sr.name)) for pm in PMachineList.get_pmachines() for sr in pm.storagerouters]
     for item in mapping:
         if item[1] == str(hostname):
             msg = "Found pmachineguid %s for Hostname %s"
             LOG.info(msg % (item[0], hostname))
             return item[0]
     raise RuntimeError("No PMachine guid found for Hostname %s" % hostname)
開發者ID:openvstorage,項目名稱:framework-cinder-plugin,代碼行數:15,代碼來源:openvstorage.py

示例2: list

# 需要導入模塊: from ovs.dal.lists.pmachinelist import PMachineList [as 別名]
# 或者: from ovs.dal.lists.pmachinelist.PMachineList import get_pmachines [as 別名]
 def list(self):
     """
     Overview of all pMachines
     """
     return PMachineList.get_pmachines()
開發者ID:tcpcloud,項目名稱:openvstorage,代碼行數:7,代碼來源:pmachines.py

示例3: _bootstrap_dal_models

# 需要導入模塊: from ovs.dal.lists.pmachinelist import PMachineList [as 別名]
# 或者: from ovs.dal.lists.pmachinelist.PMachineList import get_pmachines [as 別名]

#.........這裏部分代碼省略.........
                    self._register_dal_model(1, vd, 'statistics', "2.7", key = "cluster_cache_misses", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.8", key = "read_operations_ps", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.9", key = "sco_cache_misses_ps", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.10", key = "backend_write_operations", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.11", key = "backend_data_read", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.12", key = "cache_hits", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.13", key = "backend_write_operations_ps", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.14", key = "metadata_store_hits_ps", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.15", key = "metadata_store_misses", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.16", key = "backend_data_written", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.17", key = "data_read_ps", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.18", key = "read_operations", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.19", key = "cluster_cache_hits", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.20", key = "cluster_cache_misses_ps", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.21", key = "cluster_cache_hits_ps", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.22", key = "cache_hits_ps", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.23", key = "timestamp", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.24", key = "metadata_store_misses_ps", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.25", key = "backend_data_written_ps", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.26", key = "backend_read_operations", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.27", key = "data_written", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.28", key = "metadata_store_hits", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.29", key = "backend_data_read_ps", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.30", key = "operations_ps", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.31", key = "backend_read_operations_ps", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.32", key = "data_transferred_ps", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.33", key = "write_operations_ps", atype = int)
                    self._register_dal_model(1, vd, 'statistics', "2.34", key = "data_transferred", atype = int)
                    self._register_dal_model(1, vd, 'info', "3", key = 'stored', atype = int)
                    self._register_dal_model(1, vd, 'info', "4", key = 'failover_mode', atype = int)
                    self._register_dal_model(1, vd, 'snapshots', "5", atype = int)
                    self.instance_oid += 1

            for pm in PMachineList.get_pmachines():
                _guids.add(pm.guid)
                if not self._check_added(pm):
                    self._register_dal_model(2, pm, 'guid', "0")
                    self._register_dal_model(2, pm, 'name', "1")
                    self._register_dal_model(2, pm, 'host_status', "2")
                    self.instance_oid += 1

            for vp in VPoolList.get_vpools():
                _guids.add(vp.guid)
                if not self._check_added(vp):
                    self._register_dal_model(3, vp, 'guid', "0")
                    self._register_dal_model(3, vp, 'name', "1")
                    self._register_dal_model(3, vp, 'statistics', "2.0", key = "operations", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.1", key = "cluster_cache_misses_ps", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.2", key = "data_read", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.3", key = "sco_cache_misses", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.4", key = "sco_cache_hits_ps", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.5", key = "sco_cache_hits", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.6", key = "write_operations", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.7", key = "cluster_cache_misses", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.8", key = "read_operations_ps", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.9", key = "sco_cache_misses_ps", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.10", key = "backend_write_operations", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.11", key = "backend_data_read", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.12", key = "cache_hits", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.13", key = "backend_write_operations_ps", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.14", key = "metadata_store_hits_ps", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.15", key = "metadata_store_misses", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.16", key = "backend_data_written", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.17", key = "data_read_ps", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.18", key = "read_operations", atype = int)
                    self._register_dal_model(3, vp, 'statistics', "2.19", key = "cluster_cache_hits", atype = int)
開發者ID:DarumasLegs,項目名稱:framework,代碼行數:70,代碼來源:ovssnmpserver.py

示例4: get_pmachines

# 需要導入模塊: from ovs.dal.lists.pmachinelist import PMachineList [as 別名]
# 或者: from ovs.dal.lists.pmachinelist.PMachineList import get_pmachines [as 別名]
 def get_pmachines():
     """
     Retrieve all Physical Machines
     :return: Data-object list of Physical Machines
     """
     return PMachineList.get_pmachines()
開發者ID:DarumasLegs,項目名稱:integrationtests,代碼行數:8,代碼來源:general_pmachine.py

示例5: get_all_ips

# 需要導入模塊: from ovs.dal.lists.pmachinelist import PMachineList [as 別名]
# 或者: from ovs.dal.lists.pmachinelist.PMachineList import get_pmachines [as 別名]
 def get_all_ips():
     """
     Retrieve all IPs for all Physical Machines
     :return: List of IPs
     """
     return [str(pmachine.ip) for pmachine in PMachineList.get_pmachines()]
開發者ID:DarumasLegs,項目名稱:integrationtests,代碼行數:8,代碼來源:general_pmachine.py


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