def setup_zone(self):
<EOL>zones_content = self.request(self.api_url, '<STR_LIT>')<EOL>try:<EOL><INDENT>if len(self.domain.split('<STR_LIT:.>')) == <NUM_LIT:3>:<EOL><INDENT>domain = self.domain.split('<STR_LIT:.>', <NUM_LIT:1>)[<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>domain = self.domain<EOL><DEDENT>zone = [zone for zone in zones_content['<STR_LIT:result>'] if zone['<STR_LIT:name>'] == domain][<NUM_LIT:0>]<EOL><DEDENT>except IndexError:<EOL><INDENT>raise ZoneNotFound('<STR_LIT>'<EOL>.format(domain=self.domain))<EOL><DEDENT>self.zone = zone<EOL>dns_content = self.request(self.api_url + zone['<STR_LIT:id>'] + '<STR_LIT>', '<STR_LIT>')<EOL>self.dns_records = dns_content['<STR_LIT:result>']<EOL>
Setup zone for current domain.
It will also setup the dns records of the zone
:return: