當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。