Beispiel #1
0
def main():
    mvip, user, user_pass, mvip_node, force_reset = get_inputs()
    headers, url = build_auth(mvip, user, user_pass, mvip_node)
    list_qos_payload = build_list_qos_payload()
    list_response_json = connect_cluster(headers, url, list_qos_payload)
    qos_dict = process_actions(list_response_json, headers, url, force_reset)
    add_missing(qos_dict, headers, url)
Beispiel #2
0
def main():
    """
    Call the function for output
    """
    mvip, user, user_pass, acct_id, acct_name, all_vols = get_inputs()
    headers, url = build_auth(mvip, user, user_pass)
    output_dict = get_outputs(headers, url, acct_name)
    node_out_dict = get_node_info(**output_dict)
    # Verify which output we are to provide, this is for single
    #   account out by account ID
    if acct_id is None and all_vols is False and acct_name is not None:
        acct_id = get_account_id(**output_dict)
    # This section gathers info for the all volume output
    vol_dict = get_account_volumes(
        acct_id,
        all_vols,
        **output_dict,
    )
    vol_out_dict = get_volume_slices(vol_dict, all_vols, **output_dict)
    hdr1, hdr2, out_dict, hdr3, hdr4, hdr5 = get_merge_dict(
        node_out_dict, vol_out_dict)
    build_table(hdr1, hdr2, out_dict, hdr3, hdr4, hdr5)
    if all_vols is True:
        hdr1, hdr2, out_dict = get_slice_counts(out_dict)
        build_table(hdr1, hdr2, out_dict)
Beispiel #3
0
def main():
    """
    Do the work
    """
    mvip, user, user_pass, mvip_node, duration_set, ssh_state = get_inputs()
    headers, url = build_auth(mvip, user, user_pass, mvip_node)
    payload = build_payload(mvip_node, ssh_state, duration_set)
    connect_cluster(headers, url, payload)
    set_ssh_state(ssh_state, mvip_node, duration_set)
Beispiel #4
0
def main():
    """
    Call the functions from above
    """
    mvip, user, user_pass, check_opt = get_inputs()
    headers, url = build_auth(mvip, user, user_pass)
    payload = build_payload(check_opt)
    response_json = connect_cluster(headers, url, payload)
    compare_pair_ids(response_json, check_opt)
def main():
    """
    Execute the functions from above
    """
    mvip, user, user_pass, mvip_node = get_inputs()
    headers, url = build_auth(mvip, user, user_pass, mvip_node)
    node_session_array = get_iscsi_session_info(headers, url)
    hdr1, hdr2 = get_table_headers()
    build_table(hdr1, hdr2, node_session_array)
Beispiel #6
0
def main():
    """
    Execute the functions from above
    """
    mvip, user, user_pass, mvip_node, search_id = get_inputs()
    headers, url = build_auth(mvip, user, user_pass, mvip_node)
    iscsi_session_array = get_iscsi_session_info(headers, url, search_id)
    hdr_list = get_table_headers()
    build_table(hdr_list, iscsi_session_array)
Beispiel #7
0
def main():
    """
    Call the functions created above
    """
    mvip, user, user_pass, mvip_node = get_inputs()
    headers, url = build_auth(mvip, user, user_pass, mvip_node)
    payload = build_payload()
    response_json = connect_cluster(headers, url, payload)
    tbl_headers, vol_dict = build_output(response_json)
    build_table(tbl_headers, vol_dict)
Beispiel #8
0
def main():
    """
    Call the above functions
    """
    mvip, user, user_pass, mvip_node = get_inputs()
    headers, url = build_auth(mvip, user, user_pass, mvip_node)
    payload = build_payload()
    response_json = connect_cluster(headers, url, payload)
    account_table = create_table(response_json)
    print(account_table)
def main():
    """
    Execute the above functions
    """
    mvip, user, user_pass, mvip_node = get_inputs()
    headers, url = build_auth(mvip, user, user_pass, mvip_node)
    payload = build_payload()
    response_json = connect_cluster(headers, url, payload)
    cls_stat_dict = build_output(mvip, response_json)
    build_table(cls_stat_dict)
Beispiel #10
0
def main():
    """
    Do the work
    """
    mvip, user, user_pass, mvip_node = get_inputs()
    headers, url = build_auth(mvip, user, user_pass, mvip_node)
    payload = build_virt_net_payload()
    response_json = connect_cluster(headers, url, payload)
    tbl_headers, virt_net_list = get_virt_net(response_json)
    build_table(tbl_headers, virt_net_list)
Beispiel #11
0
def main():
    """
    Do the work
    """
    mvip, user, user_pass, mvip_node = get_inputs()
    fault_payload = build_cluster_events()
    headers, url = build_auth(mvip, user, user_pass, mvip_node)
    response_json = connect_cluster(headers, url, fault_payload)
    fault_dict = parse_events(response_json)
    outfile_name = get_filename(mvip)
    print_table(outfile_name, fault_dict)
Beispiel #12
0
def main():
    """
    Calling everything above here to get an output
    """
    mvip, user, user_pass, mvip_node = get_inputs()
    payload = build_payload()
    headers, url = build_auth(mvip, user, user_pass, mvip_node)
    response_json = connect_cluster(headers, url, payload)
    paired_vols = get_replication_status(response_json)
    payload = get_vol_stats(paired_vols)
    response_json = connect_cluster(headers, url, payload)
    parse_volume_stats(paired_vols, response_json)
Beispiel #13
0
def main():
    """
    Call the above functions
    """
    mvip, user, user_pass, mvip_node = get_inputs()
    headers, url = build_auth(mvip, user, user_pass, mvip_node)
    hw_payload = get_hw_payload()
    hw_config_response = connect_cluster(headers, url, hw_payload)
    node_dict = parse_hw_config(hw_config_response)
    payload = build_payload()
    response_json = connect_cluster(headers, url, payload)
    (active_drive_dict, failed_drive_dict,
     missing_drive_dict) = parse_drives(response_json, node_dict)
Beispiel #14
0
def main():
    """
    Call the functions from above
    """
    mvip, user, user_pass, mvip_node = get_inputs()
    if mvip_node == "cluster" or mvip_node is None:
        print(f"This script must be run with --connect node -m <NODE_IP> "
              f"as it cannot be run at a cluster level")
        sys.exit(1)
    headers, url = build_auth(mvip, user, user_pass, mvip_node)
    payload = build_payload()
    response_json = connect_cluster(headers, url, payload)
    get_switch_info(response_json)
    get_cluster_info(response_json)
Beispiel #15
0
def main():
    """
    Run the functions created above
    """
    input_tuple = get_inputs()
    mvip = input_tuple[0]
    user = input_tuple[1]
    user_pass = input_tuple[2]
    filename = get_filename(mvip)
    headers, url = build_auth(mvip, user, user_pass)
    output_dict = get_outputs(headers, url)
    hdr1, hdr2, out_dict = get_cluster_info(**output_dict)
    build_table(hdr1, hdr2, out_dict, filename)
    hdr1, hdr2, out_dict = get_drives(**output_dict)
    build_table(hdr1, hdr2, out_dict, filename)
    hdr1, hdr2, out_dict = get_cluster_capacity(**output_dict)
    build_table(hdr1, hdr2, out_dict, filename)
    hdr1, hdr2, out_dict = get_cluster_version(**output_dict)
    build_table(hdr1, hdr2, out_dict, filename)
    hdr1, hdr2, out_dict = get_cluster_pairs(**output_dict)
    build_table(hdr1, hdr2, out_dict, filename)
    hdr1, hdr2, out_dict = get_snmp_trap_info(**output_dict)
    build_table(hdr1, hdr2, out_dict, filename)
    hdr1, hdr2, out_dict = get_ntp_info(**output_dict)
    build_table(hdr1, hdr2, out_dict, filename)
    hdr1, hdr2, out_dict = get_virtual_network_info(**output_dict)
    build_table(hdr1, hdr2, out_dict, filename)
    active_nodes_tuple = get_active_nodes(**output_dict)
    hdr1 = active_nodes_tuple[0]
    hdr2 = active_nodes_tuple[1]
    out_dict = active_nodes_tuple[2]
    build_table(hdr1, hdr2, out_dict, filename)
    hdr1, hdr2, out_dict = get_pending_nodes(**output_dict)
    build_table(hdr1, hdr2, out_dict, filename)
    hdr1, hdr2, out_dict = get_pending_active_nodes(**output_dict)
    build_table(hdr1, hdr2, out_dict, filename)
    hdr1, hdr2, out_dict = get_10g_network(**output_dict)
    build_table(hdr1, hdr2, out_dict, filename)
    hdr1, hdr2, out_dict, ip_list = get_1g_network(**output_dict)
    build_table(hdr1, hdr2, out_dict, filename)
    hdr1, hdr2, out_dict = get_ldap_configuration(**output_dict)
    build_table(hdr1, hdr2, out_dict, filename)
    hdr1, hdr2, out_dict, sort_order = list_cluster_admins(**output_dict)
    build_table(hdr1, hdr2, out_dict, filename, sort_order)
    hdr1, hdr2, out_dict, sort_order = ping_node(ip_list)
    build_table(hdr1, hdr2, out_dict, filename, sort_order)
    hdr1, hdr2, out_dict = get_ssh_info(**output_dict)
    build_table(hdr1, hdr2, out_dict, filename)
Beispiel #16
0
def main():
    """
    Execute the functions from above
    """
    mvip, user, user_pass, mvip_node = get_inputs()
    headers, url = build_auth(mvip, user, user_pass, mvip_node)
    master_id_payload = build_master_id_payload()
    ensemble_id_payload = build_ensemble_id_payload()
    node_list_payload = build_node_list_payload()
    response_json = connect_cluster(headers, url, master_id_payload)
    master_id = get_master_id(response_json)
    response_json = connect_cluster(headers, url, node_list_payload)
    node_dict = get_active_nodes(response_json)
    response_json = connect_cluster(headers, url, ensemble_id_payload)
    ensemble_dict = get_ensemble(response_json)
    master_locator(master_id, node_dict, ensemble_dict)
Beispiel #17
0
def main():
    mvip, user, user_pass, mvip_node = get_inputs()
    headers, url = build_auth(mvip, user, user_pass, mvip_node)
    payload = build_payload()
    response_json = connect_cluster(headers, url, payload)
    do_stuff(response_json)
def main():
    mvip, user, user_pass, mvip_node = get_inputs()
    headers, url = build_auth(mvip, user, user_pass, mvip_node)
    hw_config_payload = build_payload()
    hw_config_response = connect_cluster(headers, url, hw_config_payload)
    parse_hw_config(hw_config_response)