You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/10/18 03:13:42 UTC

[GitHub] [apisix] Xunzhuo opened a new pull request #5259: feat: add dump upstream api in control api

Xunzhuo opened a new pull request #5259:
URL: https://github.com/apache/apisix/pull/5259


   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   feat: add dump upstream api in control api
   ### Pre-submission checklist:
   
   * [ ] Did you explain what problem does this PR solve? Or what new features have been added?
   * [ ] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] Xunzhuo commented on a change in pull request #5259: feat: add dump upstream api in control api

Posted by GitBox <gi...@apache.org>.
Xunzhuo commented on a change in pull request #5259:
URL: https://github.com/apache/apisix/pull/5259#discussion_r731443941



##########
File path: t/control/upstreams.t
##########
@@ -0,0 +1,144 @@
+#
+# 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.
+#
+use t::APISIX 'no_plan';
+
+repeat_each(1);
+no_long_string();
+no_root_location();
+no_shuffle();
+log_level("info");
+
+add_block_preprocessor(sub {
+    my ($block) = @_;
+
+    if (!$block->yaml_config) {
+        my $yaml_config = <<_EOC_;
+apisix:
+    node_listen: 1984
+    config_center: yaml
+    enable_admin: false
+_EOC_
+
+        $block->set_value("yaml_config", $yaml_config);
+    }
+
+    if (!$block->request) {
+        $block->set_value("request", "GET /t");
+    }
+});
+
+run_tests;
+
+__DATA__
+
+=== TEST 1: dump all upstreams
+--- apisix_yaml
+upstreams:
+    -
+        id: 1
+        nodes:
+            "127.0.0.1:8001": 1
+        type: roundrobin
+    -
+        id: 2
+        nodes:
+            "127.0.0.1:8002": 1
+        type: roundrobin
+#END
+--- config
+    location /t {
+        content_by_lua_block {
+            local json = require("toolkit.json")
+            local t = require("lib.test_admin")
+            local code, body, res = t.test('/v1/upstreams',
+                ngx.HTTP_GET)
+            res = json.decode(res)

Review comment:
       OK~




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] Xunzhuo commented on a change in pull request #5259: feat: add dump upstream api in control api

Posted by GitBox <gi...@apache.org>.
Xunzhuo commented on a change in pull request #5259:
URL: https://github.com/apache/apisix/pull/5259#discussion_r731467572



##########
File path: apisix/control/v1.lua
##########
@@ -193,7 +193,45 @@ function _M.dump_route_info()
     return 200, route
 end
 
+local function iter_add_get_upstream_info(values, upstream_id)
+    if not values then
+        return nil
+    end
 
+    local infos = {}
+    for _, upstream in core.config_util.iterate_values(values) do
+        local new_upstream = core.table.deepcopy(upstream)
+        core.table.insert(infos, new_upstream)
+        if new_upstream.value and new_upstream.value.parent then
+            new_upstream.value.parent = nil
+        end
+        -- check the upstream id
+        if upstream_id and upstream.value.id == upstream_id then
+            return new_upstream
+        end
+    end
+    if not upstream_id then
+        return infos
+    end
+    return nil
+end
+
+function _M.dump_all_upstreams_info()
+    local upstreams = get_upstreams()
+    local infos = iter_add_get_upstream_info(upstreams, nil)
+    return 200, infos
+end
+
+function _M.dump_upstream_info()
+    local upstreams = get_upstreams()
+    local uri_segs = core.utils.split_uri(ngx_var.uri)
+    local upstream_id = uri_segs[4]
+    local upstream = iter_add_get_upstream_info(upstreams, upstream_id)
+    if not upstream then
+        return 404, {error_msg = str_format("upstream[%s] not found", upstream_id)}

Review comment:
       If this will be changed, the error msg from routes should be changed in this format too, so in my view, this is OK for me 😃 




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] spacewander commented on a change in pull request #5259: feat: add dump upstream api in control api

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #5259:
URL: https://github.com/apache/apisix/pull/5259#discussion_r730787902



