diff --git a/.github/workflows/manual-deploy-docker.yml b/.github/workflows/manual-deploy-docker.yml index 7f940c5800d..69472345e83 100644 --- a/.github/workflows/manual-deploy-docker.yml +++ b/.github/workflows/manual-deploy-docker.yml @@ -11,10 +11,15 @@ on: type: string required: true hadoop: - type: string + type: choice description: 'Hadoop flavour. Any of: [hdp3.1, hdi5.1, emr6.1, emr6.13]' required: false - default: "hdp3.1" + default: hdp3.1 + options: + - hdp3.1 + - hdi5.1 + - emr6.1 + - emr6.13 jobs: build: @@ -40,7 +45,7 @@ jobs: ./.github/workflows/scripts/get_same_branch.sh ${{ github.ref_name }} ${{ inputs.hadoop }} fi - name: Maven Build (skip tests) - run: mvn -T 2 clean install -DskipTests -P${{ inputs.hadoop }},RClient -Dopencga.war.name=opencga -Dcheckstyle.skip + run: mvn -T 2 clean install -DskipTests -P${{ inputs.hadoop }} -Dopencga.war.name=opencga -Dcheckstyle.skip - uses: actions/upload-artifact@v4 with: name: build-folder diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86bcb471976..b59c92125e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,39 +7,90 @@ on: workflow_dispatch: jobs: - build: + # Add the build-hdp job + build-hdp: uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop with: maven_opts: -P hdp3.1,RClient -Dopencga.war.name=opencga -Dcheckstyle.skip + build_folder: build-folder - deploy-maven: - uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop - needs: build + # Add the deploy-docker-hdp job that depends on the build-hdp job + deploy-docker-hdp: + uses: opencb/java-common-libs/.github/workflows/deploy-docker-hub-workflow.yml@develop + needs: build-hdp with: - maven_opts: -P hdp3.1 -Dopencga.war.name=opencga + cli: python3 ./build/cloud/docker/docker-build.py push --images base,init --tag "${{ needs.build-hdp.outputs.version }}-hdp3.1" + build_folder: build-folder secrets: inherit - deploy-docker: - uses: opencb/java-common-libs/.github/workflows/deploy-docker-hub-workflow.yml@develop - needs: build + # Add the deploy-maven and deploy-python jobs they depend on the build-hdp job + deploy-maven: + uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop + needs: build-hdp with: - cli: python3 ./build/cloud/docker/docker-build.py push --images base,init --tag ${{ needs.build.outputs.version }} + maven_opts: -P hdp3.1 -Dopencga.war.name=opencga secrets: inherit deploy-python: uses: opencb/java-common-libs/.github/workflows/deploy-python-workflow.yml@develop - needs: build + needs: build-hdp with: cli: ./clients/python/python-build.sh push artifact: build-folder secrets: inherit + # Add the release job that depends on all the previous jobs release: uses: opencb/java-common-libs/.github/workflows/release-github-workflow.yml@develop - needs: [ build, deploy-maven, deploy-docker, deploy-python ] + needs: [ build-hdp, deploy-docker-hdp, deploy-maven, deploy-python] with: artifact: build-folder file: | - opencga-client-${{ needs.build.outputs.version }}.tar.gz - clients/R/opencgaR_${{ needs.build.outputs.version }}.tar.gz + opencga-client-${{ needs.build-hdp.outputs.version }}.tar.gz + clients/R/opencgaR_${{ needs.build-hdp.outputs.version }}.tar.gz + + # Compile and deploy other hadoop flavours + # Add the build-hdi and deploy-docker-hdi jobs + build-hdi: + uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop + with: + maven_opts: -P hdi5.1,RClient -Dopencga.war.name=opencga -Dcheckstyle.skip + build_folder: build-folder-hdi + + deploy-docker-hdi: + uses: opencb/java-common-libs/.github/workflows/deploy-docker-hub-workflow.yml@develop + needs: build-hdi + with: + cli: python3 ./build/cloud/docker/docker-build.py push --images base,init --tag "${{ needs.build-hdi.outputs.version }}-hdi5.1" + build_folder: build-folder-hdi + secrets: inherit + + # Add the build-emr and deploy-docker-emr jobs + build-emr: + uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop + with: + maven_opts: -P emr6.1,RClient -Dopencga.war.name=opencga -Dcheckstyle.skip + build_folder: build-folder-emr + + deploy-docker-emr: + uses: opencb/java-common-libs/.github/workflows/deploy-docker-hub-workflow.yml@develop + needs: build-emr + with: + cli: python3 ./build/cloud/docker/docker-build.py push --images base,init --tag "${{ needs.build-emr.outputs.version }}-emr6.1" + build_folder: build-folder-emr + secrets: inherit + + # Add the build-emr613 and deploy-docker-emr613 jobs + build-emr613: + uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop + with: + maven_opts: -P emr6.13,RClient -Dopencga.war.name=opencga -Dcheckstyle.skip + build_folder: build-folder-emr613 + deploy-docker-emr613: + uses: opencb/java-common-libs/.github/workflows/deploy-docker-hub-workflow.yml@develop + needs: build-emr613 + with: + cli: python3 ./build/cloud/docker/docker-build.py push --images base,init --tag "${{ needs.build-emr613.outputs.version }}-emr6.13" + build_folder: build-folder-emr613 + secrets: inherit diff --git a/opencga-analysis/pom.xml b/opencga-analysis/pom.xml index a82fde15ccc..3b96f1b246e 100644 --- a/opencga-analysis/pom.xml +++ b/opencga-analysis/pom.xml @@ -22,7 +22,7 @@ org.opencb.opencga opencga - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-app/app/misc/clients/copyright.txt b/opencga-app/app/misc/clients/copyright.txt new file mode 100644 index 00000000000..5c551251867 --- /dev/null +++ b/opencga-app/app/misc/clients/copyright.txt @@ -0,0 +1,13 @@ +Copyright 2015-2024 OpenCB + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/opencga-app/app/misc/clients/java_client_generator.py b/opencga-app/app/misc/clients/java_client_generator.py index 9555f4fe4b1..f65a89983e9 100755 --- a/opencga-app/app/misc/clients/java_client_generator.py +++ b/opencga-app/app/misc/clients/java_client_generator.py @@ -36,19 +36,7 @@ def get_imports(self): headers = [] headers.append('/*') - headers.append('* Copyright 2015-' + str(date.today().year) + ' OpenCB') - headers.append('*') - headers.append('* Licensed under the Apache License, Version 2.0 (the "License");') - headers.append('* you may not use this file except in compliance with the License.') - headers.append('* You may obtain a copy of the License at') - headers.append('*') - headers.append('* http://www.apache.org/licenses/LICENSE-2.0') - headers.append('*') - headers.append('* Unless required by applicable law or agreed to in writing, software') - headers.append('* distributed under the License is distributed on an "AS IS" BASIS,') - headers.append('* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.') - headers.append('* See the License for the specific language governing permissions and') - headers.append('* limitations under the License.') + headers.append(self.get_copyright_message(prefix='* ')) headers.append('*/') headers.append('') # We need to calculate the Java package and no use: headers.append('package org.opencb.opencga.client.rest.clients;') @@ -99,7 +87,6 @@ def get_class_definition(self, category): text.append('/**') text.append(' * This class contains methods for the {} webservices.'.format( self.categories[self.get_category_name(category)])) - text.append(' *{}Client version: {}'.format(' ' * 4, self.version)) text.append(' *{}PATH: {}'.format(' ' * 4, self.get_category_path(category))) text.append(' */') text.append('public class {}Client extends {} {{'.format(self.categories[self.get_category_name(category)], parentClientClass)) diff --git a/opencga-app/app/misc/clients/javascript_client_generator.py b/opencga-app/app/misc/clients/javascript_client_generator.py index b6955e46fe4..2ac2fb88667 100644 --- a/opencga-app/app/misc/clients/javascript_client_generator.py +++ b/opencga-app/app/misc/clients/javascript_client_generator.py @@ -28,18 +28,10 @@ def __init__(self, server_url, output_dir): } def get_imports(self): + copyright = self.get_copyright_message(prefix=' * ') auto_msg = "\n * ".join(self.get_autogenerated_message()) return (f'/**\n' - f' * Copyright 2015-2020 OpenCB\n' - f' * Licensed under the Apache License, Version 2.0 (the "License");\n' - f' * you may not use this file except in compliance with the License.\n' - f' * You may obtain a copy of the License at\n' - f' * http://www.apache.org/licenses/LICENSE-2.0\n' - f' * Unless required by applicable law or agreed to in writing, software\n' - f' * distributed under the License is distributed on an "AS IS" BASIS,\n' - f' * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n' - f' * See the License for the specific language governing permissions and\n' - f' * limitations under the License.\n' + f'{copyright}\n' f' * {auto_msg}' f' \n *\n**/\n\n' f'import OpenCGAParentClass from "./../opencga-parent-class.js";\n\n') diff --git a/opencga-app/app/misc/clients/python_client_generator.py b/opencga-app/app/misc/clients/python_client_generator.py index 8a0ba4320c6..ada636dc5c1 100644 --- a/opencga-app/app/misc/clients/python_client_generator.py +++ b/opencga-app/app/misc/clients/python_client_generator.py @@ -70,7 +70,6 @@ def get_class_definition(self, category): text.append('{}"""'.format(' ' * 4)) text.append('{}This class contains methods for the \'{}\' webservices'.format(' ' * 4, self.get_category_name(category))) - text.append('{}Client version: {}'.format(' ' * 4, self.version)) text.append('{}PATH: {}'.format(' ' * 4, category['path'])) text.append('{}"""'.format(' ' * 4)) text.append('') diff --git a/opencga-app/app/misc/clients/r_client_generator.py b/opencga-app/app/misc/clients/r_client_generator.py index f07735c62a0..2d2a4840a97 100644 --- a/opencga-app/app/misc/clients/r_client_generator.py +++ b/opencga-app/app/misc/clients/r_client_generator.py @@ -75,6 +75,7 @@ def get_class_definition(self, category): myEndpoint['path'], ", ".join(endpoint_params))) path_params = set(class_path_params) + path_params = sorted(list(path_params)) text.append("#'\n#' @md") text.append("#' @seealso \\url{http://docs.opencb.org/display/opencga/Using+OpenCGA} and the RESTful API documentation") text.append("#' \\url{http://bioinfo.hpc.cam.ac.uk/opencga-prod/webservices/}") diff --git a/opencga-app/app/misc/clients/rest_client_generator.py b/opencga-app/app/misc/clients/rest_client_generator.py index b4c5800e751..53ed2bdfd8f 100644 --- a/opencga-app/app/misc/clients/rest_client_generator.py +++ b/opencga-app/app/misc/clients/rest_client_generator.py @@ -56,14 +56,39 @@ def __init__(self, rest_api_file, output_dir): 'Admin': 'Admin' } + @staticmethod + def get_copyright_message(prefix=""): + # copyright = [ + # 'Copyright 2015-2024 OpenCB', + # '', + # 'Licensed under the Apache License, Version 2.0 (the "License");', + # 'you may not use this file except in compliance with the License.', + # 'You may obtain a copy of the License at', + # '', + # ' http://www.apache.org/licenses/LICENSE-2.0', + # '', + # 'Unless required by applicable law or agreed to in writing, software', + # 'distributed under the License is distributed on an "AS IS" BASIS,', + # 'WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.', + # 'See the License for the specific language governing permissions and', + # 'limitations under the License.' + # ] + copyright_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'copyright.txt') + print("Reading from file: ", copyright_file) + with open(copyright_file, 'r') as file: + copyright = file.read().splitlines() + ## Add prefix to each line + if prefix: + for line in range(len(copyright)): + copyright[line] = (prefix + copyright[line]).rstrip() + return "\n".join(copyright) + @staticmethod def get_autogenerated_message(): - date_ = datetime.now().strftime("%Y-%m-%d") return [ 'WARNING: AUTOGENERATED CODE', '', 'This code was generated by a tool.', - 'Autogenerated on: ' + date_, '', 'Manual changes to this file may cause unexpected behavior in your application.', 'Manual changes to this file will be overwritten if the code is regenerated.' diff --git a/opencga-app/pom.xml b/opencga-app/pom.xml index 6dcf364e559..1c77750c7f7 100644 --- a/opencga-app/pom.xml +++ b/opencga-app/pom.xml @@ -22,7 +22,7 @@ org.opencb.opencga opencga - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/admin/executors/MigrationCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/admin/executors/MigrationCommandExecutor.java index eb6f7ae747c..3f5f7cee80f 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/admin/executors/MigrationCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/admin/executors/MigrationCommandExecutor.java @@ -6,7 +6,7 @@ import org.opencb.commons.datastore.core.ObjectMap; import org.opencb.opencga.app.cli.admin.options.MigrationCommandOptions; import org.opencb.opencga.app.cli.main.io.Table; -import org.opencb.opencga.app.migrations.v3_0_0.OrganizationMigration; +import org.opencb.opencga.app.migrations.v3.v3_0_0.OrganizationMigration; import org.opencb.opencga.catalog.exceptions.CatalogException; import org.opencb.opencga.catalog.managers.CatalogManager; import org.opencb.opencga.catalog.migration.Migration; diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java index 623e23db9fb..d6bd902fff1 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java @@ -1,19 +1,3 @@ -/* -* Copyright 2015-2024-04-10 OpenCB -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - package org.opencb.opencga.app.cli.main; import org.jline.reader.Candidate; @@ -85,7 +69,7 @@ public abstract class OpenCgaCompleter implements Completer { .map(Candidate::new) .collect(toList()); - private List usersList = asList( "anonymous","create","login","password","info","configs","configs-update","filters","password-reset","update") + private List usersList = asList( "anonymous","create","login","password","search","info","configs","configs-update","filters","password-reset","update") .stream() .map(Candidate::new) .collect(toList()); diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java index 5b96a113110..33d53de3bf8 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java @@ -1,19 +1,3 @@ -/* -* Copyright 2015-2024-04-10 OpenCB -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - package org.opencb.opencga.app.cli.main; import com.beust.jcommander.JCommander; @@ -229,6 +213,7 @@ public OpencgaCliOptionsParser() { usersSubCommands.addCommand("create", usersCommandOptions.createCommandOptions); usersSubCommands.addCommand("login", usersCommandOptions.loginCommandOptions); usersSubCommands.addCommand("password", usersCommandOptions.passwordCommandOptions); + usersSubCommands.addCommand("search", usersCommandOptions.searchCommandOptions); usersSubCommands.addCommand("info", usersCommandOptions.infoCommandOptions); usersSubCommands.addCommand("configs", usersCommandOptions.configsCommandOptions); usersSubCommands.addCommand("configs-update", usersCommandOptions.updateConfigsCommandOptions); diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AdminCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AdminCommandExecutor.java index 4c8467fc108..e78430b3f96 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AdminCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AdminCommandExecutor.java @@ -262,7 +262,6 @@ private RestResponse searchUsers() throws Exception { queryParams.putIfNotNull("count", commandOptions.count); queryParams.putIfNotEmpty("organization", commandOptions.organization); queryParams.putIfNotEmpty("user", commandOptions.user); - queryParams.putIfNotEmpty("account", commandOptions.account); queryParams.putIfNotEmpty("authenticationId", commandOptions.authenticationId); return openCGAClient.getAdminClient().searchUsers(queryParams); diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/OrganizationsCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/OrganizationsCommandExecutor.java index e18895e85b2..991f44fd9d8 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/OrganizationsCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/OrganizationsCommandExecutor.java @@ -22,6 +22,7 @@ import org.opencb.opencga.core.models.organizations.OrganizationConfiguration; import org.opencb.opencga.core.models.organizations.OrganizationCreateParams; import org.opencb.opencga.core.models.organizations.OrganizationUpdateParams; +import org.opencb.opencga.core.models.organizations.TokenConfiguration; import org.opencb.opencga.core.response.QueryType; import org.opencb.opencga.core.response.RestResponse; diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/UsersCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/UsersCommandExecutor.java index f8bd7213886..6eeeae17408 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/UsersCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/UsersCommandExecutor.java @@ -77,6 +77,9 @@ public void execute() throws Exception { case "password": queryResponse = password(); break; + case "search": + queryResponse = search(); + break; case "info": queryResponse = info(); break; @@ -188,6 +191,24 @@ private RestResponse password() throws Exception { return openCGAClient.getUserClient().password(passwordChangeParams); } + private RestResponse search() throws Exception { + logger.debug("Executing search in Users command line"); + + UsersCommandOptions.SearchCommandOptions commandOptions = usersCommandOptions.searchCommandOptions; + + ObjectMap queryParams = new ObjectMap(); + queryParams.putIfNotEmpty("include", commandOptions.include); + queryParams.putIfNotEmpty("exclude", commandOptions.exclude); + queryParams.putIfNotNull("limit", commandOptions.limit); + queryParams.putIfNotNull("skip", commandOptions.skip); + queryParams.putIfNotNull("count", commandOptions.count); + queryParams.putIfNotEmpty("organization", commandOptions.organization); + queryParams.putIfNotEmpty("id", commandOptions.id); + queryParams.putIfNotEmpty("authenticationId", commandOptions.authenticationId); + + return openCGAClient.getUserClient().search(queryParams); + } + private RestResponse info() throws Exception { logger.debug("Executing info in Users command line"); @@ -284,7 +305,6 @@ private RestResponse update() throws Exception { ObjectMap beanParams = new ObjectMap(); putNestedIfNotEmpty(beanParams, "name",commandOptions.name, true); putNestedIfNotEmpty(beanParams, "email",commandOptions.email, true); - putNestedIfNotEmpty(beanParams, "organization",commandOptions.organization, true); putNestedIfNotNull(beanParams, "attributes",commandOptions.attributes, true); userUpdateParams = JacksonUtils.getDefaultObjectMapper().copy() diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AdminCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AdminCommandOptions.java index 50b075e7688..60684639ca0 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AdminCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AdminCommandOptions.java @@ -243,9 +243,6 @@ public class SearchUsersCommandOptions { @Parameter(names = {"--user", "-u"}, description = "User ID", required = false, arity = 1) public String user; - @Parameter(names = {"--account"}, description = "Account type [GUEST, FULL, ADMINISTRATOR]", required = false, arity = 1) - public String account; - @Parameter(names = {"--authentication-id"}, description = "Authentication origin ID", required = false, arity = 1) public String authenticationId; diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/UsersCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/UsersCommandOptions.java index e17ed6588e4..885a2ffaa70 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/UsersCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/UsersCommandOptions.java @@ -37,6 +37,7 @@ public class UsersCommandOptions extends CustomUsersCommandOptions { public CreateCommandOptions createCommandOptions; public LoginCommandOptions loginCommandOptions; public PasswordCommandOptions passwordCommandOptions; + public SearchCommandOptions searchCommandOptions; public InfoCommandOptions infoCommandOptions; public ConfigsCommandOptions configsCommandOptions; public UpdateConfigsCommandOptions updateConfigsCommandOptions; @@ -52,6 +53,7 @@ public UsersCommandOptions(CommonCommandOptions commonCommandOptions, JCommander this.createCommandOptions = new CreateCommandOptions(); this.loginCommandOptions = new LoginCommandOptions(); this.passwordCommandOptions = new PasswordCommandOptions(); + this.searchCommandOptions = new SearchCommandOptions(); this.infoCommandOptions = new InfoCommandOptions(); this.configsCommandOptions = new ConfigsCommandOptions(); this.updateConfigsCommandOptions = new UpdateConfigsCommandOptions(); @@ -136,6 +138,38 @@ public class PasswordCommandOptions { } + @Parameters(commandNames = {"search"}, commandDescription ="User search method") + public class SearchCommandOptions { + + @ParametersDelegate + public CommonCommandOptions commonOptions = commonCommandOptions; + + @Parameter(names = {"--include", "-I"}, description = "Fields included in the response, whole JSON path must be provided", required = false, arity = 1) + public String include; + + @Parameter(names = {"--exclude", "-E"}, description = "Fields excluded in the response, whole JSON path must be provided", required = false, arity = 1) + public String exclude; + + @Parameter(names = {"--limit"}, description = "Number of results to be returned", required = false, arity = 1) + public Integer limit; + + @Parameter(names = {"--skip"}, description = "Number of results to skip", required = false, arity = 1) + public Integer skip; + + @Parameter(names = {"--count"}, description = "Get the total number of results matching the query. Deactivated by default.", required = false, help = true, arity = 0) + public boolean count = false; + + @Parameter(names = {"--organization"}, description = "Organization id", required = false, arity = 1) + public String organization; + + @Parameter(names = {"--id"}, description = "Comma separated list user IDs up to a maximum of 100. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search.", required = false, arity = 1) + public String id; + + @Parameter(names = {"--authentication-id"}, description = "Authentication origin ID", required = false, arity = 1) + public String authenticationId; + + } + @Parameters(commandNames = {"info"}, commandDescription ="Return the user information including its projects and studies") public class InfoCommandOptions { @@ -251,9 +285,6 @@ public class UpdateCommandOptions { @Parameter(names = {"--email"}, description = "The body web service email parameter", required = false, arity = 1) public String email; - @Parameter(names = {"--organization"}, description = "The body web service organization parameter", required = false, arity = 1) - public String organization; - @DynamicParameter(names = {"--attributes"}, description = "The body web service attributes parameter. Use: --attributes key=value", required = false) public java.util.Map attributes = new HashMap<>(); //Dynamic parameters must be initialized; diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_0_3/catalog/java/Migration1.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_0_3/catalog/java/Migration1.java new file mode 100644 index 00000000000..425fd72353f --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_0_3/catalog/java/Migration1.java @@ -0,0 +1,14 @@ +package org.opencb.opencga.app.migrations.v2.v2_0_3.catalog.java; + +import org.opencb.opencga.catalog.exceptions.CatalogException; +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "recalculate_roles", description = "Recalculate roles from Family #1763", version = "2.0.3", date = 20210528, + deprecatedSince = "3.0.0") +public class Migration1 extends MigrationTool { + + @Override + protected void run() throws CatalogException { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_0_5/catalog/java/initialiseGroups.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_0_5/catalog/java/initialiseGroups.java new file mode 100644 index 00000000000..0c0273e7820 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_0_5/catalog/java/initialiseGroups.java @@ -0,0 +1,15 @@ +package org.opencb.opencga.app.migrations.v2.v2_0_5.catalog.java; + + +import org.opencb.opencga.catalog.exceptions.CatalogException; +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "initialise_groups", description = "Initialise userIds list from groups #1791", version = "2.0.5", date = 20210621, + deprecatedSince = "3.0.0") +public class initialiseGroups extends MigrationTool { + + @Override + protected void run() throws CatalogException { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_0_6/catalog/removeDeletedFileReferencesFromSample.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_0_6/catalog/removeDeletedFileReferencesFromSample.java new file mode 100644 index 00000000000..b99e0a9f1d5 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_0_6/catalog/removeDeletedFileReferencesFromSample.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_0_6.catalog; + + +import org.opencb.opencga.catalog.exceptions.CatalogException; +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "remove_file_references_from_sample", description = "Remove deleted file references from samples #1815", version = "2.0.6", + date = 20210901, deprecatedSince = "3.0.0") +public class removeDeletedFileReferencesFromSample extends MigrationTool { + + @Override + protected void run() throws CatalogException { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_12_0/catalog/AddAnnotationSetsInClinicalAnalysisMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_12_0/catalog/AddAnnotationSetsInClinicalAnalysisMigration.java new file mode 100644 index 00000000000..06a78900ab0 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_12_0/catalog/AddAnnotationSetsInClinicalAnalysisMigration.java @@ -0,0 +1,20 @@ +package org.opencb.opencga.app.migrations.v2.v2_12_0.catalog; + + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_annotation_sets_to_clinical_analysis" , + description = "Add private annotation fields to ClinicalAnalysis documents #TASK-5198", + version = "2.12.0", + domain = Migration.MigrationDomain.CATALOG, + language = Migration.MigrationLanguage.JAVA, + date = 20231116, + deprecatedSince = "3.0.0" +) +public class AddAnnotationSetsInClinicalAnalysisMigration extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_12_0/catalog/CompleteClinicalReportDataModelMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_12_0/catalog/CompleteClinicalReportDataModelMigration.java new file mode 100644 index 00000000000..96f702d96f4 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_12_0/catalog/CompleteClinicalReportDataModelMigration.java @@ -0,0 +1,19 @@ +package org.opencb.opencga.app.migrations.v2.v2_12_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "complete_clinical_report_data_model" , + description = "Complete Clinical Report data model #TASK-5198", + version = "2.12.0", + domain = Migration.MigrationDomain.CATALOG, + language = Migration.MigrationLanguage.JAVA, + date = 20231128, + deprecatedSince = "3.0.0" +) +public class CompleteClinicalReportDataModelMigration extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/AddMissingIndexes.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/AddMissingIndexes.java new file mode 100644 index 00000000000..7efdea6a56a --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/AddMissingIndexes.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.java; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_missing_indexes", + description = "Add missing indexes", version = "2.1.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + patch = 1, + date = 20210928, + deprecatedSince = "3.0.0") +public class AddMissingIndexes extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/AddPanelsToInterpretations.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/AddPanelsToInterpretations.java new file mode 100644 index 00000000000..a35f794d130 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/AddPanelsToInterpretations.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.java; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_panels_to_interpretations", + description = "Add panels to Interpretations #1802", version = "2.1.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20210713, + deprecatedSince = "3.0.0") +public class AddPanelsToInterpretations extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/CreateAuditIndexes.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/CreateAuditIndexes.java new file mode 100644 index 00000000000..48cd8ce2f3b --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/CreateAuditIndexes.java @@ -0,0 +1,19 @@ +package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.java; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "create_audit_indexes", description = "Create Audit indexes", version = "2.1.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + patch = 1, + date = 20210622, + deprecatedSince = "3.0.0") +public class CreateAuditIndexes extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} + diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/PanelLock.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/PanelLock.java new file mode 100644 index 00000000000..747feb3bbcb --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/PanelLock.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.java; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_panel_lock", + description = "Add new panelLock to ClinicalAnalysis #1802", version = "2.1.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + patch = 1, + date = 20210713, + deprecatedSince = "3.0.0") +public class PanelLock extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/RemoveRCVersionsFromMigrationRuns.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/RemoveRCVersionsFromMigrationRuns.java new file mode 100644 index 00000000000..58625266d9b --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/RemoveRCVersionsFromMigrationRuns.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.java; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "remove_rc_version_from_migration_runs", + description = "Remove RC versions from migration runs stored in catalog", version = "2.1.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + patch = 1, + date = 20210723, + deprecatedSince = "3.0.0") +public class RemoveRCVersionsFromMigrationRuns extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/RenameDatastoreConfigurationToOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/RenameDatastoreConfigurationToOptions.java new file mode 100644 index 00000000000..452e99d627f --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/RenameDatastoreConfigurationToOptions.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.java; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "rename_datastore_configuration_to_options", description = "Rename project.internal.datastores.variant.configuration to options", version = "2.1.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + patch = 1, + date = 20210617, + deprecatedSince = "3.0.0") +public class RenameDatastoreConfigurationToOptions extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/StudyClinicalConfigurationRelocation.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/StudyClinicalConfigurationRelocation.java new file mode 100644 index 00000000000..18e6272d7a6 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/StudyClinicalConfigurationRelocation.java @@ -0,0 +1,19 @@ +package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.java; + + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "move_study_clinical_config_to_internal", + description = "Move Study ClinicalConfiguration to internal.configuration", version = "2.1.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + patch = 1, + date = 20210708, + deprecatedSince = "3.0.0") +public class StudyClinicalConfigurationRelocation extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/VariantFileStatsRelocation.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/VariantFileStatsRelocation.java new file mode 100644 index 00000000000..f37d46cb9f2 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/java/VariantFileStatsRelocation.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.java; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "move_variant_file_stats_to_qc", description = "Move opencga_file_variant_stats annotation set from variable sets to " + + "FileQualityControl", version = "2.1.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.STORAGE, + patch = 1, + date = 20210614, + deprecatedSince = "3.0.0") +public class VariantFileStatsRelocation extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/javascript/Migration1.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/javascript/Migration1.java new file mode 100644 index 00000000000..0530e369b04 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/javascript/Migration1.java @@ -0,0 +1,14 @@ +package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.javascript; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationException; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "build_rga_indexes", description = "Create index for sample RGA status #1693", version = "2.1.0", + language = Migration.MigrationLanguage.JAVASCRIPT, date = 20210528, deprecatedSince = "3.0.0") +public class Migration1 extends MigrationTool { + + @Override + protected void run() throws MigrationException { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/javascript/Migration2.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/javascript/Migration2.java new file mode 100644 index 00000000000..a0c0938de73 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/javascript/Migration2.java @@ -0,0 +1,14 @@ +package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.javascript; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationException; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "init_userId_group_arrays", description = "Initialise all userIds arrays from groups #1735", version = "2.1.0", + language = Migration.MigrationLanguage.JAVASCRIPT, date = 20210528, deprecatedSince = "3.0.0") +public class Migration2 extends MigrationTool { + + @Override + protected void run() throws MigrationException { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/javascript/Migration3.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/javascript/Migration3.java new file mode 100644 index 00000000000..9b21dcdbc9c --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/javascript/Migration3.java @@ -0,0 +1,14 @@ +package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.javascript; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationException; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "init_ca_panel_arrays", description = "Initialise panels array in Clinical Analysis #1759", version = "2.1.0", + language = Migration.MigrationLanguage.JAVASCRIPT, date = 20210528, deprecatedSince = "3.0.0") +public class Migration3 extends MigrationTool { + + @Override + protected void run() throws MigrationException { + } +} \ No newline at end of file diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/javascript/Migration4.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/javascript/Migration4.java new file mode 100644 index 00000000000..ef72a501f44 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/catalog/javascript/Migration4.java @@ -0,0 +1,14 @@ +package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.javascript; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationException; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "update_qc_file_sample_fields", description = "Update QC fields from Sample and File #1730", version = "2.1.0", + language = Migration.MigrationLanguage.JAVASCRIPT, date = 20210531, patch = 4, deprecatedSince = "3.0.0") +public class Migration4 extends MigrationTool { + + @Override + protected void run() throws MigrationException { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/storage/AddCellbaseConfigurationToProject.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/storage/AddCellbaseConfigurationToProject.java new file mode 100644 index 00000000000..5dac53d4688 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/storage/AddCellbaseConfigurationToProject.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_1_0.storage; + + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_cellbase_configuration_to_project", description = "Add cellbase configuration from storage-configuration.yml to project.internal.cellbase", version = "2.1.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.STORAGE, + patch = 3, + date = 20210616, + deprecatedSince = "3.0.0") +public class AddCellbaseConfigurationToProject extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/storage/DefaultSampleIndexConfiguration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/storage/DefaultSampleIndexConfiguration.java new file mode 100644 index 00000000000..7b33bd7d709 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/storage/DefaultSampleIndexConfiguration.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_1_0.storage; + + +import org.opencb.opencga.app.migrations.StorageMigrationTool; +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "default_sample_index_configuration", description = "Add a default backward compatible sample index configuration", version = "2.1.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.STORAGE, + patch = 7, + date = 20210721, + deprecatedSince = "3.0.0") // Needs to run after StudyClinicalConfigurationRelocation +public class DefaultSampleIndexConfiguration extends StorageMigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/storage/NewClinicalSignificanceFields.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/storage/NewClinicalSignificanceFields.java new file mode 100644 index 00000000000..b4d243ee279 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_1_0/storage/NewClinicalSignificanceFields.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_1_0.storage; + +import org.opencb.opencga.app.migrations.StorageMigrationTool; +import org.opencb.opencga.catalog.migration.Migration; + + +@Migration(id = "new_clinical_significance_fields", description = "Add new clinical significance fields and combinations for variant storage and solr", version = "2.1.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.STORAGE, + patch = 1, + date = 20210708, + deprecatedSince = "3.0.0") +public class NewClinicalSignificanceFields extends StorageMigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/AddMissingClinicalAudit.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/AddMissingClinicalAudit.java new file mode 100644 index 00000000000..7008388f42e --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/AddMissingClinicalAudit.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_missing_create_interpretation_in_clinical_audit", + description = "Add missing CREATE_INTERPRETATION audits in ClinicalAnalysis", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211227, deprecatedSince = "3.0.0") +public class AddMissingClinicalAudit extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/AddNameFieldInCohort.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/AddNameFieldInCohort.java new file mode 100644 index 00000000000..1f23c1b331c --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/AddNameFieldInCohort.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_name_field_in_cohort_1902", + description = "Add new name field to Cohort #1902", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220228, deprecatedSince = "3.0.0") +public class AddNameFieldInCohort extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/AddNewAllowedBiotype.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/AddNewAllowedBiotype.java new file mode 100644 index 00000000000..1aa51b53014 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/AddNewAllowedBiotype.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_new_allowed_biotype", + description = "Add new allowed biotype 'guide_RNA', #1856", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + patch = 2, + date = 20211209, deprecatedSince = "3.0.0") +public class AddNewAllowedBiotype extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/AddNewFileInternalIndex_1850.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/AddNewFileInternalIndex_1850.java new file mode 100644 index 00000000000..099dd960790 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/AddNewFileInternalIndex_1850.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "new_file_internal_index_1850", + description = "Add new FileInternalVariant and FileInternalAlignment index #1850", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211127, deprecatedSince = "3.0.0") +public class AddNewFileInternalIndex_1850 extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/AddSampleInternalVariant_1851.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/AddSampleInternalVariant_1851.java new file mode 100644 index 00000000000..21218e3222d --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/AddSampleInternalVariant_1851.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_sample_internal_variant_1851", + description = "Add new SampleInternalVariant #1851", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211129, deprecatedSince = "3.0.0") +public class AddSampleInternalVariant_1851 extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ChangeInterpretationMethods.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ChangeInterpretationMethods.java new file mode 100644 index 00000000000..7731a4510fe --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ChangeInterpretationMethods.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "change_interpretation_method", + description = "Remove list of methods from Interpretations #1841", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211112, deprecatedSince = "3.0.0") +public class ChangeInterpretationMethods extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ClinicalVariantEvidenceMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ClinicalVariantEvidenceMigration.java new file mode 100644 index 00000000000..6de2592fbaa --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ClinicalVariantEvidenceMigration.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_clinical_variant_evidence_review", + description = "Add new ClinicalVariantEvidenceReview object, #1874", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220112, deprecatedSince = "3.0.0") +public class ClinicalVariantEvidenceMigration extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/DeleteUnusedVariableSets.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/DeleteUnusedVariableSets.java new file mode 100644 index 00000000000..7ddea73508c --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/DeleteUnusedVariableSets.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "delete_unused_variablesets", + description = "Delete unused VariableSets, #1859", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + patch = 2, + date = 20211210, deprecatedSince = "3.0.0") +public class DeleteUnusedVariableSets extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/FixFamilyReferences.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/FixFamilyReferences.java new file mode 100644 index 00000000000..fd160750475 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/FixFamilyReferences.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "fix_family_references_in_individual", + description = "Fix Family references, #TASK-489", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220324, deprecatedSince = "3.0.0") +public class FixFamilyReferences extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/FixNonExistingMoIFromPanels.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/FixNonExistingMoIFromPanels.java new file mode 100644 index 00000000000..d642d8499af --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/FixNonExistingMoIFromPanels.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "fix_non_existing_mois_from_panels", + description = "Remove non-existing MOIs from Panels", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + patch = 2, + date = 20220111, deprecatedSince = "3.0.0") +public class FixNonExistingMoIFromPanels extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ImproveClinicalAnalysisQualityControl.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ImproveClinicalAnalysisQualityControl.java new file mode 100644 index 00000000000..b7ff196615b --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ImproveClinicalAnalysisQualityControl.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "improve_ca_quality_control", + description = "Quality control normalize comments and fields #1826", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211001, deprecatedSince = "3.0.0") +public class ImproveClinicalAnalysisQualityControl extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ImproveFileQualityControl.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ImproveFileQualityControl.java new file mode 100644 index 00000000000..16043d38b26 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ImproveFileQualityControl.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "improve_file_quality_control", + description = "Quality control normalize comments and fields #1826", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211001, deprecatedSince = "3.0.0") +public class ImproveFileQualityControl extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ImproveIndividualQualityControl.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ImproveIndividualQualityControl.java new file mode 100644 index 00000000000..b3350e099f3 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ImproveIndividualQualityControl.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "improve_individual_quality_control", + description = "Quality control normalize comments and fields #1826", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211001, deprecatedSince = "3.0.0") +public class ImproveIndividualQualityControl extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ImproveVariableSetNamesAndDescriptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ImproveVariableSetNamesAndDescriptions.java new file mode 100644 index 00000000000..39b2df0d2a2 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/ImproveVariableSetNamesAndDescriptions.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "improveVariableSetNamesAndDescriptions", + description = "Improve VariableSet names and descriptions", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211210) +public class ImproveVariableSetNamesAndDescriptions extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RemoveFileDocsFromCA.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RemoveFileDocsFromCA.java new file mode 100644 index 00000000000..af85465d69e --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RemoveFileDocsFromCA.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "remove_file_docs_from_clinical_analyses", + description = "Store references of File in Clinical Analysis and not full File documents #1837", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211102, deprecatedSince = "3.0.0") +public class RemoveFileDocsFromCA extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RemoveParallelIndexes.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RemoveParallelIndexes.java new file mode 100644 index 00000000000..7b00543f9a5 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RemoveParallelIndexes.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "remove_parallel_indexes", + description = "Remove parallel array indexes #CU-20jc4tx", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220310, deprecatedSince = "3.0.0") +public class RemoveParallelIndexes extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RenameFamilyQualityControlFields.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RenameFamilyQualityControlFields.java new file mode 100644 index 00000000000..821fb020a28 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RenameFamilyQualityControlFields.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "rename_family_quality_control_fields", + description = "Rename FamilyQualityControl fields #1844", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211119, deprecatedSince = "3.0.0") +public class RenameFamilyQualityControlFields extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RenameFileQualityControlFields.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RenameFileQualityControlFields.java new file mode 100644 index 00000000000..c3c5d4ff7f8 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RenameFileQualityControlFields.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "rename_file_quality_control_fields", + description = "Rename FileQualityControl fields #1844", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211119, deprecatedSince = "3.0.0") +public class RenameFileQualityControlFields extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RenameIndividualQualityControlFields.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RenameIndividualQualityControlFields.java new file mode 100644 index 00000000000..6df5fc82131 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RenameIndividualQualityControlFields.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "rename_individual_quality_control_fields", + description = "Rename IndividualQualityControl fields #1844", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211119, deprecatedSince = "3.0.0") +public class RenameIndividualQualityControlFields extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RenameInterpretationFindingStats.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RenameInterpretationFindingStats.java new file mode 100644 index 00000000000..bd4ad966774 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RenameInterpretationFindingStats.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "rename_interpretation_stats_field", + description = "Rename interpretation stats field #1819", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211115, deprecatedSince = "3.0.0") +public class RenameInterpretationFindingStats extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RenameSampleQualityControlFields.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RenameSampleQualityControlFields.java new file mode 100644 index 00000000000..0c5b36cdf93 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/RenameSampleQualityControlFields.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "rename_sample_quality_control_fields", + description = "Rename SampleQualityControl fields #1844", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + patch = 2, + date = 20211119, deprecatedSince = "3.0.0") +public class RenameSampleQualityControlFields extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addDefaultVariantCallerInterpretationStudyConfiguration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addDefaultVariantCallerInterpretationStudyConfiguration.java new file mode 100644 index 00000000000..9a43d99ac53 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addDefaultVariantCallerInterpretationStudyConfiguration.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_variant_caller_interpretation_configuration", + description = "Add default variant caller Interpretation Study configuration #1822", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20210916, deprecatedSince = "3.0.0") +public class addDefaultVariantCallerInterpretationStudyConfiguration extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddInternalLastModified.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddInternalLastModified.java new file mode 100644 index 00000000000..28e32235bb0 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddInternalLastModified.java @@ -0,0 +1,10 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addInternalLastModified; + +import org.opencb.opencga.catalog.migration.MigrationTool; + +public abstract class AddInternalLastModified extends MigrationTool { + + protected void addInternalModificationDate(String collection) { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToClinicalInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToClinicalInternal.java new file mode 100644 index 00000000000..c127e7b2695 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToClinicalInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addInternalLastModified; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_modificationDate_to_clinical.internal", description = "Add internal modificationDate to Clinical #1810", + version = "2.2.0", language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210812, deprecatedSince = "3.0.0") +public class AddModificationDateToClinicalInternal extends AddInternalLastModified { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToCohortInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToCohortInternal.java new file mode 100644 index 00000000000..0aaccf98b74 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToCohortInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addInternalLastModified; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_modificationDate_to_cohort.internal", description = "Add internal modificationDate to Cohort #1810", + version = "2.2.0", language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210812, deprecatedSince = "3.0.0") +public class AddModificationDateToCohortInternal extends AddInternalLastModified { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToFamilyInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToFamilyInternal.java new file mode 100644 index 00000000000..914b6351a0c --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToFamilyInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addInternalLastModified; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_modificationDate_to_family.internal", description = "Add internal modificationDate to Family #1810", + version = "2.2.0", language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210812, deprecatedSince = "3.0.0") +public class AddModificationDateToFamilyInternal extends AddInternalLastModified { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToFileInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToFileInternal.java new file mode 100644 index 00000000000..7ffc3cf7f37 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToFileInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addInternalLastModified; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_modificationDate_to_file.internal", description = "Add internal modificationDate to File #1810", + version = "2.2.0", language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210812, deprecatedSince = "3.0.0") +public class AddModificationDateToFileInternal extends AddInternalLastModified { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToIndividualInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToIndividualInternal.java new file mode 100644 index 00000000000..05ca7bc522d --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToIndividualInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addInternalLastModified; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_modificationDate_to_individual.internal", description = "Add internal modificationDate to Individual #1810", + version = "2.2.0", language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210812, deprecatedSince = "3.0.0") +public class AddModificationDateToIndividualInternal extends AddInternalLastModified { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToInterpretationInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToInterpretationInternal.java new file mode 100644 index 00000000000..9340231dfde --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToInterpretationInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addInternalLastModified; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_modificationDate_to_interpretation.internal", description = "Add internal modificationDate to Interpretation #1810", + version = "2.2.0", language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210812, deprecatedSince = "3.0.0") +public class AddModificationDateToInterpretationInternal extends AddInternalLastModified { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToJobInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToJobInternal.java new file mode 100644 index 00000000000..543e02f328e --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToJobInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addInternalLastModified; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_modificationDate_to_job.internal", description = "Add internal modificationDate to Job #1810", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210812, deprecatedSince = "3.0.0") +public class AddModificationDateToJobInternal extends AddInternalLastModified { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToProjectInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToProjectInternal.java new file mode 100644 index 00000000000..82a3142a222 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToProjectInternal.java @@ -0,0 +1,14 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addInternalLastModified; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_modificationDate_to_project.internal", description = "Add internal modificationDate to Project #1810", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210812, deprecatedSince = "3.0.0") +public class AddModificationDateToProjectInternal extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToSampleInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToSampleInternal.java new file mode 100644 index 00000000000..875bbaa26a7 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToSampleInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addInternalLastModified; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_modificationDate_to_sample.internal", description = "Add internal modificationDate to Sample #1810", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210812, deprecatedSince = "3.0.0") +public class AddModificationDateToSampleInternal extends AddInternalLastModified { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToStudyInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToStudyInternal.java new file mode 100644 index 00000000000..987a742cb5d --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInternalLastModified/AddModificationDateToStudyInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addInternalLastModified; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_modificationDate_to_study.internal", description = "Add internal modificationDate to Study #1810", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210812, deprecatedSince = "3.0.0") +public class AddModificationDateToStudyInternal extends AddInternalLastModified { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInterpretationStats.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInterpretationStats.java new file mode 100644 index 00000000000..ac1c112d0a1 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addInterpretationStats.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_interpretation_stats", + description = "Add interpretation stats #1819", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + patch = 2, + date = 20210908, deprecatedSince = "3.0.0") +public class addInterpretationStats extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDate.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDate.java new file mode 100644 index 00000000000..efd1107ba7b --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDate.java @@ -0,0 +1,10 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addRegistrationDate; + +import org.opencb.opencga.catalog.migration.MigrationTool; + +public abstract class AddRegistrationDate extends MigrationTool { + + protected void addRegistrationDate(String collection) { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToClinicalInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToClinicalInternal.java new file mode 100644 index 00000000000..14a48ed90be --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToClinicalInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addRegistrationDate; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_registrationDate_to_clinical.internal", description = "Add registrationDate to Clinical #1804", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210720, deprecatedSince = "3.0.0") +public class AddRegistrationDateToClinicalInternal extends AddRegistrationDate { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToCohortInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToCohortInternal.java new file mode 100644 index 00000000000..a7dcf145b33 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToCohortInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addRegistrationDate; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_registrationDate_to_cohort.internal", description = "Add registrationDate to Cohort #1804", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210720, deprecatedSince = "3.0.0") +public class AddRegistrationDateToCohortInternal extends AddRegistrationDate { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToFamilyInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToFamilyInternal.java new file mode 100644 index 00000000000..66f375ce955 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToFamilyInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addRegistrationDate; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_registrationDate_to_family.internal", description = "Add registrationDate to Family #1804", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210720, deprecatedSince = "3.0.0") +public class AddRegistrationDateToFamilyInternal extends AddRegistrationDate { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToFileInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToFileInternal.java new file mode 100644 index 00000000000..cfa29de842a --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToFileInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addRegistrationDate; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_registrationDate_to_file.internal", description = "Add registrationDate to File #1804", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210720, deprecatedSince = "3.0.0") +public class AddRegistrationDateToFileInternal extends AddRegistrationDate { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToIndividualInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToIndividualInternal.java new file mode 100644 index 00000000000..58d233f6d7f --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToIndividualInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addRegistrationDate; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_registrationDate_to_individual.internal", description = "Add registrationDate to Individual #1804", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210720, deprecatedSince = "3.0.0") +public class AddRegistrationDateToIndividualInternal extends AddRegistrationDate { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToInterpretationInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToInterpretationInternal.java new file mode 100644 index 00000000000..115b4e4fc6c --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToInterpretationInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addRegistrationDate; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_registrationDate_to_interpretation.internal", description = "Add registrationDate to Interpretation #1804", + version = "2.2.0", language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210720, deprecatedSince = "3.0.0") +public class AddRegistrationDateToInterpretationInternal extends AddRegistrationDate { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToJobInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToJobInternal.java new file mode 100644 index 00000000000..c56124cdda6 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToJobInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addRegistrationDate; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_registrationDate_to_job.internal", description = "Add registrationDate to Job #1804", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210720, deprecatedSince = "3.0.0") +public class AddRegistrationDateToJobInternal extends AddRegistrationDate { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToProjectInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToProjectInternal.java new file mode 100644 index 00000000000..ae3f65b70d9 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToProjectInternal.java @@ -0,0 +1,14 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addRegistrationDate; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_registrationDate_to_project.internal", description = "Add registrationDate to Project #1804", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210720, deprecatedSince = "3.0.0") +public class AddRegistrationDateToProjectInternal extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToSampleInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToSampleInternal.java new file mode 100644 index 00000000000..e317c667a98 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToSampleInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addRegistrationDate; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_registrationDate_to_sample.internal", description = "Add registrationDate to Sample #1804", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210720, deprecatedSince = "3.0.0") +public class AddRegistrationDateToSampleInternal extends AddRegistrationDate { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToStudyInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToStudyInternal.java new file mode 100644 index 00000000000..7d036f65bc4 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRegistrationDate/AddRegistrationDateToStudyInternal.java @@ -0,0 +1,13 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.addRegistrationDate; + +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_registrationDate_to_study.internal", description = "Add registrationDate to Study #1804", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, + date = 20210720, deprecatedSince = "3.0.0") +public class AddRegistrationDateToStudyInternal extends AddRegistrationDate { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRgaIndexToStudyInternal.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRgaIndexToStudyInternal.java new file mode 100644 index 00000000000..d995f4ba97f --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/addRgaIndexToStudyInternal.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_rga_index_summary_to_study_internal", + description = "Add RGA Index information to Study Internal #", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + patch = 1, + date = 20210719, deprecatedSince = "3.0.0") +public class addRgaIndexToStudyInternal extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1795/AddFamilyIdsInIndividual.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1795/AddFamilyIdsInIndividual.java new file mode 100644 index 00000000000..25e93347812 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1795/AddFamilyIdsInIndividual.java @@ -0,0 +1,15 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issue_1795; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationException; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_familyIds_in_individual", description = "Add new list of familyIds in Individual #1795", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, date = 20210630, deprecatedSince = "3.0.0") +public class AddFamilyIdsInIndividual extends MigrationTool { + + @Override + protected void run() throws MigrationException { + } +} + diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1796/AddCohortIdsInSample.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1796/AddCohortIdsInSample.java new file mode 100644 index 00000000000..b6d1d3ff298 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1796/AddCohortIdsInSample.java @@ -0,0 +1,15 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issue_1796; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationException; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_cohortIds_in_sample", description = "Add new list of cohortIds in Sample #1796", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, date = 20210706, deprecatedSince = "3.0.0") +public class AddCohortIdsInSample extends MigrationTool { + + @Override + protected void run() throws MigrationException { + } +} + diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteClinicalStatusDataModel.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteClinicalStatusDataModel.java new file mode 100644 index 00000000000..fcb2313cb39 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteClinicalStatusDataModel.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issue_1849; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "complete_clinical_status_models", + description = "Complete Clinical Status data models #1849", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211126, + deprecatedSince = "3.0.0") +public class CompleteClinicalStatusDataModel extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteCohortStatusDataModel.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteCohortStatusDataModel.java new file mode 100644 index 00000000000..692e58cc397 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteCohortStatusDataModel.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issue_1849; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "complete_cohort_status_models", + description = "Complete Cohort Status data models #1849", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211126, deprecatedSince = "3.0.0") +public class CompleteCohortStatusDataModel extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteFamilyStatusDataModel.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteFamilyStatusDataModel.java new file mode 100644 index 00000000000..5c1bfbfc2aa --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteFamilyStatusDataModel.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issue_1849; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "complete_family_status_models", + description = "Complete Family Status data models #1849", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211126, deprecatedSince = "3.0.0") +public class CompleteFamilyStatusDataModel extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteFileStatusDataModel.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteFileStatusDataModel.java new file mode 100644 index 00000000000..c1c84058b5c --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteFileStatusDataModel.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issue_1849; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "complete_file_status_models", + description = "Complete File Status data models #1849", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211126, deprecatedSince = "3.0.0") +public class CompleteFileStatusDataModel extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteIndividualStatusDataModel.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteIndividualStatusDataModel.java new file mode 100644 index 00000000000..cb7fda578ca --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteIndividualStatusDataModel.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issue_1849; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "complete_individual_status_models", + description = "Complete Individual Status data models #1849", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211126, deprecatedSince = "3.0.0") +public class CompleteIndividualStatusDataModel extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteInterpretationStatusDataModel.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteInterpretationStatusDataModel.java new file mode 100644 index 00000000000..dad8a984810 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteInterpretationStatusDataModel.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issue_1849; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "complete_interpretation_status_models", + description = "Complete Interpretation Status data models #1849", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211126, deprecatedSince = "3.0.0") +public class CompleteInterpretationStatusDataModel extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteJobStatusDataModel.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteJobStatusDataModel.java new file mode 100644 index 00000000000..4a08d4695e7 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteJobStatusDataModel.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issue_1849; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "complete_job_status_models", + description = "Complete Job Status data models #1849", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211126, deprecatedSince = "3.0.0") +public class CompleteJobStatusDataModel extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompletePanelStatusDataModel.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompletePanelStatusDataModel.java new file mode 100644 index 00000000000..8311dcc2153 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompletePanelStatusDataModel.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issue_1849; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "complete_panel_status_models", + description = "Complete Panel Status data models #1849", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211126, deprecatedSince = "3.0.0") +public class CompletePanelStatusDataModel extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteProjectStatusDataModel.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteProjectStatusDataModel.java new file mode 100644 index 00000000000..09ce8a4fc88 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteProjectStatusDataModel.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issue_1849; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "complete_project_status_models", + description = "Complete Project Status data models #1849", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211126, deprecatedSince = "3.0.0") +public class CompleteProjectStatusDataModel extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteSampleStatusDataModel.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteSampleStatusDataModel.java new file mode 100644 index 00000000000..bb9b3e54086 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteSampleStatusDataModel.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issue_1849; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "complete_sample_status_models", + description = "Complete Sample Status data models #1849", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211126, deprecatedSince = "3.0.0") +public class CompleteSampleStatusDataModel extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteStudyStatusDataModel.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteStudyStatusDataModel.java new file mode 100644 index 00000000000..8b119d92cc4 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteStudyStatusDataModel.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issue_1849; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "complete_study_status_models", + description = "Complete Study Status data models #1849", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211126, deprecatedSince = "3.0.0") +public class CompleteStudyStatusDataModel extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteUserStatusDataModel.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteUserStatusDataModel.java new file mode 100644 index 00000000000..937e6d3f9fb --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issue_1849/CompleteUserStatusDataModel.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issue_1849; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "complete_user_status_models", + description = "Complete User Status data models #1849", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211126, deprecatedSince = "3.0.0") +public class CompleteUserStatusDataModel extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issues_1853_1855/IndividualOntologyTermMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issues_1853_1855/IndividualOntologyTermMigration.java new file mode 100644 index 00000000000..9a5eb6cec84 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issues_1853_1855/IndividualOntologyTermMigration.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issues_1853_1855; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "individual_ontology_term_migration_#1853", + description = "Change sex and ethnicity types for OntologyTermAnnotation #1855", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211203, deprecatedSince = "3.0.0") +public class IndividualOntologyTermMigration extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issues_1853_1855/NewStudyDataModelFields.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issues_1853_1855/NewStudyDataModelFields.java new file mode 100644 index 00000000000..e6659fb4ad7 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issues_1853_1855/NewStudyDataModelFields.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issues_1853_1855; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "new_study_data_model_fields_#1853", + description = "New Study 'sources', 'type' and 'additionalInfo' fields #1853", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211202, deprecatedSince = "3.0.0") +public class NewStudyDataModelFields extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issues_1853_1855/SampleProcessingAndCollectionChanges.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issues_1853_1855/SampleProcessingAndCollectionChanges.java new file mode 100644 index 00000000000..a054a6a0566 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/issues_1853_1855/SampleProcessingAndCollectionChanges.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog.issues_1853_1855; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "sample_source_treatments_#1854", + description = "Sample source, treatments, processing and collection changes #1854", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20211201, patch = 2, deprecatedSince = "3.0.0") +public class SampleProcessingAndCollectionChanges extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/renameVariableSetFieldFromVariable.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/renameVariableSetFieldFromVariable.java new file mode 100644 index 00000000000..bd3f00937e9 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/catalog/renameVariableSetFieldFromVariable.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.catalog; + + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "rename_variableset_field", + description = "Rename Variable variableSet field to variables #1823", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20210920, deprecatedSince = "3.0.0") +public class renameVariableSetFieldFromVariable extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/storage/SynchronizeCatalogStorage.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/storage/SynchronizeCatalogStorage.java new file mode 100644 index 00000000000..609d50c915a --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/storage/SynchronizeCatalogStorage.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.storage; + +import org.opencb.opencga.app.migrations.StorageMigrationTool; +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "synchronize_catalog_storage_1850_1851", + description = "Synchronize catalog storage #1850 #1851", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.STORAGE, + date = 20220118, deprecatedSince = "3.0.0") +public class SynchronizeCatalogStorage extends StorageMigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/storage/UpdateSampleIndexStatus.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/storage/UpdateSampleIndexStatus.java new file mode 100644 index 00000000000..2965c326760 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_0/storage/UpdateSampleIndexStatus.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_0.storage; + +import org.opencb.opencga.app.migrations.StorageMigrationTool; +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "update_sample_index_status_1901", + description = " Improve sample-index multi-schema management. #1901", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.STORAGE, + date = 20220302, deprecatedSince = "3.0.0") +public class UpdateSampleIndexStatus extends StorageMigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_1/catalog/AddMissingBiotypes.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_1/catalog/AddMissingBiotypes.java new file mode 100644 index 00000000000..7173a402e96 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_1/catalog/AddMissingBiotypes.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_1.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_missing_biotypes", + description = "Add missing biotypes, #TASK-625", version = "2.2.1", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220412, deprecatedSince = "3.0.0") +public class AddMissingBiotypes extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_1/catalog/AddPanelGeneNameIndex.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_1/catalog/AddPanelGeneNameIndex.java new file mode 100644 index 00000000000..0cd9ba5ff1b --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_1/catalog/AddPanelGeneNameIndex.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_1.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_panel_gene_name_index", + description = "Add Panel gene.name index #TASK-602", version = "2.2.1", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220406, deprecatedSince = "3.0.0") +public class AddPanelGeneNameIndex extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_1/catalog/InitSharedProjectField.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_1/catalog/InitSharedProjectField.java new file mode 100644 index 00000000000..49b4b252f60 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_1/catalog/InitSharedProjectField.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_1.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "init_shared_project", + description = "Initialise sharedProjects #TASK-702", version = "2.2.1", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220502, deprecatedSince = "3.0.0") +public class InitSharedProjectField extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_1/storage/SampleIndexConfigurationAddMissingStatus.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_1/storage/SampleIndexConfigurationAddMissingStatus.java new file mode 100644 index 00000000000..cd11e50f8aa --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_2_1/storage/SampleIndexConfigurationAddMissingStatus.java @@ -0,0 +1,15 @@ +package org.opencb.opencga.app.migrations.v2.v2_2_1.storage; + +import org.opencb.opencga.app.migrations.StorageMigrationTool; +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "sample_index_configuration_add_missing_status", + description = "Sample index configuration add missing status #TASK-512", version = "2.2.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.STORAGE, + date = 20220328, deprecatedSince = "3.0.0") +public class SampleIndexConfigurationAddMissingStatus extends StorageMigrationTool { + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/AddLockedToInterpretation.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/AddLockedToInterpretation.java new file mode 100644 index 00000000000..52a95ccf66e --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/AddLockedToInterpretation.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_3_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_locked_to_interpretation_TASK-552", + description = "Add new 'locked' field to Interpretation #TASK-552", version = "2.3.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220401, + deprecatedSince = "3.0.0") +public class AddLockedToInterpretation extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/AddPanelInternalField.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/AddPanelInternalField.java new file mode 100644 index 00000000000..e2edbf68060 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/AddPanelInternalField.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_3_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_panel_internal_field-TASK_734", + description = "Add 'internal' to Panel data model #TASK-734", version = "2.3.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220509, + deprecatedSince = "3.0.0") +public class AddPanelInternalField extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/AutoIncrementVersion.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/AutoIncrementVersion.java new file mode 100644 index 00000000000..8cbd5a59eef --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/AutoIncrementVersion.java @@ -0,0 +1,19 @@ +package org.opencb.opencga.app.migrations.v2.v2_3_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "autoincrement_version_TASK-323", + description = "Reorganise data in new collections (autoincrement version) #TASK-323", version = "2.3.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + offline = true, + date = 20220512, + deprecatedSince = "3.0.0") +public class AutoIncrementVersion extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/InitSampleIndexConfiguration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/InitSampleIndexConfiguration.java new file mode 100644 index 00000000000..81d3f1e8628 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/InitSampleIndexConfiguration.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_3_0.catalog; + +import org.opencb.opencga.app.migrations.StorageMigrationTool; +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "init_sampleIndexConfiguration-TASK550", + description = "Initialise SampleIndexConfiguration in Study internal #TASK-550", version = "2.3.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220502, + deprecatedSince = "3.0.0") +public class InitSampleIndexConfiguration extends StorageMigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/MoveCellbaseFromProjectInternalToProject.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/MoveCellbaseFromProjectInternalToProject.java new file mode 100644 index 00000000000..9f4f30213fb --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/MoveCellbaseFromProjectInternalToProject.java @@ -0,0 +1,19 @@ +package org.opencb.opencga.app.migrations.v2.v2_3_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "move_cellbase_from_project_internal_to_project_TASK-354", + description = "Move cellbase from project.internal to project #TASK-354", version = "2.3.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220422, + deprecatedSince = "3.0.0") + +public class MoveCellbaseFromProjectInternalToProject extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/RenameDeletedCollections.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/RenameDeletedCollections.java new file mode 100644 index 00000000000..2a1532c6da4 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/RenameDeletedCollections.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_3_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "rename_deleted_collections_TASK-359", + description = "Rename deleted collections #TASK-359", version = "2.3.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220502, + deprecatedSince = "3.0.0") +public class RenameDeletedCollections extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/RenameDeprecatedVariantStorageToolId.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/RenameDeprecatedVariantStorageToolId.java new file mode 100644 index 00000000000..b39a56cdbec --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/RenameDeprecatedVariantStorageToolId.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_3_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "rename_variant_storage_tool_ids_TASK-705", + description = "Rename variant storage tool ids #TASK-705", version = "2.3.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220506, + deprecatedSince = "3.0.0") +public class RenameDeprecatedVariantStorageToolId extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/UpdateJWTSecretKey.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/UpdateJWTSecretKey.java new file mode 100644 index 00000000000..be328bbeb6a --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/catalog/UpdateJWTSecretKey.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_3_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "update_jwt_secret_key_TASK-807", + description = "Update JWT secret key #TASK-807", version = "2.3.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220513, + deprecatedSince = "3.0.0") +public class UpdateJWTSecretKey extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/storage/AddMissingColumnsToPhoenix.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/storage/AddMissingColumnsToPhoenix.java new file mode 100644 index 00000000000..df2e308a727 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_0/storage/AddMissingColumnsToPhoenix.java @@ -0,0 +1,14 @@ +package org.opencb.opencga.app.migrations.v2.v2_3_0.storage; + +import org.opencb.opencga.app.migrations.StorageMigrationTool; +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id="add_missing_columns_to_phoenix_TASK-789", description = "Add missing 1000G columns to phoenix #TASK-789", + version = "2.3.0", domain = Migration.MigrationDomain.STORAGE, date = 20220614, deprecatedSince = "3.0.0" +) +public class AddMissingColumnsToPhoenix extends StorageMigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_1/catalog/MoveCellbaseFromProjectInternalToProjectBugFix.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_1/catalog/MoveCellbaseFromProjectInternalToProjectBugFix.java new file mode 100644 index 00000000000..2c645980391 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_3_1/catalog/MoveCellbaseFromProjectInternalToProjectBugFix.java @@ -0,0 +1,19 @@ +package org.opencb.opencga.app.migrations.v2.v2_3_1.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "bugfix_move_cellbase_from_project_internal_to_project_TASK-1100", + description = "Bugfix: Move cellbase from project.internal to project #TASK-1100", version = "2.3.1", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220620, + deprecatedSince = "3.0.0") + +public class MoveCellbaseFromProjectInternalToProjectBugFix extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_0/catalog/AddClinicalStatusType_607.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_0/catalog/AddClinicalStatusType_607.java new file mode 100644 index 00000000000..8f3886c50e8 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_0/catalog/AddClinicalStatusType_607.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_4_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_clinical_status_type_TASK-607", + description = "Automatically close cases depending on the new clinical status type #TASK-607", version = "2.4.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220610, + deprecatedSince = "3.0.0") +public class AddClinicalStatusType_607 extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_0/catalog/AddPrivateDueDate_803.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_0/catalog/AddPrivateDueDate_803.java new file mode 100644 index 00000000000..6dcab05694a --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_0/catalog/AddPrivateDueDate_803.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_4_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_private_dueDate_TASK-803", + description = "Add private _dueDate to ClinicalAnalysis #TASK-803", version = "2.4.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220530, + deprecatedSince = "3.0.0") +public class AddPrivateDueDate_803 extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_0/catalog/IndexPanelSource.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_0/catalog/IndexPanelSource.java new file mode 100644 index 00000000000..af93d04de7d --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_0/catalog/IndexPanelSource.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_4_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "index_panel_source_TASK-473", + description = "Index panel source #TASK-473", version = "2.4.0", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220530, + deprecatedSince = "3.0.0") +public class IndexPanelSource extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_10/catalog/AddMissingEndDateOnFinishedJobs.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_10/catalog/AddMissingEndDateOnFinishedJobs.java new file mode 100644 index 00000000000..0759d4c7bf1 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_10/catalog/AddMissingEndDateOnFinishedJobs.java @@ -0,0 +1,20 @@ +package org.opencb.opencga.app.migrations.v2.v2_4_10.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_missing_endDate_on_finished_jobs" , + description = "Add missing end date on finished jobs", + version = "2.4.10", + domain = Migration.MigrationDomain.CATALOG, + language = Migration.MigrationLanguage.JAVA, + date = 20221026, + deprecatedSince = "3.0.0" +) +public class AddMissingEndDateOnFinishedJobs extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_11/SynchronizeCatalogStorageStatuses.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_11/SynchronizeCatalogStorageStatuses.java new file mode 100644 index 00000000000..e2fb99933cf --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_11/SynchronizeCatalogStorageStatuses.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_4_11; + +import org.opencb.opencga.app.migrations.StorageMigrationTool; +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "synchronize_catalog_storage_statuses", + description = "Synchronize catalog internal statuses from storage, #TASK-1304", version = "2.4.11", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.STORAGE, + date = 20221117, + deprecatedSince = "3.0.0") +public class SynchronizeCatalogStorageStatuses extends StorageMigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_11/catalog/SignatureFittingsMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_11/catalog/SignatureFittingsMigration.java new file mode 100644 index 00000000000..ec0b49baae3 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_11/catalog/SignatureFittingsMigration.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_4_11.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "signature_fittings" , + description = "Replace fitting for fittings in Signature", + version = "2.4.11", + domain = Migration.MigrationDomain.CATALOG, + language = Migration.MigrationLanguage.JAVA, + date = 20221109, + deprecatedSince = "3.0.0" +) +public class SignatureFittingsMigration extends MigrationTool { + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_2/catalog/AddClinicalDiscussion.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_2/catalog/AddClinicalDiscussion.java new file mode 100644 index 00000000000..8e5825e3de7 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_2/catalog/AddClinicalDiscussion.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_4_2.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "add_clinical_discussion_TASK-1472", + description = "Add ClinicalDiscussion #TASK-1472", version = "2.4.2", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220727, + deprecatedSince = "3.0.0") +public class AddClinicalDiscussion extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_2/catalog/RecoverProbandSamplesInCases.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_2/catalog/RecoverProbandSamplesInCases.java new file mode 100644 index 00000000000..aba0267d65b --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_2/catalog/RecoverProbandSamplesInCases.java @@ -0,0 +1,19 @@ +package org.opencb.opencga.app.migrations.v2.v2_4_2.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "recover_proband_samples_in_cases_TASK-1470", + description = "Recover lost samples in clinical collection #TASK-1470", version = "2.4.2", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220725, + patch = 2, + deprecatedSince = "3.0.0") +public class RecoverProbandSamplesInCases extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_3/catalog/MigrateToClinicalAcmg.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_3/catalog/MigrateToClinicalAcmg.java new file mode 100644 index 00000000000..7951810b105 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_3/catalog/MigrateToClinicalAcmg.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_4_3.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "migrate_to_clinical_acmg_TASK-1194", + description = "Migrate to ClinicalAcmg #TASK-1194", version = "2.4.3", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220809, + deprecatedSince = "3.0.0") +public class MigrateToClinicalAcmg extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_3/catalog/ShortenIndexedFieldVariables.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_3/catalog/ShortenIndexedFieldVariables.java new file mode 100644 index 00000000000..2d4e2cb14a8 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_3/catalog/ShortenIndexedFieldVariables.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_4_3.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "shorten_indexed_field_variables-1386", + description = "Shorten indexed field variables #TASK-1386", version = "2.4.3", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220809, + deprecatedSince = "3.0.0") +public class ShortenIndexedFieldVariables extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_4/catalog/AvoidCaseStatusIdNullMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_4/catalog/AvoidCaseStatusIdNullMigration.java new file mode 100644 index 00000000000..e26df11c03c --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_4/catalog/AvoidCaseStatusIdNullMigration.java @@ -0,0 +1,18 @@ +package org.opencb.opencga.app.migrations.v2.v2_4_4.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "avoidCaseStatusIdNull-1938", + description = "Avoid nullable status id in Clinical Analysis #TASK-1938", version = "2.4.4", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220914, + deprecatedSince = "3.0.0") +public class AvoidCaseStatusIdNullMigration extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_4/catalog/RemoveBiotypeAllowedKeysMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_4/catalog/RemoveBiotypeAllowedKeysMigration.java new file mode 100644 index 00000000000..07a19a12fdb --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_4/catalog/RemoveBiotypeAllowedKeysMigration.java @@ -0,0 +1,17 @@ +package org.opencb.opencga.app.migrations.v2.v2_4_4.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "remove_biotype_allowed_keys_TASK-1849", + description = "Remove biotype and consequence type allowed keys from variable sets #TASK-1849", version = "2.4.4", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.CATALOG, + date = 20220905, + deprecatedSince = "3.0.0") +public class RemoveBiotypeAllowedKeysMigration extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_4/storage/InvalidateVariantArchivesMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_4/storage/InvalidateVariantArchivesMigration.java new file mode 100644 index 00000000000..069e1a86e6e --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_4_4/storage/InvalidateVariantArchivesMigration.java @@ -0,0 +1,16 @@ +package org.opencb.opencga.app.migrations.v2.v2_4_4.storage; + +import org.opencb.opencga.app.migrations.StorageMigrationTool; +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "invalidate_variant_archives_migration-633", + description = "Invalidate variant archives from variant storage hadoop #TASK-633", version = "2.4.4", + language = Migration.MigrationLanguage.JAVA, + domain = Migration.MigrationDomain.STORAGE, + date = 20220825, + deprecatedSince = "3.0.0") +public class InvalidateVariantArchivesMigration extends StorageMigrationTool { + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_6_0/storage/AddCellbaseDataRelease.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_6_0/storage/AddCellbaseDataRelease.java new file mode 100644 index 00000000000..06f1d871a80 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_6_0/storage/AddCellbaseDataRelease.java @@ -0,0 +1,20 @@ +package org.opencb.opencga.app.migrations.v2.v2_6_0.storage; + +import org.opencb.opencga.app.migrations.StorageMigrationTool; +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "add_cellbase_data_release" , + description = "Add default cellbase data release if missing", + version = "2.6.0", + domain = Migration.MigrationDomain.STORAGE, + language = Migration.MigrationLanguage.JAVA, + patch = 2, + date = 20230104, + deprecatedSince = "3.0.0" +) +public class AddCellbaseDataRelease extends StorageMigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_7_0/catalog/CancerRoleAndModeOfInheritanceMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_7_0/catalog/CancerRoleAndModeOfInheritanceMigration.java new file mode 100644 index 00000000000..ce425e3434b --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_7_0/catalog/CancerRoleAndModeOfInheritanceMigration.java @@ -0,0 +1,20 @@ +package org.opencb.opencga.app.migrations.v2.v2_7_0.catalog; + + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "panel_roles_and_modesOfInheritance" , + description = "Change panel cancer.role and modeOfInheritance for cancer.roles[] and modesOfInheritance[]", + version = "2.7.0", + domain = Migration.MigrationDomain.CATALOG, + language = Migration.MigrationLanguage.JAVA, + date = 20230117, + deprecatedSince = "3.0.0" +) +public class CancerRoleAndModeOfInheritanceMigration extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_8_0/catalog/CalculatePedigreeGraphMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_8_0/catalog/CalculatePedigreeGraphMigration.java new file mode 100644 index 00000000000..0be802202c4 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_8_0/catalog/CalculatePedigreeGraphMigration.java @@ -0,0 +1,19 @@ +package org.opencb.opencga.app.migrations.v2.v2_8_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "calculate_pedigree_graph" , + description = "Calculate Pedigree Graph for all the families", + version = "2.8.0", + domain = Migration.MigrationDomain.CATALOG, + language = Migration.MigrationLanguage.JAVA, + date = 20230313, + deprecatedSince = "3.0.0" +) +public class CalculatePedigreeGraphMigration extends MigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_8_6/storage/MarkUnknownLargestVariantLength.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_8_6/storage/MarkUnknownLargestVariantLength.java new file mode 100644 index 00000000000..e3b093906c4 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_8_6/storage/MarkUnknownLargestVariantLength.java @@ -0,0 +1,20 @@ +package org.opencb.opencga.app.migrations.v2.v2_8_6.storage; + +import org.opencb.opencga.app.migrations.StorageMigrationTool; +import org.opencb.opencga.catalog.migration.Migration; + +@Migration(id = "mark_unknown_largest_variant_length" , + description = "Mark as unknown largest variant length", + version = "2.8.6", + domain = Migration.MigrationDomain.STORAGE, + language = Migration.MigrationLanguage.JAVA, + patch = 1, + date = 20230927, + deprecatedSince = "3.0.0" +) +public class MarkUnknownLargestVariantLength extends StorageMigrationTool { + + @Override + protected void run() throws Exception { + } +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_9_0/catalog/RenameCellBaseToken2ApiKey.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_9_0/catalog/RenameCellBaseToken2ApiKey.java new file mode 100644 index 00000000000..7dbd590c27e --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_9_0/catalog/RenameCellBaseToken2ApiKey.java @@ -0,0 +1,20 @@ +package org.opencb.opencga.app.migrations.v2.v2_9_0.catalog; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +@Migration(id = "rename_cellbase_token_2_api_key" , + description = "Rename CellBase Token to ApiKey", + version = "2.9.0", + domain = Migration.MigrationDomain.CATALOG, + language = Migration.MigrationLanguage.JAVA, + date = 20230829, + deprecatedSince = "3.0.0" +) +public class RenameCellBaseToken2ApiKey extends MigrationTool { + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3/v3_0_0/OrganizationMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3/v3_0_0/OrganizationMigration.java new file mode 100644 index 00000000000..9b226c0ea1a --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3/v3_0_0/OrganizationMigration.java @@ -0,0 +1,19 @@ +package org.opencb.opencga.app.migrations.v3.v3_0_0; + +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; +import org.opencb.opencga.core.config.Configuration; + +@Migration(id = "add_organizations", description = "Add new Organization layer #TASK-4389", version = "3.0.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, date = 20231212, + deprecatedSince = "3.1.0") +public class OrganizationMigration extends MigrationTool { + + public OrganizationMigration(Configuration configuration, String adminPassword, String userId) { + } + + @Override + protected void run() throws Exception { + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3/v3_1_0/AuthOriginSimplificationMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3/v3_1_0/AuthOriginSimplificationMigration.java new file mode 100644 index 00000000000..e1b331fa987 --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3/v3_1_0/AuthOriginSimplificationMigration.java @@ -0,0 +1,64 @@ +package org.opencb.opencga.app.migrations.v3.v3_1_0; + +import com.mongodb.client.model.Filters; +import com.mongodb.client.model.Projections; +import com.mongodb.client.model.UpdateOneModel; +import com.mongodb.client.model.Updates; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.bson.Document; +import org.bson.conversions.Bson; +import org.opencb.opencga.catalog.db.api.OrganizationDBAdaptor; +import org.opencb.opencga.catalog.db.mongodb.OrganizationMongoDBAdaptorFactory; +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; +import org.opencb.opencga.core.common.PasswordUtils; + +import java.util.List; + +@Migration(id = "hide_secret_key", description = "Hide secret key #TASK-5923", version = "3.1.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, date = 20240410) +public class AuthOriginSimplificationMigration extends MigrationTool { + + @Override + protected void run() throws Exception { + Bson query = Filters.exists("configuration.token", false); + Bson projection = Projections.include("_id", "configuration"); + migrateCollection(OrganizationMongoDBAdaptorFactory.ORGANIZATION_COLLECTION, query, projection, (orgDocument, bulk) -> { + Document configuration = orgDocument.get(OrganizationDBAdaptor.QueryParams.CONFIGURATION.key(), Document.class); + if (configuration != null) { + String secretKey = null; + List authenticationOrigins = configuration.getList("authenticationOrigins", Document.class); + if (CollectionUtils.isNotEmpty(authenticationOrigins)) { + for (Document authenticationOrigin : authenticationOrigins) { + if (authenticationOrigin.getString("type").equals("OPENCGA")) { + secretKey = authenticationOrigin.getString("secretKey"); + if (authenticationOrigin.getString("id").equals("internal")) { + authenticationOrigin.put("id", "OPENCGA"); + } + } + authenticationOrigin.remove("secretKey"); + authenticationOrigin.remove("algorithm"); + authenticationOrigin.remove("expiration"); + } + } + secretKey = StringUtils.isNotEmpty(secretKey) ? secretKey : PasswordUtils.getStrongRandomPassword(32); + Document token = new Document() + .append("secretKey", secretKey) + .append("algorithm", "HS256") + .append("expiration", 3600L); + configuration.put("token", token); + bulk.add(new UpdateOneModel<>( + Filters.eq("_id", orgDocument.get("_id")), + Updates.set("configuration", configuration))); + } + }); + + // Change authOrigin id from all "internal" users + getMongoCollection(OrganizationMongoDBAdaptorFactory.USER_COLLECTION) + .updateMany( + new Document("account.authentication.id", "internal"), + Updates.set("account.authentication.id", "OPENCGA")); + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3_1_0/NoteMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3/v3_1_0/NoteMigration.java similarity index 98% rename from opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3_1_0/NoteMigration.java rename to opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3/v3_1_0/NoteMigration.java index a842905fc70..c5fb031f1da 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3_1_0/NoteMigration.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3/v3_1_0/NoteMigration.java @@ -1,4 +1,4 @@ -package org.opencb.opencga.app.migrations.v3_1_0; +package org.opencb.opencga.app.migrations.v3.v3_1_0; import com.mongodb.MongoNamespace; import com.mongodb.client.MongoCollection; diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3_0_0/OrganizationMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3_0_0/OrganizationMigration.java deleted file mode 100644 index 3ea84a6f204..00000000000 --- a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3_0_0/OrganizationMigration.java +++ /dev/null @@ -1,410 +0,0 @@ -package org.opencb.opencga.app.migrations.v3_0_0; - -import com.mongodb.client.*; -import com.mongodb.client.model.Filters; -import com.mongodb.client.model.InsertOneModel; -import com.mongodb.client.model.Projections; -import com.mongodb.client.model.Updates; -import com.mongodb.client.result.DeleteResult; -import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.StringUtils; -import org.bson.Document; -import org.bson.conversions.Bson; -import org.opencb.commons.datastore.mongodb.MongoDataStore; -import org.opencb.commons.utils.CryptoUtils; -import org.opencb.opencga.catalog.auth.authentication.CatalogAuthenticationManager; -import org.opencb.opencga.catalog.db.api.StudyDBAdaptor; -import org.opencb.opencga.catalog.db.mongodb.MongoDBAdaptorFactory; -import org.opencb.opencga.catalog.db.mongodb.OrganizationMongoDBAdaptorFactory; -import org.opencb.opencga.catalog.exceptions.CatalogAuthorizationException; -import org.opencb.opencga.catalog.exceptions.CatalogException; -import org.opencb.opencga.catalog.exceptions.CatalogIOException; -import org.opencb.opencga.catalog.io.CatalogIOManager; -import org.opencb.opencga.catalog.io.IOManagerFactory; -import org.opencb.opencga.catalog.managers.CatalogManager; -import org.opencb.opencga.catalog.migration.Migration; -import org.opencb.opencga.catalog.migration.MigrationTool; -import org.opencb.opencga.core.api.ParamConstants; -import org.opencb.opencga.core.config.AuthenticationOrigin; -import org.opencb.opencga.core.config.Configuration; -import org.opencb.opencga.core.models.migration.MigrationRun; -import org.opencb.opencga.core.models.organizations.OrganizationCreateParams; - -import java.nio.file.Files; -import java.nio.file.Paths; -import java.security.NoSuchAlgorithmException; -import java.util.*; -import java.util.stream.Collectors; - -@Migration(id = "add_organizations", description = "Add new Organization layer #TASK-4389", version = "3.0.0", - language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, date = 20231212) -public class OrganizationMigration extends MigrationTool { - private final Configuration configuration; - private final String adminPassword; - private String userId; - - private MongoDBAdaptorFactory mongoDBAdaptorFactory; - private String oldDatabase; - private MongoDataStore oldDatastore; - private Set userIdsToDiscardData; - - private MigrationStatus status; - - private enum MigrationStatus { - MIGRATED, - PENDING_MIGRATION, - ERROR - } - - public OrganizationMigration(Configuration configuration, String adminPassword, String userId) throws CatalogException { - this.configuration = configuration; - this.adminPassword = adminPassword; - this.userId = userId; - - this.status = checkAndInit(); - } - - private MigrationStatus checkAndInit() throws CatalogException { - this.oldDatabase = configuration.getDatabasePrefix() + "_catalog"; - this.mongoDBAdaptorFactory = new MongoDBAdaptorFactory(configuration, new IOManagerFactory()); - this.oldDatastore = mongoDBAdaptorFactory.getMongoManager().get(oldDatabase, mongoDBAdaptorFactory.getMongoDbConfiguration()); - - MongoCollection userCol = oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.USER_COLLECTION); - FindIterable iterable = userCol.find(Filters.eq("id", ParamConstants.OPENCGA_USER_ID)); - try (MongoCursor cursor = iterable.cursor()) { - if (!cursor.hasNext()) { - MongoIterable collectionNames = oldDatastore.getDb().listCollectionNames(); - try (MongoCursor tmpCursor = collectionNames.cursor()) { - if (!tmpCursor.hasNext()) { - logger.info("Database '{}' not found. Database already migrated.", this.oldDatabase); - return MigrationStatus.MIGRATED; - } else { - List collections = new LinkedList<>(); - tmpCursor.forEachRemaining(collections::add); - logger.debug("Found '{}' collections in '{}' database", StringUtils.join(collections, ", "), this.oldDatabase); - return MigrationStatus.ERROR; - } - } - } - Document userDoc = cursor.next(); - String password = userDoc.getString("_password"); - // Check admin password - try { - if (!CryptoUtils.sha1(adminPassword).equals(password)) { - throw CatalogAuthorizationException.opencgaAdminOnlySupportedOperation(); - } - } catch (NoSuchAlgorithmException e) { - throw new RuntimeException(e); - } - } - - // Check write access to file system - if (!Files.isWritable(Paths.get(configuration.getWorkspace()))) { - throw new CatalogException("Please grant write access to path '" + configuration.getWorkspace() + "'"); - } - - // TODO: Check last migration is 2.2.?? - MongoCollection migrationCol = oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.MIGRATION_COLLECTION); - long count = migrationCol.countDocuments(Filters.in("status", MigrationRun.MigrationStatus.PENDING, - MigrationRun.MigrationStatus.ON_HOLD, MigrationRun.MigrationStatus.ERROR)); - if (count > 0) { - throw new CatalogException("Please check past migrations. Found migrations with status '" + MigrationRun.MigrationStatus.PENDING - + "', '" + MigrationRun.MigrationStatus.ON_HOLD + "', or '" + MigrationRun.MigrationStatus.ERROR + "'."); - } - - // Retrieve all users with data - DistinctIterable userIdIterable = userCol.distinct("id", - Filters.and( - Filters.ne("projects", null), - Filters.ne("projects", Collections.emptyList())), - String.class); - List userIds = new LinkedList<>(); - try (MongoCursor iterator = userIdIterable.iterator()) { - while (iterator.hasNext()) { - String tmpUserId = iterator.next(); - if (!ParamConstants.OPENCGA_USER_ID.equals(tmpUserId)) { - userIds.add(tmpUserId); - } - } - } - if (StringUtils.isNotEmpty(userId)) { - if (!userIds.contains(userId)) { - throw new CatalogException("User '" + userId + "' does not have any data. Available users to migrate are " - + userIds.stream() - .collect(Collectors.joining(", "))); - } - // Extract users that will need to remove data from - this.userIdsToDiscardData = userIds.stream() - .filter(u -> !userId.equals(u)) - .collect(Collectors.toSet()); - } else { - if (userIds.size() > 1) { - throw new CatalogException("More than 1 user containing data found. Available users to migrate are " - + StringUtils.join(userIds, ", ") + ". Please, choose which one to migrate."); - } else if (userIds.isEmpty()) { - throw new CatalogException("No users found to migrate."); - } - this.userId = userIds.get(0); - this.userIdsToDiscardData = new HashSet<>(); - } - - this.organizationId = this.userId; - this.catalogManager = new CatalogManager(configuration); - return MigrationStatus.PENDING_MIGRATION; - } - - @Override - protected void run() throws Exception { - if (this.status == MigrationStatus.ERROR) { - throw new CatalogException("Corrupted database '" + this.oldDatabase + "' found. Could not migrate."); - } else if (this.status == MigrationStatus.MIGRATED) { - return; - } - - MongoCollection metadataCol = oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.METADATA_COLLECTION); - FindIterable iterable = metadataCol.find(new Document()); - Document metaDoc; - long counter; - String secretKey; - String algorithm; - try (MongoCursor cursor = iterable.cursor()) { - metaDoc = cursor.next(); - counter = metaDoc.get("idCounter", Number.class).longValue(); - Document admin = metaDoc.get("admin", Document.class); - secretKey = admin.getString("secretKey"); - algorithm = admin.getString("algorithm"); - } - - if (!userIdsToDiscardData.isEmpty()) { - MongoCollection studyCol = oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.STUDY_COLLECTION); - // First, remove unnecessary data - queryMongo(studyCol, Filters.in("_ownerId", userIdsToDiscardData), Projections.include("uid"), studyDoc -> { - long studyUid = studyDoc.get("uid", Number.class).longValue(); - Bson query = Filters.eq("studyUid", studyUid); - - // Delete data associated to the study - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.FILE_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.JOB_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.SAMPLE_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.INDIVIDUAL_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.COHORT_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.FAMILY_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.PANEL_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.CLINICAL_ANALYSIS_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.INTERPRETATION_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.SAMPLE_ARCHIVE_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.INDIVIDUAL_ARCHIVE_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.FAMILY_ARCHIVE_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.PANEL_ARCHIVE_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.INTERPRETATION_ARCHIVE_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.DELETED_FILE_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.DELETED_JOB_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.DELETED_SAMPLE_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.DELETED_INDIVIDUAL_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.DELETED_COHORT_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.DELETED_FAMILY_COLLECTION).deleteMany(query); - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.DELETED_PANEL_COLLECTION).deleteMany(query); - }); - - // Delete studies - DeleteResult result = studyCol.deleteMany(Filters.in("_ownerId", userIdsToDiscardData)); - if (result.getDeletedCount() > 0) { - logger.info("Deleted {} unnecessary studies", result.getDeletedCount()); - } - - // Remove projects from users - oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.USER_COLLECTION).updateMany( - Filters.in("id", userIdsToDiscardData), - Updates.set("projects", Collections.emptyList()) - ); - } - - // Create admin organization - catalogManager.installCatalogDB(algorithm, secretKey, "MyStr0NgT!mP0r4lP4sWSoRd", "tempmail@tempmail.com", false); - - // Create admin organization - MongoCollection oldUserCollection = oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.USER_COLLECTION); - queryMongo(oldUserCollection, Filters.eq("id", ParamConstants.OPENCGA_USER_ID), Projections.exclude("_id"), document -> { - String organizationId = ParamConstants.ADMIN_ORGANIZATION; - try { - MongoCollection userCollection = mongoDBAdaptorFactory.getMongoDataStore(organizationId).getDb() - .getCollection(OrganizationMongoDBAdaptorFactory.USER_COLLECTION); - MongoCollection projectCollection = mongoDBAdaptorFactory.getMongoDataStore(organizationId).getDb() - .getCollection(OrganizationMongoDBAdaptorFactory.PROJECT_COLLECTION); - MongoCollection studyCollection = mongoDBAdaptorFactory.getMongoDataStore(organizationId).getDb() - .getCollection(OrganizationMongoDBAdaptorFactory.STUDY_COLLECTION); - MongoCollection fileCollection = mongoDBAdaptorFactory.getMongoDataStore(organizationId).getDb() - .getCollection(OrganizationMongoDBAdaptorFactory.FILE_COLLECTION); - // Empty data from collections with default data - userCollection.deleteMany(new Document()); - projectCollection.deleteMany(new Document()); - studyCollection.deleteMany(new Document()); - fileCollection.deleteMany(new Document()); - - // Replace user in organization - userCollection.insertOne(document); - - MongoDatabase orgDatabase = mongoDBAdaptorFactory.getMongoDataStore(organizationId).getDb(); - - // Extract projects - List projects = document.getList("projects", Document.class); - for (Document project : projects) { - long projectUid = project.get("uid", Number.class).longValue(); - - // Look for studies - MongoCollection oldStudyCol = oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.STUDY_COLLECTION); - MongoCollection orgStudyCol = orgDatabase.getCollection(OrganizationMongoDBAdaptorFactory.STUDY_COLLECTION); - - queryMongo(oldStudyCol, Filters.eq("_project.uid", projectUid), Projections.exclude("_id"), studyDoc -> { - // Insert study in new organization collection - orgStudyCol.insertOne(studyDoc); - - long studyUid = studyDoc.get("uid", Number.class).longValue(); - - // Move data belonging to the study - replicateData(studyUid, oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.SAMPLE_COLLECTION), - orgDatabase.getCollection(OrganizationMongoDBAdaptorFactory.SAMPLE_COLLECTION)); - replicateData(studyUid, oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.INDIVIDUAL_COLLECTION), - orgDatabase.getCollection(OrganizationMongoDBAdaptorFactory.INDIVIDUAL_COLLECTION)); - replicateData(studyUid, oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.COHORT_COLLECTION), - orgDatabase.getCollection(OrganizationMongoDBAdaptorFactory.COHORT_COLLECTION)); - replicateData(studyUid, oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.FILE_COLLECTION), - orgDatabase.getCollection(OrganizationMongoDBAdaptorFactory.FILE_COLLECTION)); - replicateData(studyUid, oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.FAMILY_COLLECTION), - orgDatabase.getCollection(OrganizationMongoDBAdaptorFactory.FAMILY_COLLECTION)); - replicateData(studyUid, oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.PANEL_COLLECTION), - orgDatabase.getCollection(OrganizationMongoDBAdaptorFactory.PANEL_COLLECTION)); - replicateData(studyUid, oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.JOB_COLLECTION), - orgDatabase.getCollection(OrganizationMongoDBAdaptorFactory.JOB_COLLECTION)); - replicateData(studyUid, oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.CLINICAL_ANALYSIS_COLLECTION), - orgDatabase.getCollection(OrganizationMongoDBAdaptorFactory.CLINICAL_ANALYSIS_COLLECTION)); - replicateData(studyUid, oldDatastore.getDb().getCollection(OrganizationMongoDBAdaptorFactory.INTERPRETATION_COLLECTION), - orgDatabase.getCollection(OrganizationMongoDBAdaptorFactory.INTERPRETATION_COLLECTION)); - - - oldStudyCol.deleteOne(Filters.eq("uid", studyUid)); - }); - - } - - // Remove user from the source database - oldUserCollection.deleteOne(Filters.eq("id", ParamConstants.OPENCGA_USER_ID)); - } catch (CatalogException e) { - throw new RuntimeException(e); - } - }); - - // Create new organization - String opencgaToken = catalogManager.getUserManager().login(ParamConstants.ADMIN_ORGANIZATION, ParamConstants.OPENCGA_USER_ID, adminPassword).getToken(); - catalogManager.getOrganizationManager().create(new OrganizationCreateParams().setId(organizationId), null, opencgaToken); - OrganizationMongoDBAdaptorFactory orgFactory = mongoDBAdaptorFactory.getOrganizationMongoDBAdaptorFactory(organizationId); - String newDatabase = orgFactory.getMongoDataStore().getDatabaseName(); - - // Rename database to main organization database - MongoDataStore adminDatastore = mongoDBAdaptorFactory.getMongoManager().get("admin", mongoDBAdaptorFactory.getMongoDbConfiguration()); - for (String collectionName : oldDatastore.getCollectionNames()) { - if (!OrganizationMongoDBAdaptorFactory.MIGRATION_COLLECTION.equals(collectionName)) { - logger.info("Renaming collection {} to {}", oldDatabase + "." + collectionName, newDatabase + "." + collectionName); - adminDatastore.getDb().runCommand(new Document() - .append("renameCollection", oldDatabase + "." + collectionName) - .append("to", newDatabase + "." + collectionName) - .append("dropTarget", true) - ); - } else { - // Remove collections - oldDatastore.getDb().getCollection(collectionName).drop(); - } - } - - CatalogIOManager ioManager = new CatalogIOManager(configuration); - - // Loop over all organizations to perform additional data model changes - for (String organizationId : mongoDBAdaptorFactory.getOrganizationIds()) { - ioManager.createOrganization(organizationId); - - MongoDatabase database = mongoDBAdaptorFactory.getMongoDataStore(organizationId).getDb(); - MongoCollection userCollection = database.getCollection(OrganizationMongoDBAdaptorFactory.USER_COLLECTION); - - // Extract projects from users - queryMongo(userCollection, new Document(), Projections.exclude("_id"), document -> { - List projects = document.getList("projects", Document.class); - if (CollectionUtils.isNotEmpty(projects)) { - // Create project directory - for (Document project : projects) { - Long projectUid = project.get("uid", Long.class); - try { - ioManager.createProject(organizationId, Long.toString(projectUid)); - } catch (CatalogIOException e) { - throw new RuntimeException("Couldn't create project folder for project '" + project.getString("fqn") + "'.", e); - } - } - - MongoCollection projectCol = database.getCollection(OrganizationMongoDBAdaptorFactory.PROJECT_COLLECTION); - projectCol.insertMany(projects); - } - }); - - // Remove account type, projects and sharedProjects from User - for (String collection : Arrays.asList(OrganizationMongoDBAdaptorFactory.USER_COLLECTION, OrganizationMongoDBAdaptorFactory.DELETED_USER_COLLECTION)) { - MongoCollection mongoCollection = database.getCollection(collection); - mongoCollection.updateMany(new Document(), - Updates.combine( - Updates.set("projects", Collections.emptyList()), - Updates.set("organization", organizationId), - Updates.unset("sharedProjects"), - Updates.unset("account.type") - ) - ); - } - - // Add owner as admin of every study and remove _ownerId field - for (String collection : Arrays.asList(OrganizationMongoDBAdaptorFactory.STUDY_COLLECTION, OrganizationMongoDBAdaptorFactory.DELETED_STUDY_COLLECTION)) { - MongoCollection mongoCollection = database.getCollection(collection); - mongoCollection.updateMany( - Filters.eq(StudyDBAdaptor.QueryParams.GROUP_ID.key(), ParamConstants.ADMINS_GROUP), - Updates.combine( - Updates.unset("_ownerId"), - Updates.push("groups.$.userIds", organizationId) - )); - } - - // Set organization counter - MongoCollection orgCol = database.getCollection(OrganizationMongoDBAdaptorFactory.ORGANIZATION_COLLECTION); - - List authOrigins = new ArrayList<>(); - // Super admins organization will only have one authentication origin - internal - if (!ParamConstants.ADMIN_ORGANIZATION.equals(organizationId)) { - if (configuration.getAuthentication() != null && CollectionUtils.isNotEmpty(configuration.getAuthentication().getAuthenticationOrigins())) { - for (AuthenticationOrigin authenticationOrigin : configuration.getAuthentication().getAuthenticationOrigins()) { - if (authenticationOrigin.getType().equals(AuthenticationOrigin.AuthenticationType.OPENCGA) - && authenticationOrigin.getId().equals(CatalogAuthenticationManager.INTERNAL)) { - continue; - } - authenticationOrigin.setAlgorithm(algorithm); - authenticationOrigin.setSecretKey(secretKey); - authenticationOrigin.setExpiration(3600); - authOrigins.add(convertToDocument(authenticationOrigin)); - } - } - } - authOrigins.add(convertToDocument(CatalogAuthenticationManager.createRandomInternalAuthenticationOrigin())); - - // Set organization counter, owner and authOrigins - orgCol.updateOne(Filters.eq("id", organizationId), Updates.combine( - Updates.set("_idCounter", counter), - Updates.set("owner", organizationId), - Updates.set("configuration.authenticationOrigins", authOrigins) - )); - } - } - - private void replicateData(long studyUid, MongoCollection sourceCol, MongoCollection targetCol) { - // Move data to the new collection - logger.info("Moving data from {} to {}", sourceCol.getNamespace(), targetCol.getNamespace()); - migrateCollection(sourceCol, targetCol, Filters.eq("studyUid", studyUid), Projections.exclude("_id"), - (document, bulk) -> bulk.add(new InsertOneModel<>(document))); - // Remove data from the source collection - sourceCol.deleteMany(Filters.eq("studyUid", studyUid)); - } - -} diff --git a/opencga-catalog/pom.xml b/opencga-catalog/pom.xml index ff10c269d7f..d15b4768e59 100644 --- a/opencga-catalog/pom.xml +++ b/opencga-catalog/pom.xml @@ -23,7 +23,7 @@ org.opencb.opencga opencga - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authentication/CatalogAuthenticationManager.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authentication/CatalogAuthenticationManager.java index 18cd03bb2af..37c12c23f65 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authentication/CatalogAuthenticationManager.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authentication/CatalogAuthenticationManager.java @@ -26,7 +26,6 @@ import org.opencb.opencga.catalog.exceptions.CatalogException; import org.opencb.opencga.catalog.utils.ParamUtils; import org.opencb.opencga.core.common.MailUtils; -import org.opencb.opencga.core.common.PasswordUtils; import org.opencb.opencga.core.config.AuthenticationOrigin; import org.opencb.opencga.core.config.Email; import org.opencb.opencga.core.models.user.AuthenticationResponse; @@ -43,19 +42,24 @@ */ public class CatalogAuthenticationManager extends AuthenticationManager { + // TODO: Remove INTERNAL field and its usages after several releases (TASK-5923) + @Deprecated public static final String INTERNAL = "internal"; + public static final String OPENCGA = "OPENCGA"; private final Email emailConfig; private final DBAdaptorFactory dbAdaptorFactory; - public CatalogAuthenticationManager(DBAdaptorFactory dbAdaptorFactory, Email emailConfig, String secretKeyString, long expiration) { + public CatalogAuthenticationManager(DBAdaptorFactory dbAdaptorFactory, Email emailConfig, String algorithm, String secretKeyString, + long expiration) { super(expiration); this.emailConfig = emailConfig; this.dbAdaptorFactory = dbAdaptorFactory; - Key secretKey = this.converStringToKeyObject(secretKeyString, SignatureAlgorithm.HS256.getJcaName()); - this.jwtManager = new JwtManager(SignatureAlgorithm.HS256.getValue(), secretKey); + SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.valueOf(algorithm); + Key secretKey = this.converStringToKeyObject(secretKeyString, signatureAlgorithm.getJcaName()); + this.jwtManager = new JwtManager(signatureAlgorithm.getValue(), secretKey); this.logger = LoggerFactory.getLogger(CatalogAuthenticationManager.class); } @@ -136,12 +140,9 @@ public OpenCGAResult resetPassword(String organizationId, String userId) throws return result; } - public static AuthenticationOrigin createRandomInternalAuthenticationOrigin() { + public static AuthenticationOrigin createOpencgaAuthenticationOrigin() { return new AuthenticationOrigin() - .setId(CatalogAuthenticationManager.INTERNAL) - .setType(AuthenticationOrigin.AuthenticationType.OPENCGA) - .setAlgorithm("HS256") - .setExpiration(3600L) - .setSecretKey(PasswordUtils.getStrongRandomPassword(32)); + .setId(CatalogAuthenticationManager.OPENCGA) + .setType(AuthenticationOrigin.AuthenticationType.OPENCGA); } } diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authentication/LDAPAuthenticationManager.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authentication/LDAPAuthenticationManager.java index 58eae214538..516a54702c2 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authentication/LDAPAuthenticationManager.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authentication/LDAPAuthenticationManager.java @@ -66,7 +66,7 @@ public class LDAPAuthenticationManager extends AuthenticationManager { private String host; private boolean ldaps; - public LDAPAuthenticationManager(AuthenticationOrigin authenticationOrigin, String secretKeyString, long expiration) { + public LDAPAuthenticationManager(AuthenticationOrigin authenticationOrigin, String algorithm, String secretKeyString, long expiration) { super(expiration); this.logger = LoggerFactory.getLogger(LDAPAuthenticationManager.class); this.host = authenticationOrigin.getHost(); @@ -107,8 +107,9 @@ public LDAPAuthenticationManager(AuthenticationOrigin authenticationOrigin, Stri logger.info("Init LDAP AuthenticationManager. Host: {}, env:{}", host, envToStringRedacted(getDefaultEnv())); - Key secretKey = this.converStringToKeyObject(secretKeyString, SignatureAlgorithm.HS256.getJcaName()); - this.jwtManager = new JwtManager(SignatureAlgorithm.HS256.getValue(), secretKey); + SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.valueOf(algorithm); + Key secretKey = this.converStringToKeyObject(secretKeyString, signatureAlgorithm.getJcaName()); + this.jwtManager = new JwtManager(signatureAlgorithm.getValue(), secretKey); } protected static String envToStringRedacted(Hashtable env) { diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authentication/azure/AuthenticationFactory.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authentication/azure/AuthenticationFactory.java index 4972bcdaf9a..d1b1246e468 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authentication/azure/AuthenticationFactory.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authentication/azure/AuthenticationFactory.java @@ -41,6 +41,11 @@ public void configureOrganizationAuthenticationManager(Organization organization Email email = new Email(); Map tmpAuthenticationManagerMap = new HashMap<>(); + + long expiration = organization.getConfiguration().getToken().getExpiration(); + String algorithm = organization.getConfiguration().getToken().getAlgorithm(); + String secretKey = organization.getConfiguration().getToken().getSecretKey(); + if (organization.getConfiguration() != null && CollectionUtils.isNotEmpty(organization.getConfiguration().getAuthenticationOrigins())) { for (AuthenticationOrigin authOrigin : organization.getConfiguration().getAuthenticationOrigins()) { @@ -48,15 +53,16 @@ public void configureOrganizationAuthenticationManager(Organization organization switch (authOrigin.getType()) { case LDAP: tmpAuthenticationManagerMap.put(authOrigin.getId(), - new LDAPAuthenticationManager(authOrigin, authOrigin.getSecretKey(), authOrigin.getExpiration())); + new LDAPAuthenticationManager(authOrigin, algorithm, secretKey, expiration)); break; case AzureAD: tmpAuthenticationManagerMap.put(authOrigin.getId(), new AzureADAuthenticationManager(authOrigin)); break; case OPENCGA: - tmpAuthenticationManagerMap.put(authOrigin.getId(), - new CatalogAuthenticationManager(catalogDBAdaptorFactory, email, authOrigin.getSecretKey(), - authOrigin.getExpiration())); + CatalogAuthenticationManager catalogAuthenticationManager = + new CatalogAuthenticationManager(catalogDBAdaptorFactory, email, algorithm, secretKey, expiration); + tmpAuthenticationManagerMap.put(CatalogAuthenticationManager.INTERNAL, catalogAuthenticationManager); + tmpAuthenticationManagerMap.put(CatalogAuthenticationManager.OPENCGA, catalogAuthenticationManager); break; default: logger.warn("Unexpected authentication origin type '{}' for id '{}' found in organization '{}'. " diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authorization/AuthorizationManager.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authorization/AuthorizationManager.java index c4b6f63d6d4..0b2661baa46 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authorization/AuthorizationManager.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authorization/AuthorizationManager.java @@ -16,6 +16,7 @@ package org.opencb.opencga.catalog.auth.authorization; +import org.opencb.opencga.catalog.exceptions.CatalogAuthorizationException; import org.opencb.opencga.catalog.exceptions.CatalogException; import org.opencb.opencga.catalog.utils.ParamUtils; import org.opencb.opencga.core.api.ParamConstants; @@ -118,7 +119,7 @@ default boolean isOpencgaAdministrator(JwtPayload payload) throws CatalogExcepti return isOpencgaAdministrator(payload.getOrganization(), payload.getUserId()); } - boolean isOpencgaAdministrator(String organization, String userId) throws CatalogException; + boolean isOpencgaAdministrator(String organization, String userId) throws CatalogAuthorizationException; default void checkIsOpencgaAdministrator(JwtPayload payload) throws CatalogException { checkIsOpencgaAdministrator(payload, null); diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authorization/CatalogAuthorizationManager.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authorization/CatalogAuthorizationManager.java index 79d1dc256f2..b58c117d94f 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authorization/CatalogAuthorizationManager.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/auth/authorization/CatalogAuthorizationManager.java @@ -83,14 +83,11 @@ public void checkCanEditProject(String organizationId, long projectId, String us } @Override - public void checkCanViewOrganization(String organizationId, String userId) throws CatalogException { + public void checkCanViewOrganization(String organizationId, String userId) throws CatalogAuthorizationException { if (isOpencgaAdministrator(organizationId, userId)) { return; } - // Check user belongs to organization - if (!dbAdaptorFactory.getCatalogUserDBAdaptor(organizationId).exists(userId)) { - throw new CatalogAuthorizationException("Permission denied. User '" + userId + "' does not belong to the organization."); - } + checkUserExists(organizationId, userId); } @Override @@ -220,11 +217,11 @@ public void checkCanCreateUpdateDeleteVariableSets(String organizationId, long s } @Override - public boolean isOpencgaAdministrator(String organization, String userId) throws CatalogException { + public boolean isOpencgaAdministrator(String organization, String userId) throws CatalogAuthorizationException { if (ParamConstants.ADMIN_ORGANIZATION.equals(organization) || userId.startsWith(ParamConstants.ADMIN_ORGANIZATION + ":")) { // Check user exists in ADMIN ORGANIZATION String user = userId.replace(ParamConstants.ADMIN_ORGANIZATION + ":", ""); - dbAdaptorFactory.getCatalogUserDBAdaptor(ParamConstants.ADMIN_ORGANIZATION).checkId(user); + checkUserExists(ParamConstants.ADMIN_ORGANIZATION, user); return true; } return false; @@ -1014,6 +1011,14 @@ public void removePermissionRule(String organizationId, long studyId, String per ==================================== */ + private void checkUserExists(String organizationId, String userId) throws CatalogAuthorizationException { + try { + dbAdaptorFactory.getCatalogUserDBAdaptor(organizationId).checkId(userId); + } catch (CatalogException e) { + throw new CatalogAuthorizationException("User '" + userId + "' not authorized to see Org '" + organizationId + "'.", e); + } + } + /** * Retrieves the groupId where the members belongs to. * diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/OrganizationDBAdaptor.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/OrganizationDBAdaptor.java index 524b2839cb1..f9175b0a908 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/OrganizationDBAdaptor.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/OrganizationDBAdaptor.java @@ -29,6 +29,8 @@ enum QueryParams implements QueryParam { INTERNAL_MIGRATION_EXECUTIONS("internal.migrationExecutions", OBJECT, ""), CONFIGURATION("configuration", OBJECT, ""), CONFIGURATION_AUTHENTICATION_ORIGINS("configuration.authenticationOrigins", OBJECT, ""), + CONFIGURATION_AUTHENTICATION_ORIGINS_OPTIONS("configuration.authenticationOrigins.options", OBJECT, ""), + CONFIGURATION_TOKEN("configuration.token", OBJECT, ""), CREATION_DATE("creationDate", DATE, ""), MODIFICATION_DATE("modificationDate", DATE, ""), PROJECTS("projects", OBJECT, ""), @@ -95,9 +97,9 @@ public static QueryParams getParam(String key) { // OpenCGAResult insert(Organization organization, QueryOptions options) throws CatalogDBException, CatalogParameterException, CatalogAuthorizationException; -// -// OpenCGAResult get(String userId, QueryOptions options) throws CatalogDBException; -// + + OpenCGAResult get(String userId, QueryOptions options) throws CatalogDBException; + OpenCGAResult get(QueryOptions options) throws CatalogDBException; // // OpenCGAResult incrementCurrentRelease(long projectId) throws CatalogDBException; diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/OrganizationMongoDBAdaptor.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/OrganizationMongoDBAdaptor.java index 50eec94b40e..4261a247c79 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/OrganizationMongoDBAdaptor.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/OrganizationMongoDBAdaptor.java @@ -99,11 +99,24 @@ Organization insert(ClientSession clientSession, Organization organization) return organization; } + @Override + public OpenCGAResult get(String user, QueryOptions options) throws CatalogDBException { + return get(null, user, options); + } + @Override public OpenCGAResult get(QueryOptions options) throws CatalogDBException { - return get(null, options); + return get(null, null, options); + } + + OpenCGAResult get(ClientSession clientSession, String user, QueryOptions options) throws CatalogDBException { + long startTime = startQuery(); + try (DBIterator dbIterator = iterator(clientSession, user, options)) { + return endQuery(startTime, dbIterator); + } } + @Override public OpenCGAResult update(String organizationId, ObjectMap parameters, QueryOptions queryOptions) throws CatalogDBException, CatalogParameterException, CatalogAuthorizationException { @@ -139,11 +152,11 @@ private OpenCGAResult privateUpdate(ClientSession clientSession, S List events = new ArrayList<>(); logger.debug("Update organization. Query: {}, Update: {}", queryBson.toBsonDocument(), organizationUpdate.toBsonDocument()); - // Update study admins need to be before because we need to fetch the previous owner/admins in case of an update on these fields. + // Update study admins need to be executed before the actual update because we need to fetch the previous owner/admins in case + // of an update on these fields. updateStudyAdmins(clientSession, parameters, queryOptions); DataResult updateResult = organizationCollection.update(clientSession, queryBson, organizationUpdate, null); - if (updateResult.getNumMatches() == 0) { throw new CatalogDBException("Organization not found"); } @@ -161,7 +174,7 @@ private void updateStudyAdmins(ClientSession clientSession, ObjectMap parameters return; } - Organization organization = get(clientSession, OrganizationManager.INCLUDE_ORGANIZATION_ADMINS).first(); + Organization organization = get(clientSession, null, OrganizationManager.INCLUDE_ORGANIZATION_ADMINS).first(); if (parameters.containsKey(QueryParams.OWNER.key())) { // Owner has changed @@ -234,7 +247,7 @@ private UpdateDocument getValidatedUpdateParams(ClientSession clientSession, Obj throw new CatalogDBException("Could not update owner. User not found."); } // Fetch current owner - Organization organization = get(clientSession, OrganizationManager.INCLUDE_ORGANIZATION_ADMINS).first(); + Organization organization = get(clientSession, null, OrganizationManager.INCLUDE_ORGANIZATION_ADMINS).first(); if (owner.equals(organization.getOwner())) { logger.warn("Organization owner is already '{}'.", owner); } else { @@ -299,13 +312,6 @@ private UpdateDocument getValidatedUpdateParams(ClientSession clientSession, Obj return document; } - OpenCGAResult get(ClientSession clientSession, QueryOptions options) throws CatalogDBException { - long startTime = startQuery(); - try (DBIterator dbIterator = iterator(clientSession, options)) { - return endQuery(startTime, dbIterator); - } - } - @Override public OpenCGAResult delete(Organization organization) throws CatalogDBException { return null; @@ -313,12 +319,12 @@ public OpenCGAResult delete(Organization organization) throws Cata @Override public DBIterator iterator(QueryOptions options) throws CatalogDBException { - return iterator(null, options); + return iterator(null, null, options); } - public DBIterator iterator(ClientSession clientSession, QueryOptions options) throws CatalogDBException { + public DBIterator iterator(ClientSession clientSession, String user, QueryOptions options) throws CatalogDBException { MongoDBIterator mongoCursor = getMongoCursor(clientSession, options); - return new OrganizationCatalogMongoDBIterator<>(mongoCursor, clientSession, organizationConverter, dbAdaptorFactory, options); + return new OrganizationCatalogMongoDBIterator<>(mongoCursor, clientSession, organizationConverter, dbAdaptorFactory, options, user); } private MongoDBIterator getMongoCursor(ClientSession clientSession, QueryOptions options) { @@ -338,7 +344,7 @@ private MongoDBIterator getMongoCursor(ClientSession clientSession, Qu } public List getOwnerAndAdmins(ClientSession clientSession) throws CatalogDBException { - Organization organization = get(clientSession, OrganizationManager.INCLUDE_ORGANIZATION_ADMINS).first(); + Organization organization = get(clientSession, null, OrganizationManager.INCLUDE_ORGANIZATION_ADMINS).first(); List members = new ArrayList<>(organization.getAdmins().size() + 1); if (StringUtils.isNotEmpty(organization.getOwner())) { members.add(organization.getOwner()); diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/ProjectMongoDBAdaptor.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/ProjectMongoDBAdaptor.java index 0aec9113858..c1c8dfeb7bd 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/ProjectMongoDBAdaptor.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/ProjectMongoDBAdaptor.java @@ -542,9 +542,13 @@ public OpenCGAResult get(Query query, QueryOptions options, String user } @Override - public OpenCGAResult nativeGet(Query query, QueryOptions options) throws CatalogDBException { + public OpenCGAResult nativeGet(Query query, QueryOptions options) throws CatalogDBException { + return nativeGet(null, query, options); + } + + public OpenCGAResult nativeGet(ClientSession clientSession, Query query, QueryOptions options) throws CatalogDBException { long startTime = startQuery(); - try (DBIterator dbIterator = nativeIterator(query, options)) { + try (DBIterator dbIterator = nativeIterator(clientSession, query, options)) { return endQuery(startTime, dbIterator); } } @@ -552,8 +556,13 @@ public OpenCGAResult nativeGet(Query query, QueryOptions options) thro @Override public OpenCGAResult nativeGet(Query query, QueryOptions options, String user) throws CatalogDBException, CatalogAuthorizationException { + return nativeGet(null, query, options, user); + } + + public OpenCGAResult nativeGet(ClientSession clientSession, Query query, QueryOptions options, String user) + throws CatalogDBException, CatalogAuthorizationException { long startTime = startQuery(); - try (DBIterator dbIterator = nativeIterator(query, options, user)) { + try (DBIterator dbIterator = nativeIterator(clientSession, query, options, user)) { return endQuery(startTime, dbIterator); } } @@ -570,11 +579,15 @@ public DBIterator iterator(ClientSession clientSession, Query query, Qu @Override public DBIterator nativeIterator(Query query, QueryOptions options) throws CatalogDBException { + return nativeIterator(null, query, options); + } + + public DBIterator nativeIterator(ClientSession clientSession, Query query, QueryOptions options) throws CatalogDBException { QueryOptions queryOptions = options != null ? new QueryOptions(options) : new QueryOptions(); queryOptions.put(NATIVE_QUERY, true); - MongoDBIterator mongoCursor = getMongoCursor(null, query, queryOptions); - return new ProjectCatalogMongoDBIterator<>(mongoCursor, null, null, dbAdaptorFactory, options, null); + MongoDBIterator mongoCursor = getMongoCursor(clientSession, query, queryOptions); + return new ProjectCatalogMongoDBIterator<>(mongoCursor, clientSession, null, dbAdaptorFactory, options, null); } @Override @@ -587,11 +600,16 @@ public DBIterator iterator(Query query, QueryOptions options, String us @Override public DBIterator nativeIterator(Query query, QueryOptions options, String user) throws CatalogDBException, CatalogAuthorizationException { + return nativeIterator(null, query, options, user); + } + + public DBIterator nativeIterator(ClientSession clientSession, Query query, QueryOptions options, String user) + throws CatalogDBException, CatalogAuthorizationException { QueryOptions queryOptions = options != null ? new QueryOptions(options) : new QueryOptions(); queryOptions.put(NATIVE_QUERY, true); - MongoDBIterator mongoCursor = getMongoCursor(null, query, queryOptions, user); - return new ProjectCatalogMongoDBIterator<>(mongoCursor, null, null, dbAdaptorFactory, options, user); + MongoDBIterator mongoCursor = getMongoCursor(clientSession, query, queryOptions, user); + return new ProjectCatalogMongoDBIterator<>(mongoCursor, clientSession, null, dbAdaptorFactory, options, user); } // private MongoDBIterator getMongoCursor(ClientSession clientSession, Query query, QueryOptions options, String user) diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/UserMongoDBAdaptor.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/UserMongoDBAdaptor.java index a8db293e258..21b592d1195 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/UserMongoDBAdaptor.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/UserMongoDBAdaptor.java @@ -353,21 +353,16 @@ private void extractSharedProjects(DataResult userDataResult, QueryOptions studyMap.put(study.getFqn(), study); studyProjectMap.put(study.getFqn(), project.getFqn()); - String owner = study.getFqn().split("@")[0]; - if (study.getGroups() != null) { for (Group group : study.getGroups()) { if (StudyManager.MEMBERS.equals(group.getId())) { // Add all the users that should be able to see the study to the map for (String userId : group.getUserIds()) { - // Exclude owner of the project - if (!owner.equals(userId)) { - if (users.contains(userId)) { - if (!userStudyMap.containsKey(userId)) { - userStudyMap.put(userId, new ArrayList<>()); - } - userStudyMap.get(userId).add(study.getFqn()); + if (users.contains(userId)) { + if (!userStudyMap.containsKey(userId)) { + userStudyMap.put(userId, new ArrayList<>()); } + userStudyMap.get(userId).add(study.getFqn()); } } break; @@ -378,7 +373,7 @@ private void extractSharedProjects(DataResult userDataResult, QueryOptions } } - // Add sharedProject information + // Add project information for (User user : userDataResult.getResults()) { if (userStudyMap.containsKey(user.getId())) { Map> projectStudyMap = new HashMap<>(); @@ -434,7 +429,7 @@ public OpenCGAResult nativeGet(Query query, QueryOptions options) throws Catalog public OpenCGAResult update(Query query, ObjectMap parameters, QueryOptions queryOptions) throws CatalogDBException { Map userParameters = new HashMap<>(); - final String[] acceptedParams = {QueryParams.NAME.key(), QueryParams.EMAIL.key(), QueryParams.ORGANIZATION.key()}; + final String[] acceptedParams = {QueryParams.NAME.key(), QueryParams.EMAIL.key()}; filterStringParams(parameters, userParameters, acceptedParams); if (parameters.containsKey(QueryParams.INTERNAL_STATUS_ID.key())) { diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/iterators/CatalogMongoDBIterator.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/iterators/CatalogMongoDBIterator.java index e43236d8288..2389fb2db61 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/iterators/CatalogMongoDBIterator.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/iterators/CatalogMongoDBIterator.java @@ -183,25 +183,28 @@ protected QueryOptions createInnerQueryOptionsForVersionedEntity(QueryOptions op } protected boolean includeField(QueryOptions options, List fields) { - Set includedFields = new HashSet<>(fields); if (options.containsKey(QueryOptions.INCLUDE)) { List currentIncludeList = options.getAsStringList(QueryOptions.INCLUDE); for (String include : currentIncludeList) { - if (includedFields.contains(include)) { - return true; + for (String field : fields) { + if (include.startsWith(field)) { + return true; + } } } return false; } else if (options.containsKey(QueryOptions.EXCLUDE)) { List currentExcludeList = options.getAsStringList(QueryOptions.EXCLUDE); for (String exclude : currentExcludeList) { - if (includedFields.contains(exclude)) { - return false; + for (String field : fields) { + if (exclude.equals(field)) { + return false; + } } + } return true; } - return true; } diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/iterators/OrganizationCatalogMongoDBIterator.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/iterators/OrganizationCatalogMongoDBIterator.java index eef59eeed87..6f162997479 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/iterators/OrganizationCatalogMongoDBIterator.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/iterators/OrganizationCatalogMongoDBIterator.java @@ -1,6 +1,8 @@ package org.opencb.opencga.catalog.db.mongodb.iterators; import com.mongodb.client.ClientSession; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.bson.Document; import org.opencb.commons.datastore.core.Query; import org.opencb.commons.datastore.core.QueryOptions; @@ -11,7 +13,10 @@ import org.opencb.opencga.catalog.db.mongodb.MigrationMongoDBAdaptor; import org.opencb.opencga.catalog.db.mongodb.NoteMongoDBAdaptor; import org.opencb.opencga.catalog.db.mongodb.OrganizationMongoDBAdaptorFactory; +import org.opencb.opencga.catalog.db.mongodb.ProjectMongoDBAdaptor; +import org.opencb.opencga.catalog.exceptions.CatalogAuthorizationException; import org.opencb.opencga.catalog.exceptions.CatalogDBException; +import org.opencb.opencga.catalog.exceptions.CatalogRuntimeException; import org.opencb.opencga.core.models.notes.Note; import org.opencb.opencga.core.response.OpenCGAResult; import org.slf4j.Logger; @@ -23,24 +28,32 @@ public class OrganizationCatalogMongoDBIterator extends CatalogMongoDBIterator { + private final String user; + private final QueryOptions options; + private final QueryOptions projectOptions; private final Queue organizationListBuffer; - private final NoteMongoDBAdaptor noteMongoDBAdaptor; private final MigrationMongoDBAdaptor migrationDBAdaptor; + private final ProjectMongoDBAdaptor projectMongoDBAdaptor; + private final NoteMongoDBAdaptor noteMongoDBAdaptor; private final Logger logger; public OrganizationCatalogMongoDBIterator(MongoDBIterator mongoCursor, ClientSession clientSession, GenericDocumentComplexConverter converter, OrganizationMongoDBAdaptorFactory dbAdaptorFactory, - QueryOptions options) { + QueryOptions options, String user) { super(mongoCursor, clientSession, converter, null); this.options = options != null ? new QueryOptions(options) : new QueryOptions(); + this.projectOptions = createInnerQueryOptionsForVersionedEntity(this.options, OrganizationDBAdaptor.QueryParams.PROJECTS.key(), + true); + this.user = user; this.migrationDBAdaptor = dbAdaptorFactory.getMigrationDBAdaptor(); this.noteMongoDBAdaptor = dbAdaptorFactory.getCatalogNotesDBAdaptor(); + this.projectMongoDBAdaptor = dbAdaptorFactory.getCatalogProjectDBAdaptor(); this.organizationListBuffer = new LinkedList<>(); this.logger = LoggerFactory.getLogger(OrganizationCatalogMongoDBIterator.class); @@ -72,6 +85,7 @@ public E next() { private void fetchNextBatch() { if (mongoCursor.hasNext()) { Document organizationDocument = mongoCursor.next(); + String orgId = organizationDocument.getString(OrganizationDBAdaptor.QueryParams.ID.key()); if (!options.getBoolean(NATIVE_QUERY)) { List migrationFields = Arrays.asList(OrganizationDBAdaptor.QueryParams.INTERNAL.key(), @@ -100,12 +114,72 @@ private void fetchNextBatch() { OpenCGAResult result = noteMongoDBAdaptor.nativeGet(clientSession, query, noteOptions); organizationDocument.put(OrganizationDBAdaptor.QueryParams.NOTES.key(), result.getResults()); } catch (CatalogDBException e) { - logger.warn("Could not obtain the organization notes", e); + throw CatalogRuntimeException.internalException(e, "Could not fetch notes for organization '" + orgId + "'."); + } + } + + List projectField = Collections.singletonList(OrganizationDBAdaptor.QueryParams.PROJECTS.key()); + if (includeField(options, projectField)) { + OpenCGAResult openCGAResult = null; + try { + if (StringUtils.isNotEmpty(user)) { + openCGAResult = projectMongoDBAdaptor.nativeGet(clientSession, new Query(), projectOptions, user); + } else { + openCGAResult = projectMongoDBAdaptor.nativeGet(clientSession, new Query(), projectOptions); + } + organizationDocument.put(OrganizationDBAdaptor.QueryParams.PROJECTS.key(), openCGAResult.getResults()); + } catch (CatalogAuthorizationException e) { + logger.warn("Could not fetch projects for organization '{}'.", orgId, e); + } catch (CatalogDBException | RuntimeException e) { + throw CatalogRuntimeException.internalException(e, "Could not fetch projects for organization '" + orgId + "'."); } } } + // TODO: Remove this code after several releases (TASK-5923) + recoverSecretKeyTask5923(organizationDocument); + organizationListBuffer.add(organizationDocument); } } + + // TODO: Remove this method after several releases (TASK-5923) + /** + * This method should only be necessary in order to be able to run the migration for TASK-5923 because OpenCGA looks for the config. + * This configuration was changed in TASK-5923, therefore, OpenCGA would be unable to initialise without it. + * Once the migration is run, this code will do nothing, so it should be removed in the future. + * + * @param organizationDocument Organization document. + */ + private void recoverSecretKeyTask5923(Document organizationDocument) { + Document configuration = organizationDocument.get(OrganizationDBAdaptor.QueryParams.CONFIGURATION.key(), Document.class); + if (configuration != null) { + String secretKey = null; + String algorithm = null; + long expiration = 3600L; + List authenticationOrigins = configuration.getList("authenticationOrigins", Document.class); + if (CollectionUtils.isNotEmpty(authenticationOrigins)) { + for (Document authenticationOrigin : authenticationOrigins) { + if (authenticationOrigin.getString("type").equals("OPENCGA")) { + secretKey = authenticationOrigin.getString("secretKey"); + algorithm = authenticationOrigin.getString("algorithm"); + Number expiration1 = authenticationOrigin.get("expiration", Number.class); + expiration = expiration1 != null ? expiration1.longValue() : expiration; + +// authenticationOrigin.put("id", "OPENCGA"); + } + } + if (StringUtils.isNotEmpty(secretKey)) { + Document token = configuration.get("token", Document.class); + if (token == null || StringUtils.isEmpty(token.getString("secretKey"))) { + token = new Document("secretKey", secretKey) + .append("algorithm", algorithm) + .append("expiration", expiration); + configuration.put("token", token); + } + } + } + } + } + } diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/exceptions/CatalogRuntimeException.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/exceptions/CatalogRuntimeException.java new file mode 100644 index 00000000000..81dc17b16af --- /dev/null +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/exceptions/CatalogRuntimeException.java @@ -0,0 +1,34 @@ +package org.opencb.opencga.catalog.exceptions; + +import org.apache.commons.lang3.StringUtils; + +public class CatalogRuntimeException extends IllegalArgumentException { + + public CatalogRuntimeException(String message) { + super(message); + } + + public CatalogRuntimeException(String message, Throwable cause) { + super(message, cause); + } + + public static CatalogRuntimeException internalException(Exception e, String message) { + if (e instanceof CatalogRuntimeException) { + return ((CatalogRuntimeException) e); + } else { + if (StringUtils.isEmpty(message)) { + message = e.getMessage(); + if (StringUtils.isEmpty(message)) { + message = e.toString(); + } + } + return new CatalogRuntimeException("Internal exception: " + message, e); + } + } + + public static CatalogRuntimeException internalException(Exception e) { + return internalException(e, ""); + } + + +} diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/AdminManager.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/AdminManager.java index e02defb1fc2..09bc57aabf1 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/AdminManager.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/AdminManager.java @@ -47,9 +47,6 @@ public class AdminManager extends AbstractManager { public OpenCGAResult userSearch(String organizationId, Query query, QueryOptions options, String token) throws CatalogException { - query = ParamUtils.defaultObject(query, Query::new); - options = ParamUtils.defaultObject(options, QueryOptions::new); - ObjectMap auditParams = new ObjectMap() .append("organizationId", organizationId) .append("query", query) @@ -58,30 +55,23 @@ public OpenCGAResult userSearch(String organizationId, Query query, QueryO JwtPayload jwtPayload = catalogManager.getUserManager().validateToken(token); try { authorizationManager.checkIsOpencgaAdministrator(jwtPayload); - - // Fix query object - if (query.containsKey(ParamConstants.USER)) { - query.put(UserDBAdaptor.QueryParams.ID.key(), query.get(ParamConstants.USER)); - query.remove(ParamConstants.USER); - } - if (query.containsKey(ParamConstants.USER_AUTHENTICATION_ORIGIN)) { - query.put(UserDBAdaptor.QueryParams.ACCOUNT_AUTHENTICATION_ID.key(), query.get(ParamConstants.USER_AUTHENTICATION_ORIGIN)); - query.remove(ParamConstants.USER_AUTHENTICATION_ORIGIN); - } - if (query.containsKey(ParamConstants.USER_CREATION_DATE)) { - query.put(UserDBAdaptor.QueryParams.ACCOUNT_CREATION_DATE.key(), query.get(ParamConstants.USER_CREATION_DATE)); - query.remove(ParamConstants.USER_CREATION_DATE); - } - - OpenCGAResult userDataResult = getUserDBAdaptor(organizationId).get(query, options); - auditManager.auditSearch(organizationId, jwtPayload.getUserId(organizationId), Enums.Resource.USER, "", "", auditParams, - new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); - return userDataResult; } catch (CatalogException e) { auditManager.auditSearch(organizationId, jwtPayload.getUserId(organizationId), Enums.Resource.USER, "", "", auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); throw e; } + + // Fix query object + if (query.containsKey(ParamConstants.USER)) { + query.put(UserDBAdaptor.QueryParams.ID.key(), query.get(ParamConstants.USER)); + query.remove(ParamConstants.USER); + } + if (query.containsKey(ParamConstants.USER_CREATION_DATE)) { + query.put(UserDBAdaptor.QueryParams.ACCOUNT_CREATION_DATE.key(), query.get(ParamConstants.USER_CREATION_DATE)); + query.remove(ParamConstants.USER_CREATION_DATE); + } + + return catalogManager.getUserManager().search(organizationId, query, options, token); } public OpenCGAResult updateGroups(String organizationId, String userId, List studyIds, List groupIds, diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/CatalogManager.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/CatalogManager.java index 02312f0842f..2308b7ad123 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/CatalogManager.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/CatalogManager.java @@ -39,14 +39,10 @@ import org.opencb.opencga.catalog.utils.ParamUtils; import org.opencb.opencga.core.common.PasswordUtils; import org.opencb.opencga.core.common.UriUtils; -import org.opencb.opencga.core.config.AuthenticationOrigin; import org.opencb.opencga.core.config.Configuration; import org.opencb.opencga.core.config.Optimizations; import org.opencb.opencga.core.models.JwtPayload; -import org.opencb.opencga.core.models.organizations.Organization; -import org.opencb.opencga.core.models.organizations.OrganizationConfiguration; -import org.opencb.opencga.core.models.organizations.OrganizationCreateParams; -import org.opencb.opencga.core.models.organizations.OrganizationUpdateParams; +import org.opencb.opencga.core.models.organizations.*; import org.opencb.opencga.core.models.project.ProjectCreateParams; import org.opencb.opencga.core.models.project.ProjectOrganism; import org.opencb.opencga.core.models.study.Study; @@ -270,13 +266,8 @@ private void privateInstall(String algorithm, String secretKey, String password, catalogIOManager.createDefaultOpenCGAFolders(); OrganizationConfiguration organizationConfiguration = new OrganizationConfiguration( - Collections.singletonList(new AuthenticationOrigin() - .setId(CatalogAuthenticationManager.INTERNAL) - .setType(AuthenticationOrigin.AuthenticationType.OPENCGA) - .setAlgorithm(algorithm) - .setExpiration(3600L) - .setSecretKey(secretKey)), - new Optimizations()); + Collections.singletonList(CatalogAuthenticationManager.createOpencgaAuthenticationOrigin()), + new Optimizations(), new TokenConfiguration(algorithm, secretKey, 3600L)); organizationManager.create(new OrganizationCreateParams(ADMIN_ORGANIZATION, ADMIN_ORGANIZATION, null, null, organizationConfiguration, null), QueryOptions.empty(), null); diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/OrganizationManager.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/OrganizationManager.java index 9201e9c6b3e..f89d0595c30 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/OrganizationManager.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/OrganizationManager.java @@ -131,10 +131,13 @@ public OpenCGAResult get(String organizationId, QueryOptions optio OpenCGAResult queryResult; try { + authorizationManager.checkCanViewOrganization(organizationId, userId); + ParamUtils.checkParameter(organizationId, "organization id"); QueryOptions queryOptions = ParamUtils.defaultObject(options, QueryOptions::new); boolean isOrgAdmin = authorizationManager.isAtLeastOrganizationOwnerOrAdmin(organizationId, userId); queryOptions.put(OrganizationDBAdaptor.IS_ORGANIZATION_ADMIN_OPTION, isOrgAdmin); - queryResult = getOrganizationDBAdaptor(organizationId).get(queryOptions); + queryResult = getOrganizationDBAdaptor(organizationId).get(userId, queryOptions); + privatizeResults(queryResult); } catch (CatalogException e) { auditManager.auditInfo(organizationId, userId, Enums.Resource.ORGANIZATION, organizationId, "", "", "", auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); @@ -179,9 +182,10 @@ public OpenCGAResult create(OrganizationCreateParams organizationC // Fetch created organization queryResult.setResults(result.getResults()); } - // Add required authentication manager for the new organization authenticationFactory.configureOrganizationAuthenticationManager(organization); + + privatizeResults(queryResult); } catch (CatalogException e) { if (!ParamConstants.ADMIN_ORGANIZATION.equals(organizationCreateParams.getId())) { auditManager.auditCreate(ParamConstants.ADMIN_ORGANIZATION, userId, Enums.Resource.ORGANIZATION, @@ -266,12 +270,10 @@ public OpenCGAResult update(String organizationId, OrganizationUpd } internal = true; // Set id to INTERNAL - authenticationOrigin.setId(CatalogAuthenticationManager.INTERNAL); + authenticationOrigin.setId(CatalogAuthenticationManager.OPENCGA); } ParamUtils.checkIdentifier(authenticationOrigin.getId(), authOriginsPrefixKey + ".id"); ParamUtils.checkObj(authenticationOrigin.getType(), authOriginsPrefixKey + ".type"); - ParamUtils.checkParameter(authenticationOrigin.getSecretKey(), authOriginsPrefixKey + ".secretKey"); - ParamUtils.checkParameter(authenticationOrigin.getAlgorithm(), authOriginsPrefixKey + ".algorithm"); if (authenticationOriginIds.contains(authenticationOrigin.getId())) { throw new CatalogException("Found duplicated authentication origin id '" + authenticationOrigin.getId() + "'."); } @@ -292,6 +294,7 @@ public OpenCGAResult update(String organizationId, OrganizationUpd OpenCGAResult queryResult = getOrganizationDBAdaptor(organizationId).get(options); result.setResults(queryResult.getResults()); } + privatizeResults(result); } catch (Exception e) { Event event = new Event(Event.Type.ERROR, organizationId, e.getMessage()); result.getEvents().add(event); @@ -331,7 +334,11 @@ private void validateOrganizationForCreation(Organization organization, String u } else { organization.getConfiguration() .setAuthenticationOrigins(Collections.singletonList( - CatalogAuthenticationManager.createRandomInternalAuthenticationOrigin())); + CatalogAuthenticationManager.createOpencgaAuthenticationOrigin())); + } + if (organization.getConfiguration().getToken() == null + || StringUtils.isEmpty(organization.getConfiguration().getToken().getSecretKey())) { + organization.getConfiguration().setToken(TokenConfiguration.init()); } organization.setAttributes(ParamUtils.defaultObject(organization.getAttributes(), HashMap::new)); } @@ -357,4 +364,19 @@ public List getOrganizationIds(String token) throws CatalogException { authorizationManager.checkIsOpencgaAdministrator(tokenPayload, "get all organization ids"); return catalogDBAdaptorFactory.getOrganizationIds(); } + + private void privatizeResults(OpenCGAResult result) { + if (CollectionUtils.isNotEmpty(result.getResults())) { + for (Organization organization : result.getResults()) { + if (organization.getConfiguration() != null) { + organization.getConfiguration().setToken(null); + if (CollectionUtils.isNotEmpty(organization.getConfiguration().getAuthenticationOrigins())) { + for (AuthenticationOrigin authenticationOrigin : organization.getConfiguration().getAuthenticationOrigins()) { + authenticationOrigin.setOptions(null); + } + } + } + } + } + } } diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/UserManager.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/UserManager.java index 96098fedcff..d882015eae5 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/UserManager.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/UserManager.java @@ -144,7 +144,7 @@ public OpenCGAResult create(User user, String password, String token) thro throw new CatalogException("Unknown authentication origin id '" + user.getAccount().getAuthentication() + "'"); } } else { - user.getAccount().setAuthentication(new Account.AuthenticationOrigin(CatalogAuthenticationManager.INTERNAL, false)); + user.getAccount().setAuthentication(new Account.AuthenticationOrigin(CatalogAuthenticationManager.OPENCGA, false)); } if (!ParamConstants.ADMIN_ORGANIZATION.equals(organizationId) || !OPENCGA.equals(user.getId())) { @@ -203,6 +203,47 @@ public OpenCGAResult create(String id, String name, String email, String p return create(user, password, token); } + /** + * Search users from Organization. Token must belong to at least an Organization administrator. + * + * @param organizationId Organization id. + * @param query Query object. + * @param options QueryOptions object. + * @param token JWT token. + * @return OpenCGAResult with the list of users. + * @throws CatalogException if the token does not belong to an Organization administrator or there are any parameters wrong. + */ + public OpenCGAResult search(@Nullable String organizationId, Query query, QueryOptions options, String token) + throws CatalogException { + JwtPayload tokenPayload = catalogManager.getUserManager().validateToken(token); + ObjectMap auditParams = new ObjectMap() + .append("organizationId", organizationId) + .append("query", query) + .append("options", options) + .append("token", token); + + options = ParamUtils.defaultObject(options, QueryOptions::new); + String myOrganizationId = StringUtils.isNotEmpty(organizationId) ? organizationId : tokenPayload.getOrganization(); + try { + authorizationManager.checkIsAtLeastOrganizationOwnerOrAdmin(myOrganizationId, tokenPayload.getUserId(myOrganizationId)); + + // Fix query params + if (query.containsKey(ParamConstants.USER_AUTHENTICATION_ORIGIN)) { + query.put(UserDBAdaptor.QueryParams.ACCOUNT_AUTHENTICATION_ID.key(), query.get(ParamConstants.USER_AUTHENTICATION_ORIGIN)); + query.remove(ParamConstants.USER_AUTHENTICATION_ORIGIN); + } + + OpenCGAResult result = getUserDBAdaptor(myOrganizationId).get(query, options); + auditManager.auditSearch(myOrganizationId, tokenPayload.getUserId(myOrganizationId), Enums.Resource.USER, "", "", auditParams, + new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); + return result; + } catch (Exception e) { + auditManager.auditSearch(myOrganizationId, tokenPayload.getUserId(myOrganizationId), Enums.Resource.USER, "", "", auditParams, + new AuditRecord.Status(AuditRecord.Status.Result.ERROR, new Error(0, "User search", e.getMessage()))); + throw e; + } + } + public JwtPayload validateToken(String token) throws CatalogException { JwtPayload jwtPayload = new JwtPayload(token); ParamUtils.checkParameter(jwtPayload.getUserId(), "jwt user"); @@ -210,7 +251,7 @@ public JwtPayload validateToken(String token) throws CatalogException { String authOrigin; if (ParamConstants.ANONYMOUS_USER_ID.equals(jwtPayload.getUserId())) { - authOrigin = CatalogAuthenticationManager.INTERNAL; + authOrigin = CatalogAuthenticationManager.OPENCGA; } else { OpenCGAResult userResult = getUserDBAdaptor(jwtPayload.getOrganization()).get(jwtPayload.getUserId(), INCLUDE_ACCOUNT); if (userResult.getNumResults() == 0) { @@ -519,7 +560,7 @@ public OpenCGAResult get(String organizationId, String userId, QueryOption * @return The requested users * @throws CatalogException CatalogException */ - public OpenCGAResult get(String organizationId, List userIdList, QueryOptions options, String token) + public OpenCGAResult get(@Nullable String organizationId, List userIdList, QueryOptions options, String token) throws CatalogException { ParamUtils.checkNotEmptyArray(userIdList, "userId"); ParamUtils.checkParameter(token, "token"); @@ -532,7 +573,7 @@ public OpenCGAResult get(String organizationId, List userIdList, Q .append("token", token); JwtPayload jwtPayload = validateToken(token); - if (userIdList.size() == 1 && jwtPayload.getUserId().equals(userIdList.get(0)) && StringUtils.isEmpty(organizationId)) { + if (StringUtils.isEmpty(organizationId)) { organizationId = jwtPayload.getOrganization(); } String userId = jwtPayload.getUserId(organizationId); @@ -590,7 +631,7 @@ public OpenCGAResult update(String userId, ObjectMap parameters, QueryOpti userId = getValidUserId(userId, payload); for (String s : parameters.keySet()) { - if (!s.matches("name|email|organization|attributes")) { + if (!s.matches("name|email|attributes")) { throw new CatalogDBException("Parameter '" + s + "' can't be changed"); } } @@ -771,7 +812,7 @@ public AuthenticationResponse login(String organizationId, String username, Stri auditManager.auditUser(organizationId, username, Enums.Action.LOGIN, username, new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); String userId = authenticationFactory.getUserId(organizationId, authId, response.getToken()); - if (!CatalogAuthenticationManager.INTERNAL.equals(authId)) { + if (!CatalogAuthenticationManager.OPENCGA.equals(authId) && !CatalogAuthenticationManager.INTERNAL.equals(authId)) { // External authorization try { // If the user is not registered, an exception will be raised @@ -782,7 +823,7 @@ public AuthenticationResponse login(String organizationId, String username, Stri .get(0); user.setOrganization(organizationId); // Generate a root token to be able to create the user even if the installation is private - String rootToken = authenticationFactory.createToken(organizationId, CatalogAuthenticationManager.INTERNAL, OPENCGA); + String rootToken = authenticationFactory.createToken(organizationId, CatalogAuthenticationManager.OPENCGA, OPENCGA); create(user, null, rootToken); } @@ -809,7 +850,7 @@ public AuthenticationResponse loginAnonymous(String organizationId) throws Catal throw CatalogAuthenticationException.userNotFound(organizationId, ParamConstants.ANONYMOUS_USER_ID); } - String token = authenticationFactory.createToken(organizationId, CatalogAuthenticationManager.INTERNAL, + String token = authenticationFactory.createToken(organizationId, CatalogAuthenticationManager.OPENCGA, ParamConstants.ANONYMOUS_USER_ID); return new AuthenticationResponse(token); } @@ -837,7 +878,7 @@ public AuthenticationResponse refreshToken(String token) throws CatalogException break; } catch (CatalogAuthenticationException e) { logger.debug("Could not refresh token with '{}' provider: {}", entry.getKey(), e.getMessage(), e); - if (CatalogAuthenticationManager.INTERNAL.equals(entry.getKey())) { + if (CatalogAuthenticationManager.OPENCGA.equals(entry.getKey())) { exception = e; } } diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/Migration.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/Migration.java index 7fb3b1dabf8..3c5ddea26d3 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/Migration.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/Migration.java @@ -54,6 +54,11 @@ */ boolean manual() default false; + /** + * @return the version when the migration was deprecated. + */ + String deprecatedSince() default ""; + enum MigrationDomain { CATALOG, STORAGE diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/MigrationException.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/MigrationException.java index 63f666eac14..000c46d57dc 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/MigrationException.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/MigrationException.java @@ -20,4 +20,10 @@ public static MigrationException offlineMigrationException(Migration migration) return new MigrationException("Migration '" + migration.id() + "' requires database to be offline. Please, ensure the database " + "cannot be accessed and run try again with '--offline' flag."); } + + public static MigrationException deprecatedMigration(Migration migration) { + return new MigrationException("Migration '" + migration.id() + "' can't be run since version '" + + migration.deprecatedSince() + "'. Please, run this migration from a previous OpenCGA version."); + } + } diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/MigrationManager.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/MigrationManager.java index 7809f4fb0f7..10b247a6d0d 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/MigrationManager.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/MigrationManager.java @@ -622,6 +622,10 @@ private MigrationRun run(String organizationId, Class r String token) throws MigrationException { Migration annotation = getMigrationAnnotation(runnableMigration); + if (StringUtils.isNotEmpty(annotation.deprecatedSince())) { + throw MigrationException.deprecatedMigration(annotation); + } + MigrationTool migrationTool; try { migrationTool = runnableMigration.newInstance(); diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/MigrationTool.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/MigrationTool.java index 47a701f0ed2..219e1178652 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/MigrationTool.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/migration/MigrationTool.java @@ -4,6 +4,7 @@ import com.mongodb.client.MongoCursor; import com.mongodb.client.model.IndexOptions; import com.mongodb.client.model.WriteModel; +import org.apache.commons.lang3.StringUtils; import org.bson.Document; import org.bson.conversions.Bson; import org.opencb.commons.ProgressLogger; @@ -78,6 +79,10 @@ public final void setup(Configuration configuration, CatalogManager catalogManag public final void execute() throws MigrationException { try { + Migration annotation = getAnnotation(); + if (StringUtils.isNotEmpty(annotation.deprecatedSince())) { + throw MigrationException.deprecatedMigration(annotation); + } run(); } catch (MigrationException e) { throw e; diff --git a/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/CatalogManagerTest.java b/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/CatalogManagerTest.java index 07edb4610b7..21d0322207b 100644 --- a/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/CatalogManagerTest.java +++ b/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/CatalogManagerTest.java @@ -17,6 +17,7 @@ package org.opencb.opencga.catalog.managers; import com.mongodb.BasicDBObject; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.junit.Ignore; @@ -103,6 +104,35 @@ public void testAdminUserExists() throws Exception { assertEquals(ParamConstants.ADMIN_ORGANIZATION, payload.getOrganization()); } + @Test + public void searchUsersTest() throws CatalogException { + OpenCGAResult search = catalogManager.getUserManager().search(organizationId, new Query(), QueryOptions.empty(), opencgaToken); + assertEquals(8, search.getNumResults()); + for (User user : search.getResults()) { + if (noAccessUserId1.equals(user.getId())) { + assertEquals(0, user.getProjects().size()); + } else if (user.getId().startsWith("normalUser")) { + assertEquals(1, user.getProjects().size()); + } else { + assertEquals(2, user.getProjects().size()); + } + } + + search = catalogManager.getUserManager().search(null, new Query(), QueryOptions.empty(), ownerToken); + assertEquals(8, search.getNumResults()); + + search = catalogManager.getUserManager().search(null, new Query(), QueryOptions.empty(), orgAdminToken2); + assertEquals(8, search.getNumResults()); + + search = catalogManager.getUserManager().search(null, new Query(), QueryOptions.empty(), orgAdminToken1); + assertEquals(8, search.getNumResults()); + + assertThrows(CatalogAuthorizationException.class, () -> catalogManager.getUserManager().search(null, new Query(), + QueryOptions.empty(), studyAdminToken1)); + assertThrows(CatalogAuthorizationException.class, () -> catalogManager.getUserManager().search(null, new Query(), + QueryOptions.empty(), normalToken1)); + } + @Test public void testGetToken() throws Exception { String token = catalogManager.getUserManager().loginAsAdmin(TestParamConstants.ADMIN_PASSWORD).getToken(); @@ -256,6 +286,65 @@ public void testGetUserInfo() throws CatalogException { studyAdminToken1); } + @Test + public void testGetProjectsFromUserInfo() throws CatalogException { + String userId = organizationId; + catalogManager.getUserManager().create(userId, "test", "mail@mail.com", TestParamConstants.PASSWORD, organizationId, null, + opencgaToken); + catalogManager.getStudyManager().updateGroup(studyFqn, ParamConstants.MEMBERS_GROUP, ParamUtils.BasicUpdateAction.ADD, + new GroupUpdateParams(Collections.singletonList("test")), ownerToken); + String token = catalogManager.getUserManager().login(organizationId, userId, TestParamConstants.PASSWORD).getToken(); + + DataResult user = catalogManager.getUserManager().get(organizationId, userId, new QueryOptions(), token); + assertTrue(CollectionUtils.isNotEmpty(user.first().getProjects())); + System.out.println(user.first().getProjects().size()); + + user = catalogManager.getUserManager().get(organizationId, normalUserId3, new QueryOptions(), normalToken3); + assertTrue(CollectionUtils.isNotEmpty(user.first().getProjects())); + System.out.println(user.first().getProjects().size()); + + user = catalogManager.getUserManager().get(organizationId, orgOwnerUserId, new QueryOptions(), ownerToken); + assertTrue(CollectionUtils.isNotEmpty(user.first().getProjects())); + System.out.println(user.first().getProjects().size()); + + user = catalogManager.getUserManager().get(organizationId, orgAdminUserId1, new QueryOptions(), orgAdminToken1); + assertTrue(CollectionUtils.isNotEmpty(user.first().getProjects())); + System.out.println(user.first().getProjects().size()); + + user = catalogManager.getUserManager().get(organizationId, studyAdminUserId1, new QueryOptions(), studyAdminToken1); + assertTrue(CollectionUtils.isNotEmpty(user.first().getProjects())); + System.out.println(user.first().getProjects().size()); + + user = catalogManager.getUserManager().get(organizationId, normalUserId1, new QueryOptions(), orgAdminToken1); + assertTrue(CollectionUtils.isNotEmpty(user.first().getProjects())); + System.out.println(user.first().getProjects().size()); + + + user = catalogManager.getUserManager().get(null, normalUserId1, new QueryOptions(), normalToken1); + assertTrue(CollectionUtils.isNotEmpty(user.first().getProjects())); + System.out.println(user.first().getProjects().size()); + + user = catalogManager.getUserManager().get(null, normalUserId3, new QueryOptions(), normalToken3); + assertTrue(CollectionUtils.isNotEmpty(user.first().getProjects())); + System.out.println(user.first().getProjects().size()); + + user = catalogManager.getUserManager().get(null, orgOwnerUserId, new QueryOptions(), ownerToken); + assertTrue(CollectionUtils.isNotEmpty(user.first().getProjects())); + System.out.println(user.first().getProjects().size()); + + user = catalogManager.getUserManager().get(null, orgAdminUserId1, new QueryOptions(), orgAdminToken1); + assertTrue(CollectionUtils.isNotEmpty(user.first().getProjects())); + System.out.println(user.first().getProjects().size()); + + user = catalogManager.getUserManager().get(null, studyAdminUserId1, new QueryOptions(), studyAdminToken1); + assertTrue(CollectionUtils.isNotEmpty(user.first().getProjects())); + System.out.println(user.first().getProjects().size()); + + user = catalogManager.getUserManager().get(null, normalUserId1, new QueryOptions(), orgAdminToken1); + assertTrue(CollectionUtils.isNotEmpty(user.first().getProjects())); + System.out.println(user.first().getProjects().size()); + } + @Test public void testModifyUser() throws CatalogException, InterruptedException, IOException { ObjectMap params = new ObjectMap(); @@ -480,6 +569,29 @@ public void testAssignPermissions() throws CatalogException { assertTrue(acls.stream().map(x -> String.valueOf(x.get("member"))).collect(Collectors.toSet()).contains("@group_cancer_some_thing_else")); } + @Test + public void getUserInfoTest() throws CatalogException { + OpenCGAResult result = catalogManager.getUserManager().get(organizationId, orgOwnerUserId, QueryOptions.empty(), ownerToken); + assertEquals(1, result.getNumResults()); + assertNotNull(result.first().getProjects()); + assertEquals(2, result.first().getProjects().size()); + + result = catalogManager.getUserManager().get(organizationId, orgAdminUserId1, QueryOptions.empty(), orgAdminToken1); + assertEquals(1, result.getNumResults()); + assertNotNull(result.first().getProjects()); + assertEquals(2, result.first().getProjects().size()); + + result = catalogManager.getUserManager().get(organizationId, studyAdminUserId1, QueryOptions.empty(), studyAdminToken1); + assertEquals(1, result.getNumResults()); + assertNotNull(result.first().getProjects()); + assertEquals(2, result.first().getProjects().size()); + + result = catalogManager.getUserManager().get(organizationId, normalUserId1, QueryOptions.empty(), normalToken1); + assertEquals(1, result.getNumResults()); + assertNotNull(result.first().getProjects()); + assertEquals(1, result.first().getProjects().size()); + } + /** * Project methods *************************** */ diff --git a/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/OrganizationManagerTest.java b/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/OrganizationManagerTest.java index 9cbcb43c091..b408fec74c1 100644 --- a/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/OrganizationManagerTest.java +++ b/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/OrganizationManagerTest.java @@ -14,9 +14,8 @@ import org.opencb.opencga.catalog.utils.ParamUtils; import org.opencb.opencga.core.api.ParamConstants; import org.opencb.opencga.core.config.AuthenticationOrigin; -import org.opencb.opencga.core.models.organizations.Organization; -import org.opencb.opencga.core.models.organizations.OrganizationConfiguration; -import org.opencb.opencga.core.models.organizations.OrganizationUpdateParams; +import org.opencb.opencga.core.models.organizations.*; +import org.opencb.opencga.core.models.project.Project; import org.opencb.opencga.core.models.study.Group; import org.opencb.opencga.core.models.study.Study; import org.opencb.opencga.core.response.OpenCGAResult; @@ -42,7 +41,7 @@ public void ensureAuthOriginExistsTest() throws CatalogException { @Test public void ensureAuthOriginCannotBeRemovedTest() throws CatalogException { OrganizationUpdateParams updateParams = new OrganizationUpdateParams().setConfiguration(new OrganizationConfiguration( - Collections.emptyList(), null)); + Collections.emptyList(), null, new TokenConfiguration())); thrown.expect(CatalogException.class); thrown.expectMessage("OPENCGA"); catalogManager.getOrganizationManager().update(organizationId, updateParams, INCLUDE_RESULT, ownerToken); @@ -50,10 +49,10 @@ public void ensureAuthOriginCannotBeRemovedTest() throws CatalogException { @Test public void avoidDuplicatedOPENCGAAuthOriginTest() throws CatalogException { - AuthenticationOrigin authOrigin = CatalogAuthenticationManager.createRandomInternalAuthenticationOrigin(); - AuthenticationOrigin authOrigin2 = CatalogAuthenticationManager.createRandomInternalAuthenticationOrigin(); + AuthenticationOrigin authOrigin = CatalogAuthenticationManager.createOpencgaAuthenticationOrigin(); + AuthenticationOrigin authOrigin2 = CatalogAuthenticationManager.createOpencgaAuthenticationOrigin(); OrganizationUpdateParams updateParams = new OrganizationUpdateParams().setConfiguration(new OrganizationConfiguration( - Arrays.asList(authOrigin, authOrigin2), null)); + Arrays.asList(authOrigin, authOrigin2), null, new TokenConfiguration())); thrown.expect(CatalogException.class); thrown.expectMessage("OPENCGA"); @@ -62,11 +61,11 @@ public void avoidDuplicatedOPENCGAAuthOriginTest() throws CatalogException { @Test public void avoidDuplicatedAuthOriginIdTest() throws CatalogException { - AuthenticationOrigin authOrigin = CatalogAuthenticationManager.createRandomInternalAuthenticationOrigin(); - AuthenticationOrigin authOrigin2 = CatalogAuthenticationManager.createRandomInternalAuthenticationOrigin(); + AuthenticationOrigin authOrigin = CatalogAuthenticationManager.createOpencgaAuthenticationOrigin(); + AuthenticationOrigin authOrigin2 = CatalogAuthenticationManager.createOpencgaAuthenticationOrigin(); authOrigin2.setType(AuthenticationOrigin.AuthenticationType.LDAP); OrganizationUpdateParams updateParams = new OrganizationUpdateParams().setConfiguration(new OrganizationConfiguration( - Arrays.asList(authOrigin, authOrigin2), null)); + Arrays.asList(authOrigin, authOrigin2), null, new TokenConfiguration())); thrown.expect(CatalogException.class); thrown.expectMessage("origin id"); @@ -75,16 +74,80 @@ public void avoidDuplicatedAuthOriginIdTest() throws CatalogException { @Test public void updateAuthOriginTest() throws CatalogException { - AuthenticationOrigin authOrigin = CatalogAuthenticationManager.createRandomInternalAuthenticationOrigin(); + AuthenticationOrigin authOrigin = CatalogAuthenticationManager.createOpencgaAuthenticationOrigin(); OrganizationUpdateParams updateParams = new OrganizationUpdateParams().setConfiguration(new OrganizationConfiguration( - Collections.singletonList(authOrigin), null)); + Collections.singletonList(authOrigin), null, new TokenConfiguration())); Organization organization = catalogManager.getOrganizationManager().update(organizationId, updateParams, INCLUDE_RESULT, ownerToken).first(); assertEquals(authOrigin.getId(), organization.getConfiguration().getAuthenticationOrigins().get(0).getId()); assertEquals(authOrigin.getType(), organization.getConfiguration().getAuthenticationOrigins().get(0).getType()); - assertEquals(authOrigin.getExpiration(), organization.getConfiguration().getAuthenticationOrigins().get(0).getExpiration()); - assertEquals(authOrigin.getSecretKey(), organization.getConfiguration().getAuthenticationOrigins().get(0).getSecretKey()); - assertEquals(authOrigin.getAlgorithm(), organization.getConfiguration().getAuthenticationOrigins().get(0).getAlgorithm()); + } + + @Test + public void createNewOrganizationTest() throws CatalogException { + OpenCGAResult result = catalogManager.getOrganizationManager().create(new OrganizationCreateParams().setId("org2"), INCLUDE_RESULT, opencgaToken); + assertEquals(1, result.getNumInserted()); + assertEquals(1, result.getNumMatches()); + assertEquals("org2", result.first().getId()); + } + + @Test + public void organizationInfoIncludeProjectsTest() throws CatalogException { + Organization organization = catalogManager.getOrganizationManager().get(organizationId, QueryOptions.empty(), ownerToken).first(); + assertEquals(3, organization.getProjects().size()); + for (Project project : organization.getProjects()) { + assertNotNull(project.getFqn()); + assertNotNull(project.getName()); + assertNotNull(project.getCreationDate()); + } + + QueryOptions options = new QueryOptions(QueryOptions.INCLUDE, "name"); + organization = catalogManager.getOrganizationManager().get(organizationId, options, ownerToken).first(); + assertNull(organization.getProjects()); + + options = new QueryOptions(QueryOptions.EXCLUDE, "projects"); + organization = catalogManager.getOrganizationManager().get(organizationId, options, ownerToken).first(); + assertNull(organization.getProjects()); + + options = new QueryOptions(QueryOptions.INCLUDE, "projects.fqn"); + organization = catalogManager.getOrganizationManager().get(organizationId, options, ownerToken).first(); + assertEquals(3, organization.getProjects().size()); + for (Project project : organization.getProjects()) { + assertNotNull(project.getFqn()); + assertNull(project.getName()); + assertNull(project.getCreationDate()); + } + + options = new QueryOptions(QueryOptions.EXCLUDE, "projects.name"); + organization = catalogManager.getOrganizationManager().get(organizationId, options, ownerToken).first(); + assertEquals(3, organization.getProjects().size()); + for (Project project : organization.getProjects()) { + assertNotNull(project.getFqn()); + assertNull(project.getName()); + assertNotNull(project.getCreationDate()); + } + } + + @Test + public void organizationInfoProjectsAuthTest() throws CatalogException { + Organization organization = catalogManager.getOrganizationManager().get(organizationId, QueryOptions.empty(), ownerToken).first(); + assertEquals(3, organization.getProjects().size()); + + organization = catalogManager.getOrganizationManager().get(organizationId, QueryOptions.empty(), orgAdminToken1).first(); + assertEquals(3, organization.getProjects().size()); + + organization = catalogManager.getOrganizationManager().get(organizationId, QueryOptions.empty(), studyAdminToken1).first(); + assertEquals(2, organization.getProjects().size()); + assertArrayEquals(Arrays.asList(projectFqn1, projectFqn2).toArray(), + organization.getProjects().stream().map(Project::getFqn).toArray()); + + organization = catalogManager.getOrganizationManager().get(organizationId, QueryOptions.empty(), normalToken1).first(); + assertEquals(1, organization.getProjects().size()); + assertEquals(projectFqn1, organization.getProjects().get(0).getFqn()); + + organization = catalogManager.getOrganizationManager().get(organizationId, QueryOptions.empty(), noAccessToken1).first(); + assertEquals(1, organization.getProjects().size()); + assertEquals(projectFqn1, organization.getProjects().get(0).getFqn()); } @Test @@ -200,4 +263,24 @@ public void updateOrganizationTest() throws CatalogException { } } + @Test + public void secretKeyIsAlwaysHiddenTest() throws CatalogException { + Organization organization = catalogManager.getOrganizationManager().get(organizationId, null, ownerToken).first(); + assertNotNull(organization.getName()); + assertNull(organization.getConfiguration().getToken()); + assertNull(organization.getConfiguration().getAuthenticationOrigins().get(0).getOptions()); + + QueryOptions options = new QueryOptions(QueryOptions.INCLUDE, OrganizationDBAdaptor.QueryParams.CONFIGURATION.key()); + organization = catalogManager.getOrganizationManager().get(organizationId, options, ownerToken).first(); + assertNull(organization.getName()); + assertNull(organization.getConfiguration().getToken()); + assertNull(organization.getConfiguration().getAuthenticationOrigins().get(0).getOptions()); + + options = new QueryOptions(QueryOptions.EXCLUDE, OrganizationDBAdaptor.QueryParams.NAME.key()); + organization = catalogManager.getOrganizationManager().get(organizationId, options, ownerToken).first(); + assertNull(organization.getName()); + assertNull(organization.getConfiguration().getToken()); + assertNull(organization.getConfiguration().getAuthenticationOrigins().get(0).getOptions()); + } + } diff --git a/opencga-client/pom.xml b/opencga-client/pom.xml index ce253ddc6ae..2582a5f2003 100644 --- a/opencga-client/pom.xml +++ b/opencga-client/pom.xml @@ -22,7 +22,7 @@ org.opencb.opencga opencga - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-client/src/main/R/R/Admin-methods.R b/opencga-client/src/main/R/R/Admin-methods.R index 8f5d4877e7f..d63a1ad3478 100644 --- a/opencga-client/src/main/R/R/Admin-methods.R +++ b/opencga-client/src/main/R/R/Admin-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -26,7 +25,7 @@ #' | createUsers | /{apiVersion}/admin/users/create | body[*] | #' | importUsers | /{apiVersion}/admin/users/import | organization, body[*] | #' | permissionsUsers | /{apiVersion}/admin/users/permissions | study, entryIds, permissions, category | -#' | searchUsers | /{apiVersion}/admin/users/search | include, exclude, limit, skip, count, organization, user, account, authenticationId | +#' | searchUsers | /{apiVersion}/admin/users/search | include, exclude, limit, skip, count, organization, user, authenticationId | #' | syncUsers | /{apiVersion}/admin/users/sync | organization, body[*] | #' | usersUpdateGroups | /{apiVersion}/admin/users/{user}/groups/update | organization, user[*], action, body[*] | #' @@ -97,7 +96,6 @@ setMethod("adminClient", "OpencgaR", function(OpencgaR, user, endpointName, para #' @param count Get the total number of results matching the query. Deactivated by default. #' @param organization Organization id. #' @param user User ID. - #' @param account Account type [GUEST, FULL, ADMINISTRATOR]. #' @param authenticationId Authentication origin ID. searchUsers=fetchOpenCGA(object=OpencgaR, category="admin", categoryId=NULL, subcategory="users", subcategoryId=NULL, action="search", params=params, httpMethod="GET", as.queryParam=NULL, ...), diff --git a/opencga-client/src/main/R/R/Alignment-methods.R b/opencga-client/src/main/R/R/Alignment-methods.R index e9b2195c871..398851faed5 100644 --- a/opencga-client/src/main/R/R/Alignment-methods.R +++ b/opencga-client/src/main/R/R/Alignment-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/R/R/AllGenerics.R b/opencga-client/src/main/R/R/AllGenerics.R index fe127eafb19..195b5ad36f3 100644 --- a/opencga-client/src/main/R/R/AllGenerics.R +++ b/opencga-client/src/main/R/R/AllGenerics.R @@ -1,11 +1,11 @@ # ############################################################################## ## OrganizationClient -setGeneric("organizationClient", function(OpencgaR, organization, id, endpointName, params=NULL, ...) +setGeneric("organizationClient", function(OpencgaR, id, organization, endpointName, params=NULL, ...) standardGeneric("organizationClient")) # ############################################################################## ## UserClient -setGeneric("userClient", function(OpencgaR, users, user, filterId, endpointName, params=NULL, ...) +setGeneric("userClient", function(OpencgaR, filterId, user, users, endpointName, params=NULL, ...) standardGeneric("userClient")) # ############################################################################## @@ -15,42 +15,42 @@ setGeneric("projectClient", function(OpencgaR, project, projects, endpointName, # ############################################################################## ## StudyClient -setGeneric("studyClient", function(OpencgaR, study, studies, variableSet, group, templateId, members, id, endpointName, params=NULL, ...) +setGeneric("studyClient", function(OpencgaR, group, id, members, studies, study, templateId, variableSet, endpointName, params=NULL, ...) standardGeneric("studyClient")) # ############################################################################## ## FileClient -setGeneric("fileClient", function(OpencgaR, file, folder, annotationSet, members, files, endpointName, params=NULL, ...) +setGeneric("fileClient", function(OpencgaR, annotationSet, file, files, folder, members, endpointName, params=NULL, ...) standardGeneric("fileClient")) # ############################################################################## ## JobClient -setGeneric("jobClient", function(OpencgaR, jobs, members, job, endpointName, params=NULL, ...) +setGeneric("jobClient", function(OpencgaR, job, jobs, members, endpointName, params=NULL, ...) standardGeneric("jobClient")) # ############################################################################## ## SampleClient -setGeneric("sampleClient", function(OpencgaR, samples, annotationSet, members, sample, endpointName, params=NULL, ...) +setGeneric("sampleClient", function(OpencgaR, annotationSet, members, sample, samples, endpointName, params=NULL, ...) standardGeneric("sampleClient")) # ############################################################################## ## IndividualClient -setGeneric("individualClient", function(OpencgaR, individual, annotationSet, members, individuals, endpointName, params=NULL, ...) +setGeneric("individualClient", function(OpencgaR, annotationSet, individual, individuals, members, endpointName, params=NULL, ...) standardGeneric("individualClient")) # ############################################################################## ## FamilyClient -setGeneric("familyClient", function(OpencgaR, families, members, family, annotationSet, endpointName, params=NULL, ...) +setGeneric("familyClient", function(OpencgaR, annotationSet, families, family, members, endpointName, params=NULL, ...) standardGeneric("familyClient")) # ############################################################################## ## CohortClient -setGeneric("cohortClient", function(OpencgaR, cohort, members, cohorts, annotationSet, endpointName, params=NULL, ...) +setGeneric("cohortClient", function(OpencgaR, annotationSet, cohort, cohorts, members, endpointName, params=NULL, ...) standardGeneric("cohortClient")) # ############################################################################## ## PanelClient -setGeneric("panelClient", function(OpencgaR, panels, members, endpointName, params=NULL, ...) +setGeneric("panelClient", function(OpencgaR, members, panels, endpointName, params=NULL, ...) standardGeneric("panelClient")) # ############################################################################## @@ -65,7 +65,7 @@ setGeneric("variantClient", function(OpencgaR, endpointName, params=NULL, ...) # ############################################################################## ## ClinicalClient -setGeneric("clinicalClient", function(OpencgaR, clinicalAnalysis, clinicalAnalyses, interpretations, interpretation, annotationSet, members, endpointName, params=NULL, ...) +setGeneric("clinicalClient", function(OpencgaR, annotationSet, clinicalAnalyses, clinicalAnalysis, interpretation, interpretations, members, endpointName, params=NULL, ...) standardGeneric("clinicalClient")) # ############################################################################## @@ -80,7 +80,7 @@ setGeneric("metaClient", function(OpencgaR, endpointName, params=NULL, ...) # ############################################################################## ## GA4GHClient -setGeneric("ga4ghClient", function(OpencgaR, study, file, endpointName, params=NULL, ...) +setGeneric("ga4ghClient", function(OpencgaR, file, study, endpointName, params=NULL, ...) standardGeneric("ga4ghClient")) # ############################################################################## diff --git a/opencga-client/src/main/R/R/Clinical-methods.R b/opencga-client/src/main/R/R/Clinical-methods.R index 32983a2b6bc..f9d9f038ae1 100644 --- a/opencga-client/src/main/R/R/Clinical-methods.R +++ b/opencga-client/src/main/R/R/Clinical-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -62,7 +61,7 @@ #' [*]: Required parameter #' @export -setMethod("clinicalClient", "OpencgaR", function(OpencgaR, clinicalAnalysis, clinicalAnalyses, interpretations, interpretation, annotationSet, members, endpointName, params=NULL, ...) { +setMethod("clinicalClient", "OpencgaR", function(OpencgaR, annotationSet, clinicalAnalyses, clinicalAnalysis, interpretation, interpretations, members, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/analysis/clinical/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Cohort-methods.R b/opencga-client/src/main/R/R/Cohort-methods.R index 6f37317a6fb..e510a05eba8 100644 --- a/opencga-client/src/main/R/R/Cohort-methods.R +++ b/opencga-client/src/main/R/R/Cohort-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -38,7 +37,7 @@ #' [*]: Required parameter #' @export -setMethod("cohortClient", "OpencgaR", function(OpencgaR, cohort, members, cohorts, annotationSet, endpointName, params=NULL, ...) { +setMethod("cohortClient", "OpencgaR", function(OpencgaR, annotationSet, cohort, cohorts, members, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/cohorts/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Family-methods.R b/opencga-client/src/main/R/R/Family-methods.R index 18950845d09..de04b212196 100644 --- a/opencga-client/src/main/R/R/Family-methods.R +++ b/opencga-client/src/main/R/R/Family-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -37,7 +36,7 @@ #' [*]: Required parameter #' @export -setMethod("familyClient", "OpencgaR", function(OpencgaR, families, members, family, annotationSet, endpointName, params=NULL, ...) { +setMethod("familyClient", "OpencgaR", function(OpencgaR, annotationSet, families, family, members, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/families/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/File-methods.R b/opencga-client/src/main/R/R/File-methods.R index 2a108bf3c3c..41ff659c258 100644 --- a/opencga-client/src/main/R/R/File-methods.R +++ b/opencga-client/src/main/R/R/File-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -54,7 +53,7 @@ #' [*]: Required parameter #' @export -setMethod("fileClient", "OpencgaR", function(OpencgaR, file, folder, annotationSet, members, files, endpointName, params=NULL, ...) { +setMethod("fileClient", "OpencgaR", function(OpencgaR, annotationSet, file, files, folder, members, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/files/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/GA4GH-methods.R b/opencga-client/src/main/R/R/GA4GH-methods.R index 6962ac02c5d..a6053502605 100644 --- a/opencga-client/src/main/R/R/GA4GH-methods.R +++ b/opencga-client/src/main/R/R/GA4GH-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -31,7 +30,7 @@ #' [*]: Required parameter #' @export -setMethod("ga4ghClient", "OpencgaR", function(OpencgaR, study, file, endpointName, params=NULL, ...) { +setMethod("ga4ghClient", "OpencgaR", function(OpencgaR, file, study, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/ga4gh/reads/search: diff --git a/opencga-client/src/main/R/R/Individual-methods.R b/opencga-client/src/main/R/R/Individual-methods.R index 6db8609a2e0..9a3bc092adc 100644 --- a/opencga-client/src/main/R/R/Individual-methods.R +++ b/opencga-client/src/main/R/R/Individual-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -38,7 +37,7 @@ #' [*]: Required parameter #' @export -setMethod("individualClient", "OpencgaR", function(OpencgaR, individual, annotationSet, members, individuals, endpointName, params=NULL, ...) { +setMethod("individualClient", "OpencgaR", function(OpencgaR, annotationSet, individual, individuals, members, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/individuals/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Job-methods.R b/opencga-client/src/main/R/R/Job-methods.R index a08f7f1cff9..df80a2c29cc 100644 --- a/opencga-client/src/main/R/R/Job-methods.R +++ b/opencga-client/src/main/R/R/Job-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -39,7 +38,7 @@ #' [*]: Required parameter #' @export -setMethod("jobClient", "OpencgaR", function(OpencgaR, jobs, members, job, endpointName, params=NULL, ...) { +setMethod("jobClient", "OpencgaR", function(OpencgaR, job, jobs, members, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/jobs/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Meta-methods.R b/opencga-client/src/main/R/R/Meta-methods.R index e07d2af2b26..8da8f31ca44 100644 --- a/opencga-client/src/main/R/R/Meta-methods.R +++ b/opencga-client/src/main/R/R/Meta-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/R/R/Operation-methods.R b/opencga-client/src/main/R/R/Operation-methods.R index 466172bd59c..ecd586a9ed7 100644 --- a/opencga-client/src/main/R/R/Operation-methods.R +++ b/opencga-client/src/main/R/R/Operation-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/R/R/Organization-methods.R b/opencga-client/src/main/R/R/Organization-methods.R index 178042aea75..3efaf5eec2f 100644 --- a/opencga-client/src/main/R/R/Organization-methods.R +++ b/opencga-client/src/main/R/R/Organization-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -34,7 +33,7 @@ #' [*]: Required parameter #' @export -setMethod("organizationClient", "OpencgaR", function(OpencgaR, organization, id, endpointName, params=NULL, ...) { +setMethod("organizationClient", "OpencgaR", function(OpencgaR, id, organization, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/organizations/create: diff --git a/opencga-client/src/main/R/R/Panel-methods.R b/opencga-client/src/main/R/R/Panel-methods.R index a5302a2260d..b23b8043f55 100644 --- a/opencga-client/src/main/R/R/Panel-methods.R +++ b/opencga-client/src/main/R/R/Panel-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -36,7 +35,7 @@ #' [*]: Required parameter #' @export -setMethod("panelClient", "OpencgaR", function(OpencgaR, panels, members, endpointName, params=NULL, ...) { +setMethod("panelClient", "OpencgaR", function(OpencgaR, members, panels, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/panels/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Project-methods.R b/opencga-client/src/main/R/R/Project-methods.R index 2b1e2a13c3e..380d33ea815 100644 --- a/opencga-client/src/main/R/R/Project-methods.R +++ b/opencga-client/src/main/R/R/Project-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/R/R/Sample-methods.R b/opencga-client/src/main/R/R/Sample-methods.R index 14252d367ec..a5434ddb451 100644 --- a/opencga-client/src/main/R/R/Sample-methods.R +++ b/opencga-client/src/main/R/R/Sample-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -38,7 +37,7 @@ #' [*]: Required parameter #' @export -setMethod("sampleClient", "OpencgaR", function(OpencgaR, samples, annotationSet, members, sample, endpointName, params=NULL, ...) { +setMethod("sampleClient", "OpencgaR", function(OpencgaR, annotationSet, members, sample, samples, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/samples/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Study-methods.R b/opencga-client/src/main/R/R/Study-methods.R index 55a5cc88b4c..95104111011 100644 --- a/opencga-client/src/main/R/R/Study-methods.R +++ b/opencga-client/src/main/R/R/Study-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -49,7 +48,7 @@ #' [*]: Required parameter #' @export -setMethod("studyClient", "OpencgaR", function(OpencgaR, study, studies, variableSet, group, templateId, members, id, endpointName, params=NULL, ...) { +setMethod("studyClient", "OpencgaR", function(OpencgaR, group, id, members, studies, study, templateId, variableSet, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/studies/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/User-methods.R b/opencga-client/src/main/R/R/User-methods.R index f074c546a88..ffc1c599ca9 100644 --- a/opencga-client/src/main/R/R/User-methods.R +++ b/opencga-client/src/main/R/R/User-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -24,6 +23,7 @@ #' | create | /{apiVersion}/users/create | body[*] | #' | login | /{apiVersion}/users/login | body | #' | password | /{apiVersion}/users/password | body[*] | +#' | search | /{apiVersion}/users/search | include, exclude, limit, skip, count, organization, id, authenticationId | #' | info | /{apiVersion}/users/{users}/info | include, exclude, organization, users[*] | #' | configs | /{apiVersion}/users/{user}/configs | user[*], name | #' | updateConfigs | /{apiVersion}/users/{user}/configs/update | user[*], action, body[*] | @@ -39,7 +39,7 @@ #' [*]: Required parameter #' @export -setMethod("userClient", "OpencgaR", function(OpencgaR, users, user, filterId, endpointName, params=NULL, ...) { +setMethod("userClient", "OpencgaR", function(OpencgaR, filterId, user, users, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/users/anonymous: @@ -67,6 +67,19 @@ setMethod("userClient", "OpencgaR", function(OpencgaR, users, user, filterId, en password=fetchOpenCGA(object=OpencgaR, category="users", categoryId=NULL, subcategory=NULL, subcategoryId=NULL, action="password", params=params, httpMethod="POST", as.queryParam=NULL, ...), + #' @section Endpoint /{apiVersion}/users/search: + #' User search method. + #' @param include Fields included in the response, whole JSON path must be provided. + #' @param exclude Fields excluded in the response, whole JSON path must be provided. + #' @param limit Number of results to be returned. + #' @param skip Number of results to skip. + #' @param count Get the total number of results matching the query. Deactivated by default. + #' @param organization Organization id. + #' @param id Comma separated list user IDs up to a maximum of 100. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. + #' @param authenticationId Authentication origin ID. + search=fetchOpenCGA(object=OpencgaR, category="users", categoryId=NULL, subcategory=NULL, subcategoryId=NULL, + action="search", params=params, httpMethod="GET", as.queryParam=NULL, ...), + #' @section Endpoint /{apiVersion}/users/{users}/info: #' Return the user information including its projects and studies. #' @param include Fields included in the response, whole JSON path must be provided. diff --git a/opencga-client/src/main/R/R/Variant-methods.R b/opencga-client/src/main/R/R/Variant-methods.R index 2b18e5f5063..95fba46fac9 100644 --- a/opencga-client/src/main/R/R/Variant-methods.R +++ b/opencga-client/src/main/R/R/Variant-methods.R @@ -2,7 +2,6 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-04-10 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AdminClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AdminClient.java index 77e825b9edb..928fd361341 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AdminClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AdminClient.java @@ -37,7 +37,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -46,7 +45,6 @@ /** * This class contains methods for the Admin webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: admin */ public class AdminClient extends AbstractParentClient { @@ -153,7 +151,6 @@ public RestResponse permissionsUsers(ObjectMap params) throws ClientExcepti * count: Get the total number of results matching the query. Deactivated by default. * organization: Organization id. * user: User ID. - * account: Account type [GUEST, FULL, ADMINISTRATOR]. * authenticationId: Authentication origin ID. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java index 916156065b5..ca1e1ecc744 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java @@ -40,7 +40,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -49,7 +48,6 @@ /** * This class contains methods for the Alignment webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: analysis/alignment */ public class AlignmentClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java index 4ad23e20b19..976ea17a4f6 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java @@ -55,7 +55,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -64,7 +63,6 @@ /** * This class contains methods for the ClinicalAnalysis webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: analysis/clinical */ public class ClinicalAnalysisClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalClient.java deleted file mode 100644 index 67bb142fc41..00000000000 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalClient.java +++ /dev/null @@ -1,914 +0,0 @@ -/* -* Copyright 2015-2022 OpenCB -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package org.opencb.opencga.client.rest.clients; - -import org.opencb.biodata.models.clinical.interpretation.ClinicalVariant; -import org.opencb.commons.datastore.core.FacetField; -import org.opencb.commons.datastore.core.ObjectMap; -import org.opencb.opencga.client.config.ClientConfiguration; -import org.opencb.opencga.client.exceptions.ClientException; -import org.opencb.opencga.client.rest.AbstractParentClient; -import org.opencb.opencga.core.models.analysis.knockout.KnockoutByGeneSummary; -import org.opencb.opencga.core.models.analysis.knockout.KnockoutByIndividual; -import org.opencb.opencga.core.models.analysis.knockout.KnockoutByIndividualSummary; -import org.opencb.opencga.core.models.analysis.knockout.KnockoutByVariant; -import org.opencb.opencga.core.models.analysis.knockout.KnockoutByVariantSummary; -import org.opencb.opencga.core.models.analysis.knockout.RgaKnockoutByGene; -import org.opencb.opencga.core.models.clinical.CancerTieringInterpretationAnalysisParams; -import org.opencb.opencga.core.models.clinical.ClinicalAnalysis; -import org.opencb.opencga.core.models.clinical.ClinicalAnalysisAclUpdateParams; -import org.opencb.opencga.core.models.clinical.ClinicalAnalysisCreateParams; -import org.opencb.opencga.core.models.clinical.ClinicalAnalysisUpdateParams; -import org.opencb.opencga.core.models.clinical.Interpretation; -import org.opencb.opencga.core.models.clinical.InterpretationCreateParams; -import org.opencb.opencga.core.models.clinical.InterpretationUpdateParams; -import org.opencb.opencga.core.models.clinical.RgaAnalysisParams; -import org.opencb.opencga.core.models.clinical.TeamInterpretationAnalysisParams; -import org.opencb.opencga.core.models.clinical.TieringInterpretationAnalysisParams; -import org.opencb.opencga.core.models.clinical.ZettaInterpretationAnalysisParams; -import org.opencb.opencga.core.models.job.Job; -import org.opencb.opencga.core.models.study.configuration.ClinicalAnalysisStudyConfiguration; -import org.opencb.opencga.core.response.RestResponse; - - -/* -* WARNING: AUTOGENERATED CODE -* -* This code was generated by a tool. -* Autogenerated on: 2022-08-02 08:25:32 ->>>>>>> release-2.4.x ->>>>>>> release-2.4.x -* -* Manual changes to this file may cause unexpected behavior in your application. -* Manual changes to this file will be overwritten if the code is regenerated. -*/ - - -/** - * This class contains methods for the Clinical webservices. - * Client version: 2.3.3-SNAPSHOT [fb5e7ed17448243b10ddd619bdf973e4b20b0a74] ->>>>>>> release-2.4.x ->>>>>>> release-2.4.x - * PATH: analysis/clinical - */ -public class ClinicalClient extends AbstractParentClient { - - public ClinicalClient(String token, ClientConfiguration configuration) { - super(token, configuration); - } - - /** - * Update the set of permissions granted for the member. - * @param members Comma separated list of user or group IDs. - * @param action Action to be performed [ADD, SET, REMOVE or RESET]. - * @param data JSON containing the parameters to add ACLs. - * @param params Map containing any of the following optional parameters. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * propagate: Propagate permissions to related families, individuals, samples and files. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse updateAcl(String members, String action, ClinicalAnalysisAclUpdateParams data, ObjectMap params) - throws ClientException { - params = params != null ? params : new ObjectMap(); - params.putIfNotNull("action", action); - params.put("body", data); - return execute("analysis", null, "clinical/acl", members, "update", params, POST, ObjectMap.class); - } - - /** - * Update Clinical Analysis configuration. - * @param data Configuration params to update. - * @param params Map containing any of the following optional parameters. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse updateClinicalConfiguration(ClinicalAnalysisStudyConfiguration data, ObjectMap params) - throws ClientException { - params = params != null ? params : new ObjectMap(); - params.put("body", data); - return execute("analysis", null, "clinical/clinical/configuration", null, "update", params, POST, ObjectMap.class); - } - - /** - * Create a new clinical analysis. - * @param data JSON containing clinical analysis information. - * @param params Map containing any of the following optional parameters. - * include: Fields included in the response, whole JSON path must be provided. - * exclude: Fields excluded in the response, whole JSON path must be provided. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * skipCreateDefaultInterpretation: Flag to skip creating and initialise an empty default primary interpretation (Id will be - * '{clinicalAnalysisId}.1'). This flag is only considered if no Interpretation object is passed. - * includeResult: Flag indicating to include the created or updated document result in the response. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse create(ClinicalAnalysisCreateParams data, ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - params.put("body", data); - return execute("analysis", null, "clinical", null, "create", params, POST, ClinicalAnalysis.class); - } - - /** - * Clinical Analysis distinct method. - * @param field Field for which to obtain the distinct values. - * @param params Map containing any of the following optional parameters. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * id: Comma separated list of Clinical Analysis IDs up to a maximum of 100. - * uuid: Comma separated list of Clinical Analysis UUIDs up to a maximum of 100. - * type: Clinical Analysis type. - * disorder: Clinical Analysis disorder. - * files: Clinical Analysis files. - * sample: Sample associated to the proband or any member of a family. - * individual: Proband or any member of a family. - * proband: Clinical Analysis proband. - * probandSamples: Clinical Analysis proband samples. - * family: Clinical Analysis family. - * familyMembers: Clinical Analysis family members. - * familyMemberSamples: Clinical Analysis family members samples. - * panels: Clinical Analysis panels. - * locked: Locked Clinical Analyses. - * analystId: Clinical Analysis analyst id. - * priority: Clinical Analysis priority. - * flags: Clinical Analysis flags. - * creationDate: Clinical Analysis Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * modificationDate: Clinical Analysis Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * dueDate: Clinical Analysis due date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * qualityControlSummary: Clinical Analysis quality control summary. - * release: Release when it was created. - * status: Filter by status. - * internalStatus: Filter by internal status. - * deleted: Boolean to retrieve deleted entries. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse distinct(String field, ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - params.putIfNotNull("field", field); - return execute("analysis", null, "clinical", null, "distinct", params, GET, ObjectMap.class); - } - - /** - * Interpretation distinct method. - * @param field Field for which to obtain the distinct values. - * @param params Map containing any of the following optional parameters. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * id: Comma separated list of Interpretation IDs up to a maximum of 100. - * uuid: Comma separated list of Interpretation UUIDs up to a maximum of 100. - * clinicalAnalysisId: Clinical Analysis id. - * analystId: Analyst ID. - * methodName: Interpretation method name. - * panels: Interpretation panels. - * primaryFindings: Interpretation primary findings. - * secondaryFindings: Interpretation secondary findings. - * creationDate: Interpretation Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * modificationDate: Interpretation Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * status: Filter by status. - * internalStatus: Filter by internal status. - * release: Release when it was created. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse distinctInterpretation(String field, ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - params.putIfNotNull("field", field); - return execute("analysis", null, "clinical/interpretation", null, "distinct", params, GET, ObjectMap.class); - } - - /** - * Search clinical interpretations. - * @param params Map containing any of the following optional parameters. - * include: Fields included in the response, whole JSON path must be provided. - * exclude: Fields excluded in the response, whole JSON path must be provided. - * limit: Number of results to be returned. - * skip: Number of results to skip. - * sort: Sort the results. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * id: Comma separated list of Interpretation IDs up to a maximum of 100. - * uuid: Comma separated list of Interpretation UUIDs up to a maximum of 100. - * clinicalAnalysisId: Clinical Analysis id. - * analystId: Analyst ID. - * methodName: Interpretation method name. - * panels: Interpretation panels. - * primaryFindings: Interpretation primary findings. - * secondaryFindings: Interpretation secondary findings. - * creationDate: Interpretation Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * modificationDate: Interpretation Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * status: Filter by status. - * internalStatus: Filter by internal status. - * release: Release when it was created. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse searchInterpretation(ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis", null, "clinical/interpretation", null, "search", params, GET, Interpretation.class); - } - - /** - * Clinical interpretation information. - * @param interpretations Comma separated list of clinical interpretation IDs up to a maximum of 100. - * @param params Map containing any of the following optional parameters. - * include: Fields included in the response, whole JSON path must be provided. - * exclude: Fields excluded in the response, whole JSON path must be provided. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * version: Comma separated list of interpretation versions. 'all' to get all the interpretation versions. Not supported if - * multiple interpretation ids are provided. - * deleted: Boolean to retrieve deleted entries. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse infoInterpretation(String interpretations, ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis", null, "clinical/interpretation", interpretations, "info", params, GET, Interpretation.class); - } - - /** - * Run cancer tiering interpretation analysis. - * @param data Cancer tiering interpretation analysis params. - * @param params Map containing any of the following optional parameters. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * jobId: Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not provided. - * jobDescription: Job description. - * jobDependsOn: Comma separated list of existing job IDs the job will depend on. - * jobTags: Job tags. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse runInterpreterCancerTiering(CancerTieringInterpretationAnalysisParams data, ObjectMap params) - throws ClientException { - params = params != null ? params : new ObjectMap(); - params.put("body", data); - return execute("analysis", null, "clinical/interpreter/cancerTiering", null, "run", params, POST, Job.class); - } - - /** - * Run TEAM interpretation analysis. - * @param data TEAM interpretation analysis params. - * @param params Map containing any of the following optional parameters. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * jobId: Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not provided. - * jobDescription: Job description. - * jobDependsOn: Comma separated list of existing job IDs the job will depend on. - * jobTags: Job tags. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse runInterpreterTeam(TeamInterpretationAnalysisParams data, ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - params.put("body", data); - return execute("analysis", null, "clinical/interpreter/team", null, "run", params, POST, Job.class); - } - - /** - * Run tiering interpretation analysis. - * @param data Tiering interpretation analysis params. - * @param params Map containing any of the following optional parameters. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * jobId: Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not provided. - * jobDescription: Job description. - * jobDependsOn: Comma separated list of existing job IDs the job will depend on. - * jobTags: Job tags. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse runInterpreterTiering(TieringInterpretationAnalysisParams data, ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - params.put("body", data); - return execute("analysis", null, "clinical/interpreter/tiering", null, "run", params, POST, Job.class); - } - - /** - * Run Zetta interpretation analysis. - * @param data Zetta interpretation analysis params. - * @param params Map containing any of the following optional parameters. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * jobId: Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not provided. - * jobDescription: Job description. - * jobDependsOn: Comma separated list of existing job IDs the job will depend on. - * jobTags: Job tags. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse runInterpreterZetta(ZettaInterpretationAnalysisParams data, ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - params.put("body", data); - return execute("analysis", null, "clinical/interpreter/zetta", null, "run", params, POST, Job.class); - } - - /** - * RGA aggregation stats. - * @param field List of fields separated by semicolons, e.g.: clinicalSignificances;type. For nested fields use >>, e.g.: - * type>>clinicalSignificances;knockoutType. - * @param params Map containing any of the following optional parameters. - * limit: Number of results to be returned. - * skip: Number of results to skip. - * sampleId: Filter by sample id. - * individualId: Filter by individual id. - * sex: Filter by sex. - * phenotypes: Filter by phenotypes. - * disorders: Filter by disorders. - * numParents: Filter by the number of parents registered. - * geneId: Filter by gene id. - * geneName: Filter by gene name. - * chromosome: Filter by chromosome. - * start: Filter by start position. - * end: Filter by end position. - * transcriptId: Filter by transcript id. - * variants: Filter by variant id. - * dbSnps: Filter by DB_SNP id. - * knockoutType: Filter by knockout type. - * filter: Filter by filter (PASS, NOT_PASS). - * type: Filter by variant type. - * clinicalSignificance: Filter by clinical significance. - * populationFrequency: Filter by population frequency. - * consequenceType: Filter by consequence type. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse aggregationStatsRga(String field, ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - params.putIfNotNull("field", field); - return execute("analysis", null, "clinical/rga", null, "aggregationStats", params, GET, FacetField.class); - } - - /** - * Query gene RGA. - * @param params Map containing any of the following optional parameters. - * include: Fields included in the response, whole JSON path must be provided. - * exclude: Fields excluded in the response, whole JSON path must be provided. - * limit: Number of results to be returned. - * skip: Number of results to skip. - * count: Get the total number of results matching the query. Deactivated by default. - * includeIndividual: Include only the comma separated list of individuals to the response. - * skipIndividual: Number of individuals to skip. - * limitIndividual: Limit number of individuals returned (default: 1000). - * sampleId: Filter by sample id. - * individualId: Filter by individual id. - * sex: Filter by sex. - * phenotypes: Filter by phenotypes. - * disorders: Filter by disorders. - * numParents: Filter by the number of parents registered. - * geneId: Filter by gene id. - * geneName: Filter by gene name. - * chromosome: Filter by chromosome. - * start: Filter by start position. - * end: Filter by end position. - * transcriptId: Filter by transcript id. - * variants: Filter by variant id. - * dbSnps: Filter by DB_SNP id. - * knockoutType: Filter by knockout type. - * filter: Filter by filter (PASS, NOT_PASS). - * type: Filter by variant type. - * clinicalSignificance: Filter by clinical significance. - * populationFrequency: Filter by population frequency. - * consequenceType: Filter by consequence type. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse queryRgaGene(ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis", null, "clinical/rga/gene", null, "query", params, GET, RgaKnockoutByGene.class); - } - - /** - * RGA gene summary stats. - * @param params Map containing any of the following optional parameters. - * limit: Number of results to be returned. - * skip: Number of results to skip. - * count: Get the total number of results matching the query. Deactivated by default. - * sampleId: Filter by sample id. - * individualId: Filter by individual id. - * sex: Filter by sex. - * phenotypes: Filter by phenotypes. - * disorders: Filter by disorders. - * numParents: Filter by the number of parents registered. - * geneId: Filter by gene id. - * geneName: Filter by gene name. - * chromosome: Filter by chromosome. - * start: Filter by start position. - * end: Filter by end position. - * transcriptId: Filter by transcript id. - * variants: Filter by variant id. - * dbSnps: Filter by DB_SNP id. - * knockoutType: Filter by knockout type. - * filter: Filter by filter (PASS, NOT_PASS). - * type: Filter by variant type. - * clinicalSignificance: Filter by clinical significance. - * populationFrequency: Filter by population frequency. - * consequenceType: Filter by consequence type. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse summaryRgaGene(ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis", null, "clinical/rga/gene", null, "summary", params, GET, KnockoutByGeneSummary.class); - } - - /** - * Generate Recessive Gene Analysis secondary index. - * @param data Recessive Gene Analysis index params. - * @param params Map containing any of the following optional parameters. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * jobId: Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not provided. - * jobDescription: Job description. - * jobDependsOn: Comma separated list of existing job IDs the job will depend on. - * jobTags: Job tags. - * auxiliarIndex: Index auxiliar collection to improve performance assuming RGA is completely indexed. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse runRgaIndex(RgaAnalysisParams data, ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - params.put("body", data); - return execute("analysis", null, "clinical/rga/index", null, "run", params, POST, Job.class); - } - - /** - * Query individual RGA. - * @param params Map containing any of the following optional parameters. - * include: Fields included in the response, whole JSON path must be provided. - * exclude: Fields excluded in the response, whole JSON path must be provided. - * limit: Number of results to be returned. - * skip: Number of results to skip. - * count: Get the total number of results matching the query. Deactivated by default. - * sampleId: Filter by sample id. - * individualId: Filter by individual id. - * sex: Filter by sex. - * phenotypes: Filter by phenotypes. - * disorders: Filter by disorders. - * numParents: Filter by the number of parents registered. - * geneId: Filter by gene id. - * geneName: Filter by gene name. - * chromosome: Filter by chromosome. - * start: Filter by start position. - * end: Filter by end position. - * transcriptId: Filter by transcript id. - * variants: Filter by variant id. - * dbSnps: Filter by DB_SNP id. - * knockoutType: Filter by knockout type. - * filter: Filter by filter (PASS, NOT_PASS). - * type: Filter by variant type. - * clinicalSignificance: Filter by clinical significance. - * populationFrequency: Filter by population frequency. - * consequenceType: Filter by consequence type. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse queryRgaIndividual(ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis", null, "clinical/rga/individual", null, "query", params, GET, KnockoutByIndividual.class); - } - - /** - * RGA individual summary stats. - * @param params Map containing any of the following optional parameters. - * limit: Number of results to be returned. - * skip: Number of results to skip. - * count: Get the total number of results matching the query. Deactivated by default. - * sampleId: Filter by sample id. - * individualId: Filter by individual id. - * sex: Filter by sex. - * phenotypes: Filter by phenotypes. - * disorders: Filter by disorders. - * numParents: Filter by the number of parents registered. - * geneId: Filter by gene id. - * geneName: Filter by gene name. - * chromosome: Filter by chromosome. - * start: Filter by start position. - * end: Filter by end position. - * transcriptId: Filter by transcript id. - * variants: Filter by variant id. - * dbSnps: Filter by DB_SNP id. - * knockoutType: Filter by knockout type. - * filter: Filter by filter (PASS, NOT_PASS). - * type: Filter by variant type. - * clinicalSignificance: Filter by clinical significance. - * populationFrequency: Filter by population frequency. - * consequenceType: Filter by consequence type. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse summaryRgaIndividual(ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis", null, "clinical/rga/individual", null, "summary", params, GET, KnockoutByIndividualSummary.class); - } - - /** - * Query variant RGA. - * @param params Map containing any of the following optional parameters. - * include: Fields included in the response, whole JSON path must be provided. - * exclude: Fields excluded in the response, whole JSON path must be provided. - * limit: Number of results to be returned. - * skip: Number of results to skip. - * count: Get the total number of results matching the query. Deactivated by default. - * includeIndividual: Include only the comma separated list of individuals to the response. - * skipIndividual: Number of individuals to skip. - * limitIndividual: Limit number of individuals returned (default: 1000). - * sampleId: Filter by sample id. - * individualId: Filter by individual id. - * sex: Filter by sex. - * phenotypes: Filter by phenotypes. - * disorders: Filter by disorders. - * numParents: Filter by the number of parents registered. - * geneId: Filter by gene id. - * geneName: Filter by gene name. - * chromosome: Filter by chromosome. - * start: Filter by start position. - * end: Filter by end position. - * transcriptId: Filter by transcript id. - * variants: Filter by variant id. - * dbSnps: Filter by DB_SNP id. - * knockoutType: Filter by knockout type. - * filter: Filter by filter (PASS, NOT_PASS). - * type: Filter by variant type. - * clinicalSignificance: Filter by clinical significance. - * populationFrequency: Filter by population frequency. - * consequenceType: Filter by consequence type. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse queryRgaVariant(ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis", null, "clinical/rga/variant", null, "query", params, GET, KnockoutByVariant.class); - } - - /** - * RGA variant summary stats. - * @param params Map containing any of the following optional parameters. - * limit: Number of results to be returned. - * skip: Number of results to skip. - * count: Get the total number of results matching the query. Deactivated by default. - * sampleId: Filter by sample id. - * individualId: Filter by individual id. - * sex: Filter by sex. - * phenotypes: Filter by phenotypes. - * disorders: Filter by disorders. - * numParents: Filter by the number of parents registered. - * geneId: Filter by gene id. - * geneName: Filter by gene name. - * chromosome: Filter by chromosome. - * start: Filter by start position. - * end: Filter by end position. - * transcriptId: Filter by transcript id. - * variants: Filter by variant id. - * dbSnps: Filter by DB_SNP id. - * knockoutType: Filter by knockout type. - * filter: Filter by filter (PASS, NOT_PASS). - * type: Filter by variant type. - * clinicalSignificance: Filter by clinical significance. - * populationFrequency: Filter by population frequency. - * consequenceType: Filter by consequence type. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse summaryRgaVariant(ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis", null, "clinical/rga/variant", null, "summary", params, GET, KnockoutByVariantSummary.class); - } - - /** - * Clinical analysis search. - * @param params Map containing any of the following optional parameters. - * include: Fields included in the response, whole JSON path must be provided. - * exclude: Fields excluded in the response, whole JSON path must be provided. - * limit: Number of results to be returned. - * skip: Number of results to skip. - * count: Get the total number of results matching the query. Deactivated by default. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * id: Comma separated list of Clinical Analysis IDs up to a maximum of 100. - * uuid: Comma separated list of Clinical Analysis UUIDs up to a maximum of 100. - * type: Clinical Analysis type. - * disorder: Clinical Analysis disorder. - * files: Clinical Analysis files. - * sample: Sample associated to the proband or any member of a family. - * individual: Proband or any member of a family. - * proband: Clinical Analysis proband. - * probandSamples: Clinical Analysis proband samples. - * family: Clinical Analysis family. - * familyMembers: Clinical Analysis family members. - * familyMemberSamples: Clinical Analysis family members samples. - * panels: Clinical Analysis panels. - * locked: Locked Clinical Analyses. - * analystId: Clinical Analysis analyst id. - * priority: Clinical Analysis priority. - * flags: Clinical Analysis flags. - * creationDate: Clinical Analysis Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * modificationDate: Clinical Analysis Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * dueDate: Clinical Analysis due date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * qualityControlSummary: Clinical Analysis quality control summary. - * release: Release when it was created. - * status: Filter by status. - * internalStatus: Filter by internal status. - * deleted: Boolean to retrieve deleted entries. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse search(ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis", null, "clinical", null, "search", params, GET, ClinicalAnalysis.class); - } - - /** - * Fetch actionable clinical variants. - * @param params Map containing any of the following optional parameters. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * sample: Sample ID. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse actionableVariant(ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis", null, "clinical/variant", null, "actionable", params, GET, ClinicalVariant.class); - } - - /** - * Fetch clinical variants. - * @param params Map containing any of the following optional parameters. - * include: Fields included in the response, whole JSON path must be provided. - * exclude: Fields excluded in the response, whole JSON path must be provided. - * limit: Number of results to be returned. - * skip: Number of results to skip. - * count: Get the total number of results matching the query. Deactivated by default. - * approximateCount: Get an approximate count, instead of an exact total count. Reduces execution time. - * approximateCountSamplingSize: Sampling size to get the approximate count. Larger values increase accuracy but also increase - * execution time. - * savedFilter: Use a saved filter at User level. - * id: List of IDs, these can be rs IDs (dbSNP) or variants in the format chrom:start:ref:alt, e.g. rs116600158,19:7177679:C:T. - * region: List of regions, these can be just a single chromosome name or regions in the format chr:start-end, e.g.: - * 2,3:100000-200000. - * type: List of types, accepted values are SNV, MNV, INDEL, SV, COPY_NUMBER, COPY_NUMBER_LOSS, COPY_NUMBER_GAIN, INSERTION, - * DELETION, DUPLICATION, TANDEM_DUPLICATION, BREAKEND, e.g. SNV,INDEL. - * study: Filter variants from the given studies, these can be either the numeric ID or the alias with the format - * organization@project:study. - * file: Filter variants from the files specified. This will set includeFile parameter when not provided. - * filter: Specify the FILTER for any of the files. If 'file' filter is provided, will match the file and the filter. e.g.: - * PASS,LowGQX. - * qual: Specify the QUAL for any of the files. If 'file' filter is provided, will match the file and the qual. e.g.: >123.4. - * fileData: Filter by file data (i.e. FILTER, QUAL and INFO columns from VCF file). [{file}:]{key}{op}{value}[,;]* . If no file - * is specified, will use all files from "file" filter. e.g. AN>200 or file_1.vcf:AN>200;file_2.vcf:AN<10 . Many fields can - * be combined. e.g. file_1.vcf:AN>200;DB=true;file_2.vcf:AN<10,FILTER=PASS,LowDP. - * sample: Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not provided. This - * filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) - * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) - * operators. e.g. HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. - * 0|1, 1|0, 1|1), but not vice versa. When filtering by multi-allelic genotypes, any secondary allele will match, - * regardless of its position e.g. 1/2 will match with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, - * HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with - * segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted segregation modes: [ autosomalDominant, - * autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, mendelianError, - * compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. . - * sampleData: Filter by any SampleData field from samples. [{sample}:]{key}{op}{value}[,;]* . If no sample is specified, will - * use all samples from "sample" or "genotype" filter. e.g. DP>200 or HG0097:DP>200,HG0098:DP<10 . Many FORMAT fields can be - * combined. e.g. HG0097:DP>200;GT=1/1,0/1,HG0098:DP<10. - * sampleAnnotation: Selects some samples using metadata information from Catalog. e.g. - * age>20;phenotype=hpo:123,hpo:456;name=smith. - * cohort: Select variants with calculated stats for the selected cohorts. - * cohortStatsRef: Reference Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4. - * cohortStatsAlt: Alternate Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4. - * cohortStatsMaf: Minor Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4. - * cohortStatsMgf: Minor Genotype Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4. - * cohortStatsPass: Filter PASS frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL>0.8. - * missingAlleles: Number of missing alleles: [{study:}]{cohort}[<|>|<=|>=]{number}. - * missingGenotypes: Number of missing genotypes: [{study:}]{cohort}[<|>|<=|>=]{number}. - * score: Filter by variant score: [{study:}]{score}[<|>|<=|>=]{number}. - * family: Filter variants where any of the samples from the given family contains the variant (HET or HOM_ALT). - * familyDisorder: Specify the disorder to use for the family segregation. - * familySegregation: Filter by segregation mode from a given family. Accepted values: [ autosomalDominant, autosomalRecessive, - * XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, mendelianError, compoundHeterozygous ]. - * familyMembers: Sub set of the members of a given family. - * familyProband: Specify the proband child to use for the family segregation. - * gene: List of genes, most gene IDs are accepted (HGNC, Ensembl gene, ...). This is an alias to 'xref' parameter. - * ct: List of SO consequence types, e.g. missense_variant,stop_lost or SO:0001583,SO:0001578. Accepts aliases 'loss_of_function' - * and 'protein_altering'. - * xref: List of any external reference, these can be genes, proteins or variants. Accepted IDs include HGNC, Ensembl genes, - * dbSNP, ClinVar, HPO, Cosmic, ... - * biotype: List of biotypes, e.g. protein_coding. - * proteinSubstitution: Protein substitution scores include SIFT and PolyPhen. You can query using the score - * {protein_score}[<|>|<=|>=]{number} or the description {protein_score}[~=|=]{description} e.g. polyphen>0.1,sift=tolerant. - * conservation: Filter by conservation score: {conservation_score}[<|>|<=|>=]{number} e.g. phastCons>0.5,phylop<0.1,gerp>0.1. - * populationFrequencyAlt: Alternate Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01. - * populationFrequencyRef: Reference Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01. - * populationFrequencyMaf: Population minor allele frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01. - * transcriptFlag: List of transcript flags. e.g. canonical, CCDS, basic, LRG, MANE Select, MANE Plus Clinical, EGLH_HaemOnc, - * TSO500. - * geneTraitId: List of gene trait association id. e.g. "umls:C0007222" , "OMIM:269600". - * go: List of GO (Gene Ontology) terms. e.g. "GO:0002020". - * expression: List of tissues of interest. e.g. "lung". - * proteinKeyword: List of Uniprot protein variant annotation keywords. - * drug: List of drug names. - * functionalScore: Functional score: {functional_score}[<|>|<=|>=]{number} e.g. cadd_scaled>5.2 , cadd_raw<=0.3. - * clinical: Clinical source: clinvar, cosmic. - * clinicalSignificance: Clinical significance: benign, likely_benign, likely_pathogenic, pathogenic. - * clinicalConfirmedStatus: Clinical confirmed status. - * customAnnotation: Custom annotation: {key}[<|>|<=|>=]{number} or {key}[~=|=]{text}. - * panel: Filter by genes from the given disease panel. - * panelModeOfInheritance: Filter genes from specific panels that match certain mode of inheritance. Accepted values : [ - * autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, mendelianError, - * compoundHeterozygous ]. - * panelConfidence: Filter genes from specific panels that match certain confidence. Accepted values : [ high, medium, low, - * rejected ]. - * panelRoleInCancer: Filter genes from specific panels that match certain role in cancer. Accepted values : [ both, oncogene, - * tumorSuppressorGene, fusion ]. - * panelFeatureType: Filter elements from specific panels by type. Accepted values : [ gene, region, str, variant ]. - * panelIntersection: Intersect panel genes and regions with given genes and regions from que input query. This will prevent - * returning variants from regions out of the panel. - * trait: List of traits, based on ClinVar, HPO, COSMIC, i.e.: IDs, histologies, descriptions,... - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse queryVariant(ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis", null, "clinical/variant", null, "query", params, GET, ClinicalVariant.class); - } - - /** - * Returns the acl of the clinical analyses. If member is provided, it will only return the acl for the member. - * @param clinicalAnalyses Comma separated list of clinical analysis IDs or names up to a maximum of 100. - * @param params Map containing any of the following optional parameters. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * member: User or group ID. - * silent: Boolean to retrieve all possible entries that are queried for, false to raise an exception whenever one of the entries - * looked for cannot be shown for whichever reason. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse acl(String clinicalAnalyses, ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis", null, "clinical", clinicalAnalyses, "acl", params, GET, ObjectMap.class); - } - - /** - * Delete clinical analyses. - * @param clinicalAnalyses Comma separated list of clinical analysis IDs or names up to a maximum of 100. - * @param params Map containing any of the following optional parameters. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * force: Force deletion if the ClinicalAnalysis contains interpretations or is locked. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse delete(String clinicalAnalyses, ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis", null, "clinical", clinicalAnalyses, "delete", params, DELETE, ClinicalAnalysis.class); - } - - /** - * Update clinical analysis attributes. - * @param clinicalAnalyses Comma separated list of clinical analysis IDs. - * @param data JSON containing clinical analysis information. - * @param params Map containing any of the following optional parameters. - * include: Fields included in the response, whole JSON path must be provided. - * exclude: Fields excluded in the response, whole JSON path must be provided. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * commentsAction: Action to be performed if the array of comments is being updated. - * flagsAction: Action to be performed if the array of flags is being updated. - * filesAction: Action to be performed if the array of files is being updated. - * panelsAction: Action to be performed if the array of panels is being updated. - * includeResult: Flag indicating to include the created or updated document result in the response. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse update(String clinicalAnalyses, ClinicalAnalysisUpdateParams data, ObjectMap params) - throws ClientException { - params = params != null ? params : new ObjectMap(); - params.put("body", data); - return execute("analysis", null, "clinical", clinicalAnalyses, "update", params, POST, ClinicalAnalysis.class); - } - - /** - * Clinical analysis info. - * @param clinicalAnalysis Comma separated list of clinical analysis IDs or names up to a maximum of 100. - * @param params Map containing any of the following optional parameters. - * include: Fields included in the response, whole JSON path must be provided. - * exclude: Fields excluded in the response, whole JSON path must be provided. - * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. - * deleted: Boolean to retrieve deleted entries. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse info(String clinicalAnalysis, ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis", null, "clinical", clinicalAnalysis, "info", params, GET, ClinicalAnalysis.class); - } - - /** - * Create a new Interpretation. - * @param clinicalAnalysis Clinical analysis ID. - * @param data JSON containing clinical interpretation information. - * @param params Map containing any of the following optional parameters. - * include: Fields included in the response, whole JSON path must be provided. - * exclude: Fields excluded in the response, whole JSON path must be provided. - * study: [[organization@]project:]study id. - * setAs: Set interpretation as. - * includeResult: Flag indicating to include the created or updated document result in the response. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse createInterpretation(String clinicalAnalysis, InterpretationCreateParams data, ObjectMap params) - throws ClientException { - params = params != null ? params : new ObjectMap(); - params.put("body", data); - return execute("analysis/clinical", clinicalAnalysis, "interpretation", null, "create", params, POST, Interpretation.class); - } - - /** - * Clear the fields of the main interpretation of the Clinical Analysis. - * @param clinicalAnalysis Clinical analysis ID. - * @param interpretations Interpretation IDs of the Clinical Analysis. - * @param params Map containing any of the following optional parameters. - * study: [[organization@]project:]study ID. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse clearInterpretation(String clinicalAnalysis, String interpretations, ObjectMap params) - throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis/clinical", clinicalAnalysis, "interpretation", interpretations, "clear", params, POST, - Interpretation.class); - } - - /** - * Delete interpretation. - * @param clinicalAnalysis Clinical analysis ID. - * @param interpretations Interpretation IDs of the Clinical Analysis. - * @param params Map containing any of the following optional parameters. - * study: [[organization@]project:]study ID. - * setAsPrimary: Interpretation id to set as primary from the list of secondaries in case of deleting the actual primary one. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse deleteInterpretation(String clinicalAnalysis, String interpretations, ObjectMap params) - throws ClientException { - params = params != null ? params : new ObjectMap(); - return execute("analysis/clinical", clinicalAnalysis, "interpretation", interpretations, "delete", params, DELETE, - Interpretation.class); - } - - /** - * Revert to a previous interpretation version. - * @param clinicalAnalysis Clinical analysis ID. - * @param interpretation Interpretation ID. - * @param version Version to revert to. - * @param params Map containing any of the following optional parameters. - * study: [[organization@]project:]study ID. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse revertInterpretation(String clinicalAnalysis, String interpretation, int version, ObjectMap params) - throws ClientException { - params = params != null ? params : new ObjectMap(); - params.putIfNotNull("version", version); - return execute("analysis/clinical", clinicalAnalysis, "interpretation", interpretation, "revert", params, POST, - Interpretation.class); - } - - /** - * Update interpretation fields. - * @param clinicalAnalysis Clinical analysis ID. - * @param interpretation Interpretation ID. - * @param data JSON containing clinical interpretation information. - * @param params Map containing any of the following optional parameters. - * include: Fields included in the response, whole JSON path must be provided. - * exclude: Fields excluded in the response, whole JSON path must be provided. - * study: [[organization@]project:]study ID. - * primaryFindingsAction: Action to be performed if the array of primary findings is being updated. - * methodsAction: Action to be performed if the array of methods is being updated. - * secondaryFindingsAction: Action to be performed if the array of secondary findings is being updated. - * commentsAction: Action to be performed if the array of comments is being updated. To REMOVE or REPLACE, the date will need to - * be provided to identify the comment. - * panelsAction: Action to be performed if the array of panels is being updated. - * setAs: Set interpretation as. - * includeResult: Flag indicating to include the created or updated document result in the response. - * @return a RestResponse object. - * @throws ClientException ClientException if there is any server error. - */ - public RestResponse updateInterpretation(String clinicalAnalysis, String interpretation, InterpretationUpdateParams - data, ObjectMap params) throws ClientException { - params = params != null ? params : new ObjectMap(); - params.put("body", data); - return execute("analysis/clinical", clinicalAnalysis, "interpretation", interpretation, "update", params, POST, - Interpretation.class); - } -} diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/CohortClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/CohortClient.java index db3160eeb6c..0bcb27158a8 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/CohortClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/CohortClient.java @@ -36,7 +36,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -45,7 +44,6 @@ /** * This class contains methods for the Cohort webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: cohorts */ public class CohortClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java index 83d0ffa1175..ead924800fa 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java @@ -35,7 +35,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -44,7 +43,6 @@ /** * This class contains methods for the DiseasePanel webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: panels */ public class DiseasePanelClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FamilyClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FamilyClient.java index 8f8bd680ffc..368cf2eb4a5 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FamilyClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FamilyClient.java @@ -35,7 +35,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -44,7 +43,6 @@ /** * This class contains methods for the Family webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: families */ public class FamilyClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java index 02e3d914f6d..09cc5ab8c25 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java @@ -43,7 +43,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -52,7 +51,6 @@ /** * This class contains methods for the File webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: files */ public class FileClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/GA4GHClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/GA4GHClient.java index b687c3d0e47..e1eb10bd8a1 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/GA4GHClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/GA4GHClient.java @@ -27,7 +27,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -36,7 +35,6 @@ /** * This class contains methods for the GA4GH webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: ga4gh */ public class GA4GHClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/IndividualClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/IndividualClient.java index 09e91a32ff7..571f7b8953f 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/IndividualClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/IndividualClient.java @@ -35,7 +35,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -44,7 +43,6 @@ /** * This class contains methods for the Individual webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: individuals */ public class IndividualClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java index f6d27510706..523523ab4b3 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java @@ -36,7 +36,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -45,7 +44,6 @@ /** * This class contains methods for the Job webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: jobs */ public class JobClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/MetaClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/MetaClient.java index 3e77702534c..8401614fec4 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/MetaClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/MetaClient.java @@ -28,7 +28,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -37,7 +36,6 @@ /** * This class contains methods for the Meta webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: meta */ public class MetaClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/OrganizationClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/OrganizationClient.java index 1415aeb5605..aebe0ba61f5 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/OrganizationClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/OrganizationClient.java @@ -33,7 +33,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -42,7 +41,6 @@ /** * This class contains methods for the Organization webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: organizations */ public class OrganizationClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ProjectClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ProjectClient.java index 4f241541143..53ecaea4610 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ProjectClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ProjectClient.java @@ -31,7 +31,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -40,7 +39,6 @@ /** * This class contains methods for the Project webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: projects */ public class ProjectClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/SampleClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/SampleClient.java index 5feb046554a..811dcbfe08c 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/SampleClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/SampleClient.java @@ -35,7 +35,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -44,7 +43,6 @@ /** * This class contains methods for the Sample webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: samples */ public class SampleClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java index a5187a4c7d8..71e89be53fb 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java @@ -47,7 +47,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -56,7 +55,6 @@ /** * This class contains methods for the Study webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: studies */ public class StudyClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/UserClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/UserClient.java index 71b158bca58..ee290b40d21 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/UserClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/UserClient.java @@ -36,7 +36,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -45,7 +44,6 @@ /** * This class contains methods for the User webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: users */ public class UserClient extends AbstractParentClient { @@ -103,6 +101,26 @@ public RestResponse password(PasswordChangeParams data) throws ClientExcep return execute("users", null, null, null, "password", params, POST, User.class); } + /** + * User search method. + * @param params Map containing any of the following optional parameters. + * include: Fields included in the response, whole JSON path must be provided. + * exclude: Fields excluded in the response, whole JSON path must be provided. + * limit: Number of results to be returned. + * skip: Number of results to skip. + * count: Get the total number of results matching the query. Deactivated by default. + * organization: Organization id. + * id: Comma separated list user IDs up to a maximum of 100. Also admits basic regular expressions using the operator '~', i.e. + * '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. + * authenticationId: Authentication origin ID. + * @return a RestResponse object. + * @throws ClientException ClientException if there is any server error. + */ + public RestResponse search(ObjectMap params) throws ClientException { + params = params != null ? params : new ObjectMap(); + return execute("users", null, null, null, "search", params, GET, User.class); + } + /** * Return the user information including its projects and studies. * @param users Comma separated list of user IDs. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java index bf91b0a72df..93ae92a1d88 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java @@ -62,7 +62,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -71,7 +70,6 @@ /** * This class contains methods for the Variant webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: analysis/variant */ public class VariantClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java index b208b0332f5..9731eb2bcc0 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java @@ -50,7 +50,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -59,7 +58,6 @@ /** * This class contains methods for the VariantOperation webservices. - * Client version: 3.1.0-SNAPSHOT * PATH: operation */ public class VariantOperationClient extends AbstractParentClient { diff --git a/opencga-client/src/main/javascript/Admin.js b/opencga-client/src/main/javascript/Admin.js index a17bf1209e7..3f6204d4165 100644 --- a/opencga-client/src/main/javascript/Admin.js +++ b/opencga-client/src/main/javascript/Admin.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -107,7 +109,6 @@ export default class Admin extends OpenCGAParentClass { * value is false. * @param {String} [params.organization] - Organization id. * @param {String} [params.user] - User ID. - * @param {String} [params.account] - Account type [GUEST, FULL, ADMINISTRATOR]. * @param {String} [params.authenticationId] - Authentication origin ID. * @returns {Promise} Promise object in the form of RestResponse instance. */ diff --git a/opencga-client/src/main/javascript/Alignment.js b/opencga-client/src/main/javascript/Alignment.js index 3b0cf840b5a..0b374aab6a5 100644 --- a/opencga-client/src/main/javascript/Alignment.js +++ b/opencga-client/src/main/javascript/Alignment.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/ClinicalAnalysis.js b/opencga-client/src/main/javascript/ClinicalAnalysis.js index 3a2d4044b61..265e9e28a2b 100644 --- a/opencga-client/src/main/javascript/ClinicalAnalysis.js +++ b/opencga-client/src/main/javascript/ClinicalAnalysis.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Cohort.js b/opencga-client/src/main/javascript/Cohort.js index e8c016fe834..dcd44092cc6 100644 --- a/opencga-client/src/main/javascript/Cohort.js +++ b/opencga-client/src/main/javascript/Cohort.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/DiseasePanel.js b/opencga-client/src/main/javascript/DiseasePanel.js index f9401a6090f..b23920896d2 100644 --- a/opencga-client/src/main/javascript/DiseasePanel.js +++ b/opencga-client/src/main/javascript/DiseasePanel.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Family.js b/opencga-client/src/main/javascript/Family.js index 1568ca19ad2..55a5ac0caf6 100644 --- a/opencga-client/src/main/javascript/Family.js +++ b/opencga-client/src/main/javascript/Family.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/File.js b/opencga-client/src/main/javascript/File.js index 3aaf33d45a4..80c275318ef 100644 --- a/opencga-client/src/main/javascript/File.js +++ b/opencga-client/src/main/javascript/File.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/GA4GH.js b/opencga-client/src/main/javascript/GA4GH.js index 50c5f456909..02af95b1363 100644 --- a/opencga-client/src/main/javascript/GA4GH.js +++ b/opencga-client/src/main/javascript/GA4GH.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Individual.js b/opencga-client/src/main/javascript/Individual.js index 81bc55cc81d..fb33520e6db 100644 --- a/opencga-client/src/main/javascript/Individual.js +++ b/opencga-client/src/main/javascript/Individual.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Job.js b/opencga-client/src/main/javascript/Job.js index a7faefab056..e9014ed296f 100644 --- a/opencga-client/src/main/javascript/Job.js +++ b/opencga-client/src/main/javascript/Job.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Meta.js b/opencga-client/src/main/javascript/Meta.js index 5f46d66682f..0a536de0c03 100644 --- a/opencga-client/src/main/javascript/Meta.js +++ b/opencga-client/src/main/javascript/Meta.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Organization.js b/opencga-client/src/main/javascript/Organization.js index 6e96cfe293a..4385a545eb0 100644 --- a/opencga-client/src/main/javascript/Organization.js +++ b/opencga-client/src/main/javascript/Organization.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Project.js b/opencga-client/src/main/javascript/Project.js index 8728cf80482..524221df852 100644 --- a/opencga-client/src/main/javascript/Project.js +++ b/opencga-client/src/main/javascript/Project.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Sample.js b/opencga-client/src/main/javascript/Sample.js index 5687de66b71..48edf930fc8 100644 --- a/opencga-client/src/main/javascript/Sample.js +++ b/opencga-client/src/main/javascript/Sample.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Study.js b/opencga-client/src/main/javascript/Study.js index 1d8a7d97876..1be4598d5bc 100644 --- a/opencga-client/src/main/javascript/Study.js +++ b/opencga-client/src/main/javascript/Study.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/User.js b/opencga-client/src/main/javascript/User.js index 1b72aa833c4..843416dd14e 100644 --- a/opencga-client/src/main/javascript/User.js +++ b/opencga-client/src/main/javascript/User.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -64,6 +66,24 @@ export default class User extends OpenCGAParentClass { return this._post("users", null, null, null, "password", data); } + /** User search method + * @param {Object} [params] - The Object containing the following optional parameters: + * @param {String} [params.include] - Fields included in the response, whole JSON path must be provided. + * @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided. + * @param {Number} [params.limit] - Number of results to be returned. + * @param {Number} [params.skip] - Number of results to skip. + * @param {Boolean} [params.count = "false"] - Get the total number of results matching the query. Deactivated by default. The default + * value is false. + * @param {String} [params.organization] - Organization id. + * @param {String} [params.id] - Comma separated list user IDs up to a maximum of 100. Also admits basic regular expressions using the + * operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. + * @param {String} [params.authenticationId] - Authentication origin ID. + * @returns {Promise} Promise object in the form of RestResponse instance. + */ + search(params) { + return this._get("users", null, null, null, "search", params); + } + /** Return the user information including its projects and studies * @param {String} users - Comma separated list of user IDs. * @param {Object} [params] - The Object containing the following optional parameters: diff --git a/opencga-client/src/main/javascript/Variant.js b/opencga-client/src/main/javascript/Variant.js index 60baa0f5a0d..177fdffdae3 100644 --- a/opencga-client/src/main/javascript/Variant.js +++ b/opencga-client/src/main/javascript/Variant.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/VariantOperation.js b/opencga-client/src/main/javascript/VariantOperation.js index bfd6f99aa40..6f2ce1afafa 100644 --- a/opencga-client/src/main/javascript/VariantOperation.js +++ b/opencga-client/src/main/javascript/VariantOperation.js @@ -1,9 +1,12 @@ /** - * Copyright 2015-2020 OpenCB + * Copyright 2015-2024 OpenCB + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -12,7 +15,6 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-04-10 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/admin_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/admin_client.py index 1f344f41988..7311fa7e5dd 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/admin_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/admin_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class Admin(_ParentRestClient): """ This class contains methods for the 'Admin' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/admin """ @@ -117,7 +115,6 @@ def search_users(self, **options): Deactivated by default. :param str organization: Organization id. :param str user: User ID. - :param str account: Account type [GUEST, FULL, ADMINISTRATOR]. :param str authentication_id: Authentication origin ID. """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py index 08ba05a5b76..4924a3e1233 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class Alignment(_ParentRestClient): """ This class contains methods for the 'Analysis - Alignment' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/analysis/alignment """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py index c8cf1a2e23b..e66873eba68 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class ClinicalAnalysis(_ParentRestClient): """ This class contains methods for the 'Analysis - Clinical' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/analysis/clinical """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/clinical_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/clinical_client.py deleted file mode 100644 index 3c42c2e0a16..00000000000 --- a/opencga-client/src/main/python/pyopencga/rest_clients/clinical_client.py +++ /dev/null @@ -1,1005 +0,0 @@ -""" -WARNING: AUTOGENERATED CODE - - This code was generated by a tool. - Autogenerated on: 2022-08-02 08:25:32 ->>>>>>> develop ->>>>>>> release-2.4.x ->>>>>>> release-2.4.x - - Manual changes to this file may cause unexpected behavior in your application. - Manual changes to this file will be overwritten if the code is regenerated. -""" - -from pyopencga.rest_clients._parent_rest_clients import _ParentRestClient - - -class Clinical(_ParentRestClient): - """ - This class contains methods for the 'Analysis - Clinical' webservices - Client version: 2.3.3-SNAPSHOT [fb5e7ed17448243b10ddd619bdf973e4b20b0a74] ->>>>>>> develop ->>>>>>> release-2.4.x ->>>>>>> release-2.4.x - PATH: /{apiVersion}/analysis/clinical - """ - - def __init__(self, configuration, token=None, login_handler=None, *args, **kwargs): - super(Clinical, self).__init__(configuration, token, login_handler, *args, **kwargs) - - def update_acl(self, members, action, data=None, **options): - """ - Update the set of permissions granted for the member. - PATH: /{apiVersion}/analysis/clinical/acl/{members}/update - - :param dict data: JSON containing the parameters to add ACLs. - (REQUIRED) - :param str action: Action to be performed [ADD, SET, REMOVE or RESET]. - (REQUIRED) - :param str members: Comma separated list of user or group IDs. - (REQUIRED) - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param bool propagate: Propagate permissions to related families, - individuals, samples and files. - """ - - options['action'] = action - return self._post(category='analysis', resource='update', subcategory='clinical/acl', second_query_id=members, data=data, **options) - - def update_clinical_configuration(self, data=None, **options): - """ - Update Clinical Analysis configuration. - PATH: /{apiVersion}/analysis/clinical/clinical/configuration/update - - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param dict data: Configuration params to update. - """ - - return self._post(category='analysis', resource='update', subcategory='clinical/clinical/configuration', data=data, **options) - - def create(self, data=None, **options): - """ - Create a new clinical analysis. - PATH: /{apiVersion}/analysis/clinical/create - - :param dict data: JSON containing clinical analysis information. - (REQUIRED) - :param str include: Fields included in the response, whole JSON path - must be provided. - :param str exclude: Fields excluded in the response, whole JSON path - must be provided. - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param bool skip_create_default_interpretation: Flag to skip creating - and initialise an empty default primary interpretation (Id will be - '{clinicalAnalysisId}.1'). This flag is only considered if no - Interpretation object is passed. - :param bool include_result: Flag indicating to include the created or - updated document result in the response. - """ - - return self._post(category='analysis', resource='create', subcategory='clinical', data=data, **options) - - def distinct(self, field, **options): - """ - Clinical Analysis distinct method. - PATH: /{apiVersion}/analysis/clinical/distinct - - :param str field: Field for which to obtain the distinct values. - (REQUIRED) - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param str id: Comma separated list of Clinical Analysis IDs up to a - maximum of 100. - :param str uuid: Comma separated list of Clinical Analysis UUIDs up to - a maximum of 100. - :param str type: Clinical Analysis type. - :param str disorder: Clinical Analysis disorder. - :param str files: Clinical Analysis files. - :param str sample: Sample associated to the proband or any member of a - family. - :param str individual: Proband or any member of a family. - :param str proband: Clinical Analysis proband. - :param str proband_samples: Clinical Analysis proband samples. - :param str family: Clinical Analysis family. - :param str family_members: Clinical Analysis family members. - :param str family_member_samples: Clinical Analysis family members - samples. - :param str panels: Clinical Analysis panels. - :param bool locked: Locked Clinical Analyses. - :param str analyst_id: Clinical Analysis analyst id. - :param str priority: Clinical Analysis priority. - :param str flags: Clinical Analysis flags. - :param str creation_date: Clinical Analysis Creation date. Format: - yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - :param str modification_date: Clinical Analysis Modification date. - Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - :param str due_date: Clinical Analysis due date. Format: - yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - :param str quality_control_summary: Clinical Analysis quality control - summary. - :param str release: Release when it was created. - :param str status: Filter by status. - :param str internal_status: Filter by internal status. - :param bool deleted: Boolean to retrieve deleted entries. - """ - - options['field'] = field - return self._get(category='analysis', resource='distinct', subcategory='clinical', **options) - - def distinct_interpretation(self, field, **options): - """ - Interpretation distinct method. - PATH: /{apiVersion}/analysis/clinical/interpretation/distinct - - :param str field: Field for which to obtain the distinct values. - (REQUIRED) - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param str id: Comma separated list of Interpretation IDs up to a - maximum of 100. - :param str uuid: Comma separated list of Interpretation UUIDs up to a - maximum of 100. - :param str clinical_analysis_id: Clinical Analysis id. - :param str analyst_id: Analyst ID. - :param str method_name: Interpretation method name. - :param str panels: Interpretation panels. - :param str primary_findings: Interpretation primary findings. - :param str secondary_findings: Interpretation secondary findings. - :param str creation_date: Interpretation Creation date. Format: - yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - :param str modification_date: Interpretation Modification date. - Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - :param str status: Filter by status. - :param str internal_status: Filter by internal status. - :param str release: Release when it was created. - """ - - options['field'] = field - return self._get(category='analysis', resource='distinct', subcategory='clinical/interpretation', **options) - - def search_interpretation(self, **options): - """ - Search clinical interpretations. - PATH: /{apiVersion}/analysis/clinical/interpretation/search - - :param str include: Fields included in the response, whole JSON path - must be provided. - :param str exclude: Fields excluded in the response, whole JSON path - must be provided. - :param int limit: Number of results to be returned. - :param int skip: Number of results to skip. - :param bool sort: Sort the results. - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param str id: Comma separated list of Interpretation IDs up to a - maximum of 100. - :param str uuid: Comma separated list of Interpretation UUIDs up to a - maximum of 100. - :param str clinical_analysis_id: Clinical Analysis id. - :param str analyst_id: Analyst ID. - :param str method_name: Interpretation method name. - :param str panels: Interpretation panels. - :param str primary_findings: Interpretation primary findings. - :param str secondary_findings: Interpretation secondary findings. - :param str creation_date: Interpretation Creation date. Format: - yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - :param str modification_date: Interpretation Modification date. - Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - :param str status: Filter by status. - :param str internal_status: Filter by internal status. - :param str release: Release when it was created. - """ - - return self._get(category='analysis', resource='search', subcategory='clinical/interpretation', **options) - - def info_interpretation(self, interpretations, **options): - """ - Clinical interpretation information. - PATH: /{apiVersion}/analysis/clinical/interpretation/{interpretations}/info - - :param str interpretations: Comma separated list of clinical - interpretation IDs up to a maximum of 100. (REQUIRED) - :param str include: Fields included in the response, whole JSON path - must be provided. - :param str exclude: Fields excluded in the response, whole JSON path - must be provided. - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param str version: Comma separated list of interpretation versions. - 'all' to get all the interpretation versions. Not supported if - multiple interpretation ids are provided. - :param bool deleted: Boolean to retrieve deleted entries. - """ - - return self._get(category='analysis', resource='info', subcategory='clinical/interpretation', second_query_id=interpretations, **options) - - def run_interpreter_cancer_tiering(self, data=None, **options): - """ - Run cancer tiering interpretation analysis. - PATH: /{apiVersion}/analysis/clinical/interpreter/cancerTiering/run - - :param dict data: Cancer tiering interpretation analysis params. - (REQUIRED) - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param str job_id: Job ID. It must be a unique string within the - study. An ID will be autogenerated automatically if not provided. - :param str job_description: Job description. - :param str job_depends_on: Comma separated list of existing job IDs - the job will depend on. - :param str job_tags: Job tags. - """ - - return self._post(category='analysis', resource='run', subcategory='clinical/interpreter/cancerTiering', data=data, **options) - - def run_interpreter_exomiser(self, data=None, **options): - """ - Run exomiser interpretation analysis. - PATH: /{apiVersion}/analysis/clinical/interpreter/exomiser/run - - :param dict data: Exomizer interpretation analysis params. (REQUIRED) - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param str job_id: Job ID. It must be a unique string within the - study. An ID will be autogenerated automatically if not provided. - :param str job_description: Job description. - :param str job_depends_on: Comma separated list of existing job IDs - the job will depend on. - :param str job_tags: Job tags. - """ - - return self._post(category='analysis', resource='run', subcategory='clinical/interpreter/exomiser', data=data, **options) - - def run_interpreter_team(self, data=None, **options): - """ - Run TEAM interpretation analysis. - PATH: /{apiVersion}/analysis/clinical/interpreter/team/run - - :param dict data: TEAM interpretation analysis params. (REQUIRED) - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param str job_id: Job ID. It must be a unique string within the - study. An ID will be autogenerated automatically if not provided. - :param str job_description: Job description. - :param str job_depends_on: Comma separated list of existing job IDs - the job will depend on. - :param str job_tags: Job tags. - """ - - return self._post(category='analysis', resource='run', subcategory='clinical/interpreter/team', data=data, **options) - - def run_interpreter_tiering(self, data=None, **options): - """ - Run tiering interpretation analysis. - PATH: /{apiVersion}/analysis/clinical/interpreter/tiering/run - - :param dict data: Tiering interpretation analysis params. (REQUIRED) - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param str job_id: Job ID. It must be a unique string within the - study. An ID will be autogenerated automatically if not provided. - :param str job_description: Job description. - :param str job_depends_on: Comma separated list of existing job IDs - the job will depend on. - :param str job_tags: Job tags. - """ - - return self._post(category='analysis', resource='run', subcategory='clinical/interpreter/tiering', data=data, **options) - - def run_interpreter_zetta(self, data=None, **options): - """ - Run Zetta interpretation analysis. - PATH: /{apiVersion}/analysis/clinical/interpreter/zetta/run - - :param dict data: Zetta interpretation analysis params. (REQUIRED) - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param str job_id: Job ID. It must be a unique string within the - study. An ID will be autogenerated automatically if not provided. - :param str job_description: Job description. - :param str job_depends_on: Comma separated list of existing job IDs - the job will depend on. - :param str job_tags: Job tags. - """ - - return self._post(category='analysis', resource='run', subcategory='clinical/interpreter/zetta', data=data, **options) - - def aggregation_stats_rga(self, field, **options): - """ - RGA aggregation stats. - PATH: /{apiVersion}/analysis/clinical/rga/aggregationStats - - :param str field: List of fields separated by semicolons, e.g.: - clinicalSignificances;type. For nested fields use >>, e.g.: - type>>clinicalSignificances;knockoutType. (REQUIRED) - :param int limit: Number of results to be returned. - :param int skip: Number of results to skip. - :param str sample_id: Filter by sample id. - :param str individual_id: Filter by individual id. - :param str sex: Filter by sex. - :param str phenotypes: Filter by phenotypes. - :param str disorders: Filter by disorders. - :param str num_parents: Filter by the number of parents registered. - :param str gene_id: Filter by gene id. - :param str gene_name: Filter by gene name. - :param str chromosome: Filter by chromosome. - :param str start: Filter by start position. - :param str end: Filter by end position. - :param str transcript_id: Filter by transcript id. - :param str variants: Filter by variant id. - :param str db_snps: Filter by DB_SNP id. - :param str knockout_type: Filter by knockout type. - :param str filter: Filter by filter (PASS, NOT_PASS). - :param str type: Filter by variant type. - :param str clinical_significance: Filter by clinical significance. - :param str population_frequency: Filter by population frequency. - :param str consequence_type: Filter by consequence type. - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - """ - - options['field'] = field - return self._get(category='analysis', resource='aggregationStats', subcategory='clinical/rga', **options) - - def query_rga_gene(self, **options): - """ - Query gene RGA. - PATH: /{apiVersion}/analysis/clinical/rga/gene/query - - :param str include: Fields included in the response, whole JSON path - must be provided. - :param str exclude: Fields excluded in the response, whole JSON path - must be provided. - :param int limit: Number of results to be returned. - :param int skip: Number of results to skip. - :param bool count: Get the total number of results matching the query. - Deactivated by default. - :param str include_individual: Include only the comma separated list - of individuals to the response. - :param int skip_individual: Number of individuals to skip. - :param int limit_individual: Limit number of individuals returned - (default: 1000). - :param str sample_id: Filter by sample id. - :param str individual_id: Filter by individual id. - :param str sex: Filter by sex. - :param str phenotypes: Filter by phenotypes. - :param str disorders: Filter by disorders. - :param str num_parents: Filter by the number of parents registered. - :param str gene_id: Filter by gene id. - :param str gene_name: Filter by gene name. - :param str chromosome: Filter by chromosome. - :param str start: Filter by start position. - :param str end: Filter by end position. - :param str transcript_id: Filter by transcript id. - :param str variants: Filter by variant id. - :param str db_snps: Filter by DB_SNP id. - :param str knockout_type: Filter by knockout type. - :param str filter: Filter by filter (PASS, NOT_PASS). - :param str type: Filter by variant type. - :param str clinical_significance: Filter by clinical significance. - :param str population_frequency: Filter by population frequency. - :param str consequence_type: Filter by consequence type. - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - """ - - return self._get(category='analysis', resource='query', subcategory='clinical/rga/gene', **options) - - def summary_rga_gene(self, **options): - """ - RGA gene summary stats. - PATH: /{apiVersion}/analysis/clinical/rga/gene/summary - - :param int limit: Number of results to be returned. - :param int skip: Number of results to skip. - :param bool count: Get the total number of results matching the query. - Deactivated by default. - :param str sample_id: Filter by sample id. - :param str individual_id: Filter by individual id. - :param str sex: Filter by sex. - :param str phenotypes: Filter by phenotypes. - :param str disorders: Filter by disorders. - :param str num_parents: Filter by the number of parents registered. - :param str gene_id: Filter by gene id. - :param str gene_name: Filter by gene name. - :param str chromosome: Filter by chromosome. - :param str start: Filter by start position. - :param str end: Filter by end position. - :param str transcript_id: Filter by transcript id. - :param str variants: Filter by variant id. - :param str db_snps: Filter by DB_SNP id. - :param str knockout_type: Filter by knockout type. - :param str filter: Filter by filter (PASS, NOT_PASS). - :param str type: Filter by variant type. - :param str clinical_significance: Filter by clinical significance. - :param str population_frequency: Filter by population frequency. - :param str consequence_type: Filter by consequence type. - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - """ - - return self._get(category='analysis', resource='summary', subcategory='clinical/rga/gene', **options) - - def run_rga_index(self, data=None, **options): - """ - Generate Recessive Gene Analysis secondary index. - PATH: /{apiVersion}/analysis/clinical/rga/index/run - - :param dict data: Recessive Gene Analysis index params. (REQUIRED) - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param str job_id: Job ID. It must be a unique string within the - study. An ID will be autogenerated automatically if not provided. - :param str job_description: Job description. - :param str job_depends_on: Comma separated list of existing job IDs - the job will depend on. - :param str job_tags: Job tags. - :param bool auxiliar_index: Index auxiliar collection to improve - performance assuming RGA is completely indexed. - """ - - return self._post(category='analysis', resource='run', subcategory='clinical/rga/index', data=data, **options) - - def query_rga_individual(self, **options): - """ - Query individual RGA. - PATH: /{apiVersion}/analysis/clinical/rga/individual/query - - :param str include: Fields included in the response, whole JSON path - must be provided. - :param str exclude: Fields excluded in the response, whole JSON path - must be provided. - :param int limit: Number of results to be returned. - :param int skip: Number of results to skip. - :param bool count: Get the total number of results matching the query. - Deactivated by default. - :param str sample_id: Filter by sample id. - :param str individual_id: Filter by individual id. - :param str sex: Filter by sex. - :param str phenotypes: Filter by phenotypes. - :param str disorders: Filter by disorders. - :param str num_parents: Filter by the number of parents registered. - :param str gene_id: Filter by gene id. - :param str gene_name: Filter by gene name. - :param str chromosome: Filter by chromosome. - :param str start: Filter by start position. - :param str end: Filter by end position. - :param str transcript_id: Filter by transcript id. - :param str variants: Filter by variant id. - :param str db_snps: Filter by DB_SNP id. - :param str knockout_type: Filter by knockout type. - :param str filter: Filter by filter (PASS, NOT_PASS). - :param str type: Filter by variant type. - :param str clinical_significance: Filter by clinical significance. - :param str population_frequency: Filter by population frequency. - :param str consequence_type: Filter by consequence type. - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - """ - - return self._get(category='analysis', resource='query', subcategory='clinical/rga/individual', **options) - - def summary_rga_individual(self, **options): - """ - RGA individual summary stats. - PATH: /{apiVersion}/analysis/clinical/rga/individual/summary - - :param int limit: Number of results to be returned. - :param int skip: Number of results to skip. - :param bool count: Get the total number of results matching the query. - Deactivated by default. - :param str sample_id: Filter by sample id. - :param str individual_id: Filter by individual id. - :param str sex: Filter by sex. - :param str phenotypes: Filter by phenotypes. - :param str disorders: Filter by disorders. - :param str num_parents: Filter by the number of parents registered. - :param str gene_id: Filter by gene id. - :param str gene_name: Filter by gene name. - :param str chromosome: Filter by chromosome. - :param str start: Filter by start position. - :param str end: Filter by end position. - :param str transcript_id: Filter by transcript id. - :param str variants: Filter by variant id. - :param str db_snps: Filter by DB_SNP id. - :param str knockout_type: Filter by knockout type. - :param str filter: Filter by filter (PASS, NOT_PASS). - :param str type: Filter by variant type. - :param str clinical_significance: Filter by clinical significance. - :param str population_frequency: Filter by population frequency. - :param str consequence_type: Filter by consequence type. - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - """ - - return self._get(category='analysis', resource='summary', subcategory='clinical/rga/individual', **options) - - def query_rga_variant(self, **options): - """ - Query variant RGA. - PATH: /{apiVersion}/analysis/clinical/rga/variant/query - - :param str include: Fields included in the response, whole JSON path - must be provided. - :param str exclude: Fields excluded in the response, whole JSON path - must be provided. - :param int limit: Number of results to be returned. - :param int skip: Number of results to skip. - :param bool count: Get the total number of results matching the query. - Deactivated by default. - :param str include_individual: Include only the comma separated list - of individuals to the response. - :param int skip_individual: Number of individuals to skip. - :param int limit_individual: Limit number of individuals returned - (default: 1000). - :param str sample_id: Filter by sample id. - :param str individual_id: Filter by individual id. - :param str sex: Filter by sex. - :param str phenotypes: Filter by phenotypes. - :param str disorders: Filter by disorders. - :param str num_parents: Filter by the number of parents registered. - :param str gene_id: Filter by gene id. - :param str gene_name: Filter by gene name. - :param str chromosome: Filter by chromosome. - :param str start: Filter by start position. - :param str end: Filter by end position. - :param str transcript_id: Filter by transcript id. - :param str variants: Filter by variant id. - :param str db_snps: Filter by DB_SNP id. - :param str knockout_type: Filter by knockout type. - :param str filter: Filter by filter (PASS, NOT_PASS). - :param str type: Filter by variant type. - :param str clinical_significance: Filter by clinical significance. - :param str population_frequency: Filter by population frequency. - :param str consequence_type: Filter by consequence type. - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - """ - - return self._get(category='analysis', resource='query', subcategory='clinical/rga/variant', **options) - - def summary_rga_variant(self, **options): - """ - RGA variant summary stats. - PATH: /{apiVersion}/analysis/clinical/rga/variant/summary - - :param int limit: Number of results to be returned. - :param int skip: Number of results to skip. - :param bool count: Get the total number of results matching the query. - Deactivated by default. - :param str sample_id: Filter by sample id. - :param str individual_id: Filter by individual id. - :param str sex: Filter by sex. - :param str phenotypes: Filter by phenotypes. - :param str disorders: Filter by disorders. - :param str num_parents: Filter by the number of parents registered. - :param str gene_id: Filter by gene id. - :param str gene_name: Filter by gene name. - :param str chromosome: Filter by chromosome. - :param str start: Filter by start position. - :param str end: Filter by end position. - :param str transcript_id: Filter by transcript id. - :param str variants: Filter by variant id. - :param str db_snps: Filter by DB_SNP id. - :param str knockout_type: Filter by knockout type. - :param str filter: Filter by filter (PASS, NOT_PASS). - :param str type: Filter by variant type. - :param str clinical_significance: Filter by clinical significance. - :param str population_frequency: Filter by population frequency. - :param str consequence_type: Filter by consequence type. - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - """ - - return self._get(category='analysis', resource='summary', subcategory='clinical/rga/variant', **options) - - def search(self, **options): - """ - Clinical analysis search. - PATH: /{apiVersion}/analysis/clinical/search - - :param str include: Fields included in the response, whole JSON path - must be provided. - :param str exclude: Fields excluded in the response, whole JSON path - must be provided. - :param int limit: Number of results to be returned. - :param int skip: Number of results to skip. - :param bool count: Get the total number of results matching the query. - Deactivated by default. - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param str id: Comma separated list of Clinical Analysis IDs up to a - maximum of 100. - :param str uuid: Comma separated list of Clinical Analysis UUIDs up to - a maximum of 100. - :param str type: Clinical Analysis type. - :param str disorder: Clinical Analysis disorder. - :param str files: Clinical Analysis files. - :param str sample: Sample associated to the proband or any member of a - family. - :param str individual: Proband or any member of a family. - :param str proband: Clinical Analysis proband. - :param str proband_samples: Clinical Analysis proband samples. - :param str family: Clinical Analysis family. - :param str family_members: Clinical Analysis family members. - :param str family_member_samples: Clinical Analysis family members - samples. - :param str panels: Clinical Analysis panels. - :param bool locked: Locked Clinical Analyses. - :param str analyst_id: Clinical Analysis analyst id. - :param str priority: Clinical Analysis priority. - :param str flags: Clinical Analysis flags. - :param str creation_date: Clinical Analysis Creation date. Format: - yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - :param str modification_date: Clinical Analysis Modification date. - Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - :param str due_date: Clinical Analysis due date. Format: - yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - :param str quality_control_summary: Clinical Analysis quality control - summary. - :param str release: Release when it was created. - :param str status: Filter by status. - :param str internal_status: Filter by internal status. - :param bool deleted: Boolean to retrieve deleted entries. - """ - - return self._get(category='analysis', resource='search', subcategory='clinical', **options) - - def actionable_variant(self, **options): - """ - Fetch actionable clinical variants. - PATH: /{apiVersion}/analysis/clinical/variant/actionable - - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param str sample: Sample ID. - """ - - return self._get(category='analysis', resource='actionable', subcategory='clinical/variant', **options) - - def query_variant(self, **options): - """ - Fetch clinical variants. - PATH: /{apiVersion}/analysis/clinical/variant/query - - :param str include: Fields included in the response, whole JSON path - must be provided. - :param str exclude: Fields excluded in the response, whole JSON path - must be provided. - :param int limit: Number of results to be returned. - :param int skip: Number of results to skip. - :param bool count: Get the total number of results matching the query. - Deactivated by default. - :param bool approximate_count: Get an approximate count, instead of an - exact total count. Reduces execution time. - :param int approximate_count_sampling_size: Sampling size to get the - approximate count. Larger values increase accuracy but also - increase execution time. - :param str saved_filter: Use a saved filter at User level. - :param str id: List of IDs, these can be rs IDs (dbSNP) or variants in - the format chrom:start:ref:alt, e.g. rs116600158,19:7177679:C:T. - :param str region: List of regions, these can be just a single - chromosome name or regions in the format chr:start-end, e.g.: - 2,3:100000-200000. - :param str type: List of types, accepted values are SNV, MNV, INDEL, - SV, COPY_NUMBER, COPY_NUMBER_LOSS, COPY_NUMBER_GAIN, INSERTION, - DELETION, DUPLICATION, TANDEM_DUPLICATION, BREAKEND, e.g. - SNV,INDEL. - :param str study: Filter variants from the given studies, these can be - either the numeric ID or the alias with the format - user@project:study. - :param str file: Filter variants from the files specified. This will - set includeFile parameter when not provided. - :param str filter: Specify the FILTER for any of the files. If 'file' - filter is provided, will match the file and the filter. e.g.: - PASS,LowGQX. - :param str qual: Specify the QUAL for any of the files. If 'file' - filter is provided, will match the file and the qual. e.g.: >123.4. - :param str file_data: Filter by file data (i.e. FILTER, QUAL and INFO - columns from VCF file). [{file}:]{key}{op}{value}[,;]* . If no file - is specified, will use all files from 'file' filter. e.g. AN>200 or - file_1.vcf:AN>200;file_2.vcf:AN<10 . Many fields can be combined. - e.g. file_1.vcf:AN>200;DB=true;file_2.vcf:AN<10,FILTER=PASS,LowDP. - :param str sample: Filter variants by sample genotype. This will - automatically set 'includeSample' parameter when not provided. This - filter accepts multiple 3 forms: 1) List of samples: Samples that - contain the main variant. Accepts AND (;) and OR (,) operators. - e.g. HG0097,HG0098 . 2) List of samples with genotypes: - {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. - HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will - also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice - versa. When filtering by multi-allelic genotypes, any secondary - allele will match, regardless of its position e.g. 1/2 will match - with genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: - HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. - HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation - mode: {sample}:{segregation}. Only one sample accepted.Accepted - segregation modes: [ autosomalDominant, autosomalRecessive, - XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, - mendelianError, compoundHeterozygous ]. Value is case insensitive. - e.g. HG0097:DeNovo Sample must have parents defined and indexed. . - :param str sample_data: Filter by any SampleData field from samples. - [{sample}:]{key}{op}{value}[,;]* . If no sample is specified, will - use all samples from 'sample' or 'genotype' filter. e.g. DP>200 or - HG0097:DP>200,HG0098:DP<10 . Many FORMAT fields can be combined. - e.g. HG0097:DP>200;GT=1/1,0/1,HG0098:DP<10. - :param str sample_annotation: Selects some samples using metadata - information from Catalog. e.g. - age>20;phenotype=hpo:123,hpo:456;name=smith. - :param str cohort: Select variants with calculated stats for the - selected cohorts. - :param str cohort_stats_ref: Reference Allele Frequency: - [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4. - :param str cohort_stats_alt: Alternate Allele Frequency: - [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4. - :param str cohort_stats_maf: Minor Allele Frequency: - [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4. - :param str cohort_stats_mgf: Minor Genotype Frequency: - [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4. - :param str cohort_stats_pass: Filter PASS frequency: - [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL>0.8. - :param str missing_alleles: Number of missing alleles: - [{study:}]{cohort}[<|>|<=|>=]{number}. - :param str missing_genotypes: Number of missing genotypes: - [{study:}]{cohort}[<|>|<=|>=]{number}. - :param str score: Filter by variant score: - [{study:}]{score}[<|>|<=|>=]{number}. - :param str family: Filter variants where any of the samples from the - given family contains the variant (HET or HOM_ALT). - :param str family_disorder: Specify the disorder to use for the family - segregation. - :param str family_segregation: Filter by segregation mode from a given - family. Accepted values: [ autosomalDominant, autosomalRecessive, - XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, - mendelianError, compoundHeterozygous ]. - :param str family_members: Sub set of the members of a given family. - :param str family_proband: Specify the proband child to use for the - family segregation. - :param str gene: List of genes, most gene IDs are accepted (HGNC, - Ensembl gene, ...). This is an alias to 'xref' parameter. - :param str ct: List of SO consequence types, e.g. - missense_variant,stop_lost or SO:0001583,SO:0001578. Accepts - aliases 'loss_of_function' and 'protein_altering'. - :param str xref: List of any external reference, these can be genes, - proteins or variants. Accepted IDs include HGNC, Ensembl genes, - dbSNP, ClinVar, HPO, Cosmic, ... - :param str biotype: List of biotypes, e.g. protein_coding. - :param str protein_substitution: Protein substitution scores include - SIFT and PolyPhen. You can query using the score - {protein_score}[<|>|<=|>=]{number} or the description - {protein_score}[~=|=]{description} e.g. polyphen>0.1,sift=tolerant. - :param str conservation: Filter by conservation score: - {conservation_score}[<|>|<=|>=]{number} e.g. - phastCons>0.5,phylop<0.1,gerp>0.1. - :param str population_frequency_alt: Alternate Population Frequency: - {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01. - :param str population_frequency_ref: Reference Population Frequency: - {study}:{population}[<|>|<=|>=]{number}. e.g. 1000G:ALL<0.01. - :param str population_frequency_maf: Population minor allele - frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. - 1000G:ALL<0.01. - :param str transcript_flag: List of transcript flags. e.g. canonical, - CCDS, basic, LRG, MANE Select, MANE Plus Clinical, EGLH_HaemOnc, - TSO500. - :param str gene_trait_id: List of gene trait association id. e.g. - 'umls:C0007222' , 'OMIM:269600'. - :param str go: List of GO (Gene Ontology) terms. e.g. 'GO:0002020'. - :param str expression: List of tissues of interest. e.g. 'lung'. - :param str protein_keyword: List of Uniprot protein variant annotation - keywords. - :param str drug: List of drug names. - :param str functional_score: Functional score: - {functional_score}[<|>|<=|>=]{number} e.g. cadd_scaled>5.2 , - cadd_raw<=0.3. - :param str clinical: Clinical source: clinvar, cosmic. - :param str clinical_significance: Clinical significance: benign, - likely_benign, likely_pathogenic, pathogenic. - :param bool clinical_confirmed_status: Clinical confirmed status. - :param str custom_annotation: Custom annotation: - {key}[<|>|<=|>=]{number} or {key}[~=|=]{text}. - :param str panel: Filter by genes from the given disease panel. - :param str panel_mode_of_inheritance: Filter genes from specific - panels that match certain mode of inheritance. Accepted values : [ - autosomalDominant, autosomalRecessive, XLinkedDominant, - XLinkedRecessive, YLinked, mitochondrial, deNovo, mendelianError, - compoundHeterozygous ]. - :param str panel_confidence: Filter genes from specific panels that - match certain confidence. Accepted values : [ high, medium, low, - rejected ]. - :param str panel_role_in_cancer: Filter genes from specific panels - that match certain role in cancer. Accepted values : [ both, - oncogene, tumorSuppressorGene, fusion ]. - :param str panel_feature_type: Filter elements from specific panels by - type. Accepted values : [ gene, region, str, variant ]. - :param bool panel_intersection: Intersect panel genes and regions with - given genes and regions from que input query. This will prevent - returning variants from regions out of the panel. - :param str trait: List of traits, based on ClinVar, HPO, COSMIC, i.e.: - IDs, histologies, descriptions,... - """ - - return self._get(category='analysis', resource='query', subcategory='clinical/variant', **options) - - def acl(self, clinical_analyses, **options): - """ - Returns the acl of the clinical analyses. If member is provided, it - will only return the acl for the member. - PATH: /{apiVersion}/analysis/clinical/{clinicalAnalyses}/acl - - :param str clinical_analyses: Comma separated list of clinical - analysis IDs or names up to a maximum of 100. (REQUIRED) - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param str member: User or group ID. - :param bool silent: Boolean to retrieve all possible entries that are - queried for, false to raise an exception whenever one of the - entries looked for cannot be shown for whichever reason. - """ - - return self._get(category='analysis', resource='acl', subcategory='clinical', second_query_id=clinical_analyses, **options) - - def delete(self, clinical_analyses, **options): - """ - Delete clinical analyses. - PATH: /{apiVersion}/analysis/clinical/{clinicalAnalyses}/delete - - :param str clinical_analyses: Comma separated list of clinical - analysis IDs or names up to a maximum of 100. (REQUIRED) - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param bool force: Force deletion if the ClinicalAnalysis contains - interpretations or is locked. - """ - - return self._delete(category='analysis', resource='delete', subcategory='clinical', second_query_id=clinical_analyses, **options) - - def update(self, clinical_analyses, data=None, **options): - """ - Update clinical analysis attributes. - PATH: /{apiVersion}/analysis/clinical/{clinicalAnalyses}/update - - :param dict data: JSON containing clinical analysis information. - (REQUIRED) - :param str clinical_analyses: Comma separated list of clinical - analysis IDs. (REQUIRED) - :param str include: Fields included in the response, whole JSON path - must be provided. - :param str exclude: Fields excluded in the response, whole JSON path - must be provided. - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param str comments_action: Action to be performed if the array of - comments is being updated. Allowed values: ['ADD', 'REMOVE', - 'REPLACE'] - :param str flags_action: Action to be performed if the array of flags - is being updated. Allowed values: ['ADD', 'SET', 'REMOVE'] - :param str files_action: Action to be performed if the array of files - is being updated. Allowed values: ['ADD', 'SET', 'REMOVE'] - :param str panels_action: Action to be performed if the array of - panels is being updated. Allowed values: ['ADD', 'SET', 'REMOVE'] - :param bool include_result: Flag indicating to include the created or - updated document result in the response. - """ - - return self._post(category='analysis', resource='update', subcategory='clinical', second_query_id=clinical_analyses, data=data, **options) - - def info(self, clinical_analysis, **options): - """ - Clinical analysis info. - PATH: /{apiVersion}/analysis/clinical/{clinicalAnalysis}/info - - :param str clinical_analysis: Comma separated list of clinical - analysis IDs or names up to a maximum of 100. (REQUIRED) - :param str include: Fields included in the response, whole JSON path - must be provided. - :param str exclude: Fields excluded in the response, whole JSON path - must be provided. - :param str study: Study [[user@]project:]study where study and project - can be either the ID or UUID. - :param bool deleted: Boolean to retrieve deleted entries. - """ - - return self._get(category='analysis', resource='info', subcategory='clinical', second_query_id=clinical_analysis, **options) - - def create_interpretation(self, clinical_analysis, data=None, **options): - """ - Create a new Interpretation. - PATH: /{apiVersion}/analysis/clinical/{clinicalAnalysis}/interpretation/create - - :param dict data: JSON containing clinical interpretation information. - (REQUIRED) - :param str clinical_analysis: Clinical analysis ID. (REQUIRED) - :param str include: Fields included in the response, whole JSON path - must be provided. - :param str exclude: Fields excluded in the response, whole JSON path - must be provided. - :param str study: [[user@]project:]study id. - :param str set_as: Set interpretation as. Allowed values: ['PRIMARY', - 'SECONDARY'] - :param bool include_result: Flag indicating to include the created or - updated document result in the response. - """ - - return self._post(category='analysis/clinical', resource='create', query_id=clinical_analysis, subcategory='interpretation', data=data, **options) - - def clear_interpretation(self, clinical_analysis, interpretations, **options): - """ - Clear the fields of the main interpretation of the Clinical Analysis. - PATH: /{apiVersion}/analysis/clinical/{clinicalAnalysis}/interpretation/{interpretations}/clear - - :param str clinical_analysis: Clinical analysis ID. (REQUIRED) - :param str interpretations: Interpretation IDs of the Clinical - Analysis. (REQUIRED) - :param str study: [[user@]project:]study ID. - """ - - return self._post(category='analysis/clinical', resource='clear', query_id=clinical_analysis, subcategory='interpretation', second_query_id=interpretations, **options) - - def delete_interpretation(self, clinical_analysis, interpretations, **options): - """ - Delete interpretation. - PATH: /{apiVersion}/analysis/clinical/{clinicalAnalysis}/interpretation/{interpretations}/delete - - :param str interpretations: Interpretation IDs of the Clinical - Analysis. (REQUIRED) - :param str clinical_analysis: Clinical analysis ID. (REQUIRED) - :param str study: [[user@]project:]study ID. - :param str set_as_primary: Interpretation id to set as primary from - the list of secondaries in case of deleting the actual primary one. - """ - - return self._delete(category='analysis/clinical', resource='delete', query_id=clinical_analysis, subcategory='interpretation', second_query_id=interpretations, **options) - - def revert_interpretation(self, clinical_analysis, interpretation, version, **options): - """ - Revert to a previous interpretation version. - PATH: /{apiVersion}/analysis/clinical/{clinicalAnalysis}/interpretation/{interpretation}/revert - - :param int version: Version to revert to. (REQUIRED) - :param str interpretation: Interpretation ID. (REQUIRED) - :param str clinical_analysis: Clinical analysis ID. (REQUIRED) - :param str study: [[user@]project:]study ID. - """ - - options['version'] = version - return self._post(category='analysis/clinical', resource='revert', query_id=clinical_analysis, subcategory='interpretation', second_query_id=interpretation, **options) - - def update_interpretation(self, clinical_analysis, interpretation, data=None, **options): - """ - Update interpretation fields. - PATH: /{apiVersion}/analysis/clinical/{clinicalAnalysis}/interpretation/{interpretation}/update - - :param dict data: JSON containing clinical interpretation information. - (REQUIRED) - :param str interpretation: Interpretation ID. (REQUIRED) - :param str clinical_analysis: Clinical analysis ID. (REQUIRED) - :param str include: Fields included in the response, whole JSON path - must be provided. - :param str exclude: Fields excluded in the response, whole JSON path - must be provided. - :param str study: [[user@]project:]study ID. - :param str primary_findings_action: Action to be performed if the - array of primary findings is being updated. Allowed values: ['ADD', - 'SET', 'REMOVE', 'REPLACE'] - :param str methods_action: Action to be performed if the array of - methods is being updated. Allowed values: ['ADD', 'SET', 'REMOVE'] - :param str secondary_findings_action: Action to be performed if the - array of secondary findings is being updated. Allowed values: - ['ADD', 'SET', 'REMOVE', 'REPLACE'] - :param str comments_action: Action to be performed if the array of - comments is being updated. To REMOVE or REPLACE, the date will need - to be provided to identify the comment. Allowed values: ['ADD', - 'REMOVE', 'REPLACE'] - :param str panels_action: Action to be performed if the array of - panels is being updated. Allowed values: ['ADD', 'SET', 'REMOVE'] - :param str set_as: Set interpretation as. Allowed values: ['PRIMARY', - 'SECONDARY'] - :param bool include_result: Flag indicating to include the created or - updated document result in the response. - """ - - return self._post(category='analysis/clinical', resource='update', query_id=clinical_analysis, subcategory='interpretation', second_query_id=interpretation, data=data, **options) - diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/cohort_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/cohort_client.py index 1d37bffadd2..f38109debed 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/cohort_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/cohort_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class Cohort(_ParentRestClient): """ This class contains methods for the 'Cohorts' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/cohorts """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py index 61d984ad048..dff08d5a0f8 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class DiseasePanel(_ParentRestClient): """ This class contains methods for the 'Disease Panels' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/panels """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/family_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/family_client.py index 9df67f56a94..278c306bfe6 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/family_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/family_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class Family(_ParentRestClient): """ This class contains methods for the 'Families' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/families """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py index 881832c2eef..f922f15b910 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class File(_ParentRestClient): """ This class contains methods for the 'Files' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/files """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/ga4gh_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/ga4gh_client.py index 4b66f11cf5f..2b850d3c6fb 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/ga4gh_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/ga4gh_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class GA4GH(_ParentRestClient): """ This class contains methods for the 'GA4GH' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/ga4gh """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/individual_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/individual_client.py index 5bef563d519..515ca12ca0b 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/individual_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/individual_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class Individual(_ParentRestClient): """ This class contains methods for the 'Individuals' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/individuals """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py index 94b4b8d27e5..459007a179f 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class Job(_ParentRestClient): """ This class contains methods for the 'Jobs' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/jobs """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/meta_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/meta_client.py index a89eb56e683..39c13a7bcb7 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/meta_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/meta_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class Meta(_ParentRestClient): """ This class contains methods for the 'Meta' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/meta """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/organization_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/organization_client.py index 2ba35452d48..a3124bfcf45 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/organization_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/organization_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class Organization(_ParentRestClient): """ This class contains methods for the 'Organizations' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/organizations """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/project_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/project_client.py index 46bc074062d..dd650ac0f26 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/project_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/project_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class Project(_ParentRestClient): """ This class contains methods for the 'Projects' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/projects """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/sample_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/sample_client.py index 74636b383fb..6b10aac717f 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/sample_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/sample_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class Sample(_ParentRestClient): """ This class contains methods for the 'Samples' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/samples """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py index 42433932e42..57826554192 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class Study(_ParentRestClient): """ This class contains methods for the 'Studies' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/studies """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/user_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/user_client.py index d1ebc104bd8..93451319d3d 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/user_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/user_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class User(_ParentRestClient): """ This class contains methods for the 'Users' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/users """ @@ -63,6 +61,29 @@ def password(self, data=None, **options): return self._post(category='users', resource='password', data=data, **options) + def search(self, **options): + """ + User search method. + PATH: /{apiVersion}/users/search + + :param str include: Fields included in the response, whole JSON path + must be provided. + :param str exclude: Fields excluded in the response, whole JSON path + must be provided. + :param int limit: Number of results to be returned. + :param int skip: Number of results to skip. + :param bool count: Get the total number of results matching the query. + Deactivated by default. + :param str organization: Organization id. + :param str id: Comma separated list user IDs up to a maximum of 100. + Also admits basic regular expressions using the operator '~', i.e. + '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for + case insensitive search. + :param str authentication_id: Authentication origin ID. + """ + + return self._get(category='users', resource='search', **options) + def info(self, users, **options): """ Return the user information including its projects and studies. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py index ecc28f50daa..e1d63675309 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class Variant(_ParentRestClient): """ This class contains methods for the 'Analysis - Variant' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/analysis/variant """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py index 688badda837..e726e9dd2db 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py @@ -2,7 +2,6 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-04-10 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -14,7 +13,6 @@ class VariantOperation(_ParentRestClient): """ This class contains methods for the 'Operations - Variant Storage' webservices - Client version: 3.1.0-SNAPSHOT PATH: /{apiVersion}/operation """ diff --git a/opencga-clinical/pom.xml b/opencga-clinical/pom.xml index 215d392ce1c..16aff526b3e 100644 --- a/opencga-clinical/pom.xml +++ b/opencga-clinical/pom.xml @@ -5,7 +5,7 @@ org.opencb.opencga opencga - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml 4.0.0 diff --git a/opencga-core/pom.xml b/opencga-core/pom.xml index 432db00c834..73047a516e9 100644 --- a/opencga-core/pom.xml +++ b/opencga-core/pom.xml @@ -22,7 +22,7 @@ org.opencb.opencga opencga - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/api/ParamConstants.java b/opencga-core/src/main/java/org/opencb/opencga/core/api/ParamConstants.java index 41c17e5a787..6bf964e760f 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/api/ParamConstants.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/api/ParamConstants.java @@ -77,7 +77,7 @@ public class ParamConstants { public static final String DISORDERS_DESCRIPTION = "Comma separated list of disorder ids or names" + REGEX_SUPPORT; public static final String BODY_PARAM = "body"; public static final String OVERWRITE = "overwrite"; - + private static final String UP_TO_100 = " up to a maximum of 100"; public static final String CELLBASE_URL = "https://ws.zettagenomics.com/cellbase"; public static final String CELLBASE_VERSION = "v5.2"; @@ -155,10 +155,10 @@ public class ParamConstants { public static final String ORGANIZATION_DESCRIPTION = "Organization id"; public static final String ORGANIZATION = "organization"; // --------------------------------------------- + public static final String USER_ID_DESCRIPTION = "Comma separated list user IDs" + UP_TO_100 + REGEX_SUPPORT; + public static final String USER_ID_PARAM = "id"; public static final String USER_DESCRIPTION = "User ID"; public static final String USERS_DESCRIPTION = "Comma separated list of user IDs"; - public static final String USER_ACCOUNT_TYPE = "account"; - public static final String USER_ACCOUNT_TYPE_DESCRIPTION = "Account type [GUEST, FULL, ADMINISTRATOR]"; public static final String USER_AUTHENTICATION_ORIGIN = "authenticationId"; public static final String USER_AUTHENTICATION_ORIGIN_DESCRIPTION = "Authentication origin ID"; public static final String USER_CREATION_DATE = "creationDate"; @@ -1487,7 +1487,6 @@ public class ParamConstants { public static final String ADMIN_CATALOG_INSTALL_EMAIL = "The body web service email parameter"; public static final String ADMIN_CATALOG_INSTALL_ORGANIZATION = "The body web service organization parameter"; public static final String ADMIN_CATALOG_JWT_SECRETKEY = "The body web service secretKey parameter"; - private static final String UP_TO_100 = " up to a maximum of 100"; public static final String FILES_DESCRIPTION = "Comma separated list of file IDs or names" + UP_TO_100; public static final String FILES_ID_DESCRIPTION = "Comma separated list of file IDs" + UP_TO_100 + REGEX_SUPPORT; public static final String FILES_UUID_DESCRIPTION = "Comma separated list file UUIDs" + UP_TO_100; diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/config/AuthenticationOrigin.java b/opencga-core/src/main/java/org/opencb/opencga/core/config/AuthenticationOrigin.java index 95c66a5cec7..2b8bfab8624 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/config/AuthenticationOrigin.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/config/AuthenticationOrigin.java @@ -16,9 +16,6 @@ package org.opencb.opencga.core.config; -import org.opencb.opencga.core.common.PasswordUtils; - -import java.util.Collections; import java.util.Map; /** @@ -29,9 +26,6 @@ public class AuthenticationOrigin { private String id; private AuthenticationType type; private String host; - private String algorithm; - private String secretKey; - private long expiration; // Expiration time in seconds private Map options; public enum AuthenticationType { @@ -56,22 +50,12 @@ public enum AuthenticationType { public static final String CONNECTION_TIMEOUT = "connectionTimeout"; public AuthenticationOrigin() { - this("internal", AuthenticationType.OPENCGA.name(), "localhost", "HS256", PasswordUtils.getStrongRandomPassword(32), 3600L, - Collections.emptyMap()); } public AuthenticationOrigin(String id, AuthenticationType type, String host, Map options) { - this(id, type.name(), host, "HS256", PasswordUtils.getStrongRandomPassword(32), 3600L, options); - } - - public AuthenticationOrigin(String id, String type, String host, String algorithm, String secretKey, long expiration, - Map options) { this.id = id; - this.type = AuthenticationType.valueOf(type);; + this.type = type; this.host = host; - this.algorithm = algorithm; - this.secretKey = secretKey; - this.expiration = expiration; this.options = options; } @@ -81,9 +65,6 @@ public String toString() { sb.append("id='").append(id).append('\''); sb.append(", type=").append(type); sb.append(", host='").append(host).append('\''); - sb.append(", algorithm='").append(algorithm).append('\''); - sb.append(", secretKey='").append(secretKey).append('\''); - sb.append(", expiration=").append(expiration); sb.append(", options=").append(options); sb.append('}'); return sb.toString(); @@ -116,30 +97,18 @@ public AuthenticationOrigin setHost(String host) { return this; } - public String getAlgorithm() { - return algorithm; - } - + @Deprecated public AuthenticationOrigin setAlgorithm(String algorithm) { - this.algorithm = algorithm; return this; } - public String getSecretKey() { - return secretKey; - } - + @Deprecated public AuthenticationOrigin setSecretKey(String secretKey) { - this.secretKey = secretKey; return this; } - public long getExpiration() { - return expiration; - } - + @Deprecated public AuthenticationOrigin setExpiration(long expiration) { - this.expiration = expiration; return this; } diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/organizations/OrganizationConfiguration.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/organizations/OrganizationConfiguration.java index 8a5687fe221..c8f3e849c89 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/organizations/OrganizationConfiguration.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/organizations/OrganizationConfiguration.java @@ -3,22 +3,22 @@ import org.opencb.opencga.core.config.AuthenticationOrigin; import org.opencb.opencga.core.config.Optimizations; -import java.util.LinkedList; import java.util.List; public class OrganizationConfiguration { private List authenticationOrigins; private Optimizations optimizations; + private TokenConfiguration token; public OrganizationConfiguration() { - this.authenticationOrigins = new LinkedList<>(); - this.optimizations = new Optimizations(); } - public OrganizationConfiguration(List authenticationOrigins, Optimizations optimizations) { + public OrganizationConfiguration(List authenticationOrigins, Optimizations optimizations, + TokenConfiguration token) { this.authenticationOrigins = authenticationOrigins; this.optimizations = optimizations; + this.token = token; } @Override @@ -26,6 +26,7 @@ public String toString() { final StringBuilder sb = new StringBuilder("OrganizationConfiguration{"); sb.append("authenticationOrigins=").append(authenticationOrigins); sb.append(", optimizations=").append(optimizations); + sb.append(", token=").append(token); sb.append('}'); return sb.toString(); } @@ -47,4 +48,13 @@ public OrganizationConfiguration setOptimizations(Optimizations optimizations) { this.optimizations = optimizations; return this; } + + public TokenConfiguration getToken() { + return token; + } + + public OrganizationConfiguration setToken(TokenConfiguration token) { + this.token = token; + return this; + } } diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/organizations/TokenConfiguration.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/organizations/TokenConfiguration.java new file mode 100644 index 00000000000..8ca89f2f285 --- /dev/null +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/organizations/TokenConfiguration.java @@ -0,0 +1,61 @@ +package org.opencb.opencga.core.models.organizations; + +import io.jsonwebtoken.SignatureAlgorithm; +import org.opencb.opencga.core.common.PasswordUtils; + +public class TokenConfiguration { + + private String algorithm; + private String secretKey; + private long expiration; + + public TokenConfiguration() { + } + + public TokenConfiguration(String algorithm, String secretKey, long expiration) { + this.algorithm = algorithm; + this.secretKey = secretKey; + this.expiration = expiration; + } + + public static TokenConfiguration init() { + return new TokenConfiguration(SignatureAlgorithm.HS256.getValue(), PasswordUtils.getStrongRandomPassword(32), 3600L); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("TokenConfiguration{"); + sb.append("algorithm='").append(algorithm).append('\''); + sb.append(", secretKey='").append(secretKey).append('\''); + sb.append(", expiration=").append(expiration); + sb.append('}'); + return sb.toString(); + } + + public String getAlgorithm() { + return algorithm; + } + + public TokenConfiguration setAlgorithm(String algorithm) { + this.algorithm = algorithm; + return this; + } + + public String getSecretKey() { + return secretKey; + } + + public TokenConfiguration setSecretKey(String secretKey) { + this.secretKey = secretKey; + return this; + } + + public long getExpiration() { + return expiration; + } + + public TokenConfiguration setExpiration(long expiration) { + this.expiration = expiration; + return this; + } +} diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/user/UserUpdateParams.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/user/UserUpdateParams.java index 7b069623e44..d9c44a665c8 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/user/UserUpdateParams.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/user/UserUpdateParams.java @@ -22,16 +22,14 @@ public class UserUpdateParams { private String name; private String email; - private String organization; private Map attributes; public UserUpdateParams() { } - public UserUpdateParams(String name, String email, String organization, Map attributes) { + public UserUpdateParams(String name, String email, Map attributes) { this.name = name; this.email = email; - this.organization = organization; this.attributes = attributes; } @@ -40,7 +38,6 @@ public String toString() { final StringBuilder sb = new StringBuilder("UserUpdateParams{"); sb.append("name='").append(name).append('\''); sb.append(", email='").append(email).append('\''); - sb.append(", organization='").append(organization).append('\''); sb.append(", attributes=").append(attributes); sb.append('}'); return sb.toString(); @@ -64,15 +61,6 @@ public UserUpdateParams setEmail(String email) { return this; } - public String getOrganization() { - return organization; - } - - public UserUpdateParams setOrganization(String organization) { - this.organization = organization; - return this; - } - public Map getAttributes() { return attributes; } diff --git a/opencga-master/pom.xml b/opencga-master/pom.xml index eda14c31ea1..2348ef6f6f7 100644 --- a/opencga-master/pom.xml +++ b/opencga-master/pom.xml @@ -22,7 +22,7 @@ opencga org.opencb.opencga - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-server/pom.xml b/opencga-server/pom.xml index 7632ed6d65f..6863e08197c 100644 --- a/opencga-server/pom.xml +++ b/opencga-server/pom.xml @@ -22,7 +22,7 @@ org.opencb.opencga opencga - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml @@ -392,7 +392,9 @@ CodeGen - false + + !skipCodeGen + diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/generator/ClientsGenerator.java b/opencga-server/src/main/java/org/opencb/opencga/server/generator/ClientsGenerator.java index b9082449a32..f94a917e20f 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/generator/ClientsGenerator.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/generator/ClientsGenerator.java @@ -54,14 +54,18 @@ private void generateLibrary(String clientsGeneratorDir, String language, String System.out.println("outDir " + outDir); String binary = clientsGeneratorDir + "/" + language + "_client_generator.py"; ProcessBuilder processBuilder = new ProcessBuilder("python3", binary, restFilePath, outDir); + System.out.println("python3 " + binary + " " + restFilePath + " " + outDir); Process p; try { p = processBuilder.start(); BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); + BufferedReader error = new BufferedReader(new InputStreamReader(p.getErrorStream())); String line; while ((line = input.readLine()) != null) { logger.info("{} library generator: {}", language, line); - System.out.println(language + " library generator: " + line); + } + while ((line = error.readLine()) != null) { + logger.error("{} library generator: {}", language, line); } p.waitFor(); input.close(); diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/generator/writers/cli/AutoCompleteWriter.java b/opencga-server/src/main/java/org/opencb/opencga/server/generator/writers/cli/AutoCompleteWriter.java index d4f85542ddf..1d58459b343 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/generator/writers/cli/AutoCompleteWriter.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/generator/writers/cli/AutoCompleteWriter.java @@ -25,8 +25,6 @@ import java.io.File; import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; public class AutoCompleteWriter extends ParentClientRestApiWriter { @@ -37,23 +35,6 @@ public AutoCompleteWriter(RestApi restApi, CommandLineConfiguration config) { @Override protected String getClassImports(String key) { StringBuilder sb = new StringBuilder(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - sb.append("/*\n"); - sb.append("* Copyright 2015-").append(sdf.format(new Date())).append(" OpenCB\n"); - sb.append("*\n"); - sb.append("* Licensed under the Apache License, Version 2.0 (the \"License\");\n"); - sb.append("* you may not use this file except in compliance with the License.\n"); - sb.append("* You may obtain a copy of the License at\n"); - sb.append("*\n"); - sb.append("* http://www.apache.org/licenses/LICENSE-2.0\n"); - sb.append("*\n"); - sb.append("* Unless required by applicable law or agreed to in writing, software\n"); - sb.append("* distributed under the License is distributed on an \"AS IS\" BASIS,\n"); - sb.append("* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"); - sb.append("* See the License for the specific language governing permissions and\n"); - sb.append("* limitations under the License.\n"); - sb.append("*/\n"); - sb.append("\n"); sb.append("package ").append(config.getOptions().getParserPackage()).append(";\n"); sb.append("\n"); diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/generator/writers/cli/OptionsCliRestApiWriter.java b/opencga-server/src/main/java/org/opencb/opencga/server/generator/writers/cli/OptionsCliRestApiWriter.java index bfa784319b7..90b8977decc 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/generator/writers/cli/OptionsCliRestApiWriter.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/generator/writers/cli/OptionsCliRestApiWriter.java @@ -28,7 +28,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.text.SimpleDateFormat; import java.util.HashSet; import java.util.Set; @@ -45,7 +44,6 @@ protected String getClassImports(String key) { StringBuilder sb = new StringBuilder(); RestCategory restCategory = availableCategories.get(key); CategoryConfig categoryConfig = availableCategoryConfigs.get(key); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); sb.append("package ").append(config.getOptions().getOptionsPackage()).append(";\n\n"); sb.append("import com.beust.jcommander.JCommander;\n"); sb.append("import com.beust.jcommander.Parameter;\n"); diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/generator/writers/cli/ParserCliRestApiWriter.java b/opencga-server/src/main/java/org/opencb/opencga/server/generator/writers/cli/ParserCliRestApiWriter.java index 121166bd9d2..669a5151c61 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/generator/writers/cli/ParserCliRestApiWriter.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/generator/writers/cli/ParserCliRestApiWriter.java @@ -27,8 +27,6 @@ import java.io.File; import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; public class ParserCliRestApiWriter extends ParentClientRestApiWriter { @@ -39,23 +37,6 @@ public ParserCliRestApiWriter(RestApi restApi, CommandLineConfiguration config) @Override protected String getClassImports(String key) { StringBuilder sb = new StringBuilder(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - sb.append("/*\n"); - sb.append("* Copyright 2015-").append(sdf.format(new Date())).append(" OpenCB\n"); - sb.append("*\n"); - sb.append("* Licensed under the Apache License, Version 2.0 (the \"License\");\n"); - sb.append("* you may not use this file except in compliance with the License.\n"); - sb.append("* You may obtain a copy of the License at\n"); - sb.append("*\n"); - sb.append("* http://www.apache.org/licenses/LICENSE-2.0\n"); - sb.append("*\n"); - sb.append("* Unless required by applicable law or agreed to in writing, software\n"); - sb.append("* distributed under the License is distributed on an \"AS IS\" BASIS,\n"); - sb.append("* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"); - sb.append("* See the License for the specific language governing permissions and\n"); - sb.append("* limitations under the License.\n"); - sb.append("*/\n"); - sb.append("\n"); sb.append("package ").append(config.getOptions().getParserPackage()).append(";\n"); sb.append("\n"); diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/UserWSServer.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/UserWSServer.java index b354adaf8d8..31fcd3a9720 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/UserWSServer.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/UserWSServer.java @@ -69,6 +69,30 @@ public Response create( } } + @GET + @Path("/search") + @ApiOperation(value = "User search method", response = User.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = QueryOptions.INCLUDE, value = ParamConstants.INCLUDE_DESCRIPTION, example = "name,attributes", + dataType = "string", paramType = "query"), + @ApiImplicitParam(name = QueryOptions.EXCLUDE, value = ParamConstants.EXCLUDE_DESCRIPTION, example = "id,status", dataType = + "string", paramType = "query"), + @ApiImplicitParam(name = QueryOptions.LIMIT, value = ParamConstants.LIMIT_DESCRIPTION, dataType = "integer", paramType = + "query"), + @ApiImplicitParam(name = QueryOptions.SKIP, value = ParamConstants.SKIP_DESCRIPTION, dataType = "integer", paramType = "query"), + @ApiImplicitParam(name = QueryOptions.COUNT, value = ParamConstants.COUNT_DESCRIPTION, defaultValue = "false", dataType = + "boolean", paramType = "query") + }) + public Response search( + @ApiParam(value = ParamConstants.ORGANIZATION_DESCRIPTION) @QueryParam(ParamConstants.ORGANIZATION) String organizationId, + @ApiParam(value = ParamConstants.USER_ID_DESCRIPTION) @QueryParam(ParamConstants.USER_ID_PARAM) String userId, + @ApiParam(value = ParamConstants.USER_AUTHENTICATION_ORIGIN_DESCRIPTION) @QueryParam(ParamConstants.USER_AUTHENTICATION_ORIGIN) String authentication) { + return run(() -> { + query.remove(ParamConstants.ORGANIZATION); + return catalogManager.getUserManager().search(organizationId, query, queryOptions, token); + }); + } + @GET @Path("/{users}/info") @ApiOperation(value = "Return the user information including its projects and studies", response = User.class) diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/admin/AdminWSServer.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/admin/AdminWSServer.java index b1a7c1b80ff..c0345d421f5 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/admin/AdminWSServer.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/admin/AdminWSServer.java @@ -71,7 +71,6 @@ public AdminWSServer(@Context UriInfo uriInfo, @Context HttpServletRequest httpS public Response userSearch( @ApiParam(value = ParamConstants.ORGANIZATION_DESCRIPTION) @QueryParam(ParamConstants.ORGANIZATION) String organizationId, @ApiParam(value = ParamConstants.USER_DESCRIPTION) @QueryParam(ParamConstants.USER) String user, - @ApiParam(value = ParamConstants.USER_ACCOUNT_TYPE_DESCRIPTION) @QueryParam(ParamConstants.USER_ACCOUNT_TYPE) String account, @ApiParam(value = ParamConstants.USER_AUTHENTICATION_ORIGIN_DESCRIPTION) @QueryParam(ParamConstants.USER_AUTHENTICATION_ORIGIN) String authentication) { try { return createOkResponse(catalogManager.getAdminManager().userSearch(organizationId, query, queryOptions, token)); diff --git a/opencga-storage/opencga-storage-app/pom.xml b/opencga-storage/opencga-storage-app/pom.xml index cc692c6fcea..1834d5c7e64 100644 --- a/opencga-storage/opencga-storage-app/pom.xml +++ b/opencga-storage/opencga-storage-app/pom.xml @@ -22,7 +22,7 @@ org.opencb.opencga opencga-storage - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/opencga-storage-benchmark/pom.xml b/opencga-storage/opencga-storage-benchmark/pom.xml index bae503e0e91..02953389c2d 100644 --- a/opencga-storage/opencga-storage-benchmark/pom.xml +++ b/opencga-storage/opencga-storage-benchmark/pom.xml @@ -22,7 +22,7 @@ opencga-storage org.opencb.opencga - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/opencga-storage-core/pom.xml b/opencga-storage/opencga-storage-core/pom.xml index 0dffe6806ff..a7a2c8adbbb 100644 --- a/opencga-storage/opencga-storage-core/pom.xml +++ b/opencga-storage/opencga-storage-core/pom.xml @@ -22,7 +22,7 @@ org.opencb.opencga opencga-storage - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-api/pom.xml b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-api/pom.xml index deac888af82..ea3dbc32689 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-api/pom.xml +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-api/pom.xml @@ -22,7 +22,7 @@ org.opencb.opencga opencga-storage-hadoop-compat - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-hbase2.0/pom.xml b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-hbase2.0/pom.xml index 661d9416a8f..927d616c88c 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-hbase2.0/pom.xml +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-hbase2.0/pom.xml @@ -22,7 +22,7 @@ org.opencb.opencga opencga-storage-hadoop-compat - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-hbase2.2/pom.xml b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-hbase2.2/pom.xml index 358590f69f6..a84279ad4de 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-hbase2.2/pom.xml +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-hbase2.2/pom.xml @@ -22,7 +22,7 @@ org.opencb.opencga opencga-storage-hadoop-compat - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-hbase2.4/pom.xml b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-hbase2.4/pom.xml index 394e6c90e16..ea5b63a7b6f 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-hbase2.4/pom.xml +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/opencga-storage-hadoop-compat-hbase2.4/pom.xml @@ -22,7 +22,7 @@ org.opencb.opencga opencga-storage-hadoop-compat - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/pom.xml b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/pom.xml index 58aac8414c5..705f7b4104c 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/pom.xml +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-compat/pom.xml @@ -23,7 +23,7 @@ org.opencb.opencga opencga-storage-hadoop - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/pom.xml b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/pom.xml index 8c00149ba90..066630724a2 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/pom.xml +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/pom.xml @@ -23,7 +23,7 @@ org.opencb.opencga opencga-storage-hadoop - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-emr6.1/pom.xml b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-emr6.1/pom.xml index 45370142854..3675d760a35 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-emr6.1/pom.xml +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-emr6.1/pom.xml @@ -7,7 +7,7 @@ org.opencb.opencga opencga-storage-hadoop-lib - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-emr6.13/pom.xml b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-emr6.13/pom.xml index 82a3d1f0fdc..ee08e659ae7 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-emr6.13/pom.xml +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-emr6.13/pom.xml @@ -7,7 +7,7 @@ org.opencb.opencga opencga-storage-hadoop-lib - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-hdi5.1/pom.xml b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-hdi5.1/pom.xml index c4839e1c646..ffd41bdf7ca 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-hdi5.1/pom.xml +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-hdi5.1/pom.xml @@ -7,7 +7,7 @@ org.opencb.opencga opencga-storage-hadoop-lib - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-hdp3.1/pom.xml b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-hdp3.1/pom.xml index 8d09832b15a..435818c24cf 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-hdp3.1/pom.xml +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/opencga-storage-hadoop-lib-hdp3.1/pom.xml @@ -7,7 +7,7 @@ org.opencb.opencga opencga-storage-hadoop-lib - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/pom.xml b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/pom.xml index 0326f2479f3..495de2ebf89 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/pom.xml +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/pom.xml @@ -23,7 +23,7 @@ org.opencb.opencga opencga-storage-hadoop - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/src/main/assembly/src.xml b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/src/main/assembly/src.xml index 6c5519fe13b..497d6819cf0 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/src/main/assembly/src.xml +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-lib/src/main/assembly/src.xml @@ -16,6 +16,7 @@ com.sun.jersey:* org.eclipse.jetty:* + org.eclipse.jetty.http2:* org.eclipse.jetty.websocket:* org.apache.logging.log4j:log4j-slf4j-impl org.apache.commons:commons-lang3 diff --git a/opencga-storage/opencga-storage-hadoop/pom.xml b/opencga-storage/opencga-storage-hadoop/pom.xml index 7d97161a5e3..7de2add12c5 100644 --- a/opencga-storage/opencga-storage-hadoop/pom.xml +++ b/opencga-storage/opencga-storage-hadoop/pom.xml @@ -23,7 +23,7 @@ org.opencb.opencga opencga-storage - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/opencga-storage-server/pom.xml b/opencga-storage/opencga-storage-server/pom.xml index 054ab3bc9de..d6d92f43dda 100644 --- a/opencga-storage/opencga-storage-server/pom.xml +++ b/opencga-storage/opencga-storage-server/pom.xml @@ -22,7 +22,7 @@ org.opencb.opencga opencga-storage - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-storage/pom.xml b/opencga-storage/pom.xml index c3f5166b7fd..316589d12ff 100644 --- a/opencga-storage/pom.xml +++ b/opencga-storage/pom.xml @@ -22,7 +22,7 @@ org.opencb.opencga opencga - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/opencga-test/pom.xml b/opencga-test/pom.xml index 12981fefe10..76a6360d5e2 100644 --- a/opencga-test/pom.xml +++ b/opencga-test/pom.xml @@ -24,7 +24,7 @@ org.opencb.opencga opencga - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index a594ad8b350..82a13331a20 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ org.opencb.opencga opencga - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT pom OpenCGA @@ -43,12 +43,13 @@ - 3.1.0_dev - 3.1.0_dev - 6.1.0-SNAPSHOT - 3.1.0-SNAPSHOT - 5.1.0-SNAPSHOT - 3.1.0-SNAPSHOT + + 3.2.0_dev + 3.2.0_dev + 6.2.0-SNAPSHOT + 3.2.0-SNAPSHOT + 5.2.0-SNAPSHOT + 3.2.0-SNAPSHOT 0.2.0 2.14.3