当前位置: 首页>>代码示例>>C#>>正文


C# CloudServersProvider.WaitForServerState方法代码示例

本文整理汇总了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);
        }
开发者ID:Dan-Pallone-II,项目名称:openstack.net,代码行数:9,代码来源:CloudServersTests.cs

示例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);
        }
开发者ID:Dan-Pallone-II,项目名称:openstack.net,代码行数:9,代码来源:CloudServersTests.cs

示例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);
        }
开发者ID:Dan-Pallone-II,项目名称:openstack.net,代码行数:10,代码来源:CloudServersTests.cs

示例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);
        }
开发者ID:Dan-Pallone-II,项目名称:openstack.net,代码行数:10,代码来源:CloudServersTests.cs

示例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;
        }
开发者ID:nick-o,项目名称:openstack.net,代码行数:22,代码来源:UserServerTests.cs

示例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);
        }
开发者ID:nick-o,项目名称:openstack.net,代码行数:14,代码来源:UserServerTests.cs


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