當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。