def create_zone(self, domain, type=None, ttl=None, extra={}):
        """
        Create a new zone.

        There are two PowerDNS-specific quirks here. Firstly, the "type" and
        "ttl" parameters are ignored (no-ops). The "type" parameter is simply
        not implemented, and PowerDNS does not have an ability to set a
        zone-wide default TTL. (TTLs must be set per-record.)

        Secondly, PowerDNS requires that you provide a list of nameservers for
        the zone upon creation.  In other words, the "extra" parameter must be
        ``{'nameservers': ['ns1.example.org']}`` at a minimum.

        :param name: Zone domain name (e.g. example.com)
        :type  name: ``str``

        :param domain: Zone type (master / slave). (optional).  Note that the
                       PowerDNS driver does nothing with this parameter.
        :type  domain: :class:`Zone`

        :param ttl: TTL for new records. (optional). Note that the PowerDNS
                    driver does nothing with this parameter.
        :type  ttl: ``int``

        :param extra: Extra attributes (driver specific).
                      For example, specify
                      ``extra={'nameservers': ['ns1.example.org']}`` to set
                      a list of nameservers for this new zone.
        :type extra: ``dict``

        :rtype: :class:`Zone`
        """
        action = '%s/servers/%s/zones' % (self.api_root, self.ex_server)
        if extra is None or extra.get('nameservers', None) is None:
            msg = 'PowerDNS requires a list of nameservers for every new zone'
            raise ValueError(msg)
        payload = {'name': domain, 'kind': 'Native'}
        payload.update(extra)
        zone_id = domain + '.'
        try:
            self.connection.request(action=action, data=json.dumps(payload),
                                    method='POST')
        except BaseHTTPError:
            e = sys.exc_info()[1]
            if e.code == httplib.UNPROCESSABLE_ENTITY and \
               e.message.startswith("Domain '%s' already exists" % domain):
                raise ZoneAlreadyExistsError(zone_id=zone_id, driver=self,
                                             value=e.message)
            raise e
        return Zone(id=zone_id, domain=domain, type=None, ttl=None,
                    driver=self, extra=extra)
dataset/ETHPy150Open apache/libcloud/libcloud/dns/drivers/powerdns.py/PowerDNSDriver.create_zone/original