From: Remi Gacogne Date: Thu, 3 Aug 2017 10:18:50 +0000 (+0200) Subject: dnsdist: Add docs for the tag features X-Git-Tag: dnsdist-1.2.0~20^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab6f6acf6755c6963381c956301bd233cdb16078;p=pdns dnsdist: Add docs for the tag features --- diff --git a/pdns/dnsdistdist/docs/changelog.rst b/pdns/dnsdistdist/docs/changelog.rst index 62fa48de2..8edc7f745 100644 --- a/pdns/dnsdistdist/docs/changelog.rst +++ b/pdns/dnsdistdist/docs/changelog.rst @@ -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 ----- diff --git a/pdns/dnsdistdist/docs/reference/dq.rst b/pdns/dnsdistdist/docs/reference/dq.rst index 868eeb408..a5e8cc4b7 100644 --- a/pdns/dnsdistdist/docs/reference/dq.rst +++ b/pdns/dnsdistdist/docs/reference/dq.rst @@ -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 diff --git a/pdns/dnsdistdist/docs/reference/protobuf.rst b/pdns/dnsdistdist/docs/reference/protobuf.rst index 3a5fcc1d5..90397c748 100644 --- a/pdns/dnsdistdist/docs/reference/protobuf.rst +++ b/pdns/dnsdistdist/docs/reference/protobuf.rst @@ -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.