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


C# ComputeProvider.GetDetails方法代码示例

本文整理汇总了C#中net.openstack.Providers.Rackspace.ComputeProvider.GetDetails方法的典型用法代码示例。如果您正苦于以下问题:C# ComputeProvider.GetDetails方法的具体用法?C# ComputeProvider.GetDetails怎么用?C# ComputeProvider.GetDetails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.openstack.Providers.Rackspace.ComputeProvider的用法示例。


在下文中一共展示了ComputeProvider.GetDetails方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Test002_Should_Get_Details_For_Newly_Created_Server_In_DFW

        public void Test002_Should_Get_Details_For_Newly_Created_Server_In_DFW()
        {
            var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
            var serverDetails = provider.GetDetails(_testIdentity, _testServer.Id);

            Assert.IsNotNull(serverDetails);
            Assert.AreEqual("net-sdk-test-server", serverDetails.Name);
            Assert.AreEqual("d531a2dd-7ae9-4407-bb5a-e5ea03303d98", serverDetails.Image.Id);
            Assert.AreEqual("2", serverDetails.Flavor.Id);
        }
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:10,代码来源:ComputeTests.cs

示例2: Test003_Should_Wait_Until_Server_Becomes_Active_Or_A_Maximum_Of_10_Minutes

        public void Test003_Should_Wait_Until_Server_Becomes_Active_Or_A_Maximum_Of_10_Minutes()
        {
            var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
            var serverDetails = provider.GetDetails(_testIdentity, _testServer.Id);
            Assert.IsNotNull(serverDetails);
            
            int count = 0;
            while (!serverDetails.Status.Equals("ACTIVE") && !serverDetails.Status.Equals("ERROR") && !serverDetails.Status.Equals("UNKNOWN") && !serverDetails.Status.Equals("SUSPENDED") && count < 600)
            {
                Thread.Sleep(2400);
                serverDetails = provider.GetDetails(_testIdentity, _testServer.Id);
                count++;
            }

            Assert.IsNotNull(serverDetails);
            Assert.AreEqual("ACTIVE", serverDetails.Status);
        }
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:17,代码来源:ComputeTests.cs

示例3: Test025_Should_Successfully_To_And_Login_With_New_Password

        public void Test025_Should_Successfully_To_And_Login_With_New_Password()
        {
            var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
            var serverDetails = provider.GetDetails(_testIdentity, _testServer.Id);
            using(var client = new Renci.SshNet.SshClient(serverDetails.AccessIPv4, "root", NewPassword))
            {
                client.Connect();

                Assert.IsTrue(client.IsConnected);
            }
        }
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:11,代码来源:ComputeTests.cs

示例4: while

        public void Test101_Should_Wait_A_Max_Of_10_Minutes_For_The_Server_Is_Deleted_Indicated_By_A_Null_Return_Value_For_Details()
        {
            var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
            var details = provider.GetDetails(_testIdentity, _testServer.Id);
            Assert.IsNotNull(details);
            
            while (details != null && (!details.Status.Equals("DELETED") && !details.Status.Equals("ERROR") && !details.Status.Equals("UNKNOWN") && !details.Status.Equals("SUSPENDED")))
            {
                Thread.Sleep(1000);
                details = provider.GetDetails(_testIdentity, _testServer.Id);
            }

            if(details != null)
                Assert.AreEqual("DELETED", details.Status);
        }
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:15,代码来源:ComputeTests.cs

示例5: Should_Get_Details_For_Newly_Created_Complex_Server_In_DFW

        public void Should_Get_Details_For_Newly_Created_Complex_Server_In_DFW()
        {
            var provider = new ComputeProvider(_testIdentity);
            var serverDetails = provider.GetDetails(_testServer2.Id);

            Assert.IsNotNull(serverDetails);
            Assert.AreEqual("net-sdk-test-server2", serverDetails.Name);
            Assert.AreEqual("d531a2dd-7ae9-4407-bb5a-e5ea03303d98", serverDetails.Image.Id);
            Assert.AreEqual("2", serverDetails.Flavor.Id);
        }
开发者ID:bretmcg,项目名称:openstack.net,代码行数:10,代码来源:ComputeTests.cs

示例6: Test025_Should_Successfully_To_And_Login_With_New_Password

        public void Test025_Should_Successfully_To_And_Login_With_New_Password()
        {
            var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
            var serverDetails = provider.GetDetails(_testIdentity, _testServer.Id);
            bool sucess = false;
            for (int i = 0; i < 10; i++ )
            {
                using (var client = new Renci.SshNet.SshClient(serverDetails.AccessIPv4, "root", NewPassword))
                {
                    client.Connect();

                    sucess = client.IsConnected;

                    if (sucess)
                        break;
                }
                Thread.Sleep(1000);
            }
            
            Assert.IsTrue(sucess);
        }
开发者ID:jmeridth,项目名称:openstack.net,代码行数:21,代码来源:ComputeTests.cs

示例7: Should_Rebuild_Server

        public void Should_Rebuild_Server()
        {
            var provider = new ComputeProvider(_testIdentity);
            _preBuildDetails = provider.GetDetails(_testServer.Id);
            var image = provider.ListImages().First(i => i.Name.Contains("CentOS") && i.Id != _preBuildDetails.Image.Id);
            var flavor = int.Parse(_preBuildDetails.Flavor.Id) + 1;

            _rebuildServer = provider.RebuildServer(_testServer.Id, string.Format("{0}_REBUILD", _preBuildDetails.Name), image.Id, flavor.ToString(), _testServer.AdminPassword);

            Assert.IsNotNull(_rebuildServer);
        }
开发者ID:bretmcg,项目名称:openstack.net,代码行数:11,代码来源:ComputeTests.cs

示例8: Should_Resize_Server_Back

        public void Should_Resize_Server_Back()
        {
            Assert.IsTrue(_resizeSuccess);

            var provider = new ComputeProvider(_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);
        }
开发者ID:bretmcg,项目名称:openstack.net,代码行数:12,代码来源:ComputeTests.cs

示例9: Should_Match_AccessIPv6_and_Public_Network_IP

        public void Should_Match_AccessIPv6_and_Public_Network_IP()
        {
            var provider = new ComputeProvider(_testIdentity);
            var server = provider.GetDetails(_testServer2.Id);

            Assert.AreEqual(server.AccessIPv6, server.Addresses.Public.First(a => a.Version.Equals("6")).Address);
        }
开发者ID:bretmcg,项目名称:openstack.net,代码行数:7,代码来源:ComputeTests.cs

示例10: Should_Contain_Network_Addresses_For_Server2

        public void Should_Contain_Network_Addresses_For_Server2()
        {
            var provider = new ComputeProvider(_testIdentity);
            var server = provider.GetDetails(_testServer2.Id);

            Assert.IsTrue(server.Addresses.Public.Any());
            Assert.IsTrue(server.Addresses.Private.Any());
        }
开发者ID:bretmcg,项目名称:openstack.net,代码行数:8,代码来源:ComputeTests.cs

示例11: Should_Contain_AccessIP_v6_Address_For_Server2

        public void Should_Contain_AccessIP_v6_Address_For_Server2()
        {
            var provider = new ComputeProvider(_testIdentity);
            var server = provider.GetDetails(_testServer2.Id);

            Assert.IsTrue(!string.IsNullOrWhiteSpace(server.AccessIPv6));
        }
开发者ID:bretmcg,项目名称:openstack.net,代码行数:7,代码来源:ComputeTests.cs

示例12: Should_Create_Image_From_Server

        public void Should_Create_Image_From_Server()
        {
            var provider = new ComputeProvider(_testIdentity);
            var detail = provider.GetDetails(_testServer.Id);

            _testImageName = "Image_of_" + detail.Id;
            var sucess = provider.CreateImage(detail.Id, _testImageName);

            Assert.IsTrue(sucess);
        }
开发者ID:bretmcg,项目名称:openstack.net,代码行数:10,代码来源:ComputeTests.cs

示例13: Test023_Should_Successfully_To_And_Login_With_Old_Password

        public void Test023_Should_Successfully_To_And_Login_With_Old_Password()
        {
            var provider = new ComputeProvider(_testIdentity);
            var serverDetails = provider.GetDetails(_testServer.Id);
            using(var client = new Renci.SshNet.SshClient(serverDetails.AccessIPv4, "root", _testServer.AdminPassword))
            {
                client.Connect();

                Assert.IsTrue(client.IsConnected);
            }
        }
开发者ID:bretmcg,项目名称:openstack.net,代码行数:11,代码来源:ComputeTests.cs


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