membphis commented on a change in pull request #2339:
URL: https://github.com/apache/apisix/pull/2339#discussion_r502731483



##########
File path: doc/plugins/api-breaker.md
##########
@@ -0,0 +1,102 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+- [中文](../zh-cn/plugins/api-blocker.md)
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [**How To Enable**](#how-to-enable)
+- [**Test Plugin**](#test-plugin)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+The plugin implements API fuse functionality to help us protect our upstream 
business services.
+
+## Attributes
+
+| Name          | Type          | Requirement | Default | Valid      | 
Description                                                                 |
+| ------------- | ------------- | ----------- | ------- | ---------- | 
--------------------------------------------------------------------------- |
+| unhealthy_response_code           | integer | required |          | [200, 
..., 600] | return error code when unhealthy |
+| unhealthy.http_statuses | array[integer] | optional | {500}      | [500, 
..., 599] | Status codes when unhealthy |
+| unhealthy.failures      | integer        | optional | 1          | >=1       
      | Number of consecutive error requests that triggered an unhealthy state |
+| healthy.http_statuses   | array[integer] | optional | {200, 206} | [200, 
..., 499] | Status codes when healthy |
+| successes.successes     | integer        | optional | 1          | >=1       
      | Number of consecutive normal requests that trigger health status |
+
+## How To Enable
+
+Here's an example, enable the `api-breaker` plugin on the specified route:
+
+```shell
+curl "http://127.0.0.1:9080/apisix/admin/routes/5"; -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+   {
+      "plugins": {
+          "api-breaker": {
+              "unhealthy_response_code": 502,
+              "unhealthy": {
+                  "http_statuses": [500, 503],
+                  "failures": 3
+              },
+              "healthy": {
+                  "http_statuses": [200],
+                  "successes": 1
+              }
+          }
+      },
+     "uri": "/get",
+      "host": "127.0.0.1",
+      "upstream_id": 50
+  }'
+```
+
+## Test Plugin
+
+```shell

Review comment:
       Just show an example, make the user learn this plugin easier.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to