diff --git a/dashboards/README.md b/dashboards/README.md deleted file mode 100644 index 0fcec4d..0000000 --- a/dashboards/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# How to load dashboards into your Open Search installation - -Run the following shell script: `install_dashboards.sh` - diff --git a/dashboards/install_dashboards.sh b/dashboards/install_dashboards.sh deleted file mode 100755 index 7769d2f..0000000 --- a/dashboards/install_dashboards.sh +++ /dev/null @@ -1,19 +0,0 @@ - -# Ansi color code variables -ERROR='\033[0;31m' -MAJOR='\033[0;34m' -MINOR='\033[0;37m ' -RESET='\033[0m' # No Color - -: ${OPEN_SEARCH:="localhost:9200"} -: ${OPEN_SEARCH_DASHBOARDS:="localhost:5601"} - -set -eo pipefail - -echo "${MAJOR}Using Open Search and Open Search Dashboards at $OPEN_SEARCH and $OPEN_SEARCH_DASHBOARDS respectively.${RESET}" -echo " (set environment variables OPEN_SEARCH and OPEN_SEARCH_DASHBOARDS otherwise)\n" - -echo "${MAJOR}\nInstalling Quality Evaluation Framework Dashboards${RESET}" -curl -X POST "http://$OPEN_SEARCH_DASHBOARDS/api/saved_objects/_import?overwrite=true" -H "osd-xsrf: true" --form file=@ubi_dashboard.ndjson > /dev/null - -echo "${MAJOR}The UBI Dashboards were successfully installed${RESET}" diff --git a/ubi-dashboards/README.md b/ubi-dashboards/README.md new file mode 100644 index 0000000..ba5d76a --- /dev/null +++ b/ubi-dashboards/README.md @@ -0,0 +1,9 @@ + +# How to load dashboards into your OpenSearch installation + +This assumes that you have already have UBI data and the `ubi_queries` index created. +See the `ubi-data-generator` tool to generate data. + +Run the following shell script: `./install_dashboards.sh http://localhost:9200 http://localhost:5601` + +* `ubi_dashboard.ndjson` represents the UBI Dashboards needed to analyze and understand the data. diff --git a/ubi-dashboards/install_dashboards.sh b/ubi-dashboards/install_dashboards.sh new file mode 100755 index 0000000..c960fa8 --- /dev/null +++ b/ubi-dashboards/install_dashboards.sh @@ -0,0 +1,26 @@ + +# Ansi color code variables +ERROR='\033[0;31m' +MAJOR='\033[0;34m' +MINOR='\033[0;37m ' +RESET='\033[0m' # No Color + +opensearch=$1 +opensearch_dashboard=$2 +set -eo pipefail + +if [ -z "$opensearch" ]; then + echo "Error: please pass in both the opensearch url and the opensearch dashboard url" + exit 1 +fi +if [ -z "$opensearch_dashboard" ]; then + echo "Error: please pass in both the opensearch url and the opensearch dashboard url" + exit 1 +fi + +echo "${MAJOR}Using Open Search and Open Search Dashboards at $opensearch and $opensearch_dashboard respectively.${RESET}" + +echo "${MAJOR}\nInstalling Quality Evaluation Framework Dashboards${RESET}" +curl -X POST "http://$opensearch_dashboard/api/saved_objects/_import?overwrite=true" -H "osd-xsrf: true" --form file=@ubi_dashboard.ndjson > /dev/null + +echo "${MAJOR}The UBI Dashboards were successfully installed${RESET}" diff --git a/dashboards/ubi_dashboard.ndjson b/ubi-dashboards/ubi_dashboard.ndjson similarity index 100% rename from dashboards/ubi_dashboard.ndjson rename to ubi-dashboards/ubi_dashboard.ndjson