本文整理汇总了C#中CloudServersProvider.WaitForServerState方法的典型用法代码示例。如果您正苦于以下问题:C# CloudServersProvider.WaitForServerState方法的具体用法?C# CloudServersProvider.WaitForServerState怎么用?C# CloudServersProvider.WaitForServerState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CloudServersProvider
的用法示例。
在下文中一共展示了CloudServersProvider.WaitForServerState方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_Wait_For_Server_To_Go_Into_Rescue_Status
public void Should_Wait_For_Server_To_Go_Into_Rescue_Status()
{
Assert.IsFalse(string.IsNullOrWhiteSpace(_rescueAdminPass));
var provider = new CloudServersProvider(_testIdentity);
var details = provider.WaitForServerState(_testServer.Id, ServerState.RESCUE, new[] { ServerState.ERROR, ServerState.UNKNOWN, ServerState.SUSPENDED });
Assert.IsNotNull(details);
}
示例2: Should_Wait_For_Server_To_Go_Into_Confirm_Resize_Status
public void Should_Wait_For_Server_To_Go_Into_Confirm_Resize_Status()
{
Assert.IsTrue(_confirmResizeSuccess);
var provider = new CloudServersProvider(_testIdentity);
var details = provider.WaitForServerState(_testServer.Id, ServerState.VERIFY_RESIZE, new[] { ServerState.ERROR, ServerState.UNKNOWN, ServerState.SUSPENDED });
Assert.IsNotNull(details);
}
示例3: Should_Wait_For_Server_To_Go_Into_Rebuild_Status
public void Should_Wait_For_Server_To_Go_Into_Rebuild_Status()
{
Assert.IsNotNull(_rebuildServer);
var provider = new CloudServersProvider(_testIdentity);
var details = provider.WaitForServerState(_testServer.Id, ServerState.REBUILD, new[] { ServerState.ERROR, ServerState.UNKNOWN, ServerState.SUSPENDED });
Assert.IsNotNull(details);
Assert.AreEqual(_testServer.Id, _rebuildServer.Id);
}
示例4: Should_Wait_Until_Server_Goes_Into_Hard_Reboot_State
public void Should_Wait_Until_Server_Goes_Into_Hard_Reboot_State()
{
Assert.IsTrue(_rebootSuccess); // If the reboot was not successful in the previous test, then fail this one too.
var provider = new CloudServersProvider(_testIdentity);
var details = provider.WaitForServerState(_testServer.Id, ServerState.HARD_REBOOT, new[] { ServerState.ERROR, ServerState.UNKNOWN, ServerState.SUSPENDED });
Assert.IsNotNull(details);
}
示例5: TestRevertServerResize
public void TestRevertServerResize()
{
IComputeProvider provider = new CloudServersProvider(Bootstrapper.Settings.TestIdentity);
string serverName = UserComputeTests.UnitTestServerPrefix + Path.GetRandomFileName();
Flavor flavor = UserComputeTests.ListAllFlavorsWithDetails(provider).OrderBy(i => i.RAMInMB).ThenBy(i => i.DiskSizeInGB).FirstOrDefault(i => !i.Id.Equals(_server.Flavor.Id, StringComparison.OrdinalIgnoreCase));
if (flavor == null)
Assert.Inconclusive("Couldn't find a flavor to use for the test server.");
bool resized = provider.ResizeServer(_server.Id, serverName, flavor.Id);
Assert.IsTrue(resized);
Server resizedServer = provider.WaitForServerState(_server.Id, ServerState.VerifyResize, new[] { ServerState.Error, ServerState.Unknown, ServerState.Suspended });
Assert.AreEqual(ServerState.VerifyResize, resizedServer.Status);
_server = resizedServer;
bool reverted = provider.RevertServerResize(resizedServer.Id);
Assert.IsTrue(reverted);
Server revertedServer = provider.WaitForServerActive(_server.Id);
Assert.AreEqual(ServerState.Active, revertedServer.Status);
_server = revertedServer;
}
示例6: TestRescueServer
public void TestRescueServer()
{
IComputeProvider provider = new CloudServersProvider(Bootstrapper.Settings.TestIdentity);
string rescueResult = provider.RescueServer(_server.Id);
Assert.IsFalse(string.IsNullOrEmpty(rescueResult));
Server rescueServer = provider.WaitForServerState(_server.Id, ServerState.Rescue, new[] { ServerState.Error });
Assert.AreEqual(ServerState.Rescue, rescueServer.Status);
bool unrescueResult = provider.UnRescueServer(_server.Id);
Assert.IsTrue(unrescueResult);
Server unrescueServer = provider.WaitForServerActive(_server.Id);
Assert.AreEqual(ServerState.Active, unrescueServer.Status);
}