示例#1
0
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)
示例#2
0
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)
示例#3
0
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)
示例#4
0
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)
示例#5
0
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)
示例#6
0
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)
示例#7
0
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)
示例#8
0
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)
示例#9
0
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)
示例#10
0
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)
示例#11
0
def seeds(name):
    """Retrieve seed node information"""
    if name:
        cu.set_fwk_name(name)
    cu.print_json(seeds_api.seeds())
示例#12
0
def restore_status():
    """Displays the status of the restore"""
    cu.print_json(restore_api.status())
示例#13
0
def describe(node_id):
    """Describes a single node"""
    cu.print_json(nodes_api.describe(node_id))
示例#14
0
def backup_status():
    """Displays the status of the restore"""
    cu.print_json(backup_api.status())
示例#15
0
def status(node_id):
    """Gets the status of a single node."""
    cu.print_json(nodes_api.status(node_id))
示例#16
0
def status(node_id):
    """Gets the status of a single node."""
    cu.print_json(nodes_api.status(node_id))
示例#17
0
def describe(node_id):
    """Describes a single node"""
    cu.print_json(nodes_api.describe(node_id))
示例#18
0
def backup_status():
    """Displays the status of the restore"""
    cu.print_json(backup_api.status())
示例#19
0
def seeds(name):
    """Retrieve seed node information"""
    if name:
        cu.set_fwk_name(name)
    cu.print_json(seeds_api.seeds())
示例#20
0
def restore_status():
    """Displays the status of the restore"""
    cu.print_json(restore_api.status())
示例#21
0
def list():
    """Lists all nodes"""
    cu.print_json(nodes_api.list())
示例#22
0
def list():
    """Lists all nodes"""
    cu.print_json(nodes_api.list())