configurableclientlist_inc.cc 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. // Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. namespace {
  15. const char* const ConfigurableClientList_doc = "\
  16. The list of data source clients\n\
  17. \n\
  18. The purpose is to have several data source clients of the same class\
  19. and then be able to search through them to identify the one containing\
  20. a given zone.\n\
  21. \n\
  22. Unlike the C++ version, we don't have the abstract base class. Abstract\
  23. classes are not needed due to the duck typing nature of python.\
  24. ";
  25. const char* const ConfigurableClientList_configure_doc = "\
  26. configure(configuration, allow_cache) -> None\n\
  27. \n\
  28. Wrapper around C++ ConfigurableClientList::configure\n\
  29. \n\
  30. This sets the active configuration. It fills the ConfigurableClientList with\
  31. corresponding data source clients.\n\
  32. \n\
  33. If any error is detected, an exception is raised and the previous\
  34. configuration preserved.\n\
  35. \n\
  36. Parameters:\n\
  37. configuration The configuration, as a JSON encoded string.\
  38. allow_cache If caching is allowed.\
  39. ";
  40. const char* const ConfigurableClientList_reset_memory_segment_doc = "\
  41. reset_memory_segment(datasrc_name, mode, config_params) -> None\n\
  42. \n\
  43. This method resets the zone table segment for a datasource with a new\n\
  44. memory segment.\n\
  45. \n\
  46. Parameters:\n\
  47. datasrc_name The name of the data source whose segment to reset.\n\
  48. mode The open mode for the new memory segment.\n\
  49. config_params The configuration for the new memory segment, as a JSON encoded string.\n\
  50. ";
  51. const char* const ConfigurableClientList_get_zone_table_accessor_doc = "\
  52. get_zone_table_accessor(datasrc_name, use_cache) -> \
  53. isc.datasrc.ZoneTableAccessor\n\
  54. \n\
  55. Create a ZoneTableAccessor object for the specified data source.\n\
  56. \n\
  57. Parameters:\n\
  58. datasrc_name If not empty, the name of the data source\n\
  59. use_cache If true, create a zone table for in-memory cache.\n\
  60. ";
  61. const char* const ConfigurableClientList_get_cached_zone_writer_doc = "\
  62. get_cached_zone_writer(zone, catch_load_error, datasrc_name) -> status, zone_writer\n\
  63. \n\
  64. This method returns a ZoneWriter that can be used to (re)load a zone.\n\
  65. \n\
  66. By default this method identifies the first data source in the list\n\
  67. that should serve the zone of the given name, and returns a ZoneWriter\n\
  68. object that can be used to load the content of the zone, in a specific\n\
  69. way for that data source.\n\
  70. \n\
  71. If the optional datasrc_name parameter is provided with a non empty\n\
  72. string, this method only tries to load the specified zone into or with\n\
  73. the data source which has the given name, regardless where in the list\n\
  74. that data source is placed. Even if the given name of zone doesn't\n\
  75. exist in the data source, other data sources are not searched and\n\
  76. this method simply returns ZONE_NOT_FOUND in the first element\n\
  77. of the pair.\n\
  78. \n\
  79. Two elements are returned. The first element is a status\n\
  80. indicating if it worked or not (and in case it didn't, also why). If the\n\
  81. status is ZONE_SUCCESS, the second element contains a ZoneWriter object. If\n\
  82. the status is anything else, the second element is None.\n\
  83. \n\
  84. Parameters:\n\
  85. zone The origin of the zone to (re)load.\n\
  86. catch_load_error Whether to catch load errors, or to raise them as exceptions.\n\
  87. datasrc_name The name of the data source where the zone is to be loaded (optional).\n\
  88. ";
  89. const char* const ConfigurableClientList_get_status_doc = "\
  90. get_status() -> list of tuples\n\
  91. \n\
  92. This method returns a list of tuples, with each tuple containing the\n\
  93. status of a data source client. If there are no data source clients\n\
  94. present, an empty list is returned.\n\
  95. \n\
  96. The tuples contain (name, segment_type, segment_state):\n\
  97. name The name of the data source.\n\
  98. segment_type A string indicating the type of memory segment in use.\n\
  99. segment_state The state of the memory segment.\n\
  100. \n\
  101. If segment_state is SEGMENT_UNUSED, None is returned for the segment_type.\n\
  102. ";
  103. const char* const ConfigurableClientList_find_doc = "\
  104. find(zone, want_exact_match=False, want_finder=True) -> datasrc_client,\
  105. zone_finder, exact_match\n\
  106. \n\
  107. Look for a data source containing the given zone.\n\
  108. \n\
  109. It searches through the contained data sources and returns a data source\
  110. containing the zone, the zone finder of the zone and a boolean if the answer\
  111. is an exact match.\n\
  112. \n\
  113. The first parameter is isc.dns.Name object of a name in the zone. If the\
  114. want_exact_match is True, only zone with this exact origin is returned.\
  115. If it is False, the best matching zone is returned.\n\
  116. \n\
  117. If the want_finder is False, the returned zone_finder might be None even\
  118. if the data source is identified (in such case, the datasrc_client is not\
  119. None). Setting it to false allows the client list some optimisations, if\
  120. you don't need it, but if you do need it, it is better to set it to True\
  121. instead of getting it from the datasrc_client later.\n\
  122. \n\
  123. If no answer is found, the datasrc_client and zone_finder are None.\
  124. ";
  125. } // unnamed namespace