Skip to content

Commit

Permalink
Merge 3c2fa1d into fbaa5f8
Browse files Browse the repository at this point in the history
  • Loading branch information
jmthibault79 committed Jun 25, 2019
2 parents fbaa5f8 + 3c2fa1d commit f936faa
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 1 deletion.
23 changes: 23 additions & 0 deletions src/main/resources/swagger/api-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2351,6 +2351,29 @@ paths:
500:
description: Internal Error

/api/staticNotebooks/convert:
post:
x-passthrough: true
x-passthrough-target: calhoun
tags:
- Static Notebooks
operationId: convertNotebook
summary: |
Convert a Notebook ipynb file to a static HTML representation
description: |
Convert a Notebook ipynb file to a static HTML representation
parameters:
- name: notebook
description: Notebook ipynb file
required: true
in: body
type: string
responses:
200:
description: Success
500:
description: Internal Error

/api/storage/{bucket}/{object}:
get:
x-passthrough: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,9 @@ object FireCloudConfig {
private val notification = config.getConfig("notification")
val fullyQualifiedNotificationTopic: String = notification.getString("fullyQualifiedNotificationTopic")
}

object StaticNotebooks {
private val staticNotebooks = config.getConfig("staticNotebooks")
val baseUrl: String = staticNotebooks.getString("baseUrl")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class FireCloudServiceActor extends HttpServiceActor with FireCloudDirectives
with ShareLogApiService
with ManagedGroupApiService
with CromIamApiService
with StaticNotebooksApiService
{

override lazy val log = LoggerFactory.getLogger(getClass)
Expand Down Expand Up @@ -125,7 +126,8 @@ class FireCloudServiceActor extends HttpServiceActor with FireCloudDirectives
val billingService = new BillingService with ActorRefFactoryContext
val apiRoutes = methodsApiServiceRoutes ~ profileRoutes ~ cromIamApiServiceRoutes ~
methodConfigurationService.routes ~ submissionsService.routes ~
nihRoutes ~ billingService.routes ~ trialApiServiceRoutes ~ shareLogServiceRoutes
nihRoutes ~ billingService.routes ~ trialApiServiceRoutes ~ shareLogServiceRoutes ~
staticNotebooksRoutes

val healthService = new HealthService with ActorRefFactoryContext

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.broadinstitute.dsde.firecloud.webservice

import org.broadinstitute.dsde.firecloud.FireCloudConfig
import org.broadinstitute.dsde.firecloud.service._
import org.broadinstitute.dsde.firecloud.utils.StandardUserInfoDirectives
import spray.http.HttpMethods
import spray.routing._

trait StaticNotebooksApiService extends HttpService
with FireCloudDirectives
with StandardUserInfoDirectives {

private implicit val executionContext = actorRefFactory.dispatcher

val calhounStaticNotebooksRoot: String = FireCloudConfig.StaticNotebooks.baseUrl

val staticNotebooksRoutes: Route = {
path("staticNotebooks" / "convert") {
requireUserInfo() { _ =>
post {
passthrough(s"$calhounStaticNotebooksRoot/api/convert", HttpMethods.POST)
}
}
}
}
}
5 changes: 5 additions & 0 deletions src/test/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,8 @@ spray.can.host-connector {
notification {
fullyQualifiedNotificationTopic = "dummy"
}

staticNotebooks {
# OK to call deployed GAE dev for unit tests?
baseUrl = "https://terra-calhoun-dev.appspot.com"
}

0 comments on commit f936faa

Please sign in to comment.