|
@@ -37,6 +37,8 @@
|
|
|
#include "client_python.h"
|
|
|
#include "zonewriter_python.h"
|
|
|
|
|
|
+#include "configurableclientlist_inc.cc"
|
|
|
+
|
|
|
using namespace std;
|
|
|
using namespace isc::util::python;
|
|
|
using namespace isc::datasrc;
|
|
@@ -292,86 +294,19 @@ ConfigurableClientList_find(PyObject* po_self, PyObject* args) {
|
|
|
// 3. Argument type
|
|
|
// 4. Documentation
|
|
|
PyMethodDef ConfigurableClientList_methods[] = {
|
|
|
- { "configure", ConfigurableClientList_configure, METH_VARARGS,
|
|
|
- "configure(configuration, allow_cache) -> None\n\
|
|
|
-\n\
|
|
|
-Wrapper around C++ ConfigurableClientList::configure\n\
|
|
|
-\n\
|
|
|
-This sets the active configuration. It fills the ConfigurableClientList with\
|
|
|
-corresponding data source clients.\n\
|
|
|
-\n\
|
|
|
-If any error is detected, an exception is raised and the previous\
|
|
|
-configuration preserved.\n\
|
|
|
-\n\
|
|
|
-Parameters:\n\
|
|
|
- configuration The configuration, as a JSON encoded string.\
|
|
|
- allow_cache If caching is allowed." },
|
|
|
+ { "configure", ConfigurableClientList_configure,
|
|
|
+ METH_VARARGS, ConfigurableClientList_configure_doc },
|
|
|
{ "reset_memory_segment", ConfigurableClientList_resetMemorySegment,
|
|
|
- METH_VARARGS,
|
|
|
- "reset_memory_segment(datasrc_name, mode, config_params) -> None\n\
|
|
|
-\n\
|
|
|
-Wrapper around C++ ConfigurableClientList::resetMemorySegment\n\
|
|
|
-\n\
|
|
|
-This resets the zone table segment for a datasource with a new\n\
|
|
|
-memory segment.\n\
|
|
|
-\n\
|
|
|
-Parameters:\n\
|
|
|
- datasrc_name The name of the data source whose segment to reset.\
|
|
|
- mode The open mode for the new memory segment.\
|
|
|
- config_params The configuration for the new memory segment, as a JSON encoded string." },
|
|
|
+ METH_VARARGS, ConfigurableClientList_reset_memory_segment_doc },
|
|
|
{ "get_cached_zone_writer", ConfigurableClientList_getCachedZoneWriter,
|
|
|
- METH_VARARGS,
|
|
|
- "get_cached_zone_writer(zone, datasrc_name) -> status, zone_writer\n\
|
|
|
-\n\
|
|
|
-Wrapper around C++ ConfigurableClientList::getCachedZoneWriter\n\
|
|
|
-\n\
|
|
|
-This returns a ZoneWriter that can be used to (re)load a zone.\n\
|
|
|
-\n\
|
|
|
-Parameters:\n\
|
|
|
- zone The name of the zone to (re)load.\
|
|
|
- datasrc_name The name of the data source where the zone is to be loaded." },
|
|
|
+ METH_VARARGS, ConfigurableClientList_get_cached_zone_writer_doc },
|
|
|
{ "get_status", ConfigurableClientList_getStatus,
|
|
|
- METH_NOARGS,
|
|
|
- "get_status() -> list\n\
|
|
|
-\n\
|
|
|
-Wrapper around C++ ConfigurableClientList::getStatus\n\
|
|
|
-\n\
|
|
|
-This returns a list of tuples, each containing the status of a data source client." },
|
|
|
- { "find", ConfigurableClientList_find, METH_VARARGS,
|
|
|
-"find(zone, want_exact_match=False, want_finder=True) -> datasrc_client,\
|
|
|
-zone_finder, exact_match\n\
|
|
|
-\n\
|
|
|
-Look for a data source containing the given zone.\n\
|
|
|
-\n\
|
|
|
-It searches through the contained data sources and returns a data source\
|
|
|
-containing the zone, the zone finder of the zone and a boolean if the answer\
|
|
|
-is an exact match.\n\
|
|
|
-\n\
|
|
|
-The first parameter is isc.dns.Name object of a name in the zone. If the\
|
|
|
-want_exact_match is True, only zone with this exact origin is returned.\
|
|
|
-If it is False, the best matching zone is returned.\n\
|
|
|
-\n\
|
|
|
-If the want_finder is False, the returned zone_finder might be None even\
|
|
|
-if the data source is identified (in such case, the datasrc_client is not\
|
|
|
-None). Setting it to false allows the client list some optimisations, if\
|
|
|
-you don't need it, but if you do need it, it is better to set it to True\
|
|
|
-instead of getting it from the datasrc_client later.\n\
|
|
|
-\n\
|
|
|
-If no answer is found, the datasrc_client and zone_finder are None." },
|
|
|
+ METH_NOARGS, ConfigurableClientList_get_status_doc },
|
|
|
+ { "find", ConfigurableClientList_find,
|
|
|
+ METH_VARARGS, ConfigurableClientList_find_doc },
|
|
|
{ NULL, NULL, 0, NULL }
|
|
|
};
|
|
|
|
|
|
-const char* const ConfigurableClientList_doc = "\
|
|
|
-The list of data source clients\n\
|
|
|
-\n\
|
|
|
-The purpose is to have several data source clients of the same class\
|
|
|
-and then be able to search through them to identify the one containing\
|
|
|
-a given zone.\n\
|
|
|
-\n\
|
|
|
-Unlike the C++ version, we don't have the abstract base class. Abstract\
|
|
|
-classes are not needed due to the duck typing nature of python.\
|
|
|
-";
|
|
|
-
|
|
|
} // end of unnamed namespace
|
|
|
|
|
|
namespace isc {
|