##########
File path: docs/en/latest/control-api.md
##########
@@ -283,3 +283,83 @@ Return specific route info with **route_id** in the format below:
   "key": "/routes/1"
 }
 ```
+
+### Get /v1/upstreams
+
+Introduced since `v2.10.0`.

Review comment:
       ```suggestion
   Introduced since `v2.11.0`.
   ```

##########
File path: t/control/upstreams.t
##########
@@ -0,0 +1,132 @@
+#
+# 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.
+#
+use t::APISIX 'no_plan';
+
+repeat_each(1);
+no_long_string();
+no_root_location();
+no_shuffle();
+log_level("info");
+
+add_block_preprocessor(sub {
+    my ($block) = @_;
+
+    if (!$block->yaml_config) {
+        my $yaml_config = <<_EOC_;
+apisix:
+    node_listen: 1984
+    config_center: yaml
+    enable_admin: false
+_EOC_
+
+        $block->set_value("yaml_config", $yaml_config);
+    }
+
+    if (!$block->request) {
+        $block->set_value("request", "GET /t");
+    }
+});
+
+run_tests;
+
+__DATA__
+
+=== TEST 1: get upstreams
+--- apisix_yaml
+upstreams:
+    -

Review comment:
       Can we test it with multiple upstreams?

##########
File path: t/control/upstreams.t
##########
@@ -0,0 +1,132 @@
+#
+# 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.
+#
+use t::APISIX 'no_plan';
+
+repeat_each(1);
+no_long_string();
+no_root_location();
+no_shuffle();
+log_level("info");
+
+add_block_preprocessor(sub {
+    my ($block) = @_;
+
+    if (!$block->yaml_config) {
+        my $yaml_config = <<_EOC_;
+apisix:
+    node_listen: 1984
+    config_center: yaml
+    enable_admin: false
+_EOC_
+
+        $block->set_value("yaml_config", $yaml_config);
+    }
+
+    if (!$block->request) {
+        $block->set_value("request", "GET /t");
+    }
+});
+
+run_tests;
+
+__DATA__
+
+=== TEST 1: get upstreams
+--- apisix_yaml
+upstreams:
+    -
+        id: 1
+        nodes:
+            "127.0.0.1:80": 1
+            "foo.com:80": 2
+        type: roundrobin
+#END
+--- config
+    location /t {
+        content_by_lua_block {
+            local json = require("toolkit.json")
+            local t = require("lib.test_admin")
+            local code, body, res = t.test('/v1/upstreams',
+                ngx.HTTP_GET)
+            res = json.decode(res)
+            if res[1] then
+                local data = {}
+                data.nodes = res[1].value.nodes
+                ngx.say(json.encode(data))
+            end
+        }
+    }
+--- response_body
+{"nodes":[{"port":80,"host":"127.0.0.1","weight":1},{"port":80,"host":"foo.com","weight":2}]}

Review comment:
       The order is incorrect, the hash key will be sorted in the output.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] Xunzhuo commented on a change in pull request #5259: feat: add dump upstream api in control api

Posted by GitBox <gi...@apache.org>.
Xunzhuo commented on a change in pull request #5259:
URL: https://github.com/apache/apisix/pull/5259#discussion_r731467572



##########
File path: apisix/control/v1.lua
##########
@@ -193,7 +193,45 @@ function _M.dump_route_info()
     return 200, route
 end
 
+local function iter_add_get_upstream_info(values, upstream_id)
+    if not values then
+        return nil
+    end
 
+    local infos = {}
+    for _, upstream in core.config_util.iterate_values(values) do
+        local new_upstream = core.table.deepcopy(upstream)
+        core.table.insert(infos, new_upstream)
+        if new_upstream.value and new_upstream.value.parent then
+            new_upstream.value.parent = nil
+        end
+        -- check the upstream id
+        if upstream_id and upstream.value.id == upstream_id then
+            return new_upstream
+        end
+    end
+    if not upstream_id then
+        return infos
+    end
+    return nil
+end
+
+function _M.dump_all_upstreams_info()
+    local upstreams = get_upstreams()
+    local infos = iter_add_get_upstream_info(upstreams, nil)
+    return 200, infos
+end
+
+function _M.dump_upstream_info()
+    local upstreams = get_upstreams()
+    local uri_segs = core.utils.split_uri(ngx_var.uri)
+    local upstream_id = uri_segs[4]
+    local upstream = iter_add_get_upstream_info(upstreams, upstream_id)
+    if not upstream then
+        return 404, {error_msg = str_format("upstream[%s] not found", upstream_id)}

Review comment:
       If this will be changed, the error msg from dump routes should be changed in this format too, so in my view, this is OK for me 😃 




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] juzhiyuan commented on a change in pull request #5259: feat: add dump upstream api in control api

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #5259:
URL: https://github.com/apache/apisix/pull/5259#discussion_r731463742



##########
File path: apisix/control/v1.lua
##########
@@ -193,7 +193,45 @@ function _M.dump_route_info()
     return 200, route
 end
 
+local function iter_add_get_upstream_info(values, upstream_id)
+    if not values then
+        return nil
+    end
 
+    local infos = {}
+    for _, upstream in core.config_util.iterate_values(values) do
+        local new_upstream = core.table.deepcopy(upstream)
+        core.table.insert(infos, new_upstream)
+        if new_upstream.value and new_upstream.value.parent then
+            new_upstream.value.parent = nil
+        end
+        -- check the upstream id
+        if upstream_id and upstream.value.id == upstream_id then
+            return new_upstream
+        end
+    end
+    if not upstream_id then
+        return infos
+    end
+    return nil
+end
+
+function _M.dump_all_upstreams_info()
+    local upstreams = get_upstreams()
+    local infos = iter_add_get_upstream_info(upstreams, nil)
+    return 200, infos
+end
+
+function _M.dump_upstream_info()
+    local upstreams = get_upstreams()
+    local uri_segs = core.utils.split_uri(ngx_var.uri)
+    local upstream_id = uri_segs[4]
+    local upstream = iter_add_get_upstream_info(upstreams, upstream_id)
+    if not upstream then
+        return 404, {error_msg = str_format("upstream[%s] not found", upstream_id)}

Review comment:
       Do we need a space like `upstream [%s]`?

##########
File path: docs/en/latest/control-api.md
##########
@@ -283,3 +283,83 @@ Return specific route info with **route_id** in the format below:
   "key": "/routes/1"
 }
 ```
