-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
989 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
## Admin Tools | ||
Admin Tools for managing Redwood | ||
|
||
### Prerequisites | ||
In order to the use the admin tools. You must have access to the root account of this machine. | ||
|
||
Then, make sure your machine has the following installed: | ||
|
||
-Python 2.7+ | ||
-VirtualEnv | ||
-Pip | ||
|
||
Finally, do the following steps to create the python virtual environment. | ||
|
||
1. Use VirtualEnv create a python virtual environment in the admin folder. (<dcc-ops dir>/redwood/cli/admin) | ||
2. Activate the virtual environment | ||
3. Use Pip and requirements.txt to install the python packages | ||
|
||
### Setup | ||
Before doing any admin tasks, first do the following, | ||
|
||
1. Login as root | ||
2. Active the virutual environment (if it's not already activated) | ||
|
||
### Delete | ||
For File Deletion, all you need to do is run delete.py in <dcc-ops dir>/redwood/cli/admin with the file uuid. | ||
|
||
Example: `python delete.py 10101010-1212-2323-3434-454545454545` | ||
|
||
For more detailed overview of the commands, use `python delete -h` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
""" | ||
The default constants of used by admin scripts. | ||
""" | ||
|
||
import os | ||
|
||
|
||
def get_parent_directory(url, level=1): | ||
return "/".join(url.split('/')[:-level]) | ||
|
||
|
||
DCCOPS_DEFAULT_LOCATION = get_parent_directory(os.path.abspath(__file__), | ||
level=4) | ||
DCCOPS_ENV_NAME_ACCESS_ID = 'access_key' | ||
DCCOPS_ENV_NAME_SECRET_KEY = 'secret_key' | ||
DCCOPS_ENV_NAME_REDWOOD_ENDPOINT = 'base_url' | ||
DCCOPS_ENV_NAME_REDWOOD_BUCKET = 's3_bucket' | ||
DCCOPS_ENV_FILENAME = '.env' | ||
DCCOPS_BOARDWALK_SUB_DIR = 'boardwalk' | ||
DCCOPS_ACTION_SERVICE_SUB_DIR = 'action' | ||
DCCOPS_REDWOOD_SUB_DIR = 'redwood' | ||
|
||
METADATA_FILE_ROOT_FOLDER = 'data' | ||
|
||
DELETED_LIST_FILENAME = 'deleted_file_list' | ||
|
||
MONGODB_CONTAINER = 'redwood-metadata-db' | ||
DEFAULT_MONGODB_HOST = '127.0.0.1:27017' | ||
DEFAULT_MONGODB_DB_NAME = 'dcc-metadata' | ||
MONGODB_URL = "{}/{}".format(DEFAULT_MONGODB_HOST, | ||
DEFAULT_MONGODB_DB_NAME) | ||
|
||
INDEXER_CONTAINER = 'boardwalk_dcc-metadata-indexer_1' | ||
|
||
BUNDLE_METADATA_FILENAME = 'metadata.json' |
Oops, something went wrong.