• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# XenAPI.Host类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中XenAPI.Host的典型用法代码示例。如果您正苦于以下问题:C# Host类的具体用法?C# Host怎么用?C# Host使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Host类属于XenAPI命名空间,在下文中一共展示了Host类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AssignLicenseDialog

        /// <summary>
        /// Initializes a new instance of the <see cref="AssignLicenseDialog"/> class.
        /// </summary>
        /// <param name="hosts">The hosts for which the licensing is to be applied.</param>
        public AssignLicenseDialog(IEnumerable<IXenObject> xos, String firstHost, String firstPort, Host.Edition firstEdition)
        {
            Util.ThrowIfEnumerableParameterNullOrEmpty(xos, "XenObjects");
            this.xos = new List<IXenObject>(xos);
            this.currentEdition = firstEdition;
            InitializeComponent();
            licenseServerNameTextBox.TextChanged += licenseServerPortTextBox_TextChanged;
            licenseServerPortTextBox.TextChanged += licenseServerNameTextBox_TextChanged;
            SetOptionsForClearwaterAndNewer();
            UpdateButtonEnablement();

            // if all the hosts have the same license server details then populate the textboxes.
            List<Host> hosts = CreateHostsList();

            if (hosts[0].license_server.ContainsKey("address") && hosts[0].license_server.ContainsKey("port") &&
                hosts[0].license_server["address"] != "localhost")
            {
                if (hosts.TrueForAll(delegate(Host h)
                {
                    return h.license_server.ContainsKey("address") &&
                        h.license_server.ContainsKey("port") &&
                        h.license_server["address"] == hosts[0].license_server["address"] &&
                        h.license_server["port"] == hosts[0].license_server["port"];
                }))
                {
                    licenseServerPortTextBox.Text = hosts[0].license_server["port"];
                    licenseServerNameTextBox.Text = hosts[0].license_server["address"];
                }
            }
            else if ((!String.IsNullOrEmpty(firstHost)) && (!String.IsNullOrEmpty(firstPort)))
            {
                licenseServerPortTextBox.Text = firstPort;
                licenseServerNameTextBox.Text = firstHost;
            }
        }
开发者ID:huizh,项目名称:xenadmin,代码行数:39,代码来源:AssignLicenseDialog.cs


示例2: SrProbeAction

        /// <summary>
        /// Won't appear in the program history (SuppressHistory == true).
        /// </summary>
        /// <param name="masterUuid">The UUID of the host from which to perform the probe (usually the pool master).</param>
        /// <param name="srType">netapp or iscsi</param>
        public SrProbeAction(IXenConnection connection, Host host, SR.SRTypes srType, Dictionary<String, String> dconf)
            : base(connection, string.Format(Messages.ACTION_SCANNING_SR_FROM, Helpers.GetName(connection)), null, true)
        {
            this.host = host;
            this.srType = srType;
            this.dconf = dconf;

            switch (srType) {
                case XenAPI.SR.SRTypes.nfs:
                    Description = string.Format(Messages.ACTION_SR_SCANNING,
                        XenAPI.SR.getFriendlyTypeName(srType), dconf["server"]);
                    break;
                case XenAPI.SR.SRTypes.lvmoiscsi:
                    Description = string.Format(Messages.ACTION_SR_SCANNING,
                        XenAPI.SR.getFriendlyTypeName(srType), dconf["target"]);
                    break;
                case XenAPI.SR.SRTypes.lvmohba:
                    String device = dconf.ContainsKey(DEVICE) ?
                        dconf[DEVICE] : dconf[SCSIid];
                    Description = string.Format(Messages.ACTION_SR_SCANNING,
                        XenAPI.SR.getFriendlyTypeName(srType), device);
                    break;
                default:
                    Description = string.Format(Messages.ACTION_SR_SCANNING,
                        XenAPI.SR.getFriendlyTypeName(srType), Messages.REPAIRSR_SERVER); // this is a bit minging: CA-22111
                    break;
            }
            smconf = new Dictionary<string, string>();
        }
开发者ID:ChrisH4rding,项目名称:xenadmin,代码行数:34,代码来源:SrProbeAction.cs


示例3: CrossPoolMigrateWizard

 public CrossPoolMigrateWizard(IXenConnection con, IEnumerable<SelectedItem> selection, Host targetHostPreSelection)
     : base(con)
 {
     InitializeComponent();
     hostPreSelection = targetHostPreSelection;
     InitialiseWizard(selection);
 }
开发者ID:robertbreker,项目名称:xenadmin,代码行数:7,代码来源:CrossPoolMigrateWizard.cs


