Skip to content

Commit 9283e54

Browse files
authored
Scripts to help with development. (#161)
1 parent 4c97a84 commit 9283e54

File tree

5 files changed

+27
-1
lines changed

5 files changed

+27
-1
lines changed

docs/source/elasticsearch.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,9 @@ you should be able to connect to http://localhost:9200 and see something like be
1212
If you see error in elasticsearch docker container and that is related to heap memory, try upgrading memory to
1313
8Gb in docker setting.
1414

15-
For all the implemented elasticsearch APIs, please refere to the code in backend/app/elasticsearch/connect.py
15+
For all the implemented elasticsearch APIs, please refere to the code in backend/app/elasticsearch/connect.py
16+
17+
## Common Commands
18+
19+
* List indices: `http://localhost:9200/_cat/indices`
20+
* Delete index: `curl -X DELETE http://localhost:9200/{index name}`

scripts/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Utility Scripts
2+
3+
* ``/develop`` includes scripts to help when developing application. For example to create test data in a running instance
4+
or delete existing test data.
5+
* ``/keylcloak`` includes Keycloak configuration files and Clowder theme. Used when creating a new instance.
6+
* ``/metadata`` includes examples of metadata definitions. Used to populate database for new or testing instances.

scripts/develop/delete-data.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
# Delete data from mongo
4+
mongo clowder2 < mongo-delete.js
5+
# mongo clowder2 --eval "db.dropDatabase()
6+
7+
# Delete data from elasticsearch
8+
curl -X DELETE http://localhost:9200/dataset
9+
curl -X DELETE http://localhost:9200/file

scripts/develop/mongo-delete.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
db.datasets.drop()
2+
db.files.drop()
3+
db.file_versions.drop()
4+
db.folders.drop()
5+
db.metadata.drop()
6+

0 commit comments

Comments
 (0)