private RestApi defineApi() {
        return RestApi.builder()
                      .addRoute(RestApi.route("/application/v2/tenant")
                                       .get(this::getTenants))
                      .addRoute(RestApi.route("/application/v2/tenant/{tenant}")
                                       .get(this::getTenant)
                                       .put(this::putTenant)
                                       .delete(this::deleteTenant))
                      .addExceptionMapper(IllegalArgumentException.class, (c, e) -> ErrorResponse.badRequest(Exceptions.toMessageString(e)))
                      .addExceptionMapper(RuntimeException.class, (c, e) -> ErrorResponse.internalServerError(Exceptions.toMessageString(e)))
                      .build();
    }
Handler to create, get and delete a tenant, and listing of tenants.

@author jonmv
configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/TenantHandler.java