+
+### Get /v1/upstreams
+
+Introduced since `v2.11.0`.
+
+Return all upstreams info in the format below:
+
+```json
+[
+   {
+      "value":{
+         "scheme":"http",
+         "pass_host":"pass",
+         "nodes":[
+            {
+               "host":"127.0.0.1",
+               "port":80,
+               "weight":1
+            },
+            {
+               "host":"foo.com",
+               "port":80,
+               "weight":2
+            }
+         ],
+         "hash_on":"vars",
+         "update_time":1634543819,
+         "key":"remote_addr",
+         "create_time":1634539759,
+         "id":"1",
+         "type":"chash"
+      },
+      "has_domain":true,
+      "key":"\/apisix\/upstreams\/1",
+      "clean_handlers":{
+      },
+      "createdIndex":938,
+      "modifiedIndex":1225
+   }
+]
+```
+
+### Get /v1/upstream/{upstream_id}
+
+Introduced since `v2.11.0`.
+
+Return specific upstream info with **upstream_id** in the format below:

Review comment:
       ```suggestion
   Dump specific upstream info with **upstream_id** in the format below:
   ```

##########
File path: docs/en/latest/control-api.md
##########
@@ -283,3 +283,83 @@ Return specific route info with **route_id** in the format below:
   "key": "/routes/1"
 }
 ```
+
+### Get /v1/upstreams
+
+Introduced since `v2.11.0`.
+
+Return all upstreams info in the format below:

Review comment:
       ```suggestion
   Dump all upstreams in the format below:
   ```

##########
File path: apisix/control/v1.lua
##########
@@ -193,7 +193,45 @@ function _M.dump_route_info()
     return 200, route
 end
 
+local function iter_add_get_upstream_info(values, upstream_id)

Review comment:
       How about using `data` or `value` instead of `_info`?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] Xunzhuo commented on a change in pull request #5259: feat: add dump upstream api in control api

Posted by GitBox <gi...@apache.org>.
Xunzhuo commented on a change in pull request #5259:
URL: https://github.com/apache/apisix/pull/5259#discussion_r730798033



##########
File path: docs/en/latest/control-api.md
##########
@@ -283,3 +283,83 @@ Return specific route info with **route_id** in the format below:
   "key": "/routes/1"
 }
 ```
+
+### Get /v1/upstreams
+
+Introduced since `v2.10.0`.

Review comment:
       Thanks for your careful tips.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] spacewander commented on a change in pull request #5259: feat: add dump upstream api in control api

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #5259:
URL: https://github.com/apache/apisix/pull/5259#discussion_r731443382



