當前位置: 首頁>>代碼示例>>C#>>正文


C# Rackspace.ComputeProvider類代碼示例

本文整理匯總了C#中net.openstack.Providers.Rackspace.ComputeProvider的典型用法代碼示例。如果您正苦於以下問題:C# ComputeProvider類的具體用法?C# ComputeProvider怎麽用?C# ComputeProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ComputeProvider類屬於net.openstack.Providers.Rackspace命名空間,在下文中一共展示了ComputeProvider類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Test001_Should_Create_A_New_Server_In_DFW

        public void Test001_Should_Create_A_New_Server_In_DFW()
        {
            var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
            _testServer = provider.CreateServer(_testIdentity, "net-sdk-test-server", "d531a2dd-7ae9-4407-bb5a-e5ea03303d98", "2");

            Assert.IsNotNull(_testServer);
            Assert.IsNotNull(_testServer.Id);
        }
開發者ID:EdLeafe,項目名稱:openstack.net,代碼行數:8,代碼來源:ComputeTests.cs

示例2: Should_Create_A_New_Complex_Server_In_DFW

        public void Should_Create_A_New_Complex_Server_In_DFW()
        {
            var provider = new ComputeProvider(_testIdentity);
            _testServer2 = provider.CreateServer("net-sdk-test-server2", "d531a2dd-7ae9-4407-bb5a-e5ea03303d98", "2", metadata: new Metadata{{"Key1", "Value1"}, {"Key2", "Value2"}}, attachToPublicNetwork: true, attachToServiceNetwork: true);

            Assert.IsNotNull(_testServer2);
            Assert.IsNotNull(_testServer2.Id);
        }
開發者ID:bretmcg,項目名稱:openstack.net,代碼行數:8,代碼來源:ComputeTests.cs

示例3: Test004_Should_Get_A_List_Of_Servers_Which_Should_Include_The_Newly_Created_Server

        public void Test004_Should_Get_A_List_Of_Servers_Which_Should_Include_The_Newly_Created_Server()
        {
            var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
            var servers = provider.ListServers(_testIdentity);

            Assert.IsNotNull(servers);
            Assert.IsTrue(servers.Any());
            Assert.IsNotNull(servers.FirstOrDefault(s => s.Id == _testServer.Id));
        }
開發者ID:jmeridth,項目名稱:openstack.net,代碼行數:9,代碼來源:ComputeTests.cs

示例4: 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.WaitForServerActive(_testIdentity, _testServer.Id);

            Assert.IsNotNull(serverDetails);
            Assert.AreEqual("ACTIVE", serverDetails.Status);
        }
開發者ID:jmeridth,項目名稱:openstack.net,代碼行數:9,代碼來源:ComputeTests.cs

示例5: 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

示例6: 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

示例7: Test036_Should_Return_At_Least_One_Image_With_Details_When_Searching_By_Valid_Status

        public void Test036_Should_Return_At_Least_One_Image_With_Details_When_Searching_By_Valid_Status()
        {
            var validImage = _allImages.First();
            var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
            var images = provider.ListImagesWithDetails(_testIdentity, imageStatus: validImage.Status);

            Assert.IsTrue(images.Any());
        }
開發者ID:EdLeafe,項目名稱:openstack.net,代碼行數:8,代碼來源:ComputeTests.cs

示例8: Test031_Should_Return_At_Least_One_Image_When_Searching_By_Valid_Name

        public void Test031_Should_Return_At_Least_One_Image_When_Searching_By_Valid_Name()
        {
            var validImage = _allImages.First();
            var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
            var images = provider.ListImages(_testIdentity, imageName: validImage.Name);

            Assert.IsTrue(images.Any());
        }
開發者ID:EdLeafe,項目名稱:openstack.net,代碼行數:8,代碼來源:ComputeTests.cs

示例9: Test034_Should_Return_One_Image_With_Details_When_Searching_By_Valid_Id

        public void Test034_Should_Return_One_Image_With_Details_When_Searching_By_Valid_Id()
        {
            var validImage = _allImages.First();
            var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
            var images = provider.ListImagesWithDetails(_testIdentity, serverId: validImage.Server.Id);

            Assert.IsTrue(images.Any());
        }
