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


C# VirtualMachine.getQuickStats方法代码示例

本文整理汇总了C#中VirtualMachine.getQuickStats方法的典型用法代码示例。如果您正苦于以下问题:C# VirtualMachine.getQuickStats方法的具体用法?C# VirtualMachine.getQuickStats怎么用?C# VirtualMachine.getQuickStats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VirtualMachine的用法示例。


在下文中一共展示了VirtualMachine.getQuickStats方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: printNetworkInfo

 ///<summary>
 ///Take the ObjectContent[] from RetrieveProperties()
 ///and print it out.
 ///ObjectContent[] should have Network information
 ///</summary>
 private static void printNetworkInfo(ObjectContent[] ocs)
 {
     // Network MoRef -> Network
     Hashtable networksByNetwork = new Hashtable();
     // Network MoRef -> Host
     Hashtable hostsByNetwork = new Hashtable();
     // Network MoRef -> VirtualMachine
     Hashtable vmsByNetwork = new Hashtable();
     // HostSystem MoRef -> Host
     Hashtable hostByHost = new Hashtable();
     if (ocs != null)
     {
         for (int i = 0; i < ocs.Length; ++i)
         {
             ObjectContent oc = ocs[i];
             String type = oc.obj.type;
             // Create our Network objects
             if ("Network".Equals(type))
             {
                 Network network = new Network(oc.obj);
                 DynamicProperty[] dps = oc.propSet;
                 if (dps != null)
                 {
                     for (int j = 0; j < dps.Length; ++j)
                     {
                         DynamicProperty dp = dps[j];
                         if ("name".Equals(dp.name))
                         {
                             network.setName((String)dp.val);
                         }
                     }
                 }
                 // Put them in the Map
                 networksByNetwork.Add(oc.obj.Value,
                         network);
                 // Create our Host objects
             }
             else if ("HostSystem".Equals(type))
             {
                 Host cHost = new Host(oc.obj);
                 ManagedObjectReference[] network = null;
                 DynamicProperty[] dps = oc.propSet;
                 if (dps != null)
                 {
                     for (int j = 0; j < dps.Length; ++j)
                     {
                         String pName = dps[j].name;
                         Object pVal = dps[j].val;
                         if ("name".Equals(pName))
                         {
                             cHost.setName((String)pVal);
                         }
                         else if ("network".Equals(pName))
                         {
                             network =
                                 (ManagedObjectReference[])pVal;
                         }
                         else if (
                           "summary.hardware".Equals(pName))
                         {
                             cHost.setHardware(
                                     (HostHardwareSummary)pVal);
                         }
                         else if ("runtime.connectionState"
                               .Equals(pName))
                         {
                             cHost.setConnectionState(
                                 (HostSystemConnectionState)pVal);
                         }
                         else if ("summary.overallStatus"
                               .Equals(pName))
                         {
                             cHost.setOverallStatus(
                                     (ManagedEntityStatus)pVal);
                         }
                         else if ("summary.quickStats"
                               .Equals(pName))
                         {
                             cHost.setQuickStats(
                                 (HostListSummaryQuickStats)pVal);
                         }
                     }
                 }
                 Host host = new Host(
                         cHost.getMoRef(),
                         cHost.getName(),
                         cHost.getHardware(),
                         cHost.getConnectionState(),
                         cHost.getOverallStatus(),
                         cHost.getQuickStats());
                 hostByHost.Add(
                         host.getMoRef().Value, host);
                 for (int n = 0; n < network.Length; ++n)
                 {
                     ArrayList hl = (ArrayList)hostsByNetwork[network[n].Value];
//.........这里部分代码省略.........
开发者ID:Nikolay-Krasan,项目名称:DegreeWork,代码行数:101,代码来源:PropertyCollector.cs


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