def start_cleanup(nodes, keyspaces=None, column_families=None): req = {'nodes': nodes} if keyspaces is not None: req['key_spaces'] = keyspaces if column_families is not None: req['column_families'] = column_families return http.put(cu.api_url("/cleanup/start"), json=req, headers={'Content-Type': 'application/json'})
def start_restore(name, external_location, s3_access_key, s3_secret_key): req = { 'backup_name': name, 'external_location': external_location, 's3_access_key': s3_access_key, 's3_secret_key': s3_secret_key } return http.put(cu.api_url("/restore/start"), json=req, headers={'Content-Type': 'application/json'})
def start_backup(name, external_location, s3_access_key, s3_secret_key, azure_account, azure_key): req = { 'backup_name': name, 'external_location': external_location, 's3_access_key': s3_access_key, 's3_secret_key': s3_secret_key, 'azure_account': azure_account, 'azure_key': azure_key } return http.put(cu.api_url("/backup/start"), json=req, headers={'Content-Type': 'application/json'})
def status(): return cu.to_json(http.get(cu.api_url("/plan"), headers={}))
def connection_dns(): return cu.to_json(http.get(cu.api_url("/nodes/connect/dns"), headers={}))
def replace(id): url = "/nodes/replace?node=node-{}".format(str(id)) response = http.put(cu.api_url(url), headers={}) return response.status_code % 200 < 100
def status(id): url = "/nodes/node-{}/status".format(str(id)) return cu.to_json(http.get(cu.api_url(url), headers={}))
def describe(id): url = "/nodes/node-{}/info".format(str(id)) return cu.to_json(http.get(cu.api_url(url), headers={}))
def list(): return cu.to_json(http.get(cu.api_url("/nodes/list"), headers={}))
def seeds(): seeds_url = cu.api_url("/seeds") return cu.to_json(http.get(seeds_url, headers={}))