開發者ID:EdLeafe,項目名稱:openstack.net,代碼行數:8,代碼來源:ComputeTests.cs

示例10:

        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.WaitForServerDeleted(_testIdentity, _testServer.Id);

            if(details != null)
                Assert.AreEqual("DELETED", details.Status);
        }
開發者ID:jmeridth,項目名稱:openstack.net,代碼行數:9,代碼來源:ComputeTests.cs

示例11: Test008_Should_Get_The_Initial_Test_Server_Metadata

        public void Test008_Should_Get_The_Initial_Test_Server_Metadata()
        {
            var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
            var metadata = provider.ListServerMetadata(_testIdentity, _testServer.Id);

            Assert.IsNotNull(metadata);
            Assert.IsTrue(metadata.Count == 2);
            Assert.IsTrue(metadata.Any(md => md.Key == "Metadata_Key_1"));
            Assert.IsTrue(metadata.First(md => md.Key == "Metadata_Key_1").Value == "My_Value_1");
            Assert.IsTrue(metadata.Any(md => md.Key == "Metadata_Key_2"));
            Assert.IsTrue(metadata.First(md => md.Key == "Metadata_Key_2").Value == "My_Value_2");
        }
開發者ID:EdLeafe,項目名稱:openstack.net,代碼行數:12,代碼來源:ComputeTests.cs

示例12: Test041_Should_Return_All_Images_With_Details_When_Using_A_Limit_Greater_Than_What_Actually_Exists

        public void Test041_Should_Return_All_Images_With_Details_When_Using_A_Limit_Greater_Than_What_Actually_Exists()
        {
            var validImage = _allImages.First();
            var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
            var images = provider.ListImagesWithDetails(_testIdentity, limit: _allImages.Count() * 2);

            Assert.IsTrue(images.Count() == _allImages.Count());
        }
開發者ID:EdLeafe,項目名稱:openstack.net,代碼行數:8,代碼來源:ComputeTests.cs

示例13: Test100_Should_Mark_The_Server_For_Deletion

        public void Test100_Should_Mark_The_Server_For_Deletion()
        {
            var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
            var result = provider.DeleteServer(_testIdentity, _testServer.Id);

            Assert.IsTrue(result);
        }
開發者ID:EdLeafe,項目名稱:openstack.net,代碼行數:7,代碼來源:ComputeTests.cs

示例14: Test022_Should_Get_The_Updated_Test_Server_Metadata

        public void Test022_Should_Get_The_Updated_Test_Server_Metadata()
        {
            var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
            var metadata = provider.ListServerMetadata(_testIdentity, _testServer.Id);

            Assert.IsNotNull(metadata);
            Assert.IsTrue(metadata.Count == 3);
            Assert.IsTrue(metadata.Any(md => md.Key == "Metadata_Key_3"));
            Assert.IsTrue(metadata.First(md => md.Key == "Metadata_Key_3").Value == "My_Value_3_Updated_Again");
            Assert.IsTrue(metadata.Any(md => md.Key == "Metadata_Key_4"));
            Assert.IsTrue(metadata.First(md => md.Key == "Metadata_Key_4").Value == "My_Value_4");
            Assert.IsTrue(metadata.Any(md => md.Key == "Metadata_Key_5"));
            Assert.IsTrue(metadata.First(md => md.Key == "Metadata_Key_5").Value == "My_Value_5_Updated_Again");
        }
開發者ID:EdLeafe,項目名稱:openstack.net,代碼行數:14,代碼來源:ComputeTests.cs

示例15: Test024_Should_Update_The_Admin_Password

        public void Test024_Should_Update_The_Admin_Password()
        {
            var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
            var result = provider.ChangeAdministratorPassword(_testIdentity, _testServer.Id, NewPassword);

            Assert.IsTrue(result);
        }
開發者ID:EdLeafe,項目名稱:openstack.net,代碼行數:7,代碼來源:ComputeTests.cs


注:本文中的net.openstack.Providers.Rackspace.ComputeProvider類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。