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


C# CloudIdentityProvider.ListUsers方法代码示例

本文整理汇总了C#中net.openstack.Providers.Rackspace.CloudIdentityProvider.ListUsers方法的典型用法代码示例。如果您正苦于以下问题:C# CloudIdentityProvider.ListUsers方法的具体用法?C# CloudIdentityProvider.ListUsers怎么用?C# CloudIdentityProvider.ListUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.openstack.Providers.Rackspace.CloudIdentityProvider的用法示例。


在下文中一共展示了CloudIdentityProvider.ListUsers方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ListUsers

        public void ListUsers()
        {
            var identity = new CloudIdentity { Username = "{username}", APIKey = "{apiKey}" };
            var provider = new CloudIdentityProvider(identity);

            #region ListUsers
            IEnumerable<User> users = provider.ListUsers(null);
            foreach (var user in users)
                Console.WriteLine("{0}: {1}", user.Id, user.Username);
            #endregion
        }
开发者ID:charlyraffellini,项目名称:openstack.net,代码行数:11,代码来源:IdentityProviderExamples.cs

示例2: Should_List_Only_Self_When_Retrieving_List_Of_Users_With_Non_Admin_Account

        public void Should_List_Only_Self_When_Retrieving_List_Of_Users_With_Non_Admin_Account()
        {
            IIdentityProvider serviceProvider = new CloudIdentityProvider(new RackspaceCloudIdentity { Username = _testUser.Username, Password = _newTestUserPassword });

            var users = serviceProvider.ListUsers();

            Assert.IsTrue(users.Count() == 1);
            Assert.AreEqual(_testUser.Username, users.First().Username);
        }
开发者ID:amitgandhinz,项目名称:openstack.net,代码行数:9,代码来源:IdentityTests.cs

示例3: Should_List_Multiple_Users_When_Retrieving_List_Of_Users_With_Admin_Account

        public void Should_List_Multiple_Users_When_Retrieving_List_Of_Users_With_Admin_Account()
        {
            IIdentityProvider serviceProvider = new CloudIdentityProvider(_testAdminIdentity);

            var users = serviceProvider.ListUsers();

            Assert.IsTrue(users.Any());
        }
开发者ID:amitgandhinz,项目名称:openstack.net,代码行数:8,代码来源:IdentityTests.cs

示例4: Should_List_Only_User_In_Account_When_Retrieving_List_Of_Users_With_User_Admin_Account

        public void Should_List_Only_User_In_Account_When_Retrieving_List_Of_Users_With_User_Admin_Account()
        {
            IIdentityProvider serviceProvider = new CloudIdentityProvider(_testIdentity);

            var users = serviceProvider.ListUsers();

            Assert.IsTrue(users.Any());
            Assert.AreEqual(_testIdentity.Username, users.First().Username);
        }
开发者ID:amitgandhinz,项目名称:openstack.net,代码行数:9,代码来源:IdentityTests.cs

示例5: TestListUsers

        public void TestListUsers()
        {
            IIdentityProvider provider = new CloudIdentityProvider(Bootstrapper.Settings.TestIdentity);
            IEnumerable<User> users = provider.ListUsers();
            Assert.IsNotNull(users);
            Assert.IsTrue(users.Any());

            foreach (User user in users)
            {
                Console.WriteLine("User \"{0}\" (id: {1})", user.Username, user.Id);
                if (!user.Enabled)
                    Console.WriteLine("    Disabled");
                if (!string.IsNullOrEmpty(user.Email))
                    Console.WriteLine("    Email: {0}", user.Email);
                if (!string.IsNullOrEmpty(user.DefaultRegion))
                    Console.WriteLine("    Default region: {0}", user.DefaultRegion);
            }
        }
开发者ID:nick-o,项目名称:openstack.net,代码行数:18,代码来源:UserIdentityTests.cs

示例6: CleanupUsers

        public void CleanupUsers()
        {
            IIdentityProvider provider = new CloudIdentityProvider(Bootstrapper.Settings.TestIdentity);
            IEnumerable<User> users = provider.ListUsers();
            foreach (User user in users)
            {
                if (string.IsNullOrEmpty(user.Username))
                    continue;

                if (!user.Username.StartsWith(TestUserPrefix, StringComparison.OrdinalIgnoreCase))
                    continue;

                bool deleted = provider.DeleteUser(user.Id);
                Assert.IsTrue(deleted);
            }
        }
开发者ID:nick-o,项目名称:openstack.net,代码行数:16,代码来源:UserIdentityTests.cs


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