本文整理汇总了C#中CloudServersProvider.ConfirmServerResize方法的典型用法代码示例。如果您正苦于以下问题:C# CloudServersProvider.ConfirmServerResize方法的具体用法?C# CloudServersProvider.ConfirmServerResize怎么用?C# CloudServersProvider.ConfirmServerResize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CloudServersProvider
的用法示例。
在下文中一共展示了CloudServersProvider.ConfirmServerResize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_Confirm_Resize_Server
public void Should_Confirm_Resize_Server()
{
Assert.IsTrue(_resizeSuccess);
var provider = new CloudServersProvider(_testIdentity);
_confirmResizeSuccess = provider.ConfirmServerResize(_testServer.Id);
Assert.IsTrue(_confirmResizeSuccess);
}
示例2: TestConfirmServerResize
public void TestConfirmServerResize()
{
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 confirmed = provider.ConfirmServerResize(resizedServer.Id);
Assert.IsTrue(confirmed);
Server confirmedServer = provider.WaitForServerActive(_server.Id);
Assert.AreEqual(ServerState.Active, confirmedServer.Status);
_server = confirmedServer;
}