本文整理汇总了C#中net.openstack.Providers.Rackspace.ComputeProvider类的典型用法代码示例。如果您正苦于以下问题:C# ComputeProvider类的具体用法?C# ComputeProvider怎么用?C# ComputeProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ComputeProvider类属于net.openstack.Providers.Rackspace命名空间,在下文中一共展示了ComputeProvider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Test019_Should_Delete_A_Single_Server_Metadata_item
public void Test019_Should_Delete_A_Single_Server_Metadata_item()
{
var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
var response = provider.DeleteServerMetadataItem(_testIdentity, _testServer.Id, "Metadata_Key_4");
Assert.IsTrue(response);
}
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:7,代码来源:ComputeTests.cs
示例17: Test021_Should_Set_Update_Two_Of_The_Three_Server_Metadata_Items
public void Test021_Should_Set_Update_Two_Of_The_Three_Server_Metadata_Items()
{
var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
var metadata = new Metadata() { { "Metadata_Key_4", "My_Value_4" }, { "Metadata_Key_5", "My_Value_5_Updated_Again" } };
var response = provider.UpdateServerMetadata(_testIdentity, _testServer.Id, metadata);
Assert.IsTrue(response);
}
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:8,代码来源:ComputeTests.cs
示例18: Test017_Should_Set_Update_A_Single_Server_Metadata_item
public void Test017_Should_Set_Update_A_Single_Server_Metadata_item()
{
var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
var response = provider.SetServerMetadataItem(_testIdentity, _testServer.Id, "Metadata_Key_4", "My_Value_4_Updated_Again");
Assert.IsTrue(response);
}
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:7,代码来源:ComputeTests.cs
示例19: Test013_Should_Add_A_New_Metadata_Item
public void Test013_Should_Add_A_New_Metadata_Item()
{
var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
var response = provider.SetServerMetadataItem(_testIdentity, _testServer.Id, "Metadata_Key_5", "My_Value_5");
Assert.IsTrue(response);
}
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:7,代码来源:ComputeTests.cs
示例20: Test009_Should_Set_Updated_Reset_Server_Metadata
public void Test009_Should_Set_Updated_Reset_Server_Metadata()
{
var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
var metadata = new Metadata() { { "Metadata_Key_3", "My_Value_3" }, { "Metadata_Key_4", "My_Value_4" } };
var response = provider.SetServerMetadata(_testIdentity, _testServer.Id, metadata);
Assert.IsTrue(response);
}
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:8,代码来源:ComputeTests.cs
注:本文中的net.openstack.Providers.Rackspace.ComputeProvider类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论