예제 #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())