mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-02 12:07:35 +08:00
docs: update admin ip example node ip (#5603)
This commit is contained in:
parent
4b94b84f92
commit
12b3fac3ce
@ -142,7 +142,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f
|
||||
"upstream": {
|
||||
"type": "roundrobin",
|
||||
"nodes": {
|
||||
"39.97.63.215:80": 1
|
||||
"127.0.0.1:1980": 1
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -158,7 +158,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/2?ttl=60 -H 'X-API-KEY: edd1c9f
|
||||
"upstream": {
|
||||
"type": "roundrobin",
|
||||
"nodes": {
|
||||
"39.97.63.215:80": 1
|
||||
"127.0.0.1:1980": 1
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -173,7 +173,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H'X-API-KEY: edd1c9f034335f1
|
||||
{
|
||||
"upstream": {
|
||||
"nodes": {
|
||||
"39.97.63.216:80": 1
|
||||
"127.0.0.1:1981": 1
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -182,8 +182,8 @@ HTTP/1.1 200 OK
|
||||
|
||||
After successful execution, upstream nodes will be updated to:
|
||||
{
|
||||
"39.97.63.215:80": 1,
|
||||
"39.97.63.216:80": 1
|
||||
"127.0.0.1:1980": 1,
|
||||
"127.0.0.1:1981": 1
|
||||
}
|
||||
|
||||
|
||||
@ -192,7 +192,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H'X-API-KEY: edd1c9f034335f1
|
||||
{
|
||||
"upstream": {
|
||||
"nodes": {
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -201,8 +201,8 @@ HTTP/1.1 200 OK
|
||||
|
||||
After successful execution, upstream nodes will be updated to:
|
||||
{
|
||||
"39.97.63.215:80": 1,
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1980": 1,
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
|
||||
|
||||
@ -211,7 +211,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H'X-API-KEY: edd1c9f034335f1
|
||||
{
|
||||
"upstream": {
|
||||
"nodes": {
|
||||
"39.97.63.215:80": null
|
||||
"127.0.0.1:1980": null
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -220,7 +220,7 @@ HTTP/1.1 200 OK
|
||||
|
||||
After successful execution, upstream nodes will be updated to:
|
||||
{
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
|
||||
|
||||
@ -238,14 +238,14 @@ After successful execution, methods will not retain the original data, and the e
|
||||
# Replace upstream nodes of the Route -- sub path
|
||||
$ curl http://127.0.0.1:9080/apisix/admin/routes/1/upstream/nodes -H'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PATCH -i -d '
|
||||
{
|
||||
"39.97.63.200:80": 1
|
||||
"127.0.0.1:1982": 1
|
||||
}'
|
||||
HTTP/1.1 200 OK
|
||||
...
|
||||
|
||||
After successful execution, nodes will not retain the original data, and the entire update is:
|
||||
{
|
||||
"39.97.63.200:80": 1
|
||||
"127.0.0.1:1982": 1
|
||||
}
|
||||
|
||||
|
||||
@ -359,7 +359,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/services/201 -H 'X-API-KEY: edd1c9f03
|
||||
"upstream": {
|
||||
"type": "roundrobin",
|
||||
"nodes": {
|
||||
"39.97.63.215:80": 1
|
||||
"127.0.0.1:1980": 1
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -373,7 +373,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/services/201 -H'X-API-KEY: edd1c9f0343
|
||||
{
|
||||
"upstream": {
|
||||
"nodes": {
|
||||
"39.97.63.216:80": 1
|
||||
"127.0.0.1:1981": 1
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -382,8 +382,8 @@ HTTP/1.1 200 OK
|
||||
|
||||
After successful execution, upstream nodes will be updated to:
|
||||
{
|
||||
"39.97.63.215:80": 1,
|
||||
"39.97.63.216:80": 1
|
||||
"127.0.0.1:1980": 1,
|
||||
"127.0.0.1:1981": 1
|
||||
}
|
||||
|
||||
|
||||
@ -392,7 +392,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/services/201 -H'X-API-KEY: edd1c9f0343
|
||||
{
|
||||
"upstream": {
|
||||
"nodes": {
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -401,8 +401,8 @@ HTTP/1.1 200 OK
|
||||
|
||||
After successful execution, upstream nodes will be updated to:
|
||||
{
|
||||
"39.97.63.215:80": 1,
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1980": 1,
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
|
||||
|
||||
@ -411,7 +411,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/services/201 -H'X-API-KEY: edd1c9f0343
|
||||
{
|
||||
"upstream": {
|
||||
"nodes": {
|
||||
"39.97.63.215:80": null
|
||||
"127.0.0.1:1980": null
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -420,21 +420,21 @@ HTTP/1.1 200 OK
|
||||
|
||||
After successful execution, upstream nodes will be updated to:
|
||||
{
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
|
||||
|
||||
# Replace upstream nodes of the Service
|
||||
$ curl http://127.0.0.1:9080/apisix/admin/services/201/upstream/nodes -H'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PATCH -i -d '
|
||||
{
|
||||
"39.97.63.200:80": 1
|
||||
"127.0.0.1:1982": 1
|
||||
}'
|
||||
HTTP/1.1 200 OK
|
||||
...
|
||||
|
||||
After successful execution, upstream nodes will not retain the original data, and the entire update is:
|
||||
{
|
||||
"39.97.63.200:80": 1
|
||||
"127.0.0.1:1982": 1
|
||||
}
|
||||
|
||||
```
|
||||
@ -622,7 +622,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/upstreams/100 -H 'X-API-KEY: edd1c9f0
|
||||
{
|
||||
"type":"roundrobin",
|
||||
"nodes":{
|
||||
"39.97.63.215:80": 1
|
||||
"127.0.0.1:1980": 1
|
||||
}
|
||||
}'
|
||||
HTTP/1.1 201 Created
|
||||
@ -633,7 +633,7 @@ HTTP/1.1 201 Created
|
||||
$ curl http://127.0.0.1:9080/apisix/admin/upstreams/100 -H'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PATCH -i -d '
|
||||
{
|
||||
"nodes": {
|
||||
"39.97.63.216:80": 1
|
||||
"127.0.0.1:1981": 1
|
||||
}
|
||||
}'
|
||||
HTTP/1.1 200 OK
|
||||
@ -641,8 +641,8 @@ HTTP/1.1 200 OK
|
||||
|
||||
After successful execution, nodes will be updated to:
|
||||
{
|
||||
"39.97.63.215:80": 1,
|
||||
"39.97.63.216:80": 1
|
||||
"127.0.0.1:1980": 1,
|
||||
"127.0.0.1:1981": 1
|
||||
}
|
||||
|
||||
|
||||
@ -650,7 +650,7 @@ After successful execution, nodes will be updated to:
|
||||
$ curl http://127.0.0.1:9080/apisix/admin/upstreams/100 -H'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PATCH -i -d '
|
||||
{
|
||||
"nodes": {
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
}'
|
||||
HTTP/1.1 200 OK
|
||||
@ -658,8 +658,8 @@ HTTP/1.1 200 OK
|
||||
|
||||
After successful execution, nodes will be updated to:
|
||||
{
|
||||
"39.97.63.215:80": 1,
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1980": 1,
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
|
||||
|
||||
@ -667,7 +667,7 @@ After successful execution, nodes will be updated to:
|
||||
$ curl http://127.0.0.1:9080/apisix/admin/upstreams/100 -H'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PATCH -i -d '
|
||||
{
|
||||
"nodes": {
|
||||
"39.97.63.215:80": null
|
||||
"127.0.0.1:1980": null
|
||||
}
|
||||
}'
|
||||
HTTP/1.1 200 OK
|
||||
@ -675,21 +675,21 @@ HTTP/1.1 200 OK
|
||||
|
||||
After successful execution, nodes will be updated to:
|
||||
{
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
|
||||
|
||||
# Replace the nodes of the Upstream
|
||||
$ curl http://127.0.0.1:9080/apisix/admin/upstreams/100/nodes -H'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PATCH -i -d '
|
||||
{
|
||||
"39.97.63.200:80": 1
|
||||
"127.0.0.1:1982": 1
|
||||
}'
|
||||
HTTP/1.1 200 OK
|
||||
...
|
||||
|
||||
After the execution is successful, nodes will not retain the original data, and the entire update is:
|
||||
{
|
||||
"39.97.63.200:80": 1
|
||||
"127.0.0.1:1982": 1
|
||||
}
|
||||
|
||||
```
|
||||
@ -750,7 +750,7 @@ For example:
|
||||
"type": "roundrobin",
|
||||
"nodes": [
|
||||
{"host": "127.0.0.1", "port": 1980, "weight": 2000},
|
||||
{"host": "127.0.0.2", "port": 1980, "weight": 1, "priority": -1}
|
||||
{"host": "127.0.0.1", "port": 1981, "weight": 1, "priority": -1}
|
||||
],
|
||||
"checks": {
|
||||
"active": {
|
||||
|
@ -143,7 +143,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f
|
||||
"upstream": {
|
||||
"type": "roundrobin",
|
||||
"nodes": {
|
||||
"39.97.63.215:80": 1
|
||||
"127.0.0.1:1980": 1
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -159,7 +159,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/2?ttl=60 -H 'X-API-KEY: edd1c9f
|
||||
"upstream": {
|
||||
"type": "roundrobin",
|
||||
"nodes": {
|
||||
"39.97.63.215:80": 1
|
||||
"127.0.0.1:1980": 1
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -174,7 +174,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f
|
||||
{
|
||||
"upstream": {
|
||||
"nodes": {
|
||||
"39.97.63.216:80": 1
|
||||
"127.0.0.1:1981": 1
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -183,8 +183,8 @@ HTTP/1.1 200 OK
|
||||
|
||||
执行成功后,upstream nodes 将更新为:
|
||||
{
|
||||
"39.97.63.215:80": 1,
|
||||
"39.97.63.216:80": 1
|
||||
"127.0.0.1:1980": 1,
|
||||
"127.0.0.1:1981": 1
|
||||
}
|
||||
|
||||
|
||||
@ -193,7 +193,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f
|
||||
{
|
||||
"upstream": {
|
||||
"nodes": {
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -202,8 +202,8 @@ HTTP/1.1 200 OK
|
||||
|
||||
执行成功后,upstream nodes 将更新为:
|
||||
{
|
||||
"39.97.63.215:80": 1,
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1980": 1,
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
|
||||
|
||||
@ -212,7 +212,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f
|
||||
{
|
||||
"upstream": {
|
||||
"nodes": {
|
||||
"39.97.63.215:80": null
|
||||
"127.0.0.1:1980": null
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -221,7 +221,7 @@ HTTP/1.1 200 OK
|
||||
|
||||
执行成功后,upstream nodes 将更新为:
|
||||
{
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
|
||||
|
||||
@ -239,14 +239,14 @@ HTTP/1.1 200 OK
|
||||
# 替换路由的 upstream nodes -- sub path
|
||||
$ curl http://127.0.0.1:9080/apisix/admin/routes/1/upstream/nodes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PATCH -i -d '
|
||||
{
|
||||
"39.97.63.200:80": 1
|
||||
"127.0.0.1:1982": 1
|
||||
}'
|
||||
HTTP/1.1 200 OK
|
||||
...
|
||||
|
||||
执行成功后,nodes 将不保留原来的数据,整个更新为:
|
||||
{
|
||||
"39.97.63.200:80": 1
|
||||
"127.0.0.1:1982": 1
|
||||
}
|
||||
|
||||
|
||||
@ -362,7 +362,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/services/201 -H 'X-API-KEY: edd1c9f03
|
||||
"upstream": {
|
||||
"type": "roundrobin",
|
||||
"nodes": {
|
||||
"39.97.63.215:80": 1
|
||||
"127.0.0.1:1980": 1
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -378,7 +378,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/services/201 -H 'X-API-KEY: edd1c9f034
|
||||
{
|
||||
"upstream": {
|
||||
"nodes": {
|
||||
"39.97.63.216:80": 1
|
||||
"127.0.0.1:1981": 1
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -387,8 +387,8 @@ HTTP/1.1 200 OK
|
||||
|
||||
执行成功后,upstream nodes 将更新为:
|
||||
{
|
||||
"39.97.63.215:80": 1,
|
||||
"39.97.63.216:80": 1
|
||||
"127.0.0.1:1980": 1,
|
||||
"127.0.0.1:1981": 1
|
||||
}
|
||||
|
||||
|
||||
@ -397,7 +397,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/services/201 -H 'X-API-KEY: edd1c9f034
|
||||
{
|
||||
"upstream": {
|
||||
"nodes": {
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -406,8 +406,8 @@ HTTP/1.1 200 OK
|
||||
|
||||
执行成功后,upstream nodes 将更新为:
|
||||
{
|
||||
"39.97.63.215:80": 1,
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1980": 1,
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
|
||||
|
||||
@ -416,7 +416,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/services/201 -H 'X-API-KEY: edd1c9f034
|
||||
{
|
||||
"upstream": {
|
||||
"nodes": {
|
||||
"39.97.63.215:80": null
|
||||
"127.0.0.1:1980": null
|
||||
}
|
||||
}
|
||||
}'
|
||||
@ -425,21 +425,21 @@ HTTP/1.1 200 OK
|
||||
|
||||
执行成功后,upstream nodes 将更新为:
|
||||
{
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
|
||||
|
||||
# 替换 Service 的 upstream nodes
|
||||
$ curl http://127.0.0.1:9080/apisix/admin/services/201/upstream/nodes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PATCH -i -d '
|
||||
{
|
||||
"39.97.63.200:80": 1
|
||||
"127.0.0.1:1982": 1
|
||||
}'
|
||||
HTTP/1.1 200 OK
|
||||
...
|
||||
|
||||
执行成功后,upstream nodes 将不保留原来的数据,整个更新为:
|
||||
{
|
||||
"39.97.63.200:80": 1
|
||||
"127.0.0.1:1982": 1
|
||||
}
|
||||
|
||||
```
|
||||
@ -627,7 +627,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/upstreams/100 -H 'X-API-KEY: edd1c9f0
|
||||
{
|
||||
"type":"roundrobin",
|
||||
"nodes":{
|
||||
"39.97.63.215:80": 1
|
||||
"127.0.0.1:1980": 1
|
||||
}
|
||||
}'
|
||||
HTTP/1.1 201 Created
|
||||
@ -638,7 +638,7 @@ HTTP/1.1 201 Created
|
||||
$ curl http://127.0.0.1:9080/apisix/admin/upstreams/100 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PATCH -i -d '
|
||||
{
|
||||
"nodes": {
|
||||
"39.97.63.216:80": 1
|
||||
"127.0.0.1:1981": 1
|
||||
}
|
||||
}'
|
||||
HTTP/1.1 200 OK
|
||||
@ -646,8 +646,8 @@ HTTP/1.1 200 OK
|
||||
|
||||
执行成功后,nodes 将更新为:
|
||||
{
|
||||
"39.97.63.215:80": 1,
|
||||
"39.97.63.216:80": 1
|
||||
"127.0.0.1:1980": 1,
|
||||
"127.0.0.1:1981": 1
|
||||
}
|
||||
|
||||
|
||||
@ -655,7 +655,7 @@ HTTP/1.1 200 OK
|
||||
$ curl http://127.0.0.1:9080/apisix/admin/upstreams/100 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PATCH -i -d '
|
||||
{
|
||||
"nodes": {
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
}'
|
||||
HTTP/1.1 200 OK
|
||||
@ -663,8 +663,8 @@ HTTP/1.1 200 OK
|
||||
|
||||
执行成功后,nodes 将更新为:
|
||||
{
|
||||
"39.97.63.215:80": 1,
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1980": 1,
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
|
||||
|
||||
@ -672,7 +672,7 @@ HTTP/1.1 200 OK
|
||||
$ curl http://127.0.0.1:9080/apisix/admin/upstreams/100 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PATCH -i -d '
|
||||
{
|
||||
"nodes": {
|
||||
"39.97.63.215:80": null
|
||||
"127.0.0.1:1980": null
|
||||
}
|
||||
}'
|
||||
HTTP/1.1 200 OK
|
||||
@ -680,21 +680,21 @@ HTTP/1.1 200 OK
|
||||
|
||||
执行成功后,nodes 将更新为:
|
||||
{
|
||||
"39.97.63.216:80": 10
|
||||
"127.0.0.1:1981": 10
|
||||
}
|
||||
|
||||
|
||||
# 替换 Upstream 的 nodes
|
||||
$ curl http://127.0.0.1:9080/apisix/admin/upstreams/100/nodes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PATCH -i -d '
|
||||
{
|
||||
"39.97.63.200:80": 1
|
||||
"127.0.0.1:1982": 1
|
||||
}'
|
||||
HTTP/1.1 200 OK
|
||||
...
|
||||
|
||||
执行成功后,nodes 将不保留原来的数据,整个更新为:
|
||||
{
|
||||
"39.97.63.200:80": 1
|
||||
"127.0.0.1:1982": 1
|
||||
}
|
||||
|
||||
```
|
||||
@ -753,7 +753,7 @@ $ curl http://127.0.0.1:9080/get
|
||||
"type": "roundrobin",
|
||||
"nodes": [
|
||||
{"host": "127.0.0.1", "port": 1980, "weight": 2000},
|
||||
{"host": "127.0.0.2", "port": 1980, "weight": 1, "priority": -1}
|
||||
{"host": "127.0.0.1", "port": 1981, "weight": 1, "priority": -1}
|
||||
],
|
||||
"checks": {
|
||||
"active": {
|
||||
|
Loading…
Reference in New Issue
Block a user