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


C# ElasticClient.CatPlugins方法代码示例

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


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

示例1: Can_install_plugin

        public void Can_install_plugin()
        {
            string pluginName = "mobz/elasticsearch-head";
            using (var elasticsearch = new Elasticsearch(c => c.AddPlugin(new Configuration.Plugin(pluginName))))
            {
                ////Arrange
                var client = new ElasticClient(new ConnectionSettings(elasticsearch.Url));

                ////Act
                var result = client.CatPlugins();

                int pluginCount = 0;
                foreach (CatPluginsRecord plugin in result.Records)
                {
                    pluginCount++;
                }

                ////Assert
                Assert.That(result.IsValid);
                Assert.AreEqual(1, pluginCount);
            }
        }
开发者ID:poulfoged,项目名称:Elasticsearch-Inside,代码行数:22,代码来源:ElasticsearchTests.cs

示例2: Can_install_plugin_url

        public void Can_install_plugin_url()
        {
            string pluginName = "test_plugin_135076"; // random numbers to make sure the name doesn't conflict with publicly available plugins
            string pluginUrl = "file:///" + Directory.GetCurrentDirectory() + "/TestFiles/test_plugin_135076.zip";
            using (var elasticsearch = new Elasticsearch(c => c.AddPlugin(new Configuration.Plugin(pluginName, pluginUrl))))
            {
                ////Arrange
                var client = new ElasticClient(new ConnectionSettings(elasticsearch.Url));

                ////Act
                var result = client.CatPlugins();

                int pluginCount = 0;
                foreach (CatPluginsRecord plugin in result.Records)
                {
                    pluginCount++;
                }

                ////Assert
                Assert.That(result.IsValid);
                Assert.AreEqual(1, pluginCount);
            }
        }
开发者ID:poulfoged,项目名称:Elasticsearch-Inside,代码行数:23,代码来源:ElasticsearchTests.cs

示例3: Start

		public IObservable<ElasticsearchMessage> Start()
		{

			if (!this.RunningIntegrations) return Observable.Empty<ElasticsearchMessage>();

			this.Stop();
			var timeout = TimeSpan.FromSeconds(60);
			var handle = new ManualResetEvent(false);

			if (_doNotSpawnIfAlreadyRunning)
			{
			    var client = new ElasticClient();
			    var alreadyUp = client.RootNodeInfo();
				if (alreadyUp.IsValid)
				{
				    var checkPlugins = client.CatPlugins();

				    if (checkPlugins.IsValid)
				    {
				        foreach (var supportedPlugin in  SupportedPlugins)
				        {
				            if (!checkPlugins.Records.Any(r => r.Component.Equals(supportedPlugin.Key)))
				                throw new ApplicationException($"Already running elasticsearch does not have supported plugin {supportedPlugin.Key} installed.");
				        }

				        this.Started = true;
				        this.Port = 9200;
				        this.Info = new ElasticsearchNodeInfo(alreadyUp.Version.Number, null, alreadyUp.Version.LuceneVersion);
				        this._blockingSubject.OnNext(handle);
				        if (!handle.WaitOne(timeout, true))
				            throw new ApplicationException($"Could not launch tests on already running elasticsearch within {timeout}");

				        return Observable.Empty<ElasticsearchMessage>();
				    }
				}
			}

		    lock (_lock)
		    {
		        InstallPlugins();
		    }

			this._process = new ObservableProcess(this.Binary,
				$"-Des.cluster.name={this.ClusterName}",
				$"-Des.node.name={this.NodeName}",
				$"-Des.path.repo={this.RepositoryPath}",
				$"-Des.script.inline=on",
				$"-Des.script.indexed=on"
			);
			var observable = Observable.Using(() => this._process, process => process.Start())
				.Select(consoleLine => new ElasticsearchMessage(consoleLine));
			this._processListener = observable.Subscribe(onNext: s => HandleConsoleMessage(s, handle));

			if (!handle.WaitOne(timeout, true))
			{
				this.Stop();
				throw new ApplicationException($"Could not start elasticsearch within {timeout}");
			}

			return observable;
		}
开发者ID:michaelbudnik,项目名称:elasticsearch-net,代码行数:61,代码来源:ElasticsearchNode.cs


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