]> granicus.if.org Git - pdns/commitdiff
dnsdist: Add docs for the tag features
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 3 Aug 2017 10:18:50 +0000 (12:18 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 9 Aug 2017 14:47:08 +0000 (16:47 +0200)
pdns/dnsdistdist/docs/changelog.rst
pdns/dnsdistdist/docs/reference/dq.rst
pdns/dnsdistdist/docs/reference/protobuf.rst

index 62fa48de2fdd0ef4966946d1be6982d3df24fe28..8edc7f745c3bd9c180430c56a4f6f4bf2ba105ab 100644 (file)
@@ -385,6 +385,12 @@ Changelog
 
     Remove BlockFilter.
 
+  .. change::
+    :tags: New Features
+    :pullreq: 5396
+
+    Add the capability to set arbitrary tags in protobuf messages.
+
 1.1.0
 -----
 
index 868eeb4083f0382de436383e2d823750ee03c3d0..a5e8cc4b7b770424c8a88789351e2154ee88db6b 100644 (file)
@@ -76,7 +76,7 @@ The DNSQuestion object has several attributes, many of them read-only:
 
 It also supports the following methods:
 
-.. classmethod:: DNSQuestion.getDO() -> bool
+.. classmethod:: DNSQuestion:getDO() -> bool
 
   .. versionadded:: 1.2.0
 
@@ -84,6 +84,48 @@ It also supports the following methods:
 
   :returns: true if the DO bit was set, false otherwise
 
+.. classmethod:: DNSQuestion:getTag(key) -> string
+
+  .. versionadded:: 1.2.0
+
+  Get the value of a tag stored into the DNSQuestion object.
+
+  :param string key: The tag's key
+  :returns: A table of tags, using strings as keys and values
+
+.. classmethod:: DNSQuestion:getTagArray() -> table
+
+  .. versionadded:: 1.2.0
+
+  Get all the tags stored into the DNSQuestion object.
+
+  :returns: The tag's value if it was set, an empty string otherwise
+
+.. classmethod:: DNSQuestion:sendTrap(reason)
+
+  .. versionadded:: 1.2.0
+
+  Send an SNMP trap.
+
+  :param string reason: An optional string describing the reason why this trap was sent
+
+.. classmethod:: DNSQuestion:setTag(key, value)
+
+  .. versionadded:: 1.2.0
+
+  Set a tag into the DNSQuestion object.
+
+  :param string key: The tag's key
+  :param string value: The tag's value
+
+.. classmethod:: DNSQuestion:setTagArray(tags)
+
+  .. versionadded:: 1.2.0
+
+  Set an array of tags into the DNSQuestion object.
+
+  :param table tags: A table of tags, using strings as keys and values
+
 .. _DNSResponse:
 
 DNSResponse object
index 3a5fcc1d56e269e4e9b1e126142cbef1c19640bf..90397c7483a5c732b4d7d379086956b6614e4d90 100644 (file)
@@ -5,6 +5,18 @@ Protobuf Logging Reference
 
   This object represents a single protobuf message as emitted by :program:`dnsdist`.
 
+.. classmethod:: DNSDistProtoBufMessage:addResponseRR(name, type, class, ttl, blob)
+
+  .. versionadded:: 1.2.0
+
+  Add a response RR to the protobuf message.
+
+  :param string name: The RR name.
+  :param int type: The RR type.
+  :param int class: The RR class.
+  :param int ttl: The RR TTL.
+  :param string blob: The RR binary content.
+
 .. classmethod:: DNSDistProtoBufMessage:setBytes(bytes)
 
   Set the size of the query
@@ -32,6 +44,15 @@ Protobuf Logging Reference
   :param int qtype: The qtype of the question
   :param int qclass: The qclass of the question
 
+.. classmethod:: DNSDistProtoBufMessage:setProtobufResponseType(sec, usec)
+
+  .. versionadded:: 1.2.0
+
+  Change the protobuf response type from a query to a response, and optionally set the query time.
+
+  :param int sec: Optional query time in seconds.
+  :param int usec: Optional query time in additional micro-seconds.
+
 .. classmethod:: DNSDistProtoBufMessage:setRequestor(address)
 
   Set the requestor's address.
@@ -62,6 +83,22 @@ Protobuf Logging Reference
 
   :param int rcode: The response code of the answer
 
+.. classmethod:: DNSDistProtoBufMessage:setTag(value)
+
+  .. versionadded:: 1.2.0
+
+  Add a tag to the list of tags.
+
+  :param string value: The tag value
+
+.. classmethod:: DNSDistProtoBufMessage:setTagArray(valueList)
+
+  .. versionadded:: 1.2.0
+
+  Add a list of tags.
+
+  :param table tags: A list of tags as strings
+
 .. classmethod:: DNSDistProtoBufMessage:setTime(sec, usec)
 
   Set the time at which the query or response has been received.