Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest proxy config for all services with a given gateway host #254

Open
eguzki opened this issue Jun 10, 2020 · 0 comments
Open

Latest proxy config for all services with a given gateway host #254

eguzki opened this issue Jun 10, 2020 · 0 comments

Comments

@eguzki
Copy link
Member

eguzki commented Jun 10, 2020

Export proxy configuration command can be enhanced providing some gateway host parameter.

3scale API provides an endpoint that returns the latest proxy config for all services that share a gateway host. Just a single request:

GET /admin/api/services/proxy/configs/{ENVIRONMENT}.json?host=HOST
{
  "proxy_configs" : [
    {
      "proxy_config": { ... }
     },
     {
      "proxy_config": { ... }
     }      
  ]
}

Needs new public method in the 3scale-api-ruby library. Something like this:

 # @api public                                                                                       
 # @return [Array]                                                                                    
 # @param [String] host Gateway Host                                                             
 # @param [String] environment. Must be 'sandbox' or 'production'                                    
 def proxy_config_list_by_host(host, environment = 'sandbox')                                        
   params = { host: host }                                                                           
   response = http_client.get("/admin/api/services/proxy/configs/#{environment}", params: params)    
   extract(collection: 'proxy_configs', entity: 'proxy_config', from: response)                      
 end                                                                                                 

Note: When services share a gateway host, APICAST_PATH_ROUTING has to be enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant