All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tic-lagom-api_sjs1_2.13.0.90.0.source-code.ElasticService.scala Maven / Gradle / Ivy

There is a newer version: 0.90.1
Show newest version
package net.sc8s.elastic.lagom.api

import akka.NotUsed
import com.lightbend.lagom.scaladsl.api.transport.Method
import com.lightbend.lagom.scaladsl.api.{Descriptor, Service, ServiceCall}

trait ElasticService extends Service {
  def migrateIndices(indices: Seq[String] = Nil, forceReindex: Option[Boolean]): ServiceCall[NotUsed, NotUsed]

  def cancelIndicesMigration: ServiceCall[NotUsed, NotUsed]

  def evolveDocuments(indices: Seq[String] = Nil): ServiceCall[NotUsed, NotUsed]

  def batchUpdate(index: String, job: String): ServiceCall[NotUsed, NotUsed]

  val apiPrefix: String

  abstract override def descriptor: Descriptor = super.descriptor.addCalls({
    import Service._
    Seq(
      restCall(Method.POST, s"$apiPrefix/elastic/index/migrate?indices&forceReindex", migrateIndices _),
      restCall(Method.POST, s"$apiPrefix/elastic/index/migrate/cancel", cancelIndicesMigration _),
      restCall(Method.POST, s"$apiPrefix/elastic/documents/evolve?indices", evolveDocuments _),
      restCall(Method.POST, s"$apiPrefix/elastic/documents/batch-update?index&job", batchUpdate _),
    )
  }: _ *)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy