示例#1
0
 def record_list(self,
                 offset=0,
                 length=2000,
                 sub_domain=None,
                 record_type=None,
                 record_line=None,
                 keyword=None):
     params = {
         'domain': self.name,
         'offset': offset,
         'length': length,
         'keyword': keyword,
         'sub_domain': sub_domain,
         'record_type': record_type,
         'record_line': record_line,
     }
     params = util.remove_none(params)
     json_data = util.http_post('Record.List', self.user.login_token,
                                params)
     record_list = []
     for item in json_data['records']:
         record_list.append(
             Record(self.user, self, item['name'], item['type'],
                    item['value'], item['line'], item['ttl'], item['mx'],
                    item['id'], item['status']))
     return record_list, json_data
示例#2
0
 def remove(self):
     params = {
         'domain': self.domain.name,
         'record_id': self.r_id,
     }
     params = util.remove_none(params)
     json_data = util.http_post('Record.Remove', self.user.login_token,
                                params)
     return self, json_data
示例#3
0
 def info(self, r_id):
     self.r_id = r_id
     params = {
         'domain': self.domain.name,
         'record_id': self.r_id,
     }
     params = util.remove_none(params)
     json_data = util.http_post('Record.Info', self.user.login_token,
                                params)
     self.mx = json_data['mx']
     self.ttl = json_data['ttl']
     self.name = json_data['name']
     self.line = json_data['line']
     self.r_type = json_data['type']
     self.value = json_data['value']
     self.status = json_data['status']
     return self, json_data
示例#4
0
文件: user.py 项目: wolfbolin/DNSPodX
 def domain_list(self,
                 offset=0,
                 length=50,
                 domain_type=None,
                 group_id=None,
                 keyword=None):
     params = {
         'offset': offset,
         'length': length,
         'domain_type': domain_type,
         'group_id': group_id,
         'keyword': keyword,
     }
     params = util.remove_none(params)
     json_data = util.http_post('Domain.List', self.login_token, params)
     domain_list = []
     for item in json_data['domains']:
         domain_list.append(Domain(self, item['punycode']))
     return domain_list, json_data
示例#5
0
文件: user.py 项目: wolfbolin/DNSPodX
 def version(self):
     json_data = util.http_post('Info.Version', self.login_token, {})
     return json_data['status']['message'], json_data
示例#6
0
 def modify(self):
     params = self.detail()
     params = util.remove_none(params)
     json_data = util.http_post('Record.Modify', self.user.login_token,
                                params)
     return self, json_data