def backup_start(backup_name, external_location, s3_access_key, s3_secret_key): """Perform cluster backup via snapshot mechanism""" response = backup_api.start_backup(backup_name, external_location, s3_access_key, s3_secret_key) if response.status_code % 200 < 100: print("Successfully started backup. " + "Please check the backup status using the status sub-command.") else: cu.print_json(response)
def restore_start(backup_name, external_location, s3_access_key, s3_secret_key): """Restores cluster to a snapshot""" response = restore_api.start_restore(backup_name, external_location, s3_access_key, s3_secret_key) if response.status_code % 200 < 100: print("Successfully started restore. " + "Please check the restore status using the status sub-command.") else: cu.print_json(response)
def connection(name, address, dns): """Provides connection information""" if name: cu.set_fwk_name(name) if (address and dns) or (not address and not dns): response = nodes_api.connection() elif address: response = nodes_api.connection_address() else: response = nodes_api.connection_dns() cu.print_json(response)
def backup_start(backup_name, external_location, s3_access_key, s3_secret_key, azure_account, azure_key): """Perform cluster backup via snapshot mechanism""" response = backup_api.start_backup(backup_name, external_location, s3_access_key, s3_secret_key, azure_account, azure_key) if response.status_code % 200 < 100: print("Successfully started backup. " + "Please check the backup status using the status sub-command.") else: cu.print_json(response)
def restore_start(backup_name, external_location, s3_access_key, s3_secret_key, azure_account, azure_key): """Restores cluster to a snapshot""" response = restore_api.start_restore(backup_name, external_location, s3_access_key, s3_secret_key, azure_account, azure_key) if response.status_code % 200 < 100: print("Successfully started restore. " + "Please check the restore status using the status sub-command.") else: cu.print_json(response)
def repair_start(nodes, key_spaces, column_families): """Perform primary range anti-entropy repair""" if nodes == '*': node_ids = ['*'] else: node_ids = [] for nid in nodes.split(','): node_ids.append("node-{}".format(nid)) response = repair_api.start_repair(node_ids, key_spaces, column_families) if response.status_code % 200 < 100: print("Successfully started repair") else: cu.print_json(response)
def cleanup_start(nodes, key_spaces, column_families): """Perform cluster cleanup of deleted or moved keys""" if nodes == '*': node_ids = ['*'] else: node_ids = [] for nid in nodes.split(','): node_ids.append("node-{}".format(nid)) response = cleanup_api.start_cleanup(node_ids, key_spaces, column_families) if response.status_code % 200 < 100: print("Successfully started cleanup") else: cu.print_json(response)
def seeds(name): """Retrieve seed node information""" if name: cu.set_fwk_name(name) cu.print_json(seeds_api.seeds())
def restore_status(): """Displays the status of the restore""" cu.print_json(restore_api.status())
def describe(node_id): """Describes a single node""" cu.print_json(nodes_api.describe(node_id))
def backup_status(): """Displays the status of the restore""" cu.print_json(backup_api.status())
def status(node_id): """Gets the status of a single node.""" cu.print_json(nodes_api.status(node_id))
def list(): """Lists all nodes""" cu.print_json(nodes_api.list())