You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by GitBox <gi...@apache.org> on 2019/09/18 13:35:19 UTC

[GitHub] [knox] smolnar82 opened a new pull request #147: KNOX-1914 - New admin API to be used by the UI to fetch available service discovery types

smolnar82 opened a new pull request #147: KNOX-1914 - New admin API to be used by the UI to fetch available service discovery types
URL: https://github.com/apache/knox/pull/147
 
 
   ## What changes were proposed in this pull request?
   
   The Discovery Details section of the Admin UI for working with descriptors includes a drop-down list of supported discovery providers (e.g., Ambari, ClouderaManager). Currently, this list is statically defined in the Admin UI. With my changes in place, the admin UI uses a new API from the Knox server for determining the list of supported discovery providers.
   
   ## How was this patch tested?
   
   Running JUnit tests:
   ```
   $ mvn clean -Dshellcheck=true -T1C verify -Prelease,package
   ...
   [INFO] ------------------------------------------------------------------------
   [INFO] BUILD SUCCESS
   [INFO] ------------------------------------------------------------------------
   [INFO] Total time: 18:01 min (Wall Clock)
   [INFO] Finished at: 2019-09-18T15:27:07+02:00
   [INFO] Final Memory: 385M/1928M
   [INFO] ------------------------------------------------------------------------
   ```
   
   Additionally, I tested this feature locally as follows:
   1. Rebuilt the entire project, redeployed the Knox gateway and restarted the service
   2. Logged in the admin UI and created a new descriptor called `smolnarTest`
   3. When the descriptor was created I could browse the available service discovery types
   
   <img width="1669" alt="Screen Shot 2019-09-18 at 3 10 34 PM" src="https://user-images.githubusercontent.com/34065904/65153312-d430e800-da29-11e9-9e51-4d2da6898b68.png">
   
   I also confirmed the new admin API works with `curl` too:
   ```
   $ curl --header "Accept: application/json" --header "Content-Type: application/json" -iku admin:admin-password  -X GET 'https://localhost:8443/gateway/admin/api/v1/servicediscoveries'
   HTTP/1.1 200 OK
   Date: Wed, 18 Sep 2019 13:08:47 GMT
   Set-Cookie: KNOXSESSIONID=node0omo2sp8auh5v1uwa6e4cir5uu0.node0; Path=/gateway/admin; Secure; HttpOnly
   Expires: Thu, 01 Jan 1970 00:00:00 GMT
   Set-Cookie: rememberMe=deleteMe; Path=/gateway/admin; Max-Age=0; Expires=Tue, 17-Sep-2019 13:08:47 GMT
   Content-Type: application/json
   Content-Length: 372
   Server: Jetty(9.4.19.v20190610)
   
   {
      "knoxServiceDiscoveries" : {
         "knoxServiceDiscovery" : [ {
            "type" : "Ambari",
            "implementation" : "org.apache.knox.gateway.topology.discovery.ambari.AmbariServiceDiscovery"
         }, {
            "type" : "ClouderaManager",
            "implementation" : "org.apache.knox.gateway.topology.discovery.cm.ClouderaManagerServiceDiscovery"
         } ]
      }
   }
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services