本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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));
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}