{"action":"created","issue":{"url":"https://api.github.com/repos/cbornet/generator-jhipster-swagger-cli/issues/4","repository_url":"https://api.github.com/repos/cbornet/generator-jhipster-swagger-cli","labels_url":"https://api.github.com/repos/cbornet/generator-jhipster-swagger-cli/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/cbornet/generator-jhipster-swagger-cli/issues/4/comments","events_url":"https://api.github.com/repos/cbornet/generator-jhipster-swagger-cli/issues/4/events","html_url":"https://github.com/cbornet/generator-jhipster-swagger-cli/issues/4","id":131403645,"number":4,"title":"In a microservice context discover the available swagger-docs automatically using Eureka or Zuul","user":{"login":"PierreBesson","id":513471,"avatar_url":"https://avatars.githubusercontent.com/u/513471?v=3","gravatar_id":"","url":"https://api.github.com/users/PierreBesson","html_url":"https://github.com/PierreBesson","followers_url":"https://api.github.com/users/PierreBesson/followers","following_url":"https://api.github.com/users/PierreBesson/following{/other_user}","gists_url":"https://api.github.com/users/PierreBesson/gists{/gist_id}","starred_url":"https://api.github.com/users/PierreBesson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PierreBesson/subscriptions","organizations_url":"https://api.github.com/users/PierreBesson/orgs","repos_url":"https://api.github.com/users/PierreBesson/repos","events_url":"https://api.github.com/users/PierreBesson/events{/privacy}","received_events_url":"https://api.github.com/users/PierreBesson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-02-04T16:38:13Z","updated_at":"2016-02-12T11:25:34Z","closed_at":null,"body":"As the [jhipster microservice version](https://github.com/jhipster/jhipster-experimental-microservices) is getting merged to the main generator we could provide this as an option.\r\nHowever I don't know if we should discover the services directly on the Eureka registry or through a Zuul route on the gateway. The former might be good enough for a Feign client (as it need only the service ID to call it) and the latter for an Angular client (as it need to know the route to call the right REST endpoint).\r\nWhat do you think @jdubois ?\r\n\r\nOnce the jhiregistry is started we can get the list of available registered microservices. Usually the registry is located on localhost:8761.\r\n\r\nGET http://localhost:8761/eureka/apps\r\n```\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<applications>\r\n   <versions__delta>1</versions__delta>\r\n   <apps__hashcode>UP_1_</apps__hashcode>\r\n   <application>\r\n      <name>APP1</name>\r\n      <instance>\r\n         <instanceId>app1:3bcde735f84db35caa06fd101b8d1cb0</instanceId>\r\n         <hostName>192.168.43.8</hostName>\r\n         <app>APP1</app>\r\n         <ipAddr>192.168.43.8</ipAddr>\r\n         <status>UP</status>\r\n         <overriddenstatus>UNKNOWN</overriddenstatus>\r\n         <port enabled=\"true\">8090</port>\r\n         <securePort enabled=\"false\">443</securePort>\r\n         <countryId>1</countryId>\r\n         <dataCenterInfo class=\"com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo\">\r\n            <name>MyOwn</name>\r\n         </dataCenterInfo>\r\n         <leaseInfo>\r\n            <renewalIntervalInSecs>30</renewalIntervalInSecs>\r\n            <durationInSecs>90</durationInSecs>\r\n            <registrationTimestamp>1454601030889</registrationTimestamp>\r\n            <lastRenewalTimestamp>1454601451272</lastRenewalTimestamp>\r\n            <evictionTimestamp>0</evictionTimestamp>\r\n            <serviceUpTimestamp>1454601030889</serviceUpTimestamp>\r\n         </leaseInfo>\r\n         <metadata class=\"java.util.Collections$EmptyMap\" />\r\n         <homePageUrl>http://192.168.43.8:8090/</homePageUrl>\r\n         <statusPageUrl>http://192.168.43.8:8080/info</statusPageUrl>\r\n         <healthCheckUrl>http://192.168.43.8:8080/health</healthCheckUrl>\r\n         <vipAddress>app1</vipAddress>\r\n         <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>\r\n         <lastUpdatedTimestamp>1454601030890</lastUpdatedTimestamp>\r\n         <lastDirtyTimestamp>1454601030715</lastDirtyTimestamp>\r\n         <actionType>ADDED</actionType>\r\n      </instance>\r\n   </application>\r\n</applications>\r\n```\r\nFrom there it's easy to get the swagger-docs at http://192.168.43.8:8090/v2/api-docs\r\n\r\nOr on the Zuul Gateway (on localhost:8080):\r\n\r\nGET http://localhost:8080/routes\r\n\r\n```\r\n{\"/app1/**\":\"app1\"}\r\n```\r\nWe can get the swagger-docs for app1 here : http://localhost:8080/app1/v2/api-docs\r\n\r\nFinally, maybe after getting the list of all available endpoints on all microservices then one of the choice we could offer is to cherry-pick the ones we want to consume in our service and generate their rest client code."},"comment":{"url":"https://api.github.com/repos/cbornet/generator-jhipster-swagger-cli/issues/comments/183285312","html_url":"https://github.com/cbornet/generator-jhipster-swagger-cli/issues/4#issuecomment-183285312","issue_url":"https://api.github.com/repos/cbornet/generator-jhipster-swagger-cli/issues/4","id":183285312,"user":{"login":"cbornet","id":11633333,"avatar_url":"https://avatars.githubusercontent.com/u/11633333?v=3","gravatar_id":"","url":"https://api.github.com/users/cbornet","html_url":"https://github.com/cbornet","followers_url":"https://api.github.com/users/cbornet/followers","following_url":"https://api.github.com/users/cbornet/following{/other_user}","gists_url":"https://api.github.com/users/cbornet/gists{/gist_id}","starred_url":"https://api.github.com/users/cbornet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbornet/subscriptions","organizations_url":"https://api.github.com/users/cbornet/orgs","repos_url":"https://api.github.com/users/cbornet/repos","events_url":"https://api.github.com/users/cbornet/events{/privacy}","received_events_url":"https://api.github.com/users/cbornet/received_events","type":"User","site_admin":false},"created_at":"2016-02-12T11:25:34Z","updated_at":"2016-02-12T11:25:34Z","body":"@PierreBesson can we close from #6 ?"}}