Esempio n. 1
0
def get_domain_line_list_by_domain_name_api():
    tmp_dict = {}
    tmp_dict['success'] = "false"
    if request.method == "POST":
        domain_name = request.form['domain_name']
        domain_info = Domain.get_domain_by_domain_name(domain_name)
        if domain_info:
            if domain_info[2] == "local_bind":
                tmp_dict['success'] = "true"
                tmp_dict['domain_line_list'] = config.LOCAL_BIND_LINE
            elif domain_info[2] == "dnspod":
                tmp_dict['success'] = "true"
                tmp_dict['domain_line_list'] = get_dnspod_domain_list_list_by_domain_id_lib(domain_info[0])
        else:
            tmp_dict['msg'] = "no this domain_name"
    else:
        tmp_dict['msg'] = "no post data"
    return json.dumps(tmp_dict)
Esempio n. 2
0
def get_dns_record_info_api():
    tmp_dict = {}
    tmp_dict['success'] = "false"
    if request.method == "POST":
        domain_name = request.form['domain_name']
        record = request.form['record']
        domain_info = Domain.get_domain_by_domain_name(domain_name)
        if domain_info:
            if domain_info[2] == "local_bind":
                tmp_dict['success'] = "true"
                tmp_dict['record_list'] = get_dns_record_list_by_domain_id_and_record_lib(domain_info[0], record)
            elif domain_info[2] == "dnspod":
                tmp_dict['success'] = "true"
                tmp_dict['record_list'] = get_dnspod_record_list_by_domain_id_and_record_lib(domain_info[0], record)
        else:
            tmp_dict['msg'] = "no this domain_name"
    else:
        tmp_dict['msg'] = "no post data"
    return json.dumps(tmp_dict)