def _create_record(self, name, address, ttl):
        """Creates a new record."""
        data = json.dumps({'record': {'name': name,
                                      'record_type': 'A',
                                      'content': address,
                                      'ttl': ttl}})
        headers = {'Content-Type': 'application/json'}
        request = self._session.post(self._baseurl, data=data, headers=headers)
        if not request.ok:
            raise RuntimeError('Failed to create new record: %s - %s' %
                               (self._format_hostname(name), request.json()))
        record = request.json()
        if 'record' not in record or 'id' not in record['record']:
            raise RuntimeError('Invalid record JSON format: %s - %s' %
                               (self._format_hostname(name), request.json()))
        return record['record']
Creates a new record.