Files
galaxy/scripts/api/reset_metadata_on_installed_repositories.py
T
Nicola Soranzo 21b44bf348 Fix all E201 and E202 style errors
using the following command:
```
autopep8 -i -r --exclude $(sed -e 's|^|./|' -e 's|/$||' .ci/flake8_blacklist.txt | paste -sd,) --select E201,E202 .
```
2017-08-17 11:35:39 +01:00

28 lines
1.0 KiB
Python

#!/usr/bin/env python
"""
Script to reset metadata on all Tool Shed repositories installed into a Galaxy instance. The received
API key must be associated with a Galaxy admin user.
usage: reset_metadata_on_installed_repositories.py key
Here is a working example of how to use this script.
python ./reset_metadata_on_installed_repositories.py -a 22be3b -u http://localhost:8763/
"""
import argparse
from common import submit
def main(options):
base_galaxy_url = options.galaxy_url.rstrip('/')
url = '%s/api/tool_shed_repositories/reset_metadata_on_installed_repositories' % base_galaxy_url
submit(options.api, url, {})
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Reset metadata on all Tool Shed repositories installed into Galaxy via the Galaxy API.')
parser.add_argument("-a", "--api", dest="api", required=True, help="API Key")
parser.add_argument("-u", "--url", dest="galaxy_url", required=True, help="Galaxy URL")
options = parser.parse_args()
main(options)