hmthoo commented on issue #8117:
URL: https://github.com/apache/apisix/issues/8117#issuecomment-1285045821

   > > I have created upstream "upstream-test1" and "upstream-test2" via the 
admin api. how do forward to it in the access phase?
   > 
   > search:
   > 
   > ```
   >  upstream.set(ctx, up_conf.type .. "#route_" .. matched_route.value.id, 
   >                   ctx.conf_version, up_conf) 
   > ```
   
   Forwarding to upstrem via upstrem_set() is ok.   Thank you for giving me a 
general idea!
   
   How to get the node information of an existing upstream to add to 
up_conf?For example, get the nodes information in my test upstream 
"upstream-test-a" and add it to the variable up_conf.
   
   `  local up_conf = {
           type = "roundrobin",
           nodes = {
               {host = upstream-test-a.node-1.ip , port = 
upstream-test-a.node-1.port  , weight = 10},
               {host = upstream-test-a.node-2.ip , port = 
upstream-test-a.node-2.port  , weight = 10},
           }
       }`
   
   
   
   


-- 
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-unsubscr...@apisix.apache.org

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

Reply via email to