#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~


# publish
#POST        /publish/:topic                                               org.apache.s2graph.rest.play.controllers.PublishController.mutateBulk(topic)
POST        /publishOnly/:topic                                           org.apache.s2graph.rest.play.controllers.PublishController.publishOnly(topic)

#### Health Check
GET         /health_check.html                                            org.apache.s2graph.rest.play.controllers.ApplicationController.healthCheck()
PUT         /health_check/:isHealthy                                      org.apache.s2graph.rest.play.controllers.ApplicationController.updateHealthCheck(isHealthy: Boolean)

## Edge
POST        /graphs/edges/insert                                          org.apache.s2graph.rest.play.controllers.EdgeController.inserts()
POST        /graphs/edges/insertWithWait                                  org.apache.s2graph.rest.play.controllers.EdgeController.insertsWithWait()
POST        /graphs/edges/insertBulk                                      org.apache.s2graph.rest.play.controllers.EdgeController.insertsBulk()
POST        /graphs/edges/delete                                          org.apache.s2graph.rest.play.controllers.EdgeController.deletes()
POST        /graphs/edges/deleteWithWait                                  org.apache.s2graph.rest.play.controllers.EdgeController.deletesWithWait()
POST        /graphs/edges/deleteAll                                       org.apache.s2graph.rest.play.controllers.EdgeController.deleteAll()
POST        /graphs/edges/deleteAllWithOutWait                            org.apache.s2graph.rest.play.controllers.EdgeController.deleteAllWithOutWait()
POST        /graphs/edges/update                                          org.apache.s2graph.rest.play.controllers.EdgeController.updates()
POST        /graphs/edges/updateWithWait                                  org.apache.s2graph.rest.play.controllers.EdgeController.updatesWithWait()
POST        /graphs/edges/increment                                       org.apache.s2graph.rest.play.controllers.EdgeController.increments()
POST        /graphs/edges/incrementWithWait                               org.apache.s2graph.rest.play.controllers.EdgeController.incrementsWithWait()
POST        /graphs/edges/incrementCount                                  org.apache.s2graph.rest.play.controllers.EdgeController.incrementCounts()
POST        /graphs/edges/bulk                                            org.apache.s2graph.rest.play.controllers.EdgeController.mutateBulk()
POST        /graphs/edges/bulkWithWait                                    org.apache.s2graph.rest.play.controllers.EdgeController.mutateBulkWithWait()

## Vertex
POST        /graphs/vertices/insert                                       org.apache.s2graph.rest.play.controllers.VertexController.inserts()
POST        /graphs/vertices/insertWithWait                               org.apache.s2graph.rest.play.controllers.VertexController.insertsWithWait()
POST        /graphs/vertices/insert/:serviceName/:columnName              org.apache.s2graph.rest.play.controllers.VertexController.insertsSimple(serviceName, columnName)
POST        /graphs/vertices/delete                                       org.apache.s2graph.rest.play.controllers.VertexController.deletes()
POST        /graphs/vertices/deleteWithWait                               org.apache.s2graph.rest.play.controllers.VertexController.deletesWithWait()
POST        /graphs/vertices/delete/:serviceName/:columnName              org.apache.s2graph.rest.play.controllers.VertexController.deletesSimple(serviceName, columnName)
POST        /graphs/vertices/deleteAll                                    org.apache.s2graph.rest.play.controllers.VertexController.deletesAll()
POST        /graphs/vertices/deleteAll/:serviceName/:columnName           org.apache.s2graph.rest.play.controllers.VertexController.deletesAllSimple(serviceName, columnName)


### SELECT Edges
POST        /graphs/getEdges                                              org.apache.s2graph.rest.play.controllers.QueryController.getEdges()
POST        /graphs/getEdges/grouped                                      org.apache.s2graph.rest.play.controllers.QueryController.getEdgesWithGrouping()
POST        /graphs/getEdgesExcluded                                      org.apache.s2graph.rest.play.controllers.QueryController.getEdgesExcluded()
POST        /graphs/getEdgesExcluded/grouped                              org.apache.s2graph.rest.play.controllers.QueryController.getEdgesExcludedWithGrouping()
POST        /graphs/checkEdges                                            org.apache.s2graph.rest.play.controllers.QueryController.checkEdges()

### this will be deprecated
POST        /graphs/getEdgesGrouped                                       org.apache.s2graph.rest.play.controllers.QueryController.getEdgesGrouped()
POST        /graphs/getEdgesGroupedExcluded                               org.apache.s2graph.rest.play.controllers.QueryController.getEdgesGroupedExcluded()
POST        /graphs/getEdgesGroupedExcludedFormatted                      org.apache.s2graph.rest.play.controllers.QueryController.getEdgesGroupedExcludedFormatted()
GET         /graphs/getEdge/:srcId/:tgtId/:labelName/:direction           org.apache.s2graph.rest.play.controllers.QueryController.getEdge(srcId, tgtId, labelName, direction)


### SELECT Vertices
POST        /graphs/getVertices                                           org.apache.s2graph.rest.play.controllers.QueryController.getVertices()


