-
Notifications
You must be signed in to change notification settings - Fork 71
/
migration_tools.py
executable file
·50 lines (38 loc) · 1.15 KB
/
migration_tools.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import click
import requests
@click.group()
def tools():
pass
@tools.command()
@click.option('--base-url',
default=None,
required=True,
help='url to migration service ex: http://localhost:8082')
def upgrade(base_url):
"""Upgrade to latest db schema"""
url = base_url + "/upgrade"
response = requests.patch(url)
print(response.text)
@tools.command()
@click.option('--base-url',
default=None,
required=True,
help='url to migration service ex: http://localhost:8082')
def db_status(base_url):
"""get status of current db schema"""
url = base_url + "/db_schema_status"
response = requests.get(url)
print(response.json())
@tools.command()
@click.option('--base-url',
default=None,
required=True,
help='url to metadata service ex: http://localhost:8080')
def metadata_service_version(base_url):
"""get status of current db schema"""
url = base_url + "/version"
response = requests.get(url)
print(response.text)
cli = click.CommandCollection(sources=[tools])
if __name__ == "__main__":
cli()