From 1134ceeca7ab82e4f5db70c54b7d1c1a293d9c4c Mon Sep 17 00:00:00 2001 From: Matt Klein Date: Wed, 29 Nov 2017 13:00:41 -0800 Subject: [PATCH] docs: redis proxy (#293) Signed-off-by: Matt Klein --- api/BUILD | 3 +- api/filter/network/redis_proxy.proto | 35 +++++++------- docs/build.sh | 1 + .../network_filters/redis_proxy_filter.rst | 46 +++++++++++++++++++ .../network_filters/redis_proxy_filter.rst | 44 ++---------------- 5 files changed, 71 insertions(+), 58 deletions(-) create mode 100644 docs/root/api-v1/network_filters/redis_proxy_filter.rst diff --git a/api/BUILD b/api/BUILD index 8bfce92d..d791a07d 100644 --- a/api/BUILD +++ b/api/BUILD @@ -152,8 +152,9 @@ proto_library( "//api/filter/http:lua", "//api/filter/http:router", "//api/filter/http:transcoder", - "//api/filter/network:tcp_proxy", "//api/filter/network:http_connection_manager", "//api/filter/network:mongo_proxy", + "//api/filter/network:redis_proxy", + "//api/filter/network:tcp_proxy", ], ) diff --git a/api/filter/network/redis_proxy.proto b/api/filter/network/redis_proxy.proto index 3fd67262..ba17f443 100644 --- a/api/filter/network/redis_proxy.proto +++ b/api/filter/network/redis_proxy.proto @@ -4,28 +4,31 @@ package envoy.api.v2.filter.network; import "google/protobuf/duration.proto"; +import "validate/validate.proto"; + +// [#protodoc-title: Redis Proxy] +// Redis Proxy :ref:`configuration overview `. + message RedisProxy { - // The human readable prefix to use when emitting statistics for the - // Redis proxy filter. See the statistics documentation for more information. - string stat_prefix = 1; + // The prefix to use when emitting :ref:`statistics `. + string stat_prefix = 1 [(validate.rules).string.min_len = 1]; - // Indicates the upstream cluster to which the operation should be routed to. - string cluster = 2; + // Name of cluster from cluster manager. See the :ref:`configuration section + // ` of the architecture overview for recommendations on + // configuring the backing cluster. + string cluster = 2 [(validate.rules).string.min_len = 1]; // Redis connection pool settings. message ConnPoolSettings { - // Per-operation timeout. See - // https://developers.google.com/protocol-buffers/docs/proto3#json for - // the JSON/YAML Duration mapping. The timer starts when the first - // command of a pipeline is written to the backend connection. Each - // response received from Redis resets the timer since it signifies - // that the next command is being processed by the backend. The only - // exception to this behavior is when a connection to a backend is not - // yet established. In that case, the connect timeout on the cluster - // will govern the timeout until the connection is ready. REQUIRED. - google.protobuf.Duration op_timeout = 1; + // Per-operation timeout in milliseconds. The timer starts when the first + // command of a pipeline is written to the backend connection. Each response received from Redis + // resets the timer since it signifies that the next command is being processed by the backend. + // The only exception to this behavior is when a connection to a backend is not yet established. + // In that case, the connect timeout on the cluster will govern the timeout until the connection + // is ready. + google.protobuf.Duration op_timeout = 1 [(validate.rules).duration.required = true]; } // Network settings for the connection pool to the upstream cluster. - ConnPoolSettings settings = 3; + ConnPoolSettings settings = 3 [(validate.rules).message.required = true]; } diff --git a/docs/build.sh b/docs/build.sh index 16b0768a..c40ddfc2 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -45,6 +45,7 @@ PROTO_RST=" /api/filter/http/transcoder/api/filter/http/transcoder.proto.rst /api/filter/network/http_connection_manager/api/filter/network/http_connection_manager.proto.rst /api/filter/network/mongo_proxy/api/filter/network/mongo_proxy.proto.rst + /api/filter/network/redis_proxy/api/filter/network/redis_proxy.proto.rst /api/filter/network/tcp_proxy/api/filter/network/tcp_proxy.proto.rst /api/protocol/api/protocol.proto.rst /api/rds/api/rds.proto.rst diff --git a/docs/root/api-v1/network_filters/redis_proxy_filter.rst b/docs/root/api-v1/network_filters/redis_proxy_filter.rst new file mode 100644 index 00000000..b2d2653c --- /dev/null +++ b/docs/root/api-v1/network_filters/redis_proxy_filter.rst @@ -0,0 +1,46 @@ +.. _config_network_filters_redis_proxy_v1: + +Redis proxy +=========== + +Redis proxy :ref:`configuration overview `. + +.. code-block:: json + + { + "name": "redis_proxy", + "config": { + "cluster_name": "...", + "conn_pool": "{...}", + "stat_prefix": "..." + } + } + +cluster_name + *(required, string)* Name of cluster from cluster manager. + See the :ref:`configuration section ` of the architecture + overview for recommendations on configuring the backing cluster. + +conn_pool + *(required, object)* Connection pool configuration. + +stat_prefix + *(required, string)* The prefix to use when emitting :ref:`statistics + `. + +Connection pool configuration +----------------------------- + +.. code-block:: json + + { + "op_timeout_ms": "...", + } + +op_timeout_ms + *(required, integer)* Per-operation timeout in milliseconds. The timer starts when the first + command of a pipeline is written to the backend connection. Each response received from Redis + resets the timer since it signifies that the next command is being processed by the backend. + The only exception to this behavior is when a connection to a backend is not yet established. In + that case, the connect timeout on the cluster will govern the timeout until the connection is + ready. diff --git a/docs/root/configuration/network_filters/redis_proxy_filter.rst b/docs/root/configuration/network_filters/redis_proxy_filter.rst index 516019cb..96f1d619 100644 --- a/docs/root/configuration/network_filters/redis_proxy_filter.rst +++ b/docs/root/configuration/network_filters/redis_proxy_filter.rst @@ -3,47 +3,9 @@ Redis proxy =========== -Redis :ref:`architecture overview ` - -.. code-block:: json - - { - "name": "redis_proxy", - "config": { - "cluster_name": "...", - "conn_pool": "{...}", - "stat_prefix": "..." - } - } - -cluster_name - *(required, string)* Name of cluster from cluster manager. - See the :ref:`configuration section ` of the architecture - overview for recommendations on configuring the backing cluster. - -conn_pool - *(required, object)* Connection pool configuration. - -stat_prefix - *(required, string)* The prefix to use when emitting :ref:`statistics - `. - -Connection pool configuration ------------------------------ - -.. code-block:: json - - { - "op_timeout_ms": "...", - } - -op_timeout_ms - *(required, integer)* Per-operation timeout in milliseconds. The timer starts when the first - command of a pipeline is written to the backend connection. Each response received from Redis - resets the timer since it signifies that the next command is being processed by the backend. - The only exception to this behavior is when a connection to a backend is not yet established. In - that case, the connect timeout on the cluster will govern the timeout until the connection is - ready. +* Redis :ref:`architecture overview ` +* :ref:`v1 API reference ` +* :ref:`v2 API reference ` .. _config_network_filters_redis_proxy_stats: