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


C# ComputeProvider.ListImages方法代码示例

本文整理汇总了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());
        }
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:8,代码来源:ComputeTests.cs

示例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());
        }
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:8,代码来源:ComputeTests.cs

示例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);
        }
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:8,代码来源:ComputeTests.cs

示例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());
        }
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:8,代码来源:ComputeTests.cs

示例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());
        }
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:8,代码来源:ComputeTests.cs

示例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());
        }
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:7,代码来源:ComputeTests.cs

示例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)));
            }
        }
开发者ID:EdLeafe,项目名称:openstack.net,代码行数:14,代码来源:ComputeTests.cs

示例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);
        }
开发者ID:bretmcg,项目名称:openstack.net,代码行数:11,代码来源:ComputeTests.cs

示例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);
        }
开发者ID:bretmcg,项目名称:openstack.net,代码行数:8,代码来源:ComputeTests.cs

示例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());
        }
开发者ID:bretmcg,项目名称:openstack.net,代码行数:8,代码来源:ComputeTests.cs

示例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());
        }
开发者ID:bretmcg,项目名称:openstack.net,代码行数:8,代码来源:ComputeTests.cs

示例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());
        }
开发者ID:bretmcg,项目名称:openstack.net,代码行数:7,代码来源:ComputeTests.cs


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