You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by sp...@apache.org on 2022/08/11 01:14:20 UTC
[apisix] branch master updated: change: adjust response format for V3 feature (#7630)
This is an automated email from the ASF dual-hosted git repository.
spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new bda9ca86e change: adjust response format for V3 feature (#7630)
bda9ca86e is described below
commit bda9ca86e071cb0da7dc610cdee327277c21962f
Author: tzssangglass <tz...@gmail.com>
AuthorDate: Thu Aug 11 09:14:12 2022 +0800
change: adjust response format for V3 feature (#7630)
---
apisix/core/config_etcd.lua | 15 +++--
conf/config-default.yaml | 2 +-
docs/en/latest/admin-api.md | 2 +-
docs/en/latest/discovery.md | 2 +-
docs/en/latest/discovery/consul_kv.md | 3 +-
docs/en/latest/discovery/nacos.md | 12 ++--
docs/en/latest/getting-started.md | 1 -
docs/en/latest/internal/testing-framework.md | 2 +-
docs/en/latest/plugins/grpc-transcode.md | 2 +-
docs/en/latest/terminology/route.md | 2 +-
docs/zh/latest/admin-api.md | 2 +-
docs/zh/latest/discovery.md | 2 +-
docs/zh/latest/discovery/nacos.md | 12 ++--
docs/zh/latest/getting-started.md | 1 -
docs/zh/latest/plugins/grpc-transcode.md | 2 +-
docs/zh/latest/terminology/route.md | 2 +-
t/admin/consumers.t | 37 ++++---------
t/admin/consumers2.t | 8 +--
t/admin/global-rules.t | 46 +++++----------
t/admin/global-rules2.t | 14 ++---
t/admin/health-check.t | 3 +-
t/admin/plugin-configs.t | 46 +++++----------
t/admin/plugin-metadata.t | 41 +++++---------
t/admin/plugin-metadata2.t | 2 +-
t/admin/proto.t | 51 +++++------------
t/admin/protos.t | 13 ++---
t/admin/routes-array-nodes.t | 6 +-
t/admin/routes.t | 42 ++++----------
t/admin/routes2.t | 13 ++---
t/admin/routes3.t | 35 ++++--------
t/admin/routes4.t | 28 +++-------
t/admin/services-array-nodes.t | 6 +-
t/admin/services-string-id.t | 48 +++++-----------
t/admin/services.t | 83 +++++++++-------------------
t/admin/services2.t | 28 ++++------
t/admin/ssl.t | 75 ++++++++-----------------
t/admin/ssl2.t | 10 ++--
t/admin/ssl3.t | 2 +-
t/admin/ssls.t | 3 +-
t/admin/stream-routes.t | 39 ++++---------
t/admin/upstream-array-nodes.t | 33 +++--------
t/admin/upstream.t | 39 ++++---------
t/admin/upstream2.t | 10 ++--
t/admin/upstream3.t | 14 ++---
t/admin/upstream4.t | 53 ++++++------------
t/core/config_etcd.t | 2 +-
t/error_page/error_page.t | 8 +--
t/node/chash-hashon.t | 6 +-
t/node/upstream-domain.t | 8 +--
t/node/upstream.t | 24 ++------
t/plugin/grpc-transcode2.t | 8 +--
t/plugin/jwt-auth.t | 3 +-
t/plugin/key-auth.t | 2 +-
t/plugin/rocketmq-logger2.t | 5 +-
t/router/multi-ssl-certs.t | 9 +--
t/router/radixtree-sni.t | 21 +++----
t/router/radixtree-sni2.t | 6 +-
t/router/radixtree-uri-with-parameter.t | 6 +-
58 files changed, 326 insertions(+), 674 deletions(-)
diff --git a/apisix/core/config_etcd.lua b/apisix/core/config_etcd.lua
index 3e9776341..edb05455c 100644
--- a/apisix/core/config_etcd.lua
+++ b/apisix/core/config_etcd.lua
@@ -212,14 +212,17 @@ local function load_full_data(self, dir_res, headers)
self:upgrade_version(item.modifiedIndex)
else
- if not dir_res.nodes then
- dir_res.nodes = {}
+ -- here dir_res maybe res.body.node or res.body.list
+ -- we need make values equals to res.body.node.nodes or res.body.list
+ local values = (dir_res and dir_res.nodes) or dir_res
+ if not values then
+ values = {}
end
- self.values = new_tab(#dir_res.nodes, 0)
- self.values_hash = new_tab(0, #dir_res.nodes)
+ self.values = new_tab(#values, 0)
+ self.values_hash = new_tab(0, #values)
- for _, item in ipairs(dir_res.nodes) do
+ for _, item in ipairs(values) do
local key = short_key(self, item.key)
local data_valid = true
if type(item.value) ~= "table" then
@@ -302,7 +305,7 @@ local function sync_data(self)
return false, err
end
- local dir_res, headers = res.body.node or {}, res.headers
+ local dir_res, headers = res.body.list or {}, res.headers
log.debug("readdir key: ", self.key, " res: ",
json.delay_encode(dir_res))
if not dir_res then
diff --git a/conf/config-default.yaml b/conf/config-default.yaml
index 642d4e89d..cbada9d5e 100755
--- a/conf/config-default.yaml
+++ b/conf/config-default.yaml
@@ -85,7 +85,7 @@ apisix:
admin_ssl_cert_key: "" # Path of your self-signed server side key.
admin_ssl_ca_cert: "" # Path of your self-signed ca cert.The CA is used to sign all admin api callers' certificates.
- #admin_api_version: v3 # The version of admin api, latest version is v3.
+ admin_api_version: v3 # The version of admin api, latest version is v3.
# Default token when use API to call for Admin API.
# *NOTE*: Highly recommended to modify this value to protect APISIX's Admin API.
diff --git a/docs/en/latest/admin-api.md b/docs/en/latest/admin-api.md
index 2b695b1a1..9889c1be9 100644
--- a/docs/en/latest/admin-api.md
+++ b/docs/en/latest/admin-api.md
@@ -486,7 +486,7 @@ HTTP/1.1 200 OK
Date: Thu, 26 Dec 2019 08:17:49 GMT
...
-{"node":{"value":{"username":"jack","plugins":{"key-auth":{"key":"auth-one"},"limit-count":{"time_window":60,"count":2,"rejected_code":503,"key":"remote_addr","policy":"local"}}},"createdIndex":64,"key":"\/apisix\/consumers\/jack","modifiedIndex":64},"prevNode":{"value":"{\"username\":\"jack\",\"plugins\":{\"key-auth\":{\"key\":\"auth-one\"},\"limit-count\":{\"time_window\":60,\"count\":2,\"rejected_code\":503,\"key\":\"remote_addr\",\"policy\":\"local\"}}}","createdIndex":63,"key":"\/ap [...]
+{"node":{"value":{"username":"jack","plugins":{"key-auth":{"key":"auth-one"},"limit-count":{"time_window":60,"count":2,"rejected_code":503,"key":"remote_addr","policy":"local"}}},"createdIndex":64,"key":"\/apisix\/consumers\/jack","modifiedIndex":64},"prevNode":{"value":"{\"username\":\"jack\",\"plugins\":{\"key-auth\":{\"key\":\"auth-one\"},\"limit-count\":{\"time_window\":60,\"count\":2,\"rejected_code\":503,\"key\":\"remote_addr\",\"policy\":\"local\"}}}","createdIndex":63,"key":"\/ap [...]
```
Since `v2.2`, we can bind multiple authentication plugins to the same consumer.
diff --git a/docs/en/latest/discovery.md b/docs/en/latest/discovery.md
index eddcf03a4..cd11811e7 100644
--- a/docs/en/latest/discovery.md
+++ b/docs/en/latest/discovery.md
@@ -202,7 +202,7 @@ Transfer-Encoding: chunked
Connection: keep-alive
Server: APISIX web server
-{"node":{"value":{"uri":"\/user\/*","upstream": {"service_name": "USER-SERVICE", "type": "roundrobin", "discovery_type": "eureka"}},"createdIndex":61925,"key":"\/apisix\/routes\/1","modifiedIndex":61925},"action":"create"}
+{"node":{"value":{"uri":"\/user\/*","upstream": {"service_name": "USER-SERVICE", "type": "roundrobin", "discovery_type": "eureka"}},"createdIndex":61925,"key":"\/apisix\/routes\/1","modifiedIndex":61925}}
```
Because the upstream interface URL may have conflict, usually in the gateway by prefix to distinguish:
diff --git a/docs/en/latest/discovery/consul_kv.md b/docs/en/latest/discovery/consul_kv.md
index 7826c66b7..e4dbde39b 100644
--- a/docs/en/latest/discovery/consul_kv.md
+++ b/docs/en/latest/discovery/consul_kv.md
@@ -166,8 +166,7 @@ The format response as below:
"status": 1
},
"key": "/apisix/routes/1"
- },
- "action": "set"
+ }
}
```
diff --git a/docs/en/latest/discovery/nacos.md b/docs/en/latest/discovery/nacos.md
index a35a2ac28..6974ea43f 100644
--- a/docs/en/latest/discovery/nacos.md
+++ b/docs/en/latest/discovery/nacos.md
@@ -92,8 +92,7 @@ The formatted response as below:
"priority": 0,
"uri": "\/nacos\/*"
}
- },
- "action": "set"
+ }
}
```
@@ -148,8 +147,7 @@ The formatted response as below:
"priority": 0,
"uri": "\/nacosWithNamespaceId\/*"
}
- },
- "action": "set"
+ }
}
```
@@ -197,8 +195,7 @@ The formatted response as below:
"priority": 0,
"uri": "\/nacosWithGroupName\/*"
}
- },
- "action": "set"
+ }
}
```
@@ -248,7 +245,6 @@ The formatted response as below:
"priority": 0,
"uri": "\/nacosWithNamespaceIdAndGroupName\/*"
}
- },
- "action": "set"
+ }
}
```
diff --git a/docs/en/latest/getting-started.md b/docs/en/latest/getting-started.md
index 8b393fcc8..050d6ae0c 100644
--- a/docs/en/latest/getting-started.md
+++ b/docs/en/latest/getting-started.md
@@ -189,7 +189,6 @@ This response indicates that APISIX is running successfully:
```json
{
"count":0,
- "action":"get",
"node":{
"key":"/apisix/services",
"nodes":[],
diff --git a/docs/en/latest/internal/testing-framework.md b/docs/en/latest/internal/testing-framework.md
index 36dd31d6e..555153493 100644
--- a/docs/en/latest/internal/testing-framework.md
+++ b/docs/en/latest/internal/testing-framework.md
@@ -351,7 +351,7 @@ ONLY:
--- config
...
--- response_body
-{"action":"get","count":0,"node":{"dir":true,"key":"/apisix/upstreams","nodes":[]}}
+{"count":0,"node":{"dir":true,"key":"/apisix/upstreams","nodes":[]}}
```
### Executing Shell Commands
diff --git a/docs/en/latest/plugins/grpc-transcode.md b/docs/en/latest/plugins/grpc-transcode.md
index de7699a25..21c6e42a1 100644
--- a/docs/en/latest/plugins/grpc-transcode.md
+++ b/docs/en/latest/plugins/grpc-transcode.md
@@ -145,7 +145,7 @@ Response:
```
# 200
-# {"node":{"value":{"create_time":1643879753,"update_time":1643883085,"content":"CmgKEnByb3RvL2ltcG9ydC5wcm90bxIDcGtnIhoKBFVzZXISEgoEbmFtZRgBIAEoCVIEbmFtZSIeCghSZXNwb25zZRISCgRib2R5GAEgASgJUgRib2R5QglaBy4vcHJvdG9iBnByb3RvMwq9AQoPcHJvdG8vc3JjLnByb3RvEgpoZWxsb3dvcmxkGhJwcm90by9pbXBvcnQucHJvdG8iPAoHUmVxdWVzdBIdCgR1c2VyGAEgASgLMgkucGtnLlVzZXJSBHVzZXISEgoEYm9keRgCIAEoCVIEYm9keTI5CgpUZXN0SW1wb3J0EisKA1J1bhITLmhlbGxvd29ybGQuUmVxdWVzdBoNLnBrZy5SZXNwb25zZSIAQglaBy4vcHJvdG9iBnByb3RvMw=="},"key":"\ [...]
+# {"node":{"value":{"create_time":1643879753,"update_time":1643883085,"content":"CmgKEnByb3RvL2ltcG9ydC5wcm90bxIDcGtnIhoKBFVzZXISEgoEbmFtZRgBIAEoCVIEbmFtZSIeCghSZXNwb25zZRISCgRib2R5GAEgASgJUgRib2R5QglaBy4vcHJvdG9iBnByb3RvMwq9AQoPcHJvdG8vc3JjLnByb3RvEgpoZWxsb3dvcmxkGhJwcm90by9pbXBvcnQucHJvdG8iPAoHUmVxdWVzdBIdCgR1c2VyGAEgASgLMgkucGtnLlVzZXJSBHVzZXISEgoEYm9keRgCIAEoCVIEYm9keTI5CgpUZXN0SW1wb3J0EisKA1J1bhITLmhlbGxvd29ybGQuUmVxdWVzdBoNLnBrZy5SZXNwb25zZSIAQglaBy4vcHJvdG9iBnByb3RvMw=="},"key":"\ [...]
```
Now, we can enable the `grpc-transcode` Plugin to a specific Route:
diff --git a/docs/en/latest/terminology/route.md b/docs/en/latest/terminology/route.md
index 685c8ce25..0641ce333 100644
--- a/docs/en/latest/terminology/route.md
+++ b/docs/en/latest/terminology/route.md
@@ -66,7 +66,7 @@ Transfer-Encoding: chunked
Connection: keep-alive
Server: APISIX web server
-{"node":{"value":{"uri":"\/index.html","upstream":{"nodes":{"127.0.0.1:1980":1},"type":"roundrobin"}},"createdIndex":61925,"key":"\/apisix\/routes\/1","modifiedIndex":61925},"action":"create"}
+{"node":{"value":{"uri":"\/index.html","upstream":{"nodes":{"127.0.0.1:1980":1},"type":"roundrobin"}},"createdIndex":61925,"key":"\/apisix\/routes\/1","modifiedIndex":61925}}
```
A successful response indicates that the route was created.
diff --git a/docs/zh/latest/admin-api.md b/docs/zh/latest/admin-api.md
index 9462cdfb9..7f7668e23 100644
--- a/docs/zh/latest/admin-api.md
+++ b/docs/zh/latest/admin-api.md
@@ -496,7 +496,7 @@ HTTP/1.1 200 OK
Date: Thu, 26 Dec 2019 08:17:49 GMT
...
-{"node":{"value":{"username":"jack","plugins":{"key-auth":{"key":"auth-one"},"limit-count":{"time_window":60,"count":2,"rejected_code":503,"key":"remote_addr","policy":"local"}}},"createdIndex":64,"key":"\/apisix\/consumers\/jack","modifiedIndex":64},"prevNode":{"value":"{\"username\":\"jack\",\"plugins\":{\"key-auth\":{\"key\":\"auth-one\"},\"limit-count\":{\"time_window\":60,\"count\":2,\"rejected_code\":503,\"key\":\"remote_addr\",\"policy\":\"local\"}}}","createdIndex":63,"key":"\/ap [...]
+{"node":{"value":{"username":"jack","plugins":{"key-auth":{"key":"auth-one"},"limit-count":{"time_window":60,"count":2,"rejected_code":503,"key":"remote_addr","policy":"local"}}},"createdIndex":64,"key":"\/apisix\/consumers\/jack","modifiedIndex":64},"prevNode":{"value":"{\"username\":\"jack\",\"plugins\":{\"key-auth\":{\"key\":\"auth-one\"},\"limit-count\":{\"time_window\":60,\"count\":2,\"rejected_code\":503,\"key\":\"remote_addr\",\"policy\":\"local\"}}}","createdIndex":63,"key":"\/ap [...]
```
从 `v2.2` 版本之后,同一个 consumer 可以绑定多个认证插件。
diff --git a/docs/zh/latest/discovery.md b/docs/zh/latest/discovery.md
index 6271334ff..178989d6a 100644
--- a/docs/zh/latest/discovery.md
+++ b/docs/zh/latest/discovery.md
@@ -206,7 +206,7 @@ Transfer-Encoding: chunked
Connection: keep-alive
Server: APISIX web server
-{"node":{"value":{"uri":"\/user\/*","upstream": {"service_name": "USER-SERVICE", "type": "roundrobin", "discovery_type": "eureka"}},"createdIndex":61925,"key":"\/apisix\/routes\/1","modifiedIndex":61925},"action":"create"}
+{"node":{"value":{"uri":"\/user\/*","upstream": {"service_name": "USER-SERVICE", "type": "roundrobin", "discovery_type": "eureka"}},"createdIndex":61925,"key":"\/apisix\/routes\/1","modifiedIndex":61925}}
```
因为上游的接口 URL 可能会有冲突,通常会在网关通过前缀来进行区分:
diff --git a/docs/zh/latest/discovery/nacos.md b/docs/zh/latest/discovery/nacos.md
index 3d0e927ee..6a0571757 100644
--- a/docs/zh/latest/discovery/nacos.md
+++ b/docs/zh/latest/discovery/nacos.md
@@ -93,8 +93,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f
"priority": 0,
"uri": "\/nacos\/*"
}
- },
- "action": "set"
+ }
}
```
@@ -150,8 +149,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/2 -H 'X-API-KEY: edd1c9f034335f
"priority": 0,
"uri": "\/nacosWithNamespaceId\/*"
}
- },
- "action": "set"
+ }
}
```
@@ -200,8 +198,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/3 -H 'X-API-KEY: edd1c9f034335f
"priority": 0,
"uri": "\/nacosWithGroupName\/*"
}
- },
- "action": "set"
+ }
}
```
@@ -252,7 +249,6 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/4 -H 'X-API-KEY: edd1c9f034335f
"priority": 0,
"uri": "\/nacosWithNamespaceIdAndGroupName\/*"
}
- },
- "action": "set"
+ }
}
```
diff --git a/docs/zh/latest/getting-started.md b/docs/zh/latest/getting-started.md
index b40736269..68f014979 100644
--- a/docs/zh/latest/getting-started.md
+++ b/docs/zh/latest/getting-started.md
@@ -182,7 +182,6 @@ curl "http://127.0.0.1:9080/apisix/admin/services/" -H 'X-API-KEY: edd1c9f034335
```json
{
"count":0,
- "action":"get",
"node":{
"key":"/apisix/services",
"nodes":[],
diff --git a/docs/zh/latest/plugins/grpc-transcode.md b/docs/zh/latest/plugins/grpc-transcode.md
index ec2337952..0dfb352cc 100644
--- a/docs/zh/latest/plugins/grpc-transcode.md
+++ b/docs/zh/latest/plugins/grpc-transcode.md
@@ -143,7 +143,7 @@ chmod +x ./upload_pb.py
```
# 200
-# {"node":{"value":{"create_time":1643879753,"update_time":1643883085,"content":"CmgKEnByb3RvL2ltcG9ydC5wcm90bxIDcGtnIhoKBFVzZXISEgoEbmFtZRgBIAEoCVIEbmFtZSIeCghSZXNwb25zZRISCgRib2R5GAEgASgJUgRib2R5QglaBy4vcHJvdG9iBnByb3RvMwq9AQoPcHJvdG8vc3JjLnByb3RvEgpoZWxsb3dvcmxkGhJwcm90by9pbXBvcnQucHJvdG8iPAoHUmVxdWVzdBIdCgR1c2VyGAEgASgLMgkucGtnLlVzZXJSBHVzZXISEgoEYm9keRgCIAEoCVIEYm9keTI5CgpUZXN0SW1wb3J0EisKA1J1bhITLmhlbGxvd29ybGQuUmVxdWVzdBoNLnBrZy5SZXNwb25zZSIAQglaBy4vcHJvdG9iBnByb3RvMw=="},"key":"\ [...]
+# {"node":{"value":{"create_time":1643879753,"update_time":1643883085,"content":"CmgKEnByb3RvL2ltcG9ydC5wcm90bxIDcGtnIhoKBFVzZXISEgoEbmFtZRgBIAEoCVIEbmFtZSIeCghSZXNwb25zZRISCgRib2R5GAEgASgJUgRib2R5QglaBy4vcHJvdG9iBnByb3RvMwq9AQoPcHJvdG8vc3JjLnByb3RvEgpoZWxsb3dvcmxkGhJwcm90by9pbXBvcnQucHJvdG8iPAoHUmVxdWVzdBIdCgR1c2VyGAEgASgLMgkucGtnLlVzZXJSBHVzZXISEgoEYm9keRgCIAEoCVIEYm9keTI5CgpUZXN0SW1wb3J0EisKA1J1bhITLmhlbGxvd29ybGQuUmVxdWVzdBoNLnBrZy5SZXNwb25zZSIAQglaBy4vcHJvdG9iBnByb3RvMw=="},"key":"\ [...]
```
现在我们可以在指定路由中启用 `grpc-transcode` 插件:
diff --git a/docs/zh/latest/terminology/route.md b/docs/zh/latest/terminology/route.md
index 161fc0bb9..eab4786c1 100644
--- a/docs/zh/latest/terminology/route.md
+++ b/docs/zh/latest/terminology/route.md
@@ -53,7 +53,7 @@ Transfer-Encoding: chunked
Connection: keep-alive
Server: APISIX web server
-{"node":{"value":{"uri":"\/index.html","upstream":{"nodes":{"127.0.0.1:1980":1},"type":"roundrobin"}},"createdIndex":61925,"key":"\/apisix\/routes\/1","modifiedIndex":61925},"action":"create"}
+{"node":{"value":{"uri":"\/index.html","upstream":{"nodes":{"127.0.0.1:1980":1},"type":"roundrobin"}},"createdIndex":61925,"key":"\/apisix\/routes\/1","modifiedIndex":61925}}
```
当我们接收到成功应答,表示该 Route 已成功创建。
diff --git a/t/admin/consumers.t b/t/admin/consumers.t
index 9ba284b3e..b4ccb7818 100644
--- a/t/admin/consumers.t
+++ b/t/admin/consumers.t
@@ -43,8 +43,7 @@ __DATA__
"username": "jack",
"desc": "new consumer"
}
- },
- "action": "set"
+ }
}]]
)
@@ -96,8 +95,7 @@ passed
}
}
}
- },
- "action": "set"
+ }
}]]
)
@@ -139,8 +137,7 @@ passed
}
}
}
- },
- "action": "get"
+ }
}]]
)
@@ -164,10 +161,8 @@ passed
ngx.sleep(0.3)
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/consumers/jack',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.status = code
ngx.say(body)
@@ -189,11 +184,8 @@ passed
local t = require("lib.test_admin").test
local code = t('/apisix/admin/consumers/not_found',
ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ nil
+ )
ngx.say("[delete] code: ", code)
}
}
@@ -221,8 +213,7 @@ GET /t
"value": {
"id": "jack"
}
- },
- "action": "set"
+ }
}]]
)
@@ -267,8 +258,7 @@ GET /t
"version":"v2"
}
}
- },
- "action": "set"
+ }
}]]
)
@@ -360,8 +350,7 @@ GET /t
"create_time": 1602883670,
"update_time": 1602893670
}
- },
- "action": "set"
+ }
}]]
)
@@ -385,10 +374,8 @@ passed
ngx.sleep(0.3)
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/consumers/pony',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.status = code
ngx.say(body)
diff --git a/t/admin/consumers2.t b/t/admin/consumers2.t
index 3c296b793..da1f4028b 100644
--- a/t/admin/consumers2.t
+++ b/t/admin/consumers2.t
@@ -65,7 +65,7 @@ __DATA__
}
}
--- response_body
-{"action":"set","node":{"key":"/apisix/consumers/jack","value":{"username":"jack"}}}
+{"node":{"key":"/apisix/consumers/jack","value":{"username":"jack"}}}
@@ -98,7 +98,7 @@ __DATA__
}
}
--- response_body
-{"action":"get","node":{"key":"/apisix/consumers/jack","value":{"username":"jack"}}}
+{"node":{"key":"/apisix/consumers/jack","value":{"username":"jack"}}}
@@ -124,7 +124,7 @@ __DATA__
}
}
--- response_body
-{"action":"delete","deleted":"1","key":"/apisix/consumers/jack","node":{}}
+{"deleted":"1","key":"/apisix/consumers/jack","node":{}}
@@ -150,7 +150,7 @@ __DATA__
}
}
--- response_body
-{"action":"get","count":0,"node":{"dir":true,"key":"/apisix/consumers","nodes":[]}}
+{"count":0,"list":[]}
diff --git a/t/admin/global-rules.t b/t/admin/global-rules.t
index b153aeee1..65d177ece 100644
--- a/t/admin/global-rules.t
+++ b/t/admin/global-rules.t
@@ -57,8 +57,7 @@ __DATA__
}
},
"key": "/apisix/global_rules/1"
- },
- "action": "set"
+ }
}]]
)
@@ -102,8 +101,7 @@ passed
}
},
"key": "/apisix/global_rules/1"
- },
- "action": "get"
+ }
}]]
)
@@ -129,9 +127,8 @@ passed
ngx.HTTP_GET,
nil,
[[{
- "node": {
- "dir": true,
- "nodes": [
+ "count": 1,
+ "list": [
{
"key": "/apisix/global_rules/1",
"value": {
@@ -146,10 +143,7 @@ passed
}
}
}
- ],
- "key": "/apisix/global_rules"
- },
- "action": "get"
+ ]
}]]
)
@@ -203,8 +197,7 @@ passed
}
},
"key": "/apisix/global_rules/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -264,8 +257,7 @@ passed
}
},
"key": "/apisix/global_rules/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -295,12 +287,8 @@ passed
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/global_rules/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -319,12 +307,8 @@ GET /t
content_by_lua_block {
local t = require("lib.test_admin").test
local code = t('/apisix/admin/global_rules/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code)
}
}
@@ -447,7 +431,7 @@ passed
}
}
--- response_body
-{"action":"set","node":{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"uri":"/","use_real_request_uri_unsafe":false}}}}}
+{"node":{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"uri":"/","use_real_request_uri_unsafe":false}}}}}
--- request
GET /t
--- no_error_log
@@ -485,7 +469,7 @@ GET /t
}
}
--- response_body
-{"action":"compareAndSwap","node":{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"uri":"/","use_real_request_uri_unsafe":false}}}}}
+{"node":{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"uri":"/","use_real_request_uri_unsafe":false}}}}}
--- request
GET /t
--- no_error_log
@@ -521,7 +505,7 @@ GET /t
}
}
--- response_body
-{"action":"get","node":{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"uri":"/","use_real_request_uri_unsafe":false}}}}}
+{"node":{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"uri":"/","use_real_request_uri_unsafe":false}}}}}
--- request
GET /t
--- no_error_log
@@ -550,7 +534,7 @@ GET /t
}
}
--- response_body
-{"action":"delete","deleted":"1","key":"/apisix/global_rules/1","node":{}}
+{"deleted":"1","key":"/apisix/global_rules/1","node":{}}
--- request
GET /t
--- no_error_log
diff --git a/t/admin/global-rules2.t b/t/admin/global-rules2.t
index b84a80123..56d395031 100644
--- a/t/admin/global-rules2.t
+++ b/t/admin/global-rules2.t
@@ -60,7 +60,7 @@ __DATA__
}
}
--- response_body
-{"action":"get","count":0,"node":{"dir":true,"key":"/apisix/global_rules","nodes":[]}}
+{"count":0,"list":[]}
@@ -94,7 +94,7 @@ __DATA__
}
}
--- response_body
-{"action":"set","node":{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"uri":"/","use_real_request_uri_unsafe":false}}}}}
+{"node":{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"uri":"/","use_real_request_uri_unsafe":false}}}}}
@@ -120,7 +120,7 @@ __DATA__
}
}
--- response_body_like
-{"action":"get","count":1,"node":\{"dir":true,"key":"/apisix/global_rules","nodes":.*
+{"count":1,"list":[{"createdIndex":\d+,"key":"/apisix/global_rules/1".*
@@ -130,12 +130,8 @@ __DATA__
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/global_rules/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
diff --git a/t/admin/health-check.t b/t/admin/health-check.t
index d26e92428..6484e771b 100644
--- a/t/admin/health-check.t
+++ b/t/admin/health-check.t
@@ -46,8 +46,7 @@ add_block_preprocessor(sub {
node = {
value = req_data,
key = "/apisix/routes/1",
- },
- action = "set",
+ }
}
_EOC_
diff --git a/t/admin/plugin-configs.t b/t/admin/plugin-configs.t
index 1f0da8a2a..344224cec 100644
--- a/t/admin/plugin-configs.t
+++ b/t/admin/plugin-configs.t
@@ -69,8 +69,7 @@ __DATA__
}
},
"key": "/apisix/plugin_configs/1"
- },
- "action": "set"
+ }
}]]
)
@@ -110,8 +109,7 @@ passed
}
},
"key": "/apisix/plugin_configs/1"
- },
- "action": "get"
+ }
}]]
)
@@ -133,9 +131,8 @@ passed
ngx.HTTP_GET,
nil,
[[{
- "node": {
- "dir": true,
- "nodes": [
+ "count": 1,
+ "list": [
{
"key": "/apisix/plugin_configs/1",
"value": {
@@ -150,10 +147,7 @@ passed
}
}
}
- ],
- "key": "/apisix/plugin_configs"
- },
- "action": "get"
+ ]
}]]
)
@@ -203,8 +197,7 @@ passed
}
},
"key": "/apisix/plugin_configs/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -260,8 +253,7 @@ passed
}
},
"key": "/apisix/plugin_configs/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -348,8 +340,7 @@ passed
"desc": "blah"
},
"key": "/apisix/plugin_configs/1"
- },
- "action": "set"
+ }
}]]
)
@@ -393,8 +384,7 @@ passed
"desc": "blah"
},
"key": "/apisix/plugin_configs/1"
- },
- "action": "get"
+ }
}]]
)
@@ -502,10 +492,8 @@ passed
ngx.sleep(0.3)
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/plugin_configs/1',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.print(body)
}
}
@@ -521,10 +509,8 @@ passed
ngx.sleep(0.3)
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/routes/1',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say(body)
}
}
@@ -540,10 +526,8 @@ passed
ngx.sleep(0.3)
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/plugin_configs/1',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say(body)
}
}
diff --git a/t/admin/plugin-metadata.t b/t/admin/plugin-metadata.t
index 5dccf2c0c..8f4622a23 100644
--- a/t/admin/plugin-metadata.t
+++ b/t/admin/plugin-metadata.t
@@ -43,8 +43,7 @@ __DATA__
"skey": "val",
"ikey": 1
}
- },
- "action": "set"
+ }
}]]
)
@@ -78,8 +77,7 @@ passed
"skey": "val2",
"ikey": 2
}
- },
- "action": "set"
+ }
}]]
)
@@ -99,8 +97,7 @@ passed
"skey": "val2",
"ikey": 2
}
- },
- "action": "set"
+ }
}]]
)
@@ -133,8 +130,7 @@ passed
"skey": "val2",
"ikey": 2
}
- },
- "action": "get"
+ }
}]]
)
@@ -158,10 +154,8 @@ passed
ngx.sleep(0.3)
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/plugin_metadata/example-plugin',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.status = code
ngx.say(body)
@@ -182,12 +176,8 @@ passed
content_by_lua_block {
local t = require("lib.test_admin").test
local code = t('/apisix/admin/plugin_metadata/not_found',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code)
}
}
@@ -211,8 +201,7 @@ GET /t
[[{
"node": {
"value": "sdf"
- },
- "action": "set"
+ }
}]]
)
@@ -241,8 +230,7 @@ GET /t
[[{
"node": {
"value": "sdf"
- },
- "action": "set"
+ }
}]]
)
@@ -276,8 +264,7 @@ GET /t
"skey": "val",
"ikey": 1
}
- },
- "action": "set"
+ }
}]]
)
@@ -322,7 +309,7 @@ qr/\{"error_msg":"invalid configuration: property \\"ikey\\" is required"\}/
}
}
--- response_body
-{"action":"set","node":{"key":"/apisix/plugin_metadata/example-plugin","value":{"ikey":1,"skey":"val"}}}
+{"node":{"key":"/apisix/plugin_metadata/example-plugin","value":{"ikey":1,"skey":"val"}}}
--- request
GET /t
--- no_error_log
@@ -354,7 +341,7 @@ GET /t
}
}
--- response_body
-{"action":"get","node":{"key":"/apisix/plugin_metadata/example-plugin","value":{"ikey":1,"skey":"val"}}}
+{"node":{"key":"/apisix/plugin_metadata/example-plugin","value":{"ikey":1,"skey":"val"}}}
--- request
GET /t
--- no_error_log
@@ -383,7 +370,7 @@ GET /t
}
}
--- response_body
-{"action":"delete","deleted":"1","key":"/apisix/plugin_metadata/example-plugin","node":{}}
+{"deleted":"1","key":"/apisix/plugin_metadata/example-plugin","node":{}}
--- request
GET /t
--- no_error_log
diff --git a/t/admin/plugin-metadata2.t b/t/admin/plugin-metadata2.t
index 190b9ae20..26e348cc9 100644
--- a/t/admin/plugin-metadata2.t
+++ b/t/admin/plugin-metadata2.t
@@ -60,4 +60,4 @@ __DATA__
}
}
--- response_body
-{"action":"get","count":0,"node":{"dir":true,"key":"/apisix/plugin_metadata","nodes":[]}}
+{"count":0,"list":[]}
diff --git a/t/admin/proto.t b/t/admin/proto.t
index 0a41f8001..0e9cc7427 100644
--- a/t/admin/proto.t
+++ b/t/admin/proto.t
@@ -61,15 +61,10 @@ __DATA__
// Sends a greeting
rpc SayHi (HelloRequest) returns (HelloResponse){}
}"
- }]],
- [[
- {
- "action": "set"
- }
- ]]
- )
+ }]]
+ )
- if code ~= 200 then
+ if code ~= 201 then
ngx.status = code
ngx.say("[put proto] code: ", code, " message: ", message)
return
@@ -79,7 +74,7 @@ __DATA__
}
}
--- response_body
-[put proto] code: 200 message: passed
+[put proto] code: 201 message: passed
@@ -89,12 +84,8 @@ __DATA__
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/protos/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
if code ~= 200 then
ngx.status = code
@@ -133,15 +124,10 @@ __DATA__
// Sends a greeting
rpc SayHi (HelloRequest) returns (HelloResponse){}
}"
- }]],
- [[
- {
- "action": "set"
- }
- ]]
- )
+ }]]
+ )
- if code ~= 200 then
+ if code ~= 201 then
ngx.status = code
ngx.say("[put proto] code: ", code, " message: ", message)
return
@@ -169,13 +155,10 @@ __DATA__
},
"uri": "/grpc/sayhi",
"name": "hi-grpc"
- }]],
- [[{
- "action": "set"
}]]
- )
+ )
- if code ~= 200 then
+ if code ~= 201 then
ngx.status = code
ngx.say("[route refer proto] code: ", code, " message: ", message)
return
@@ -185,19 +168,15 @@ __DATA__
ngx.sleep(0.1) -- ensure reference is synced from etcd
code, message = t('/apisix/admin/protos/2',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete proto] code: ", code)
}
}
--- response_body
-[put proto] code: 200 message: passed
-[route refer proto] code: 200 message: passed
+[put proto] code: 201 message: passed
+[route refer proto] code: 201 message: passed
[delete proto] code: 400
diff --git a/t/admin/protos.t b/t/admin/protos.t
index 6265020e4..320c6179e 100644
--- a/t/admin/protos.t
+++ b/t/admin/protos.t
@@ -61,15 +61,10 @@ __DATA__
// Sends a greeting
rpc SayHi (HelloRequest) returns (HelloResponse){}
}"
- }]],
- [[
- {
- "action": "set"
- }
- ]]
- )
+ }]]
+ )
- if code ~= 200 then
+ if code ~= 201 then
ngx.status = code
ngx.say("[put proto] code: ", code, " message: ", message)
return
@@ -79,4 +74,4 @@ __DATA__
}
}
--- response_body
-[put proto] code: 200 message: passed
+[put proto] code: 201 message: passed
diff --git a/t/admin/routes-array-nodes.t b/t/admin/routes-array-nodes.t
index c9b141883..0aa7e3211 100644
--- a/t/admin/routes-array-nodes.t
+++ b/t/admin/routes-array-nodes.t
@@ -64,8 +64,7 @@ __DATA__
}
},
"key": "/apisix/routes/1"
- },
- "action": "set"
+ }
}]]
)
@@ -108,8 +107,7 @@ passed
}
},
"key": "/apisix/routes/1"
- },
- "action": "get"
+ }
}]]
)
diff --git a/t/admin/routes.t b/t/admin/routes.t
index a16ccdbdf..febfdc446 100644
--- a/t/admin/routes.t
+++ b/t/admin/routes.t
@@ -60,8 +60,7 @@ __DATA__
}
},
"key": "/apisix/routes/1"
- },
- "action": "set"
+ }
}]]
)
@@ -102,8 +101,7 @@ passed
}
},
"key": "/apisix/routes/1"
- },
- "action": "get"
+ }
}]]
)
@@ -126,12 +124,8 @@ passed
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/routes/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -150,12 +144,8 @@ GET /t
content_by_lua_block {
local t = require("lib.test_admin").test
local code = t('/apisix/admin/routes/not_found',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code)
}
}
@@ -200,8 +190,7 @@ GET /t
"type": "roundrobin"
}
}
- },
- "action": "create"
+ }
}]]
)
@@ -221,12 +210,8 @@ GET /t
assert(update_time ~= nil, "update_time is nil")
code, message = t('/apisix/admin/routes/' .. id,
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -269,8 +254,7 @@ GET /t
"type": "roundrobin"
}
}
- },
- "action": "set"
+ }
}]]
)
@@ -330,8 +314,7 @@ GET /t
}
}
}
- },
- "action": "set"
+ }
}]]
)
@@ -726,8 +709,7 @@ GET /t
}
},
"key": "/apisix/routes/1"
- },
- "action": "set"
+ }
}]]
)
diff --git a/t/admin/routes2.t b/t/admin/routes2.t
index 42cbc805b..4c9393e88 100644
--- a/t/admin/routes2.t
+++ b/t/admin/routes2.t
@@ -205,7 +205,7 @@ GET /t
--- request
GET /t
--- response_body
-{"action":"create","node":{"value":{"methods":["GET"],"priority":0,"status":1,"upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"},"uri":"/not_unwanted_data_post"}}}
+{"node":{"value":{"methods":["GET"],"priority":0,"status":1,"upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"},"uri":"/not_unwanted_data_post"}}}
--- no_error_log
[error]
@@ -247,7 +247,7 @@ GET /t
--- request
GET /t
--- response_body
-{"action":"set","node":{"key":"/apisix/routes/1","value":{"id":1,"methods":["GET"],"priority":0,"status":1,"upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"},"uri":"/index.html"}}}
+{"node":{"key":"/apisix/routes/1","value":{"id":1,"methods":["GET"],"priority":0,"status":1,"upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"},"uri":"/index.html"}}}
--- no_error_log
[error]
@@ -288,7 +288,7 @@ GET /t
--- request
GET /t
--- response_body
-{"action":"compareAndSwap","node":{"key":"/apisix/routes/1","value":{"id":"1","methods":["GET"],"priority":0,"status":1,"upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"},"uri":"/index"}}}
+{"node":{"key":"/apisix/routes/1","value":{"id":"1","methods":["GET"],"priority":0,"status":1,"upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"},"uri":"/index"}}}
--- no_error_log
[error]
@@ -324,7 +324,7 @@ GET /t
--- request
GET /t
--- response_body
-{"action":"get","node":{"key":"/apisix/routes/1","value":{"id":"1","methods":["GET"],"priority":0,"status":1,"upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"},"uri":"/index"}}}
+{"node":{"key":"/apisix/routes/1","value":{"id":"1","methods":["GET"],"priority":0,"status":1,"upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"},"uri":"/index"}}}
--- no_error_log
[error]
@@ -353,7 +353,7 @@ GET /t
--- request
GET /t
--- response_body
-{"action":"delete","deleted":"1","key":"/apisix/routes/1","node":{}}
+{"deleted":"1","key":"/apisix/routes/1","node":{}}
--- no_error_log
[error]
@@ -567,8 +567,7 @@ GET /t
}
},
"key": "/apisix/routes/1"
- },
- "action": "set"
+ }
}]]
)
diff --git a/t/admin/routes3.t b/t/admin/routes3.t
index 60e4d4134..d178aa133 100644
--- a/t/admin/routes3.t
+++ b/t/admin/routes3.t
@@ -60,7 +60,7 @@ __DATA__
}
}
--- response_body
-{"action":"get","count":0,"node":{"dir":true,"key":"/apisix/routes","nodes":[]}}
+{"count":0,"list":[]}
@@ -94,8 +94,7 @@ __DATA__
"uri": "/index.html"
},
"key": "/apisix/routes/1"
- },
- "action": "set"
+ }
}]]
)
@@ -140,8 +139,7 @@ passed
"uri": "/index.html"
},
"key": "/apisix/routes/1"
- },
- "action": "set"
+ }
}]]
)
@@ -240,8 +238,7 @@ passed
"uri": "/patch_test"
},
"key": "/apisix/routes/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -293,8 +290,7 @@ passed
}
},
"key": "/apisix/routes/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -323,8 +319,7 @@ passed
"methods": ["GET", "DELETE", "PATCH", "POST", "PUT"]
},
"key": "/apisix/routes/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -353,8 +348,7 @@ passed
"methods": ["GET", "POST"]
},
"key": "/apisix/routes/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -383,8 +377,7 @@ passed
]
},
"key": "/apisix/routes/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -411,8 +404,7 @@ passed
"uri": "/patch_uri_test"
},
"key": "/apisix/routes/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -459,8 +451,7 @@ passed
}
},
"key": "/apisix/routes/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -743,8 +734,7 @@ passed
"enable_websocket": false
},
"key": "/apisix/routes/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -771,8 +761,7 @@ passed
"enable_websocket": true
},
"key": "/apisix/routes/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
diff --git a/t/admin/routes4.t b/t/admin/routes4.t
index 158d6ad6b..e71300073 100644
--- a/t/admin/routes4.t
+++ b/t/admin/routes4.t
@@ -119,7 +119,7 @@ location /t {
},
"uri": "/index.html"
}]],
- [[{"action": "create"}]]
+ [[{}]]
)
if code >= 300 then
@@ -203,8 +203,7 @@ location /t {
"priority": 0
},
"key": "/apisix/routes/1"
- },
- "action": "set"
+ }
}]]
)
@@ -242,8 +241,7 @@ passed
"priority": 1
},
"key": "/apisix/routes/1"
- },
- "action": "set"
+ }
}]]
)
@@ -394,8 +392,7 @@ passed
"name": "test name"
},
"key": "/apisix/routes/1"
- },
- "action": "set"
+ }
}]]
)
@@ -683,8 +680,7 @@ failed to read request body: request size 1678025 is greater than the maximum si
}
},
"key": "/apisix/routes/1"
- },
- "action": "set"
+ }
}]]
)
@@ -729,8 +725,7 @@ passed
}
},
"key": "/apisix/routes/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -801,8 +796,7 @@ passed
"update_time": 1602893670
},
"key": "/apisix/routes/1"
- },
- "action": "set"
+ }
}]]
)
@@ -821,12 +815,8 @@ passed
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/routes/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
diff --git a/t/admin/services-array-nodes.t b/t/admin/services-array-nodes.t
index 7ca2c6cb5..fb70045fe 100644
--- a/t/admin/services-array-nodes.t
+++ b/t/admin/services-array-nodes.t
@@ -58,8 +58,7 @@ __DATA__
"desc": "new service"
},
"key": "/apisix/services/1"
- },
- "action": "set"
+ }
}]]
)
@@ -98,8 +97,7 @@ passed
"desc": "new service"
},
"key": "/apisix/services/1"
- },
- "action": "get"
+ }
}]]
)
diff --git a/t/admin/services-string-id.t b/t/admin/services-string-id.t
index 15160c5a6..5f7e8a916 100644
--- a/t/admin/services-string-id.t
+++ b/t/admin/services-string-id.t
@@ -54,8 +54,7 @@ __DATA__
"desc": "new service"
},
"key": "/apisix/services/5eeb3dc90f747328b2930b0b"
- },
- "action": "set"
+ }
}]]
)
@@ -92,8 +91,7 @@ passed
"desc": "new service"
},
"key": "/apisix/services/5eeb3dc90f747328b2930b0b"
- },
- "action": "get"
+ }
}]]
)
@@ -116,12 +114,8 @@ passed
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/services/5eeb3dc90f747328b2930b0b',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -140,12 +134,8 @@ GET /t
content_by_lua_block {
local t = require("lib.test_admin").test
local code = t('/apisix/admin/services/not_found',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code)
}
@@ -184,8 +174,7 @@ GET /t
"type": "roundrobin"
}
}
- },
- "action": "create"
+ }
}]]
)
@@ -199,12 +188,8 @@ GET /t
local id = string.sub(res.node.key, #"/apisix/services/" + 1)
code, message = t('/apisix/admin/services/' .. id,
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -244,8 +229,7 @@ GET /t
"type": "roundrobin"
}
}
- },
- "action": "set"
+ }
}]]
)
@@ -297,8 +281,7 @@ GET /t
}
}
}
- },
- "action": "set"
+ }
}]]
)
@@ -394,8 +377,7 @@ GET /t
"plugins": {}
},
"key": "/apisix/services/5eeb3dc90f747328b2930b0b"
- },
- "action": "set"
+ }
}]]
)
@@ -601,8 +583,7 @@ GET /t
"desc": "new 20 service"
},
"key": "/apisix/services/5eeb3dc90f747328b2930b0b"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -641,8 +622,7 @@ passed
"desc": "new 19 service"
},
"key": "/apisix/services/5eeb3dc90f747328b2930b0b"
- },
- "action": "compareAndSwap"
+ }
}]]
)
diff --git a/t/admin/services.t b/t/admin/services.t
index 409e47c8c..aa05610d6 100644
--- a/t/admin/services.t
+++ b/t/admin/services.t
@@ -55,8 +55,7 @@ __DATA__
"desc": "new service"
},
"key": "/apisix/services/1"
- },
- "action": "set"
+ }
}]]
)
@@ -99,8 +98,7 @@ passed
"desc": "new service"
},
"key": "/apisix/services/1"
- },
- "action": "get"
+ }
}]]
)
@@ -123,12 +121,8 @@ passed
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/services/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -147,12 +141,8 @@ GET /t
content_by_lua_block {
local t = require("lib.test_admin").test
local code = t('/apisix/admin/services/not_found',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code)
}
@@ -192,8 +182,7 @@ GET /t
"type": "roundrobin"
}
}
- },
- "action": "create"
+ }
}]]
)
@@ -213,12 +202,8 @@ GET /t
assert(update_time ~= nil, "update_time is nil")
code, message = t('/apisix/admin/services/' .. id,
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -258,8 +243,7 @@ GET /t
"type": "roundrobin"
}
}
- },
- "action": "set"
+ }
}]]
)
@@ -311,8 +295,7 @@ GET /t
}
}
}
- },
- "action": "set"
+ }
}]]
)
@@ -408,8 +391,7 @@ GET /t
"plugins": {}
},
"key": "/apisix/services/1"
- },
- "action": "set"
+ }
}]]
)
@@ -623,8 +605,7 @@ GET /t
"desc": "new 20 service"
},
"key": "/apisix/services/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -669,8 +650,7 @@ passed
"desc": "new 19 service"
},
"key": "/apisix/services/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -760,8 +740,7 @@ passed
"desc": "new 22 service"
},
"key": "/apisix/services/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -798,8 +777,7 @@ passed
"desc": "new 23 service"
},
"key": "/apisix/services/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -1012,8 +990,7 @@ GET /t
"name": "test service name"
},
"key": "/apisix/services/1"
- },
- "action": "set"
+ }
}]]
)
@@ -1072,8 +1049,7 @@ GET /t
[[{
"node": {
"value": {"id":"1"}
- },
- "action": "set"
+ }
}]]
)
@@ -1137,8 +1113,7 @@ passed
},
"id":"1"
}
- },
- "action":"compareAndSwap"
+ }
}]]
)
@@ -1193,8 +1168,7 @@ passed
"desc": "new service"
},
"key": "/apisix/services/1"
- },
- "action": "set"
+ }
}]]
)
@@ -1240,8 +1214,7 @@ passed
"desc": "new service"
},
"key": "/apisix/services/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -1323,8 +1296,7 @@ GET /t
}
},
"key": "/apisix/services/1"
- },
- "action": "set"
+ }
}]]
)
@@ -1347,12 +1319,8 @@ passed
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/services/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -1417,8 +1385,7 @@ GET /t
"desc": "new service"
},
"key": "/apisix/services/a.b"
- },
- "action": "set"
+ }
}]]
)
diff --git a/t/admin/services2.t b/t/admin/services2.t
index 9cbe8e725..0ff22a942 100644
--- a/t/admin/services2.t
+++ b/t/admin/services2.t
@@ -72,7 +72,7 @@ __DATA__
}
}
--- response_body
-{"action":"create","node":{"value":{"upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}}
+{"node":{"value":{"upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}}
@@ -107,7 +107,7 @@ __DATA__
}
}
--- response_body
-{"action":"set","node":{"key":"/apisix/services/1","value":{"id":"1","upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}}
+{"node":{"key":"/apisix/services/1","value":{"id":"1","upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}}
@@ -142,7 +142,7 @@ __DATA__
}
}
--- response_body
-{"action":"compareAndSwap","node":{"key":"/apisix/services/1","value":{"id":"1","upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}}
+{"node":{"key":"/apisix/services/1","value":{"id":"1","upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}}
@@ -174,7 +174,7 @@ __DATA__
}
}
--- response_body
-{"action":"get","node":{"key":"/apisix/services/1","value":{"id":"1","upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}}
+{"node":{"key":"/apisix/services/1","value":{"id":"1","upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}}
@@ -199,7 +199,7 @@ __DATA__
}
}
--- response_body
-{"action":"delete","deleted":"1","key":"/apisix/services/1","node":{}}
+{"deleted":"1","key":"/apisix/services/1","node":{}}
@@ -262,10 +262,8 @@ passed
ngx.sleep(0.3)
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/services/1',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.print("[delete] code: ", code, " message: ", message)
}
}
@@ -281,10 +279,8 @@ passed
ngx.sleep(0.3)
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/routes/1',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -300,10 +296,8 @@ passed
ngx.sleep(0.3)
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/services/1',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
diff --git a/t/admin/ssl.t b/t/admin/ssl.t
index ff1504b13..68ff9b2f1 100644
--- a/t/admin/ssl.t
+++ b/t/admin/ssl.t
@@ -43,8 +43,7 @@ __DATA__
"sni": "test.com"
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -84,8 +83,7 @@ passed
},
"key": "/apisix/ssls/1"
- },
- "action": "get"
+ }
}]]
)
@@ -108,12 +106,8 @@ passed
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/ssls/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -132,12 +126,8 @@ GET /t
content_by_lua_block {
local t = require("lib.test_admin").test
local code = t('/apisix/admin/ssls/99999999999999',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code)
}
}
@@ -169,8 +159,7 @@ GET /t
"value": {
"sni": "foo.com"
}
- },
- "action": "create"
+ }
}]]
)
@@ -184,11 +173,7 @@ GET /t
local id = string.sub(res.node.key, #"/apisix/ssls/" + 1)
code, message = t.test('/apisix/admin/ssls/' .. id,
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
+ ngx.HTTP_DELETE
)
ngx.say("[delete] code: ", code, " message: ", message)
}
@@ -223,8 +208,7 @@ GET /t
"sni": "foo.com"
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -262,8 +246,7 @@ GET /t
"sni": "*.foo.com"
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -303,8 +286,7 @@ passed
"snis": ["*.foo.com", "bar.com"]
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -346,8 +328,7 @@ passed
"exptime": 1619798400
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -480,8 +461,7 @@ GET /t
"sni": "test.com"
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -522,8 +502,7 @@ passed
"sni": "test.com"
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -567,8 +546,7 @@ GET /t
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -609,8 +587,7 @@ passed
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -660,8 +637,7 @@ GET /t
"validity_end": 1603893670
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -684,12 +660,8 @@ passed
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/ssls/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -722,8 +694,7 @@ GET /t
"value": {
"sni": "test.com"
}
- },
- "action": "create"
+ }
}]]
)
@@ -791,8 +762,7 @@ passed
[[{
"node": {
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -827,8 +797,7 @@ GET /t
[[{
"node": {
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
diff --git a/t/admin/ssl2.t b/t/admin/ssl2.t
index 773552f41..a8e5b9aee 100644
--- a/t/admin/ssl2.t
+++ b/t/admin/ssl2.t
@@ -71,7 +71,7 @@ __DATA__
}
}
--- response_body
-{"action":"create","node":{"value":{"cert":"","key":"","sni":"not-unwanted-post.com","status":1,"type":"server"}}}
+{"node":{"value":{"cert":"","key":"","sni":"not-unwanted-post.com","status":1,"type":"server"}}}
@@ -104,7 +104,7 @@ __DATA__
}
}
--- response_body
-{"action":"set","node":{"key":"/apisix/ssls/1","value":{"cert":"","id":"1","key":"","sni":"test.com","status":1,"type":"server"}}}
+{"node":{"key":"/apisix/ssls/1","value":{"cert":"","id":"1","key":"","sni":"test.com","status":1,"type":"server"}}}
@@ -137,7 +137,7 @@ __DATA__
}
}
--- response_body
-{"action":"compareAndSwap","node":{"key":"/apisix/ssls/1","value":{"cert":"","id":"1","key":"","sni":"t.com","status":1,"type":"server"}}}
+{"node":{"key":"/apisix/ssls/1","value":{"cert":"","id":"1","key":"","sni":"t.com","status":1,"type":"server"}}}
@@ -172,7 +172,7 @@ __DATA__
}
}
--- response_body
-{"action":"get","node":{"key":"/apisix/ssls/1","value":{"cert":"","id":"1","sni":"t.com","status":1,"type":"server"}}}
+{"node":{"key":"/apisix/ssls/1","value":{"cert":"","id":"1","sni":"t.com","status":1,"type":"server"}}}
@@ -200,7 +200,7 @@ __DATA__
}
}
--- response_body
-{"action":"delete","deleted":"1","key":"/apisix/ssls/1","node":{}}
+{"deleted":"1","key":"/apisix/ssls/1","node":{}}
diff --git a/t/admin/ssl3.t b/t/admin/ssl3.t
index cf8960e78..e9db3d576 100644
--- a/t/admin/ssl3.t
+++ b/t/admin/ssl3.t
@@ -60,4 +60,4 @@ __DATA__
}
}
--- response_body
-{"action":"get","count":0,"node":{"dir":true,"key":"/apisix/ssls","nodes":[]}}
+{"count":0,"list":[]}
diff --git a/t/admin/ssls.t b/t/admin/ssls.t
index 911b89494..86d811012 100644
--- a/t/admin/ssls.t
+++ b/t/admin/ssls.t
@@ -59,8 +59,7 @@ __DATA__
"sni": "test.com"
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
diff --git a/t/admin/stream-routes.t b/t/admin/stream-routes.t
index 01062fbc8..7cc489dc9 100644
--- a/t/admin/stream-routes.t
+++ b/t/admin/stream-routes.t
@@ -59,8 +59,7 @@ __DATA__
"desc": "new route"
},
"key": "/apisix/stream_routes/1"
- },
- "action": "set"
+ }
}]]
)
@@ -105,8 +104,7 @@ passed
"desc": "new route"
},
"key": "/apisix/stream_routes/1"
- },
- "action": "get"
+ }
}]]
)
@@ -129,12 +127,8 @@ passed
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/stream_routes/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -177,8 +171,7 @@ GET /t
},
"desc": "new route"
}
- },
- "action": "create"
+ }
}]]
)
@@ -201,11 +194,7 @@ GET /t
assert(id ~= nil, "id is nil")
code, message = t('/apisix/admin/stream_routes/' .. id,
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
+ ngx.HTTP_DELETE
)
ngx.say("[delete] code: ", code, " message: ", message)
}
@@ -302,12 +291,8 @@ passed
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/stream_routes/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -453,7 +438,7 @@ GET /t
}
}
--- response_body
-{"action":"create","node":{"value":{"remote_addr":"127.0.0.1","upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}}
+{"node":{"value":{"remote_addr":"127.0.0.1","upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}}
--- request
GET /t
--- no_error_log
@@ -493,7 +478,7 @@ GET /t
}
}
--- response_body
-{"action":"set","node":{"key":"/apisix/stream_routes/1","value":{"id":"1","remote_addr":"127.0.0.1","upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}}
+{"node":{"key":"/apisix/stream_routes/1","value":{"id":"1","remote_addr":"127.0.0.1","upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}}
--- request
GET /t
--- no_error_log
@@ -528,7 +513,7 @@ GET /t
}
}
--- response_body
-{"action":"get","node":{"key":"/apisix/stream_routes/1","value":{"id":"1","remote_addr":"127.0.0.1","upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}}
+{"node":{"key":"/apisix/stream_routes/1","value":{"id":"1","remote_addr":"127.0.0.1","upstream":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}}
--- request
GET /t
--- no_error_log
@@ -557,7 +542,7 @@ GET /t
}
}
--- response_body
-{"action":"delete","deleted":"1","key":"/apisix/stream_routes/1","node":{}}
+{"deleted":"1","key":"/apisix/stream_routes/1","node":{}}
--- request
GET /t
--- no_error_log
diff --git a/t/admin/upstream-array-nodes.t b/t/admin/upstream-array-nodes.t
index 16855526c..d90cfca01 100644
--- a/t/admin/upstream-array-nodes.t
+++ b/t/admin/upstream-array-nodes.t
@@ -54,8 +54,7 @@ __DATA__
"desc": "new upstream"
},
"key": "/apisix/upstreams/1"
- },
- "action": "set"
+ }
}]]
)
@@ -92,8 +91,7 @@ passed
"desc": "new upstream"
},
"key": "/apisix/upstreams/1"
- },
- "action": "get"
+ }
}]]
)
@@ -116,12 +114,8 @@ passed
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/upstreams/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -140,12 +134,8 @@ GET /t
content_by_lua_block {
local t = require("lib.test_admin").test
local code = t('/apisix/admin/upstreams/not_found',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code)
}
@@ -184,8 +174,7 @@ GET /t
}],
"type": "roundrobin"
}
- },
- "action": "create"
+ }
}]]
)
@@ -199,12 +188,8 @@ GET /t
local id = string.sub(res.node.key, #"/apisix/upstreams/" + 1)
code, message = t('/apisix/admin/upstreams/' .. id,
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
diff --git a/t/admin/upstream.t b/t/admin/upstream.t
index f04d5e1a6..bbbb15c66 100644
--- a/t/admin/upstream.t
+++ b/t/admin/upstream.t
@@ -52,8 +52,7 @@ so that we can delete it later)
"desc": "new upstream"
},
"key": "/apisix/upstreams/admin_up"
- },
- "action": "set"
+ }
}]]
)
@@ -94,8 +93,7 @@ passed
"desc": "new upstream"
},
"key": "/apisix/upstreams/admin_up"
- },
- "action": "get"
+ }
}]]
)
@@ -118,12 +116,8 @@ passed
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/upstreams/admin_up',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -142,12 +136,8 @@ GET /t
content_by_lua_block {
local t = require("lib.test_admin").test
local code = t('/apisix/admin/upstreams/not_found',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code)
}
@@ -183,8 +173,7 @@ GET /t
},
"type": "roundrobin"
}
- },
- "action": "create"
+ }
}]]
)
@@ -204,12 +193,8 @@ GET /t
assert(update_time ~= nil, "update_time is nil")
code, message = t('/apisix/admin/upstreams/' .. id,
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -302,8 +287,7 @@ GET /t
"type": "roundrobin"
},
"key": "/apisix/upstreams/1"
- },
- "action": "set"
+ }
}]]
)
@@ -435,8 +419,7 @@ passed
"type": "chash"
},
"key": "/apisix/upstreams/1"
- },
- "action": "set"
+ }
}]]
)
diff --git a/t/admin/upstream2.t b/t/admin/upstream2.t
index 7f22d1149..6b7fa0146 100644
--- a/t/admin/upstream2.t
+++ b/t/admin/upstream2.t
@@ -70,7 +70,7 @@ __DATA__
}
}
--- response_body
-{"action":"create","node":{"value":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}
+{"node":{"value":{"hash_on":"vars","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}
@@ -103,7 +103,7 @@ __DATA__
}
}
--- response_body
-{"action":"set","node":{"key":"/apisix/upstreams/unwanted","value":{"hash_on":"vars","id":"unwanted","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}
+{"node":{"key":"/apisix/upstreams/unwanted","value":{"hash_on":"vars","id":"unwanted","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}
@@ -136,7 +136,7 @@ __DATA__
}
}
--- response_body
-{"action":"compareAndSwap","node":{"key":"/apisix/upstreams/unwanted","value":{"hash_on":"vars","id":"unwanted","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}
+{"node":{"key":"/apisix/upstreams/unwanted","value":{"hash_on":"vars","id":"unwanted","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}
@@ -168,7 +168,7 @@ __DATA__
}
}
--- response_body
-{"action":"get","node":{"key":"/apisix/upstreams/unwanted","value":{"hash_on":"vars","id":"unwanted","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}
+{"node":{"key":"/apisix/upstreams/unwanted","value":{"hash_on":"vars","id":"unwanted","nodes":{"127.0.0.1:8080":1},"pass_host":"pass","scheme":"http","type":"roundrobin"}}}
@@ -193,7 +193,7 @@ __DATA__
}
}
--- response_body
-{"action":"delete","deleted":"1","key":"/apisix/upstreams/unwanted","node":{}}
+{"deleted":"1","key":"/apisix/upstreams/unwanted","node":{}}
diff --git a/t/admin/upstream3.t b/t/admin/upstream3.t
index 070c8b3d2..e372d74f3 100644
--- a/t/admin/upstream3.t
+++ b/t/admin/upstream3.t
@@ -60,7 +60,7 @@ __DATA__
}
}
--- response_body
-{"action":"get","count":0,"node":{"dir":true,"key":"/apisix/upstreams","nodes":[]}}
+{"count":0,"list":[]}
@@ -148,8 +148,7 @@ __DATA__
"desc": "new upstream"
},
"key": "/apisix/upstreams/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -188,8 +187,7 @@ passed
"desc": "new 21 upstream"
},
"key": "/apisix/upstreams/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -299,8 +297,7 @@ passed
"desc": "new upstream 24"
},
"key": "/apisix/upstreams/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -331,8 +328,7 @@ passed
"desc": "new 25 upstream"
},
"key": "/apisix/upstreams/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
diff --git a/t/admin/upstream4.t b/t/admin/upstream4.t
index 7c909e26a..6568207b1 100644
--- a/t/admin/upstream4.t
+++ b/t/admin/upstream4.t
@@ -62,8 +62,7 @@ __DATA__
"name": "test upstream name"
},
"key": "/apisix/upstreams/1"
- },
- "action": "set"
+ }
}]]
)
@@ -259,8 +258,7 @@ passed
}
},
"key": "/apisix/upstreams/1"
- },
- "action": "set"
+ }
}]]
)
@@ -295,8 +293,7 @@ passed
}
},
"key": "/apisix/upstreams/1"
- },
- "action": "get"
+ }
}]]
)
@@ -335,8 +332,7 @@ passed
}
},
"key": "/apisix/upstreams/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -405,8 +401,7 @@ passed
"create_time": 1705252779
},
"key": "/apisix/upstreams/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -455,8 +450,7 @@ passed
"create_time": 1705252779
},
"key": "/apisix/upstreams/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -503,8 +497,7 @@ passed
"update_time": 1602893670
},
"key": "/apisix/upstreams/up_create_update_time"
- },
- "action": "set"
+ }
}]]
)
@@ -523,12 +516,8 @@ passed
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/upstreams/up_create_update_time',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -658,10 +647,8 @@ passed
ngx.sleep(0.3)
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/upstreams/1',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.print("[delete] code: ", code, " message: ", message)
}
}
@@ -677,10 +664,8 @@ passed
ngx.sleep(0.3)
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/routes/1',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -696,10 +681,8 @@ passed
ngx.sleep(0.3)
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/services/1',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
@@ -715,10 +698,8 @@ passed
ngx.sleep(0.3)
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/upstreams/1',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
diff --git a/t/core/config_etcd.t b/t/core/config_etcd.t
index 0d6a77989..3baefa275 100644
--- a/t/core/config_etcd.t
+++ b/t/core/config_etcd.t
@@ -248,7 +248,7 @@ etcd auth failed
local config = core.config.new()
local res = config:getkey("/routes/")
if res and res.status == 200 and res.body
- and res.body.node and res.body.node.key == "/apisix/routes" then
+ and res.body.count and tonumber(res.body.count) >= 1 then
ngx.say("passed")
else
ngx.say("failed")
diff --git a/t/error_page/error_page.t b/t/error_page/error_page.t
index 70cc34c68..807d945a2 100644
--- a/t/error_page/error_page.t
+++ b/t/error_page/error_page.t
@@ -136,12 +136,8 @@ X-Test-Status: 500
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/routes/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
diff --git a/t/node/chash-hashon.t b/t/node/chash-hashon.t
index 0b9c161d9..67aee7881 100644
--- a/t/node/chash-hashon.t
+++ b/t/node/chash-hashon.t
@@ -60,8 +60,7 @@ __DATA__
}
}
}
- },
- "action": "set"
+ }
}]]
)
@@ -91,8 +90,7 @@ __DATA__
}
}
}
- },
- "action": "set"
+ }
}]]
)
ngx.say(code .. " " ..body)
diff --git a/t/node/upstream-domain.t b/t/node/upstream-domain.t
index 2cf71dd87..12b7f53aa 100644
--- a/t/node/upstream-domain.t
+++ b/t/node/upstream-domain.t
@@ -174,9 +174,7 @@ failed to parse domain: httpbin.orgx
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/routes/1',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]]
+ ngx.HTTP_DELETE
)
if code >= 300 then
@@ -202,9 +200,7 @@ passed
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/upstreams/1',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]]
+ ngx.HTTP_DELETE
)
if code >= 300 then
diff --git a/t/node/upstream.t b/t/node/upstream.t
index f8623eb96..ec6da1f82 100644
--- a/t/node/upstream.t
+++ b/t/node/upstream.t
@@ -140,11 +140,7 @@ hello world
ngx.sleep(0.5)
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/upstreams/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
+ ngx.HTTP_DELETE
)
ngx.print("[delete] code: ", code, " message: ", message)
}
@@ -164,11 +160,7 @@ GET /t
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/routes/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
+ ngx.HTTP_DELETE
)
ngx.say("[delete] code: ", code, " message: ", message)
}
@@ -188,11 +180,7 @@ GET /t
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/upstreams/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
+ ngx.HTTP_DELETE
)
ngx.say("[delete] code: ", code, " message: ", message)
}
@@ -212,11 +200,7 @@ GET /t
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/upstreams/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
+ ngx.HTTP_DELETE
)
ngx.say("[delete] code: ", code)
}
diff --git a/t/plugin/grpc-transcode2.t b/t/plugin/grpc-transcode2.t
index 9f98efb1a..3bdede099 100644
--- a/t/plugin/grpc-transcode2.t
+++ b/t/plugin/grpc-transcode2.t
@@ -500,12 +500,8 @@ qr/request log: \{.*body":\"\\u0000\\u0000\\u0000\\u0000\\u0002\\b\\u0003\\u0000
content_by_lua_block {
local t = require("lib.test_admin").test
local code, message = t('/apisix/admin/global_rules/1',
- ngx.HTTP_DELETE,
- nil,
- [[{
- "action": "delete"
- }]]
- )
+ ngx.HTTP_DELETE
+ )
ngx.say("[delete] code: ", code, " message: ", message)
}
}
diff --git a/t/plugin/jwt-auth.t b/t/plugin/jwt-auth.t
index cfea01313..a6ed72833 100644
--- a/t/plugin/jwt-auth.t
+++ b/t/plugin/jwt-auth.t
@@ -1148,8 +1148,7 @@ base64_secret required but the secret is not in base64 format
}
}
}
- },
- "action": "set"
+ }
}]]
)
diff --git a/t/plugin/key-auth.t b/t/plugin/key-auth.t
index a3483573a..b9b1e0f65 100644
--- a/t/plugin/key-auth.t
+++ b/t/plugin/key-auth.t
@@ -188,7 +188,7 @@ GET /hello
code, body = t('/apisix/admin/consumers',
ngx.HTTP_PUT,
string.format('{"username":"%s","plugins":{"key-auth":{"key":"%s"}}}', username, key),
- string.format('{"node":{"value":{"username":"%s","plugins":{"key-auth":{"key":"%s"}}}},"action":"set"}', username, key)
+ string.format('{"node":{"value":{"username":"%s","plugins":{"key-auth":{"key":"%s"}}}},}', username, key)
)
end
diff --git a/t/plugin/rocketmq-logger2.t b/t/plugin/rocketmq-logger2.t
index 286d3cad4..60178612e 100644
--- a/t/plugin/rocketmq-logger2.t
+++ b/t/plugin/rocketmq-logger2.t
@@ -208,9 +208,8 @@ qr/failed to send data to rocketmq topic: .*, nameserver_list: \{"127.0.0.127":9
content_by_lua_block {
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/plugin_metadata/rocketmq-logger',
- ngx.HTTP_DELETE,
- nil,
- [[{"action": "delete"}]])
+ ngx.HTTP_DELETE
+ )
}
}
--- response_body
diff --git a/t/router/multi-ssl-certs.t b/t/router/multi-ssl-certs.t
index c1669434f..99a81d7aa 100644
--- a/t/router/multi-ssl-certs.t
+++ b/t/router/multi-ssl-certs.t
@@ -45,8 +45,7 @@ location /t {
"sni": "www.test.com"
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -192,8 +191,7 @@ location /t {
"sni": "*.test2.com"
},
"key": "/apisix/ssls/2"
- },
- "action": "set"
+ }
}]]
)
@@ -277,8 +275,7 @@ location /t {
"sni": "apisix.dev"
},
"key": "/apisix/ssls/3"
- },
- "action": "set"
+ }
}]]
)
diff --git a/t/router/radixtree-sni.t b/t/router/radixtree-sni.t
index ce232e8d3..ba7e4123f 100644
--- a/t/router/radixtree-sni.t
+++ b/t/router/radixtree-sni.t
@@ -45,8 +45,7 @@ location /t {
"sni": "www.test.com"
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -232,8 +231,7 @@ location /t {
"sni": "*.test.com"
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -346,8 +344,7 @@ location /t {
"sni": "test.com"
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -460,8 +457,7 @@ location /t {
"sni": "*.test2.com"
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
@@ -588,8 +584,7 @@ location /t {
"status": 0
},
"key": "/apisix/ssls/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -669,8 +664,7 @@ location /t {
"status": 1
},
"key": "/apisix/ssls/1"
- },
- "action": "compareAndSwap"
+ }
}]]
)
@@ -753,8 +747,7 @@ location /t {
"snis": ["test2.com", "*.test2.com"]
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
diff --git a/t/router/radixtree-sni2.t b/t/router/radixtree-sni2.t
index 1a8e6c8da..8be50d645 100644
--- a/t/router/radixtree-sni2.t
+++ b/t/router/radixtree-sni2.t
@@ -54,8 +54,7 @@ location /t {
"sni": "test.com"
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
ngx.status = code
@@ -176,8 +175,7 @@ location /t {
"sni": "*.test2.com"
},
"key": "/apisix/ssls/1"
- },
- "action": "set"
+ }
}]]
)
diff --git a/t/router/radixtree-uri-with-parameter.t b/t/router/radixtree-uri-with-parameter.t
index d8fa0950c..1e23e57e9 100644
--- a/t/router/radixtree-uri-with-parameter.t
+++ b/t/router/radixtree-uri-with-parameter.t
@@ -70,8 +70,7 @@ __DATA__
}
},
"key": "/apisix/routes/1"
- },
- "action": "set"
+ }
}]]
)
@@ -173,8 +172,7 @@ qr/404 Not Found/
}
},
"key": "/apisix/routes/1"
- },
- "action": "set"
+ }
}]]
)