Search in sources :

Example 11 with ReferencedDataRepoSnapshotResource

use of bio.terra.workspace.service.resource.referenced.cloud.gcp.datareposnapshot.ReferencedDataRepoSnapshotResource in project terra-workspace-manager by DataBiosphere.

the class ReferencedGcpResourceController method getDataRepoSnapshotReferenceByName.

@Override
public ResponseEntity<ApiDataRepoSnapshotResource> getDataRepoSnapshotReferenceByName(UUID id, String name) {
    AuthenticatedUserRequest userRequest = getAuthenticatedInfo();
    ReferencedDataRepoSnapshotResource referenceResource = referenceResourceService.getReferenceResourceByName(id, name, userRequest).castByEnum(WsmResourceType.REFERENCED_ANY_DATA_REPO_SNAPSHOT);
    return new ResponseEntity<>(referenceResource.toApiResource(), HttpStatus.OK);
}
Also used : ResponseEntity(org.springframework.http.ResponseEntity) AuthenticatedUserRequest(bio.terra.workspace.service.iam.AuthenticatedUserRequest) ReferencedDataRepoSnapshotResource(bio.terra.workspace.service.resource.referenced.cloud.gcp.datareposnapshot.ReferencedDataRepoSnapshotResource)

Aggregations

ReferencedDataRepoSnapshotResource (bio.terra.workspace.service.resource.referenced.cloud.gcp.datareposnapshot.ReferencedDataRepoSnapshotResource)11 Test (org.junit.jupiter.api.Test)5 ResponseEntity (org.springframework.http.ResponseEntity)5 AuthenticatedUserRequest (bio.terra.workspace.service.iam.AuthenticatedUserRequest)4 ReferencedResource (bio.terra.workspace.service.resource.referenced.cloud.gcp.ReferencedResource)4 UUID (java.util.UUID)4 BaseUnitTest (bio.terra.workspace.common.BaseUnitTest)3 BaseConnectedTest (bio.terra.workspace.common.BaseConnectedTest)2 ApiCloneReferencedGcpDataRepoSnapshotResourceResult (bio.terra.workspace.generated.model.ApiCloneReferencedGcpDataRepoSnapshotResourceResult)1 ApiDataRepoSnapshotAttributes (bio.terra.workspace.generated.model.ApiDataRepoSnapshotAttributes)1 ApiResourceAttributesUnion (bio.terra.workspace.generated.model.ApiResourceAttributesUnion)1 ApiResourceDescription (bio.terra.workspace.generated.model.ApiResourceDescription)1 CloningInstructions (bio.terra.workspace.service.resource.model.CloningInstructions)1 Workspace (bio.terra.workspace.service.workspace.model.Workspace)1