human readable plans

This commit is contained in:
Lulzette 2022-03-27 23:36:21 +03:00
parent e312fc67a0
commit cec099b97e

View File

@ -39,7 +39,10 @@ def get_balance():
@app.command() @app.command()
def get_tariffs(): def get_tariffs():
response = requests.get("https://api.cloudvps.reg.ru/v1/prices", headers=reqHeader) response = requests.get("https://api.cloudvps.reg.ru/v1/prices", headers=reqHeader)
print(json.dumps(response.json(),indent=4)) print('{0:17} {1:5} {2:5} {3:6}'.format('name', 'hour', 'month', 'unit'))
for i in response.json()['prices']:
if i['type'] == 'reglet':
print('{0:17} {1:5} {2:5} {3:6}'.format(i['plan'], i['price'], i['price_month'], i['unit']))
@app.command() @app.command()