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