]> granicus.if.org Git - pdns/commitdiff
json: Remove old get-zone implementations
authorChristian Hofstaedtler <christian@hofstaedtler.name>
Wed, 4 Sep 2013 09:59:28 +0000 (11:59 +0200)
committerChristian Hofstaedtler <christian@hofstaedtler.name>
Wed, 4 Sep 2013 09:59:28 +0000 (11:59 +0200)
pdnscontrol users must upgrade to at least 4c0e059731.

pdns/json_ws.cc
pdns/ws.cc

index 30567a444c8386b6897dc86db52426e444f2a3cf..d63c6416757de5448b92b6c9ee05db7685800494 100644 (file)
@@ -160,27 +160,6 @@ string JWebserver::handleRequest(const string &method, const string &uri, const
     }
     content += makeStringFromDocument(doc);
   }
-  else if(command == "get-zone") {
-    SyncRes::domainmap_t::const_iterator ret = t_sstorage->domainmap->find(varmap["zone"]);
-    
-    content += "[";
-    bool first=1;
-    
-    if(ret != t_sstorage->domainmap->end()) {
-      BOOST_FOREACH(const SyncRes::AuthDomain::records_t::value_type& val, ret->second.d_records) {
-       if(!first) content+= ", ";
-       first=false;
-       stats.clear();
-       stats["name"] = val.qname;
-       stats["type"] = val.qtype.getName();
-       stats["ttl"] = lexical_cast<string>(val.ttl);
-       stats["priority"] = lexical_cast<string>(val.priority);
-       stats["content"] = val.content;
-       content += returnJSONObject(stats);
-      }
-    }
-    content += "]";
-  }
   else if(command == "zone") {
     SyncRes::domainmap_t::const_iterator ret = t_sstorage->domainmap->find(varmap["zone"]);
     if (ret != t_sstorage->domainmap->end()) {
index 9ead254839100266f23e96e6d114d622e4924ede..20cfd73ca9067c4f77a9492fb6596ce5969938e5 100644 (file)
@@ -324,36 +324,6 @@ static string json_dispatch(const string& method, const string& post, varmap_t&
     //cerr<<"Flushed cache for '"<<varmap["domain"]<<"', cleaned "<<number<<" records"<<endl;
     return returnJSONObject(object);
   }
-  else if(command=="get-zone") {
-    UeberBackend B;
-    SOAData sd;
-    sd.db = (DNSBackend*)-1;
-    if(!B.getSOA(varmap["zone"], sd) || !sd.db) {
-      map<string, string> err;
-      err["error"] = "Could not find domain '"+varmap["zone"]+"'";
-      return returnJSONObject(err);
-    }
-    sd.db->list(varmap["zone"], sd.domain_id);
-    DNSResourceRecord rr;
-
-    string ret = "[";
-    map<string, string> object;
-    bool first=1;
-    while(sd.db->get(rr)) {
-      if(!first) ret += ", ";
-      first=false;
-      object.clear();
-      object["name"] = rr.qname;
-      object["type"] = rr.qtype.getName();
-      object["ttl"] = lexical_cast<string>(rr.ttl);
-      object["priority"] = lexical_cast<string>(rr.priority);
-      object["content"] = rr.content;
-      ret+=returnJSONObject(object);
-    }
-
-    ret += "]";
-    return ret;
-  }
   else if(command == "pdns-control") {
     if(method!="POST") {
       map<string, string> m;