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


C# Cluster.CreateManager方法代码示例

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


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

示例1: Test_AddNode

 public void Test_AddNode()
 {
     var configuration = new ClientConfiguration
     {
         Servers = new List<Uri>
         {
             new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
         }
     };
     using (var cluster = new Cluster(configuration))
     {
         var clusterManager = cluster.CreateManager("Administrator", "password");
         var result = clusterManager.AddNode(SecondaryIp);
         Assert.IsNullOrEmpty(result.Message);
         Assert.IsTrue(result.Success);
     }
 }
开发者ID:orangeloop,项目名称:couchbase-net-client,代码行数:17,代码来源:ClusterManagerTests.cs

示例2: Test_RemoveNodeAsync

 public void Test_RemoveNodeAsync()
 {
     if (SecondaryIp.Equals(PrimaryIp))
     {
         Assert.Ignore();
     }
     var configuration = new ClientConfiguration
     {
         Servers = new List<Uri>
         {
             new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
         }
     };
     using (var cluster = new Cluster(configuration))
     {
         var clusterManager = cluster.CreateManager("Administrator", "password");
         var result = clusterManager.RemoveNodeAsync(SecondaryIp).Result;
         Assert.IsNullOrEmpty(result.Message);
         Assert.IsTrue(result.Success);
     }
 }
开发者ID:orangeloop,项目名称:couchbase-net-client,代码行数:21,代码来源:ClusterManagerTests.cs

示例3: Test_CreateSampleBuckets

 public async void Test_CreateSampleBuckets()
 {
     var configuration = new ClientConfiguration
     {
         Servers = new List<Uri>
         {
             new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
         }
     };
     using (var cluster = new Cluster(configuration))
     {
         var clusterManager = cluster.CreateManager("Administrator", "password");
         var result = await clusterManager.AddSampleBucketAsync("192.168.77.101","beer-sample");
         Console.WriteLine(result.Message);
         Assert.IsTrue(result.Success);
     }
 }
开发者ID:orangeloop,项目名称:couchbase-net-client,代码行数:17,代码来源:ClusterManagerTests.cs

示例4: Test_SetupServices

 public async void Test_SetupServices()
 {
     var configuration = new ClientConfiguration
     {
         Servers = new List<Uri>
         {
             new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
         }
     };
     using (var cluster = new Cluster(configuration))
     {
         var clusterManager = cluster.CreateManager("Administrator", "password");
         var result = await clusterManager.SetupServicesAsync("192.168.77.101",
             CouchbaseService.Index, CouchbaseService.KV, CouchbaseService.N1QL);
         Console.WriteLine(result.Message);
         Assert.IsTrue(result.Success);
     }
 }
开发者ID:orangeloop,项目名称:couchbase-net-client,代码行数:18,代码来源:ClusterManagerTests.cs

示例5: Test_InitializeCluster

        public async void Test_InitializeCluster()
        {
            var configuration = new ClientConfiguration
            {
                Servers = new List<Uri>
                {
                    new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
                }
            };
            using (var cluster = new Cluster(configuration))
            {
                var clusterManager = cluster.CreateManager("Administrator", "password");
                var result = await clusterManager.InitializeClusterAsync("192.168.77.101");

                Assert.IsNullOrEmpty(result.Message);
                Assert.IsTrue(result.Success);
            }
        }
开发者ID:orangeloop,项目名称:couchbase-net-client,代码行数:18,代码来源:ClusterManagerTests.cs

示例6: Test_CreateBucketAsync

        public void Test_CreateBucketAsync()
        {
            var configuration = new ClientConfiguration
            {
                Servers = new List<Uri>
                {
                    new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
                }
            };
            using (var cluster = new Cluster(configuration))
            {
                var clusterManager = cluster.CreateManager("Administrator", "password");
                var result = clusterManager.CreateBucketAsync("test").Result;

                Console.WriteLine(result.Message);
                Assert.IsTrue(result.Success);
            }
        }
开发者ID:orangeloop,项目名称:couchbase-net-client,代码行数:18,代码来源:ClusterManagerTests.cs

示例7: Test_ClusterInfoAsync

        public void Test_ClusterInfoAsync()
        {
            var configuration = new ClientConfiguration
            {
                Servers = new List<Uri>
                {
                    new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
                }
            };
            using (var cluster = new Cluster(configuration))
            {
                var clusterManager = cluster.CreateManager("Administrator", "password");
                var result = clusterManager.ClusterInfoAsync().Result;

                Assert.NotNull(result.Success);
                Assert.That(result.Success);
                var info = result.Value;
                Assert.NotNull(info);
                Assert.NotNull(info.Pools());
                Assert.NotNull(info.BucketConfigs());
                Assert.Greater(info.BucketConfigs().Count, 0);
                Assert.NotNull(info.BucketConfigs().ElementAt(0));
            }
        }
开发者ID:orangeloop,项目名称:couchbase-net-client,代码行数:24,代码来源:ClusterManagerTests.cs

示例8: Test_RebalanceAsync

 public void Test_RebalanceAsync()
 {
     var configuration = new ClientConfiguration
     {
         Servers = new List<Uri>
         {
             new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
         }
     };
     using (var cluster = new Cluster(configuration))
     {
         var clusterManager = cluster.CreateManager("Administrator", "password");
         var result = clusterManager.RebalanceAsync().Result;
         Assert.IsTrue(result.Success);
     }
 }
开发者ID:orangeloop,项目名称:couchbase-net-client,代码行数:16,代码来源:ClusterManagerTests.cs

示例9: Test_ListBucketsAsync

 public void Test_ListBucketsAsync()
 {
     var configuration = new ClientConfiguration
     {
         Servers = new List<Uri>
         {
             new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
         }
     };
     using (var cluster = new Cluster(configuration))
     {
         var clusterManager = cluster.CreateManager("Administrator", "password");
         var results = clusterManager.ListBucketsAsync().Result;
         Assert.Greater(results.Value.Count, 0);
     }
 }
开发者ID:orangeloop,项目名称:couchbase-net-client,代码行数:16,代码来源:ClusterManagerTests.cs

示例10: When_Bucket_Password_And_Username_Are_Used_ListBuckets_Succeeds

 public void When_Bucket_Password_And_Username_Are_Used_ListBuckets_Succeeds()
 {
     var configuration = new ClientConfiguration
     {
         Servers = new List<Uri>
         {
             new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
         }
     };
     using (var cluster = new Cluster(configuration))
     {
         var clusterManager = cluster.CreateManager("authenticated", "secret");
         var results = clusterManager.ListBuckets();
         Assert.Greater(results.Value.Count, 0);
     }
 }
开发者ID:orangeloop,项目名称:couchbase-net-client,代码行数:16,代码来源:ClusterManagerTests.cs


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