本文整理汇总了C#中XenAdmin.Actions.AsyncAction.PollToCompletion方法的典型用法代码示例。如果您正苦于以下问题:C# AsyncAction.PollToCompletion方法的具体用法?C# AsyncAction.PollToCompletion怎么用?C# AsyncAction.PollToCompletion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenAdmin.Actions.AsyncAction
的用法示例。
在下文中一共展示了AsyncAction.PollToCompletion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReconfigureManagement_
/// <summary>
/// Switch the host's management interface from its current setting over to the given PIF.
/// </summary>
private static void ReconfigureManagement_(AsyncAction action, PIF pif, int hi)
{
log.DebugFormat("Switching to PIF {0} {1} for management...", pif.Name, pif.uuid);
action.Description = string.Format(Messages.ACTION_CHANGE_NETWORKING_MANAGEMENT_RECONFIGURING, pif.Name);
int mid = (hi + action.PercentComplete) / 2;
PIF p = (PIF)pif.Clone();
p.disallow_unplug = false;
p.ManagementPurpose = null;
p.SaveChanges(action.Session);
action.PercentComplete = mid;
action.RelatedTask = XenAPI.Host.async_management_reconfigure(action.Session, pif.opaque_ref);
action.PollToCompletion(mid, hi);
log.DebugFormat("Switched to PIF {0} {1} for management.", pif.Name, pif.uuid);
action.Description = string.Format(Messages.ACTION_CHANGE_NETWORKING_MANAGEMENT_RECONFIGURED, pif.Name);
}
示例2: ReconfigureIP
internal static void ReconfigureIP(AsyncAction action, PIF new_pif, PIF existing_pif, string ip, int hi)
{
log.DebugFormat("Reconfiguring IP on {0} {1} ...", existing_pif.Name, existing_pif.uuid);
action.RelatedTask = PIF.async_reconfigure_ip(action.Session, existing_pif.opaque_ref,
new_pif.ip_configuration_mode, ip, new_pif.netmask, new_pif.gateway, new_pif.DNS);
action.PollToCompletion(action.PercentComplete, hi);
log.DebugFormat("Reconfiguring IP on {0} {1} done.", existing_pif.Name, existing_pif.uuid);
}
示例3: ClearIP
/// <summary>
/// Remove the IP address from the given PIF.
/// </summary>
private static void ClearIP(AsyncAction action, PIF pif, int hi)
{
log.DebugFormat("Removing IP address from {0} {1}...", pif.Name, pif.uuid);
action.Description = string.Format(Messages.ACTION_CHANGE_NETWORKING_BRINGING_DOWN, pif.Name);
action.RelatedTask = PIF.async_reconfigure_ip(action.Session, pif.opaque_ref, ip_configuration_mode.None, "", "", "", "");
action.PollToCompletion(action.PercentComplete, hi);
action.Description = string.Format(Messages.ACTION_CHANGE_NETWORKING_BRINGING_DOWN_DONE, pif.Name);
log.DebugFormat("Removed IP address from {0} {1}.", pif.Name, pif.uuid);
}
示例4: Plug
internal static void Plug(AsyncAction action, PIF pif, int hi)
{
if (!PIF.get_currently_attached(action.Session, pif.opaque_ref))
{
log.DebugFormat("Plugging {0} {1} ...", pif.Name, pif.uuid);
action.RelatedTask = PIF.async_plug(action.Session, pif.opaque_ref);
action.PollToCompletion(action.PercentComplete, hi);
log.DebugFormat("Plugging {0} {1} done.", pif.Name, pif.uuid);
}
}