#### ADMIN
POST        /graphs/createService                                         org.apache.s2graph.rest.play.controllers.AdminController.createService()
GET         /graphs/getService/:serviceName                               org.apache.s2graph.rest.play.controllers.AdminController.getService(serviceName)
GET         /graphs/getLabels/:serviceName                                org.apache.s2graph.rest.play.controllers.AdminController.getLabels(serviceName)
POST        /graphs/createLabel                                           org.apache.s2graph.rest.play.controllers.AdminController.createLabel()
POST        /graphs/addIndex                                              org.apache.s2graph.rest.play.controllers.AdminController.addIndex()
GET         /graphs/getLabel/:labelName                                   org.apache.s2graph.rest.play.controllers.AdminController.getLabel(labelName)
PUT         /graphs/deleteLabelReally/:labelName                          org.apache.s2graph.rest.play.controllers.AdminController.deleteLabel(labelName)

POST        /graphs/addProp/:labelName                                    org.apache.s2graph.rest.play.controllers.AdminController.addProp(labelName)
POST        /graphs/createServiceColumn                                   org.apache.s2graph.rest.play.controllers.AdminController.createServiceColumn()
PUT         /graphs/deleteServiceColumn/:serviceName/:columnName          org.apache.s2graph.rest.play.controllers.AdminController.deleteServiceColumn(serviceName, columnName)
POST        /graphs/addServiceColumnProp/:serviceName/:columnName         org.apache.s2graph.rest.play.controllers.AdminController.addServiceColumnProp(serviceName, columnName)
POST        /graphs/addServiceColumnProps/:serviceName/:columnName        org.apache.s2graph.rest.play.controllers.AdminController.addServiceColumnProps(serviceName, columnName)
GET         /graphs/getServiceColumn/:serviceName/:columnName             org.apache.s2graph.rest.play.controllers.AdminController.getServiceColumn(serviceName, columnName)
POST        /graphs/createHTable                                          org.apache.s2graph.rest.play.controllers.AdminController.createHTable()


# AdminController API
GET         /admin/labels/:serviceName                                    org.apache.s2graph.rest.play.controllers.AdminController.getLabels(serviceName)
POST        /graphs/copyLabel/:oldLabelName/:newLabelName                 org.apache.s2graph.rest.play.controllers.AdminController.copyLabel(oldLabelName, newLabelName)
POST        /graphs/renameLabel/:oldLabelName/:newLabelName               org.apache.s2graph.rest.play.controllers.AdminController.renameLabel(oldLabelName, newLabelName)
POST        /graphs/swapLabels/:leftLabelName/:rightLabelName             org.apache.s2graph.rest.play.controllers.AdminController.swapLabels(leftLabelName, rightLabelName)
POST        /graphs/updateHTable/:labelName/:newHTableName                org.apache.s2graph.rest.play.controllers.AdminController.updateHTable(labelName, newHTableName)
PUT         /graphs/loadCache                                             org.apache.s2graph.rest.play.controllers.AdminController.loadCache()


# Counter Admin API
POST    /counter/v1/:service/:action                                    org.apache.s2graph.rest.play.controllers.CounterController.createAction(service, action)
GET     /counter/v1/:service/:action                                    org.apache.s2graph.rest.play.controllers.CounterController.getAction(service, action)
PUT     /counter/v1/:service/:action                                    org.apache.s2graph.rest.play.controllers.CounterController.updateAction(service, action)
PUT     /counter/v1/:service/:action/prepare                            org.apache.s2graph.rest.play.controllers.CounterController.prepareAction(service, action)
DELETE  /counter/v1/:service/:action                                    org.apache.s2graph.rest.play.controllers.CounterController.deleteAction(service, action)

# Counter API
GET     /counter/v1/:service/:action/ranking                            org.apache.s2graph.rest.play.controllers.CounterController.getRankingCountAsync(service, action)
DELETE  /counter/v1/:service/:action/ranking                            org.apache.s2graph.rest.play.controllers.CounterController.deleteRankingCount(service, action)
GET     /counter/v1/:service/:action/:item                              org.apache.s2graph.rest.play.controllers.CounterController.getExactCountAsync(service, action, item)
PUT     /counter/v1/:service/:action/:item                              org.apache.s2graph.rest.play.controllers.CounterController.incrementCount(service, action, item)
POST    /counter/v1/mget                                                org.apache.s2graph.rest.play.controllers.CounterController.getExactCountAsyncMulti()

# Experiment API
POST        /graphs/experiment/:accessToken/:experimentName/:uuid         org.apache.s2graph.rest.play.controllers.ExperimentController.experiment(accessToken, experimentName, uuid)
POST        /graphs/experiments                                           org.apache.s2graph.rest.play.controllers.ExperimentController.experiments()

# Map static resources from the /public folder to the /assets URL path
GET         /images/*file                                                 controllers.Assets.at(path="/public/images", file)
GET         /javascripts/*file                                            controllers.Assets.at(path="/public/javascripts", file)
GET         /stylesheets/*file                                            controllers.Assets.at(path="/public/stylesheets", file)
GET         /font-awesome-4.1.0/*file                                     controllers.Assets.at(path="/public/font-awesome-4.1.0", file)
GET         /swagger/*file                                                controllers.Assets.at(path="/public/swagger-ui", file)
