Search in sources :

Example 1 with WorkspacesApi

use of org.pmiops.workbench.firecloud.api.WorkspacesApi in project workbench by all-of-us.

the class FireCloudConfig method workspacesApi.

@Bean
@RequestScope(proxyMode = ScopedProxyMode.DEFAULT)
public WorkspacesApi workspacesApi(@Qualifier(END_USER_API_CLIENT) ApiClient apiClient) {
    WorkspacesApi api = new WorkspacesApi();
    api.setApiClient(apiClient);
    return api;
}
Also used : WorkspacesApi(org.pmiops.workbench.firecloud.api.WorkspacesApi) RequestScope(org.springframework.web.context.annotation.RequestScope) Bean(org.springframework.context.annotation.Bean)

Example 2 with WorkspacesApi

use of org.pmiops.workbench.firecloud.api.WorkspacesApi in project workbench by all-of-us.

the class FireCloudServiceImpl method cloneWorkspace.

@Override
public void cloneWorkspace(String fromProject, String fromName, String toProject, String toName) {
    WorkspacesApi workspacesApi = workspacesApiProvider.get();
    WorkspaceIngest workspaceIngest = new WorkspaceIngest();
    workspaceIngest.setNamespace(toProject);
    workspaceIngest.setName(toName);
    try {
        workspacesApi.cloneWorkspace(fromProject, fromName, workspaceIngest);
    } catch (org.pmiops.workbench.firecloud.ApiException e) {
        log.log(Level.SEVERE, String.format("Error cloning FC workspace %s/%s: %s", fromProject, fromName, e.getResponseBody()), e);
        ExceptionUtils.convertFirecloudException(e);
    }
}
Also used : WorkspaceIngest(org.pmiops.workbench.firecloud.model.WorkspaceIngest) WorkspacesApi(org.pmiops.workbench.firecloud.api.WorkspacesApi)

Example 3 with WorkspacesApi

use of org.pmiops.workbench.firecloud.api.WorkspacesApi in project workbench by all-of-us.

the class FireCloudServiceImpl method createWorkspace.

@Override
public void createWorkspace(String projectName, String workspaceName) throws ApiException {
    WorkspacesApi workspacesApi = workspacesApiProvider.get();
    WorkspaceIngest workspaceIngest = new WorkspaceIngest();
    workspaceIngest.setName(workspaceName);
    workspaceIngest.setNamespace(projectName);
    // TODO: add concept of controlled auth domain.
    if (configProvider.get().firecloud.enforceRegistered) {
        ArrayList<ManagedGroupRef> authDomain = new ArrayList<ManagedGroupRef>();
        ManagedGroupRef registeredDomain = new ManagedGroupRef();
        registeredDomain.setMembersGroupName(configProvider.get().firecloud.registeredDomainName);
        authDomain.add(registeredDomain);
        workspaceIngest.setAuthorizationDomain(authDomain);
    }
    workspacesApi.createWorkspace(workspaceIngest);
}
Also used : WorkspaceIngest(org.pmiops.workbench.firecloud.model.WorkspaceIngest) ManagedGroupRef(org.pmiops.workbench.firecloud.model.ManagedGroupRef) WorkspacesApi(org.pmiops.workbench.firecloud.api.WorkspacesApi) ArrayList(java.util.ArrayList)

Example 4 with WorkspacesApi

use of org.pmiops.workbench.firecloud.api.WorkspacesApi in project workbench by all-of-us.

the class FireCloudServiceImpl method deleteWorkspace.

@Override
public void deleteWorkspace(String projectName, String workspaceName) throws ApiException {
    WorkspacesApi workspacesApi = workspacesApiProvider.get();
    workspacesApi.deleteWorkspace(projectName, workspaceName);
}
Also used : WorkspacesApi(org.pmiops.workbench.firecloud.api.WorkspacesApi)

Aggregations

WorkspacesApi (org.pmiops.workbench.firecloud.api.WorkspacesApi)4 WorkspaceIngest (org.pmiops.workbench.firecloud.model.WorkspaceIngest)2 ArrayList (java.util.ArrayList)1 ManagedGroupRef (org.pmiops.workbench.firecloud.model.ManagedGroupRef)1 Bean (org.springframework.context.annotation.Bean)1 RequestScope (org.springframework.web.context.annotation.RequestScope)1