Class AppStoreController

java.lang.Object
org.apache.hadoop.yarn.appcatalog.controller.AppStoreController

@Path("/app_store") public class AppStoreController extends Object
Application catalog REST API for searching and recommending applications.
  • Constructor Details

    • AppStoreController

      public AppStoreController()
  • Method Details

    • get

      @GET @Path("recommended") @Produces("application/json") public List<AppStoreEntry> get()
      Display the most frequently used applications on YARN AppCatalog home page.
      
       @apiGroup AppStoreController
       @apiName get
       @api {get} /app_store/recommended  Display recommended applications.
       @apiSuccess {Object} AppEntry Application configuration.
       @apiSuccessExample {json} Success-Response:
           HTTP/1.1 200 OK
           [
              {
                 "id":"96b7833a-e3",
                 "org":"Hortonworks",
                 "name":"LAMP",
                 "desc":"Linux Apache MySQL PHP web application",
                 "icon":"/css/img/feather.png",
                 "like":0,
                 "download":0,
                 "app":null
              },
              {
              ...
              }
           ]
       
      Returns:
      List of YARN applications
    • search

      @GET @Path("search") @Produces("application/json") public List<AppStoreEntry> search(@QueryParam("q") String keyword)
      Search for yarn applications from solr.
      
       @apiGroup AppStoreController
       @apiName search
       @api {get} /app_store/search  Find application from appstore.
       @apiParam {String} q Keyword to search.
       @apiSuccess {Object} AppStoreEntry List of matched applications.
       @apiSuccessExample {json} Success-Response:
           HTTP/1.1 200 OK
           [
              {
                 "id":"96b7833a-e3",
                 "org":"Hortonworks",
                 "name":"LAMP",
                 "desc":"Linux Apache MySQL PHP web application",
                 "icon":"/css/img/feather.png",
                 "like":0,
                 "download":0,
                 "app":null
              },
              {
              ...
              }
           ]
       
      Parameters:
      keyword - search for keyword
      Returns:
      List of YARN applications matching keyword search.
    • get

      @GET @Path("get/{id}") @Produces("application/json") public AppStoreEntry get(@PathParam("id") String id)
      Find yarn application from solr.
      Parameters:
      id - Application ID
      Returns:
      AppEntry
    • register

      @POST @Path("register") @Produces("application/json") public javax.ws.rs.core.Response register(Application app)
      Register an application.
      
       @apiGroup AppStoreController
       @apiName register
       @api {post} /app_store/register  Register an application in appstore.
       @apiParam {Object} app Application definition.
       @apiParamExample {json} Request-Example:
           {
             "name": "Jenkins",
             "organization": "Jenkins-ci.org",
             "description": "The leading open source automation server",
             "icon": "/css/img/jenkins.png",
             "lifetime": "3600",
             "components": [
               {
                 "name": "jenkins",
                 "number_of_containers": 1,
                 "artifact": {
                   "id": "eyang-1.openstacklocal:5000/jenkins:latest",
                   "type": "DOCKER"
                 },
                 "launch_command": "",
                 "resource": {
                   "cpus": 1,
                   "memory": "2048"
                 },
                 "configuration": {
                   "env": {
                   },
                   "files": [
                   ]
                 }
               }
             ],
             "quicklinks": {
               "Jenkins UI": "http://jenkins.${SERVICE_NAME}.${USER}.${DOMAIN}:8080/"
             }
           }
       @apiSuccess {String} Response Application register result.
       @apiError BadRequest Error in process application registration.
       
      Parameters:
      app - Yarnfile in JSON form
      Returns:
      Web response