本文整理汇总了C#中net.openstack.Providers.Rackspace.ComputeProvider.ListImages方法的典型用法代码示例。如果您正苦于以下问题:C# ComputeProvider.ListImages方法的具体用法?C# ComputeProvider.ListImages怎么用?C# ComputeProvider.ListImages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.openstack.Providers.Rackspace.ComputeProvider
的用法示例。
在下文中一共展示了ComputeProvider.ListImages方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test040_Should_Return_All_Images_When_Using_A_Limit_Greater_Than_What_Actually_Exists
public void Test040_Should_Return_All_Images_When_Using_A_Limit_Greater_Than_What_Actually_Exists()
{
var validImage = _allImages.First();
var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
var images = provider.ListImages(_testIdentity, limit: _allImages.Count() * 2);
Assert.IsTrue(images.Count() == _allImages.Count());
}
示例2: Test033_Should_Return_At_Least_One_Image_When_Searching_By_Valid_Change_Since_Date
public void Test033_Should_Return_At_Least_One_Image_When_Searching_By_Valid_Change_Since_Date()
{
var validImage = _allImages.First();
var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
var images = provider.ListImages(_testIdentity, changesSince: validImage.Updated.AddSeconds(-1));
Assert.IsTrue(images.Any());
}
示例3: Test038_Should_Return_Exactly_Two_Images
public void Test038_Should_Return_Exactly_Two_Images()
{
var validImage = _allImages.First();
var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
var images = provider.ListImages(_testIdentity, limit: 2);
Assert.IsTrue(images.Count() == 2);
}
示例4: Test030_Should_Return_One_Image_When_Searching_By_Valid_Id
public void Test030_Should_Return_One_Image_When_Searching_By_Valid_Id()
{
var validImage = _allImages.First();
var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
var images = provider.ListImages(_testIdentity, serverId: validImage.Server.Id);
Assert.IsTrue(images.Any());
}
示例5: Test032_Should_Return_At_Least_One_Image_When_Searching_By_Valid_Status
public void Test032_Should_Return_At_Least_One_Image_When_Searching_By_Valid_Status()
{
var validImage = _allImages.First();
var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
var images = provider.ListImages(_testIdentity, imageStatus: validImage.Status);
Assert.IsTrue(images.Any());
}
示例6: Test027_Should_Get_List_Of_Snapshot_Images
public void Test027_Should_Get_List_Of_Snapshot_Images()
{
var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
var images = provider.ListImages(_testIdentity, imageType: ImageType.Snapshot);
Assert.IsTrue(images.Any());
}
示例7: Test028_Should_Get_List_All_Images_Which_should_Equal_Base_And_Snapshot_Combined
public void Test028_Should_Get_List_All_Images_Which_should_Equal_Base_And_Snapshot_Combined()
{
var provider = new net.openstack.Providers.Rackspace.ComputeProvider();
var allImages = provider.ListImages(_testIdentity);
var baseImages = provider.ListImages(_testIdentity, imageType: ImageType.Base);
var snapImages = provider.ListImages(_testIdentity, imageType: ImageType.Snapshot);
Assert.IsTrue(allImages.Any());
Assert.IsTrue(allImages.Count() == (baseImages.Count() + snapImages.Count()));
foreach (var image in allImages)
{
Assert.IsTrue(baseImages.Any(i => i.Id.Equals(image.Id, StringComparison.OrdinalIgnoreCase)) ^ snapImages.Any(i => i.Id.Equals(image.Id, StringComparison.OrdinalIgnoreCase)));
}
}
示例8: 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);
}
示例9: Test038_Should_Return_Exactly_Two_Images
public void Test038_Should_Return_Exactly_Two_Images()
{
var validImage = _allImages.First();
var provider = new ComputeProvider(_testIdentity);
var images = provider.ListImages(limit: 2);
Assert.IsTrue(images.Count() == 2);
}
示例10: 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 ComputeProvider(_testIdentity);
var images = provider.ListImages(imageName: validImage.Name);
Assert.IsTrue(images.Any());
}
示例11: Test030_Should_Return_One_Image_When_Searching_By_Valid_Id
public void Test030_Should_Return_One_Image_When_Searching_By_Valid_Id()
{
var validImage = _allImages.First(i => i.Server != null);
var provider = new ComputeProvider(_testIdentity);
var images = provider.ListImages(serverId: validImage.Server.Id);
Assert.IsTrue(images.Any());
}
示例12: Test027_Should_Get_List_Of_Snapshot_Images
public void Test027_Should_Get_List_Of_Snapshot_Images()
{
var provider = new ComputeProvider(_testIdentity);
var images = provider.ListImages(imageType: ImageType.Snapshot);
Assert.IsTrue(images.Any());
}