Beispiel #1
0
 private static List <Func <object> > CatCommandsAsync(ElasticClient elastic)
 {
     return(new List <Func <object> >
     {
         () => elastic.CatAliasesAsync(new CatAliasesRequest()),
         () => elastic.CatAllocationAsync(new CatAllocationRequest()),
         () => elastic.CatCountAsync(new CatCountRequest()),
         () => elastic.CatFielddataAsync(new CatFielddataRequest()),
         () => elastic.CatHealthAsync(new CatHealthRequest()),
         () => elastic.CatHelpAsync(new CatHelpRequest()),
         () => elastic.CatIndicesAsync(new CatIndicesRequest()),
         () => elastic.CatMasterAsync(new CatMasterRequest()),
         () => elastic.CatNodeAttributesAsync(new CatNodeAttributesRequest()),
         () => elastic.CatNodesAsync(new CatNodesRequest()),
         () => elastic.CatPendingTasksAsync(new CatPendingTasksRequest()),
         () => elastic.CatPluginsAsync(new CatPluginsRequest()),
         () => elastic.CatRecoveryAsync(new CatRecoveryRequest()),
         () => elastic.CatRepositoriesAsync(new CatRepositoriesRequest()),
         () => elastic.CatSegmentsAsync(new CatSegmentsRequest()),
         () => elastic.CatShardsAsync(new CatShardsRequest()),
         // CatSnapshots is failing with a JSON deserialization error.
         // It might be a bug in the client or an incompatibility between client
         // and server versions.
         // () => elastic.CatSnapshotsAsync(new CatSnapshotsRequest()),
         () => elastic.CatTasksAsync(new CatTasksRequest()),
         () => elastic.CatTemplatesAsync(new CatTemplatesRequest()),
         () => elastic.CatThreadPoolAsync(new CatThreadPoolRequest()),
     });
 }
        public async Task Can_spinup_with_plugin_and_cleanup_twice_without_problems()
        {
            Settings settings;

            var plugin = new Plugin("analysis-icu");

            using (var elasticsearch = await new Elasticsearch(c => c.SetPort(4444).EnableLogging().LogTo(Console.WriteLine).AddPlugin(plugin)).Ready())
            {
                settings = (Settings)elasticsearch.Settings;
                var client = new ElasticClient(new ConnectionSettings(elasticsearch.Url));
                var result = await client.CatPluginsAsync();

                Assert.That(result.Records.Count, Is.EqualTo(1));
            }

            var folder = settings.RootFolder;

            folder.Refresh();
            Assert.That(!folder.Exists);

            using (var elasticsearch = await new Elasticsearch(c => c.SetPort(4444).EnableLogging().LogTo(Console.WriteLine).AddPlugin(plugin)).Ready())
            {
                settings = (Settings)elasticsearch.Settings;
                var client = new ElasticClient(new ConnectionSettings(elasticsearch.Url));
                var result = await client.CatPluginsAsync();

                Assert.That(result.Records.Count, Is.EqualTo(1));
            }

            folder = settings.RootFolder;
            folder.Refresh();
            Assert.That(!folder.Exists);
        }
Beispiel #3
0
 private static List <Func <object> > CatCommandsAsync(ElasticClient elastic)
 {
     return(new List <Func <object> >
     {
         () => elastic.CatAliasesAsync(new CatAliasesRequest()),
         () => elastic.CatAllocationAsync(new CatAllocationRequest()),
         () => elastic.CatCountAsync(new CatCountRequest()),
         () => elastic.CatFielddataAsync(new CatFielddataRequest()),
         () => elastic.CatHealthAsync(new CatHealthRequest()),
         () => elastic.CatHelpAsync(new CatHelpRequest()),
         () => elastic.CatIndicesAsync(new CatIndicesRequest()),
         () => elastic.CatMasterAsync(new CatMasterRequest()),
         () => elastic.CatNodeAttributesAsync(new CatNodeAttributesRequest()),
         () => elastic.CatNodesAsync(new CatNodesRequest()),
         () => elastic.CatPendingTasksAsync(new CatPendingTasksRequest()),
         () => elastic.CatPluginsAsync(new CatPluginsRequest()),
         () => elastic.CatRecoveryAsync(new CatRecoveryRequest()),
         () => elastic.CatRepositoriesAsync(new CatRepositoriesRequest()),
         () => elastic.CatSegmentsAsync(new CatSegmentsRequest()),
         () => elastic.CatShardsAsync(new CatShardsRequest()),
         () => elastic.CatSnapshotsAsync(new CatSnapshotsRequest()),
         () => elastic.CatTasksAsync(new CatTasksRequest()),
         () => elastic.CatTemplatesAsync(new CatTemplatesRequest()),
         () => elastic.CatThreadPoolAsync(new CatThreadPoolRequest()),
     });
 }
        public async Task Can_install_plugin()
        {
            using (var elasticsearch = await new Elasticsearch(c => c.SetPort(4444).EnableLogging().AddPlugin(new Plugin("analysis-icu")).SetElasticsearchStartTimeout(60)).Ready())
            {
                ////Arrange
                var client = new ElasticClient(new ConnectionSettings(elasticsearch.Url));

                ////Act
                var result = await client.CatPluginsAsync();

                ////Assert
                Assert.That(result.Records.Count, Is.EqualTo(1));
            }
        }