Files
galaxy/scripts/api/reset_metadata_on_installed_repositories.py
T
2022-02-03 07:42:20 -05:00

30 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)