private string DownloadSnapshotIfNeeded(NodeFileSystem fileSystem, ElasticsearchPluginConfiguration plugin, ElasticsearchVersion v)
        {
            var downloadLocation = Path.Combine(fileSystem.RoamingFolder, plugin.SnapshotZip(v));

            this.DownloadPluginSnapshot(downloadLocation, plugin, v);
            //transform downloadLocation to file uri and use that to install from
            return(new Uri(downloadLocation).AbsoluteUri);
        }
        private static bool AlreadyInstalled(ElasticsearchPluginConfiguration plugin, NodeFileSystem fileSystem)
        {
            var folder       = plugin.FolderName;
            var pluginFolder = Path.Combine(fileSystem.ElasticsearchHome, "plugins", folder);

            // assume plugin already installed
            return(Directory.Exists(pluginFolder));
        }
Example #3
0
        private string UseHttpPluginLocation(NodeFileSystem fileSystem, ElasticsearchPluginConfiguration plugin, ElasticsearchVersion v)
        {
            var downloadLocation = Path.Combine(fileSystem.RoamingFolder, $"{plugin.Moniker}-{v}.zip");

            this.DownloadPluginSnapshot(downloadLocation, plugin, v);
            //transform downloadLocation to file uri and use that to install from
            return(new Uri(downloadLocation).AbsoluteUri);
        }
        private void DownloadPluginSnapshot(string downloadLocation, ElasticsearchPluginConfiguration plugin, ElasticsearchVersion v)
        {
            if (File.Exists(downloadLocation))
            {
                return;
            }
            var downloadUrl = plugin.SnapshotDownloadUrl(v);

            Console.WriteLine($"Download plugin snapshot {plugin.Moniker}: {downloadUrl}");
            this.DownloadFile(downloadUrl, downloadLocation);
            Console.WriteLine($"Download plugin snapshot {plugin.Moniker}");
        }
Example #5
0
        private void DownloadPluginSnapshot(string downloadLocation, ElasticsearchPluginConfiguration plugin, ElasticsearchVersion v)
        {
            if (File.Exists(downloadLocation))
            {
                return;
            }
            var downloadUrl = plugin.SnapshotDownloadUrl(v);

            Console.WriteLine($"Download plugin snapshot {plugin.Moniker}: {downloadUrl}");
            try
            {
                this.DownloadFile(downloadUrl, downloadLocation);
                Console.WriteLine($"Downloaded plugin snapshot {plugin.Moniker}");
            }
            catch (Exception e)
            {
                Console.WriteLine($"Failed downloading plugin snapshot {plugin.Moniker}, {e.Message}");
            }
        }