import os, requests, time, json, sys, logging, configparser from datetime import datetime, timedelta from http.cookies import SimpleCookie from pathlib import Path def checkAPIlimit(): global number_of_calls print("API calls: ", str(number_of_calls+1)) if number_of_calls == 59: print("Sleeping") time.sleep(60) number_of_calls=0 def saveValues(): YOUR_DT_API_URL = tenant_info.split(" ")[0].rstrip('\n') YOUR_DT_API_TOKEN = tenant_info.split(" ")[1].rstrip('\n') return YOUR_DT_API_URL, YOUR_DT_API_TOKEN def getList(): print('Iterate through list? y/n') iterate = input() if iterate == 'y': print('Enter the key of the object:') jsonKey = input() else: jsonKey = None return iterate, jsonKey def delete(): endpointLast = endpoint if "/" in endpoint: endpointLast = endpoint.split("/")[-1] directory="data/"+env_id+"/"+endpointLast print(''.join(YOUR_DT_API_URL) + endpoint) r = requests.get(''.join(YOUR_DT_API_URL) + endpoint, headers=headers, cookies=dict(cookies), verify=False); data_json = json.loads(r.text) i=0 while i