Skip to content

Commit

Permalink
Updating the example opensearch snapshot help command with --P arg
Browse files Browse the repository at this point in the history
Signed-off-by: Manasvini B Suryanarayana <manasvis@amazon.com>
  • Loading branch information
manasvinibs committed Nov 8, 2022
1 parent 694731a commit ec64787
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
3 changes: 0 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [Multi DataSource] Update MD data source documentation link ([#2693](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2693))
- [Save Object Aggregation View] Add extension point in saved object management to register namespaces and show filter ([#2656](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2656))
- [Save Object Aggregation View] Fix for export all after scroll count response changed in PR#2656 ([#2696](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2696))
<<<<<<< HEAD
- [Vis Builder] Add an experimental table visualization in vis builder ([#2705](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2705))
- [Vis Builder] Add field summary popovers ([#2682](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2682))
=======
- Add yarn opensearch arg to setup plugin dependencies ([#2544](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/2544))
>>>>>>> Adding yarn opensearch args to setup opensearch plugin dependencies on snapshot

### 🐛 Bug Fixes

Expand Down
5 changes: 3 additions & 2 deletions packages/osd-opensearch/src/cli_commands/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ exports.help = (defaults = {}) => {
-E Additional key=value settings to pass to OpenSearch
--download-only Download the snapshot but don't actually start it
--ssl Sets up SSL on OpenSearch
--P OpenSearch plugin artifact URL to install it on the cluster.
--P OpenSearch plugin artifact URL to install it on the cluster. We should use the flag multiple times
to install multiple plugins on the cluster snapshot.
Example:
opensearch snapshot --version 5.6.8 -E cluster.name=test -E path.data=/tmp/opensearch-data
opensearch snapshot --version 2.2.0 -E cluster.name=test -E path.data=/tmp/opensearch-data --P org.opensearch.plugin:alerting:2.2.0.0
`;
};

Expand Down
17 changes: 6 additions & 11 deletions packages/osd-opensearch/src/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,14 @@ exports.Cluster = class Cluster {
* @param {Array|string} opensearchPlugins Array or string of opensearch plugin(s) artifact url
*/
async installOpensearchPlugin(installPath, opensearchPluginsPath) {
this._log.info(chalk.bold(`Downloading Opensearch plugin on the cluster snapshot`));
this._log.info(chalk.bold(`Downloading Opensearch plugin(s) on the cluster snapshot`));
this._log.indent(4);
opensearchPluginsPath =
typeof opensearchPluginsPath === 'string' ? [opensearchPluginsPath] : opensearchPluginsPath;
// Run opensearch-plugin tool script to download openSearch plugin artifacts
if (Array.isArray(opensearchPluginsPath)) {
for (const pluginPath of opensearchPluginsPath) {
this._log.info(`Installing OpenSearch Plugin from the path: ${pluginPath}`);
await execa(OPENSEARCH_PLUGIN, [`install`, `--batch`, pluginPath], { cwd: installPath });
}
} else if (typeof opensearchPluginsPath === 'string') {
this._log.info(`Installing OpenSearch Plugin from the path: ${opensearchPluginsPath}`);
await execa(OPENSEARCH_PLUGIN, [`install`, `--batch`, opensearchPluginsPath], {
cwd: installPath,
});
for (const pluginPath of opensearchPluginsPath) {
this._log.info(`Installing OpenSearch Plugin from the path: ${pluginPath}`);
await execa(OPENSEARCH_PLUGIN, [`install`, `--batch`, pluginPath], { cwd: installPath });
}
this._log.info(`Plugin download complete`);
this._log.indent(-4);
Expand Down

0 comments on commit ec64787

Please sign in to comment.