package water.automl;

import water.api.AbstractRegister;
import water.api.RequestServer;
import water.automl.api.AutoMLBuilderHandler;
import water.automl.api.AutoMLHandler;
import water.automl.api.LeaderboardsHandler;
import water.util.Log;

public class Register extends AbstractRegister{
  @Override public void register(String relativeResourcePath) throws ClassNotFoundException {
    // H2O.register("POST /3/AutoMLBuilder", AutoMLBuilderHandler.class, "POST", "automl", "automatically build models");
    // H2O.register("GET /3/AutoML/{automl_id}", AutoMLHandler.class,"refresh", "GET", "refresh the model key");
    // H2O.register("GET /3/AutoMLJSONSchemaHandler", AutoMLJSONSchemaHandler.class, "GET", "getJSONSchema", "Get the json schema for the AutoML input fields.");

    RequestServer.registerEndpoint("automl_build",
            "POST /3/AutoMLBuilder", AutoMLBuilderHandler.class, "build",
            "Start an AutoML build process.");

    RequestServer.registerEndpoint("fetch",
            "GET /3/AutoML/{automl_id}", AutoMLHandler.class, "fetch",
            "Fetch the specified AutoML object.");

    RequestServer.registerEndpoint("list",
            "GET /99/Leaderboards", LeaderboardsHandler.class, "list",
            "Return all the AutoML leaderboards.");

    RequestServer.registerEndpoint("fetch",
            "GET /99/Leaderboards/{project}", LeaderboardsHandler.class, "fetch",
            "Return the AutoML leaderboard for the given project.");

    /*
    RequestServer.registerEndpoint("automl_schema",

            "GET /3/AutoMLJSONSchemaHandler", AutoMLJSONSchemaHandler.class, "getJSONSchema",
            "Get the json schema for the AutoML input fields.");
*/
    Log.info("H2O AutoML extensions enabled.");

  }
}

@@ -383,406 +383,8 @@
 n %7B%0A
-    // H2O.register(%22POST /3/AutoMLBuilder%22, AutoMLBuilderHandler.class, %22POST%22, %22automl%22, %22automatically build models%22);%0A    // H2O.register(%22GET /3/AutoML/%7Bautoml_id%7D%22, AutoMLHandler.class,%22refresh%22, %22GET%22, %22refresh the model key%22);%0A    // H2O.register(%22GET /3/AutoMLJSONSchemaHandler%22, AutoMLJSONSchemaHandler.class, %22GET%22, %22getJSONSchema%22, %22Get the json schema for the AutoML input fields.%22);%0A%0A
     
@@ -449,17 +449,18 @@
  %22POST /
-3
+99
 /AutoMLB
@@ -611,25 +611,26 @@
       %22GET /
-3
+99
 /AutoML/%7Baut

Change /3/AutoML* to /99/AutoML