##########
File path: t/control/upstreams.t
##########
@@ -0,0 +1,144 @@
+#
+# 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.
+#
+use t::APISIX 'no_plan';
+
+repeat_each(1);
+no_long_string();
+no_root_location();
+no_shuffle();
+log_level("info");
+
+add_block_preprocessor(sub {
+    my ($block) = @_;
+
+    if (!$block->yaml_config) {
+        my $yaml_config = <<_EOC_;
+apisix:
+    node_listen: 1984
+    config_center: yaml
+    enable_admin: false
+_EOC_
+
+        $block->set_value("yaml_config", $yaml_config);
+    }
+
+    if (!$block->request) {
+        $block->set_value("request", "GET /t");
+    }
+});
+
+run_tests;
+
+__DATA__
+
+=== TEST 1: dump all upstreams
+--- apisix_yaml
+upstreams:
+    -
+        id: 1
+        nodes:
+            "127.0.0.1:8001": 1
+        type: roundrobin
+    -
+        id: 2
+        nodes:
+            "127.0.0.1:8002": 1
+        type: roundrobin
+#END
+--- config
+    location /t {
+        content_by_lua_block {
+            local json = require("toolkit.json")
+            local t = require("lib.test_admin")
+            local code, body, res = t.test('/v1/upstreams',
+                ngx.HTTP_GET)
+            res = json.decode(res)

Review comment:
       Need to check if two items are returned.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] Xunzhuo commented on a change in pull request #5259: feat: add dump upstream api in control api

Posted by GitBox <gi...@apache.org>.
Xunzhuo commented on a change in pull request #5259:
URL: https://github.com/apache/apisix/pull/5259#discussion_r730792723



##########
File path: t/control/upstreams.t
##########
@@ -0,0 +1,132 @@
+#
+# 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.
+#
+use t::APISIX 'no_plan';
+
+repeat_each(1);
+no_long_string();
+no_root_location();
+no_shuffle();
+log_level("info");
+
+add_block_preprocessor(sub {
+    my ($block) = @_;
+
+    if (!$block->yaml_config) {
+        my $yaml_config = <<_EOC_;
+apisix:
+    node_listen: 1984
+    config_center: yaml
+    enable_admin: false
+_EOC_
+
+        $block->set_value("yaml_config", $yaml_config);
+    }
+
+    if (!$block->request) {
+        $block->set_value("request", "GET /t");
+    }
+});
+
+run_tests;
+
+__DATA__
+
+=== TEST 1: get upstreams
+--- apisix_yaml
+upstreams:
+    -

Review comment:
       Yes of course 👌 




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] Xunzhuo commented on a change in pull request #5259: feat: add dump upstream api in control api

Posted by GitBox <gi...@apache.org>.
Xunzhuo commented on a change in pull request #5259:
URL: https://github.com/apache/apisix/pull/5259#discussion_r730812410



##########
File path: t/control/upstreams.t
##########
@@ -0,0 +1,132 @@
+#
+# 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.
+#
+use t::APISIX 'no_plan';
+
+repeat_each(1);
+no_long_string();
+no_root_location();
+no_shuffle();
+log_level("info");
+
+add_block_preprocessor(sub {
+    my ($block) = @_;
+
+    if (!$block->yaml_config) {
+        my $yaml_config = <<_EOC_;
+apisix:
+    node_listen: 1984
+    config_center: yaml
+    enable_admin: false
+_EOC_
+
+        $block->set_value("yaml_config", $yaml_config);
+    }
+
+    if (!$block->request) {
+        $block->set_value("request", "GET /t");
+    }
+});
+
+run_tests;
+
+__DATA__
+
+=== TEST 1: get upstreams
+--- apisix_yaml
+upstreams:
+    -
+        id: 1
+        nodes:
+            "127.0.0.1:80": 1
+            "foo.com:80": 2
+        type: roundrobin
+#END
+--- config
+    location /t {
+        content_by_lua_block {
+            local json = require("toolkit.json")
+            local t = require("lib.test_admin")
+            local code, body, res = t.test('/v1/upstreams',
+                ngx.HTTP_GET)
+            res = json.decode(res)
+            if res[1] then
+                local data = {}
+                data.nodes = res[1].value.nodes
+                ngx.say(json.encode(data))
+            end
+        }
+    }
+--- response_body
+{"nodes":[{"port":80,"host":"127.0.0.1","weight":1},{"port":80,"host":"foo.com","weight":2}]}

Review comment:
       Appreciate it a lot!




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] spacewander merged pull request #5259: feat(control): add dump upstream api

Posted by GitBox <gi...@apache.org>.
spacewander merged pull request #5259:
URL: https://github.com/apache/apisix/pull/5259


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] Xunzhuo commented on a change in pull request #5259: feat: add dump upstream api in control api

Posted by GitBox <gi...@apache.org>.
Xunzhuo commented on a change in pull request #5259:
URL: https://github.com/apache/apisix/pull/5259#discussion_r731466212



##########
File path: apisix/control/v1.lua
##########
@@ -193,7 +193,45 @@ function _M.dump_route_info()
     return 200, route
 end
 
+local function iter_add_get_upstream_info(values, upstream_id)

Review comment:
       I do not think this is necessary 😄 , as you can see other methods in `v1.lua`.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] Xunzhuo commented on pull request #5259: feat: add dump upstream api in control api

Posted by GitBox <gi...@apache.org>.
Xunzhuo commented on pull request #5259:
URL: https://github.com/apache/apisix/pull/5259#issuecomment-945611555


   cc @spacewander , would you like to take a look at this? dump upstreams API works fine locally, but in GitHub there are a few CI failures.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] Xunzhuo edited a comment on pull request #5259: feat: add dump upstream api in control api

Posted by GitBox <gi...@apache.org>.
Xunzhuo edited a comment on pull request #5259:
URL: https://github.com/apache/apisix/pull/5259#issuecomment-945611555


   cc @spacewander , would you like to take a look at this? 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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