Skip to content

Commit

Permalink
Merge 549b800 into 69b60ab
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewBemis committed Apr 30, 2020
2 parents 69b60ab + 549b800 commit 9103e6f
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 1 deletion.
119 changes: 119 additions & 0 deletions src/main/resources/swagger/api-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4080,6 +4080,81 @@ paths:
- email
- profile

/api/workspaces/{workspaceNamespace}/{workspaceName}/snapshots:
post:
x-passthrough: true
x-passthrough-target: rawls
responses:
201:
description: Created
schema:
$ref: '#/definitions/WMDataReferenceResponse'
404:
description: Workspace or snapshot not found
parameters:
- in: path
description: workspace namespace
name: workspaceNamespace
required: true
type: string
- in: path
description: workspace name
name: workspaceName
required: true
type: string
- in: body
description: Reference to the Data Repo snapshot
name: dataRepoSnapshot
required: true
schema:
$ref: '#/definitions/DataRepoSnapshot'
tags:
- Snapshots
summary: Add a reference to a snapshot in the Terra Data Repo
operationId: createDataRepoSnapshot
security:
- googleoauth:
- openid
- email
- profile

/api/workspaces/{workspaceNamespace}/{workspaceName}/snapshots/{snapshotId}:
post:
x-passthrough: true
x-passthrough-target: rawls
responses:
200:
description: OK
schema:
$ref: '#/definitions/WMDataReferenceResponse'
404:
description: Workspace or snapshot not found
parameters:
- in: path
description: workspace namespace
name: workspaceNamespace
required: true
type: string
- in: path
description: workspace name
name: workspaceName
required: true
type: string
- in: path
description: The snapshot ID
name: snapshotId
required: true
type: string
tags:
- Snapshots
summary: Get a reference to a snapshot in the Terra Data Repo
operationId: getDataRepoSnapshot
security:
- googleoauth:
- openid
- email
- profile

/api/workspaces/{workspaceNamespace}/{workspaceName}/storageCostEstimate:
get:
x-passthrough: false
Expand Down Expand Up @@ -5944,6 +6019,16 @@ definitions:
curator:
type: boolean

DataRepoSnapshot:
description: A Data Repo snapshot
properties:
snapshotId:
type: string
description: The ID of the snapshot in Terra Data Repo
name:
type: string
description: The name of the snapshot

DatasetPermission:
type: object
properties:
Expand Down Expand Up @@ -7016,6 +7101,22 @@ definitions:
type: string
default: ""

ResourceDescription:
description: A description of a resource from Workspace Manager
properties:
resource_id:
type: string
workspace_id:
type: string
application_id:
type: string
is_visible:
type: string
owner:
type: string
attributes:
type: string

SearchTermRef:
type: object
properties:
Expand Down Expand Up @@ -7562,6 +7663,24 @@ definitions:
methodConfiguration:
$ref: '#/definitions/MethodConfiguration'

WMDataReferenceResponse:
description: A Data Reference definition from Workspace Manager
properties:
referenceId:
type: string
name:
type: string
resourceDescription:
$ref: '#/definitions/ResourceDescription'
referenceType:
type: string
reference:
type: object
credentialId:
type: string
cloningInstructions:
type: string

Workflow:
description: ''
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class FireCloudServiceActor extends HttpServiceActor with FireCloudDirectives
with WorkspaceApiService
with NotificationsApiService
with StatusApiService
with SnapshotApiService
with MethodsApiService
with Ga4ghApiService
with UserApiService
Expand Down Expand Up @@ -127,7 +128,7 @@ class FireCloudServiceActor extends HttpServiceActor with FireCloudDirectives
val apiRoutes = methodsApiServiceRoutes ~ profileRoutes ~ cromIamApiServiceRoutes ~
methodConfigurationService.routes ~ submissionsService.routes ~
nihRoutes ~ billingService.routes ~ trialApiServiceRoutes ~ shareLogServiceRoutes ~
staticNotebooksRoutes
staticNotebooksRoutes ~ snapshotRoutes

val healthService = new HealthService with ActorRefFactoryContext

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

import org.broadinstitute.dsde.firecloud.FireCloudConfig
import org.broadinstitute.dsde.firecloud.service.FireCloudDirectives
import org.broadinstitute.dsde.firecloud.utils.UserInfoDirectives
import spray.http.HttpMethods

object SnapshotApiService {
val rawlsBasePath = FireCloudConfig.Rawls.baseUrl

def createDataRepoSnapshotURL(namespace: String, name: String) = rawlsBasePath + s"/workspaces/${namespace}/${name}/snapshots"
def getDataRepoSnapshotURL(namespace: String, name: String, snapshotId: String) = rawlsBasePath + s"/workspaces/${namespace}/${name}/snapshots/${snapshotId}"
}

trait SnapshotApiService extends FireCloudDirectives with UserInfoDirectives {

val snapshotRoutes =
pathPrefix("api") {
pathPrefix("workspaces" / Segment / Segment ) { (namespace, name) =>
pathEnd {
post {
passthrough(SnapshotApiService.createDataRepoSnapshotURL(namespace, name), HttpMethods.POST)
}
}
} ~
pathPrefix("workspaces" / Segment / Segment / "snapshots" / Segment) { (namespace, name, snapshotId) =>
pathEnd {
get {
passthrough(SnapshotApiService.getDataRepoSnapshotURL(namespace, name, snapshotId), HttpMethods.GET)
}
}
}
}
}

0 comments on commit 9103e6f

Please sign in to comment.