def Del_Record(self): '''删除记录''' Domains = All_params.check_input("您需要删除解析记录的域名,以便获取其子域名的记录ID,用逗号分隔:") Domains_List = Domains.split(sep=',') running = Dns_Del_Record(self.Login_Token, self.Product) running.Get_Record(Domains_List) Records = All_params.check_input( "需要删除的 域名ID 和 解析记录ID,多个记录已逗号分隔(格式,agvip2003.com=384855336):") Domains_Records_List = Records.split(sep=',') running.Del_Record(Domains_Records_List)
def Add_Record(self): '''添加解析记录''' Domains = All_params.check_input("您需要添加解析记录的域名,多个域名用逗号分隔:") Sub_Domians = All_params.check_input("需要添加的子域名,用逗号分隔:") Domains_List = Domains.split(sep=',') running = Dns_Add_Record(self.Login_Token, self.Product) Record_Type = All_params.check_input("选择记录类型,输入( A 或 CNAME ):") Value = All_params.check_input("要解析的记录值:") Record_Line = All_params.check_input("输入记录线路:输入null为默认:") if Record_Line == 'null': Record_Line_value = '默认' else: Record_Line_value = Record_Line Sub_Domian_List = Sub_Domians.split(sep=',') running.Add_Record(Domains_List, Sub_Domian_List, Record_Type, Record_Line_value, Value)
def Alter_Record(self): '''修改记录''' Domains = All_params.check_input( "您需要修改解析记录的域名,以便获取其子域名的记录ID,多个记录(只能单个域名修改)用逗号分隔:") Domains_List = Domains.split(sep=',') running = Dns_Alter_Record(self.Login_Token, self.Product) running.Get_Record(Domains_List) Records = All_params.check_input("需要修改的解析记录的ID,并且输入ID,用逗号分隔:") Records_List = Records.split(sep=',') Change = All_params.check_input( "您要修改的字段([sub_domain,record_type,area,value,mx,ttl,status]):") Change_TO = All_params.check_input( "你要修改的字段例如:record_type= A CNAME MX TTL,sub_domain= @ www test|这个值对应是你上一步选择的字段| 要修改为:" ) if Change == 'value': running.Alter_Record(Records_List, Change, Change_TO, Value='') else: Value = All_params.check_input("要修改到的记录值:") running.Alter_Record(Records_List, Change, Change_TO, Value)
def Get_Domain_Log(self): '''查询域名日志''' Domains = All_params.check_input(u'输入查询日志的域名,用逗号分隔:') Domains_List = Domains.split(sep=',') running = Dns_Get_Domain_Log(self.Login_Token, self.Product) running.Get_Domain_Log_Info(Domains_List)
def Get_Domain_Record_Info(self): '''获取域名解析记录''' Domains = All_params.check_input("您需要查看记录的域名,以便获取其子域名的记录ID,多个域名用逗号分隔:") Domains_List = Domains.split(sep=',') running = Dns_Get_Domain_Record_Info(self.Login_Token, self.Product) running.Get_Domain_Record_Info(Domains_List)
def Del_Domain(self): '''删除域名''' Domains = All_params.check_input("您需要删除的域名,用逗号分隔:") Domains_List = Domains.split(sep=',') running = Dns_Del_Domain(self.Login_Token, self.Product) running.Del_Domain(Domains_List)