示例4: EvacuateHostPlanAction

 public EvacuateHostPlanAction(Host host)
     : base(host.Connection, string.Format(Messages.PLANACTION_VMS_MIGRATING, host.Name))
 {
     base.TitlePlan = string.Format(Messages.MIGRATE_VMS_OFF_SERVER, host.Name);
     this._host = new XenRef<Host>(host);
     currentHost = host;
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:EvacuateHostPlanAction.cs


示例5: ChangeNetworkingAction

        /// <summary>
        /// 
        /// </summary>
        /// <param name="connection"></param>
        /// <param name="pool">May be null, in which case we're acting on a single host basis.</param>
        /// <param name="host">If pool is set, then host should be the pool master.</param>
        /// <param name="newPIFs">New PIF instances that are to be created on the server.</param>
        /// <param name="downPIFs"></param>
        /// <param name="newManagement">May be null, in which case the management network will not be disturbed.
        /// Note that it is still possible for the management interface to receive a new IP address even if this
        /// parameter is null, because it may be in newPIFs.  You only need to use this parameter if the management
        /// interface is switching onto a different PIF.</param>
        /// <param name="downManagement">May be null iff newManagement is null.</param>
        public ChangeNetworkingAction(IXenConnection connection, Pool pool, Host host, List<PIF> newPIFs, List<PIF> downPIFs,
            PIF newManagement, PIF downManagement, bool managementIPChanged)
            : base(connection, Messages.ACTION_CHANGE_NETWORKING_TITLE)
        {
            Pool = pool;
            Host = host;

            this.newPIFs = newPIFs;
            this.downPIFs = downPIFs;
            this.newManagement = newManagement;
            this.downManagement = downManagement;
            this.managementIPChanged = managementIPChanged;

            if (pool != null)
            {
                // If we're going to compute address ranges, then we need a sorted list of hosts (to keep the addresses stable).
                Hosts = Connection.Cache.Hosts;
                Array.Sort(Hosts);
                foreach (Host h in Hosts)
                {
                    AppliesTo.Add(h.opaque_ref);
                }
            }
            #region RBAC Dependencies
            ApiMethodsToRoleCheck.Add("vm.set_memory_limits");
            ApiMethodsToRoleCheck.Add("host.management_reconfigure");
            ApiMethodsToRoleCheck.Add("pif.reconfigure_ip");
            ApiMethodsToRoleCheck.Add("pif.plug");
            ApiMethodsToRoleCheck.AddRange(XenAPI.Role.CommonSessionApiList);
            ApiMethodsToRoleCheck.AddRange(XenAPI.Role.CommonTaskApiList);
            #endregion
        }
开发者ID:huizh,项目名称:xenadmin,代码行数:45,代码来源:ChangeNetworkingAction.cs


示例6: NewNetworkWizard

        /// <summary>
        /// 
        /// </summary>
        /// <param name="connection"></param>
        /// <param name="pool">May be null.</param>
        /// <param name="host">Never null. In the case of a pool, "host" is set to the master.</param>
        public NewNetworkWizard(Network.IXenConnection connection, Pool pool, Host host)
            : base(connection)
        {
            InitializeComponent();

            pageNetworkType = new NetWTypeSelect();
            pageName = new NetWName();
            pageNetworkDetails = new NetWDetails();
            pageBondDetails = new NetWBondDetails();
            pageChinDetails = new NetWChinDetails();

            System.Diagnostics.Trace.Assert(host != null);
            Pool = pool;
            Host = host;

            if (Pool != null)
                pageBondDetails.SetPool(Pool);
            else
                pageBondDetails.SetHost(Host);

            pageNetworkDetails.Host = host;
            pageChinDetails.Host = host;
            pageChinDetails.Pool = pool;

            AddPage(pageNetworkType);
            AddPage(new XenTabPage { Text = "" });
        }
开发者ID:robhoes,项目名称:xenadmin,代码行数:33,代码来源:NewNetworkWizard.cs


示例7: CanExecute

        public static new bool CanExecute(VM vm, Host preSelectedHost)
        {
            if (vm == null || !vm.is_a_template || vm.DefaultTemplate || vm.Locked)
                return false;

            return CrossPoolMigrateCommand.CanExecute(vm, preSelectedHost);
        }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:7,代码来源:CrossPoolCopyVMCommand.cs


示例8: CanActivate

 public static bool CanActivate(Host host)
 {
     //This check used to be "_expiresText != Messages.LICENSE_NEVER" but I've swapped it for
     //"!host.isOEM" according to the ticket CA-37336 where this 3rd part of the check was added
     //OEM licenses (< XS ver 5.5) have perpetual (2036) expiry dates
     return host.IsFreeLicense() && host.IsFloodgateOrLater() && !host.isOEM && !Helpers.ClearwaterOrGreater(host);
 }
开发者ID:agimofcarmen,项目名称:xenadmin,代码行数:7,代码来源:LicenseActivationRequest.cs


示例9: IqnAlert

 protected IqnAlert(Host host)
 {
     Host = host;
     HostUuid = host.uuid;
     _timestamp = DateTime.UtcNow;
     Connection = host.Connection;
 }
开发者ID:ChrisH4rding,项目名称:xenadmin,代码行数:7,代码来源:IqnAlert.cs


示例10: ImportVmAction

		public ImportVmAction(IXenConnection connection, Host affinity, string filename, SR sr)
			: base(connection, string.Format(Messages.IMPORTVM_TITLE, filename, Helpers.GetName(connection)), Messages.IMPORTVM_PREP)
		{
			Pool = Helpers.GetPoolOfOne(connection);
			m_affinity = affinity;
			Host = affinity ?? connection.Resolve(Pool.master);
			SR = sr;
			VM = null;
			m_filename = filename;

			#region RBAC Dependencies

			ApiMethodsToRoleCheck.AddRange(ConstantRBACRequirements);

			if (affinity != null)
				ApiMethodsToRoleCheck.Add("vm.set_affinity");

			//??
			//if (startAutomatically)
			//	ApiMethodsToRoleCheck.Add("vm.start");

			ApiMethodsToRoleCheck.AddRange(Role.CommonTaskApiList);
			ApiMethodsToRoleCheck.AddRange(Role.CommonSessionApiList);

			#endregion
		}
开发者ID:slamj1,项目名称:xenadmin,代码行数:26,代码来源:ImportVmAction.cs


示例11: CopyPatchFromHostToOther

 public CopyPatchFromHostToOther(IXenConnection connection, Host hostDestiny, Pool_patch patchToCopy)
     : base(connection, Messages.UPLOADING_PATCH, true)
 {
     _hostDestiny = hostDestiny;
     _patchToCopy = patchToCopy;
     Host = _hostDestiny;
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:CopyPatchFromHostToOther.cs


示例12: ApplyLicenseAction

 public ApplyLicenseAction(Network.IXenConnection connection, Host host, string filepath, bool activateFreeLicense)
     : base(connection, string.Format(Messages.APPLYLICENSE_TITLE, host.Name), Messages.APPLYLICENSE_PREP)
 {
     this.Host = host;
     this.Filepath = filepath;
     this.ActivateFreeLicense = activateFreeLicense;
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:ApplyLicenseAction.cs


示例13: IsHostLicenseRestricted

 private bool IsHostLicenseRestricted(Host host)
 {
     if(host == null)
         return false;
     
     return !host.CanApplyHotfixes;
 }
开发者ID:robhoes,项目名称:xenadmin,代码行数:7,代码来源:XenServerPatchAlert.cs


示例14: EjectHostFromPoolAction

 public EjectHostFromPoolAction(Pool pool,Host hostToEject)
     : base(pool.Connection, string.Format(Messages.REMOVING_SERVER_FROM_POOL, hostToEject.Name, pool.Name))
 {
     this.Pool = pool;
     this.Host = hostToEject;
     this.Description = Messages.WAITING;
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:EjectHostFromPoolAction.cs


示例15: CanExecute

        private bool CanExecute(Host host)
        {
            if (host == null)
                return false;

            return true;
        }
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:RescanPIFsCommand.cs


示例16: CanExecute

        public new static bool CanExecute(VM vm, Host preSelectedHost)
        {
            if (vm == null || vm.is_a_template || vm.Locked || vm.power_state == vm_power_state.Running)
                return false;

            return CrossPoolMigrateCommand.CanExecute(vm, preSelectedHost);
        }
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:CrossPoolMoveVMCommand.cs


示例17: SelectedItem

 /// <summary>
 /// Initializes a new instance of the <see cref="SelectedItem"/> class.
 /// </summary>
 /// <param name="xenObject">The xen object that is selected.</param>
 /// <param name="connection">The connection of the xen object.</param>
 /// <param name="hostAncestor">The host ancestor of the xen object in the tree.</param>
 /// <param name="poolAncestor">The pool ancestor of the xen object in the tree.</param>
 public SelectedItem(IXenObject xenObject, IXenConnection connection, Host hostAncestor, Pool poolAncestor)
 {
     _xenObject = xenObject;
     _hostAncestor = hostAncestor;
     _poolAncestor = poolAncestor;
     _connection = connection;
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:14,代码来源:SelectedItem.cs


示例18: ApplyXenServerPatchPlanAction

 public ApplyXenServerPatchPlanAction(Host host, XenServerPatch xenServerPatch, List<PoolPatchMapping> mappings)
     : base(host.Connection, string.Format(Messages.UPDATES_WIZARD_APPLYING_UPDATE, xenServerPatch.Name, host.Name))
 {
     this.host = host;
     this.xenServerPatch = xenServerPatch;
     this.mappings = mappings;
 }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:7,代码来源:ApplyXenServerPatchPlanAction.cs


示例19: DisableHostAction

 public DisableHostAction(Host host)
     : base(host.Connection,Messages.HOST_DISABLE)
 {
     Host = host;
     AddCommonAPIMethodsToRoleCheck();
     ApiMethodsToRoleCheck.Add("host.remove_from_other_config");
     ApiMethodsToRoleCheck.Add("host.disable");
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:8,代码来源:DisableHostAction.cs


示例20: DestroyHostAction

 public DestroyHostAction(Pool pool, Host hostToDestroy)
     : base(pool.Connection, string.Format(Messages.DESTROY_HOST_ACTION_TITLE, hostToDestroy.Name))
 {
     this.Pool = pool;
     this.Host = hostToDestroy;
     this.Description = Messages.WAITING;
     SetRBACPermissions();
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:8,代码来源:DestroyHostAction.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# XenAPI.Session类代码示例发布时间:2022-05-26
下一篇:
C# DataGrid.DataGridControl类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap