Skip to content

Commit

Permalink
core: add priority and jobPriority params, #TASK-6089
Browse files Browse the repository at this point in the history
  • Loading branch information
pfurio committed Jul 3, 2024
1 parent bbfe0f9 commit 83ef3aa
Show file tree
Hide file tree
Showing 17 changed files with 105 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public RestResponse<JobTop> top(CustomJobsCommandOptions.TopCommandOptions c) th
query.putIfNotEmpty(ParamConstants.JOB_TOOL_ID_PARAM, c.toolId);
query.putIfNotEmpty(ParamConstants.INTERNAL_STATUS_PARAM, c.internalStatus);
query.putIfNotEmpty(ParamConstants.JOB_USER_PARAM, c.userId);
query.putIfNotEmpty(ParamConstants.JOB_PRIORITY_PARAM, c.jobPriority);
query.putIfNotEmpty(ParamConstants.JOB_PRIORITY_PARAM, c.priority);
query.putAll(c.commonOptions.params);

new JobsTopManager(openCGAClient, query, c.iterations, c.jobsLimit, c.delay, c.plain, c.columns).run();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public class TopCommandOptions {
@Parameter(names = {"--user-id"}, description = ParamConstants.JOB_USER_DESCRIPTION, arity = 1)
public String userId;

@Parameter(names = {"--job-priority"}, description = ParamConstants.JOB_PRIORITY_DESCRIPTION, arity = 1)
public String jobPriority;
@Parameter(names = {"--priority"}, description = ParamConstants.JOB_PRIORITY_DESCRIPTION, arity = 1)
public String priority;

@Parameter(names = {"--internal-status"}, description = ParamConstants.JOB_STATUS_DESCRIPTION, arity = 1)
public String internalStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,25 @@ public class RunTemplatesCommandOptions {
@Parameter(names = {"--resume"}, description = "Resume study metadata ingestion.", arity = 0)
public boolean resume;

@Parameter(names = {"--jobId"}, description = "Job id.", arity = 1)
@Parameter(names = {"--job-id", "--jobId"}, description = "Job id.", arity = 1)
public String jobId;

@Parameter(names = {"--jobDependsOn"}, description = "Job depends on.", arity = 1)
@Parameter(names = {"--job-depends-on", "--jobDependsOn"}, description = "Job depends on.", arity = 1)
public String jobDependsOn;

@Parameter(names = {"--jobDescription"}, description = "Job description.", arity = 1)
@Parameter(names = {"--job-description", "--jobDescription"}, description = "Job description.", arity = 1)
public String jobDescription;

@Parameter(names = {"--jobTags"}, description = "Job tags.", arity = 1)
@Parameter(names = {"--job-tags", "--jobTags"}, description = "Job tags.", arity = 1)
public String jobTags;

@Parameter(names = {"--jobScheduledStartTime"}, description = "Job scheduled start time.", arity = 1)
@Parameter(names = {"--job-scheduled-start-time"}, description = "Job scheduled start time.", arity = 1)
public String jobScheduledStartTime;

@Parameter(names = {"--jobPriority"}, description = "Job priority.", arity = 1)
@Parameter(names = {"--job-priority"}, description = "Job priority.", arity = 1)
public String jobPriority;

@Parameter(names = {"--jobDryRun"}, description = "Job dry-run mode.", arity = 1)
@Parameter(names = {"--job-dry-run"}, description = "Job dry-run mode.", arity = 1)
public Boolean jobDryRun;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ private RestResponse<Object> distinct() throws Exception {
queryParams.putIfNotEmpty("toolId", commandOptions.toolId);
queryParams.putIfNotEmpty("toolType", commandOptions.toolType);
queryParams.putIfNotEmpty("userId", commandOptions.userId);
queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority);
queryParams.putIfNotEmpty("priority", commandOptions.priority);
queryParams.putIfNotEmpty("status", commandOptions.status);
queryParams.putIfNotEmpty("internalStatus", commandOptions.internalStatus);
queryParams.putIfNotEmpty("creationDate", commandOptions.creationDate);
Expand Down Expand Up @@ -286,7 +286,7 @@ private RestResponse<Job> search() throws Exception {
queryParams.putIfNotEmpty("toolId", commandOptions.toolId);
queryParams.putIfNotEmpty("toolType", commandOptions.toolType);
queryParams.putIfNotEmpty("userId", commandOptions.userId);
queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority);
queryParams.putIfNotEmpty("priority", commandOptions.priority);
queryParams.putIfNotEmpty("status", commandOptions.status);
queryParams.putIfNotEmpty("internalStatus", commandOptions.internalStatus);
queryParams.putIfNotEmpty("creationDate", commandOptions.creationDate);
Expand All @@ -313,7 +313,7 @@ private RestResponse<JobTop> top() throws Exception {
queryParams.putIfNotNull("limit", commandOptions.limit);
queryParams.putIfNotEmpty("study", commandOptions.study);
queryParams.putIfNotEmpty("internalStatus", commandOptions.internalStatus);
queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority);
queryParams.putIfNotEmpty("priority", commandOptions.priority);
queryParams.putIfNotEmpty("userId", commandOptions.userId);
queryParams.putIfNotEmpty("toolId", commandOptions.toolId);
if (queryParams.get("study") == null && OpencgaMain.isShellMode()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ public class DistinctCommandOptions {
@Parameter(names = {"--user-id"}, description = "User that created the job", required = false, arity = 1)
public String userId;

@Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1)
public String jobPriority;
@Parameter(names = {"--priority"}, description = "Priority of the job", required = false, arity = 1)
public String priority;

@Parameter(names = {"--status"}, description = "Filter by status", required = false, arity = 1)
public String status;
Expand Down Expand Up @@ -318,8 +318,8 @@ public class SearchCommandOptions {
@Parameter(names = {"--user-id"}, description = "User that created the job", required = false, arity = 1)
public String userId;

@Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1)
public String jobPriority;
@Parameter(names = {"--priority"}, description = "Priority of the job", required = false, arity = 1)
public String priority;

@Parameter(names = {"--status"}, description = "Filter by status", required = false, arity = 1)
public String status;
Expand Down
12 changes: 6 additions & 6 deletions opencga-client/src/main/R/R/Job-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
#' | -- | :-- | --: |
#' | updateAcl | /{apiVersion}/jobs/acl/{members}/update | members[*], action[*], body[*] |
#' | create | /{apiVersion}/jobs/create | study, body[*] |
#' | distinct | /{apiVersion}/jobs/distinct | study, otherStudies, id, uuid, toolId, toolType, userId, jobPriority, status, internalStatus, creationDate, modificationDate, visited, tags, input, output, acl, release, deleted, field[*] |
#' | distinct | /{apiVersion}/jobs/distinct | study, otherStudies, id, uuid, toolId, toolType, userId, priority, status, internalStatus, creationDate, modificationDate, visited, tags, input, output, acl, release, deleted, field[*] |
#' | retry | /{apiVersion}/jobs/retry | jobId, jobDescription, jobDependsOn, jobTags, study, body[*] |
#' | search | /{apiVersion}/jobs/search | include, exclude, limit, skip, count, study, otherStudies, id, uuid, toolId, toolType, userId, jobPriority, status, internalStatus, creationDate, modificationDate, visited, tags, input, output, acl, release, deleted |
#' | top | /{apiVersion}/jobs/top | limit, study, internalStatus, jobPriority, userId, toolId |
#' | search | /{apiVersion}/jobs/search | include, exclude, limit, skip, count, study, otherStudies, id, uuid, toolId, toolType, userId, priority, status, internalStatus, creationDate, modificationDate, visited, tags, input, output, acl, release, deleted |
#' | top | /{apiVersion}/jobs/top | limit, study, internalStatus, priority, userId, toolId |
#' | acl | /{apiVersion}/jobs/{jobs}/acl | jobs[*], member, silent |
#' | delete | /{apiVersion}/jobs/{jobs}/delete | study, jobs[*] |
#' | info | /{apiVersion}/jobs/{jobs}/info | include, exclude, jobs[*], study, deleted |
Expand Down Expand Up @@ -67,7 +67,7 @@ setMethod("jobClient", "OpencgaR", function(OpencgaR, job, jobs, members, endpoi
#' @param toolId Tool ID executed by the job. 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 toolType Tool type executed by the job [OPERATION, ANALYSIS].
#' @param userId User that created the job.
#' @param jobPriority Priority of the job.
#' @param priority Priority of the job.
#' @param status Filter by status.
#' @param internalStatus Filter by internal status.
#' @param creationDate Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
Expand Down Expand Up @@ -108,7 +108,7 @@ setMethod("jobClient", "OpencgaR", function(OpencgaR, job, jobs, members, endpoi
#' @param toolId Tool ID executed by the job. 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 toolType Tool type executed by the job [OPERATION, ANALYSIS].
#' @param userId User that created the job.
#' @param jobPriority Priority of the job.
#' @param priority Priority of the job.
#' @param status Filter by status.
#' @param internalStatus Filter by internal status.
#' @param creationDate Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
Expand All @@ -128,7 +128,7 @@ setMethod("jobClient", "OpencgaR", function(OpencgaR, job, jobs, members, endpoi
#' @param limit Maximum number of jobs to be returned.
#' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID.
#' @param internalStatus Filter by internal status.
#' @param jobPriority Priority of the job.
#' @param priority Priority of the job.
#' @param userId User that created the job.
#' @param toolId Tool ID executed by the job. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search.
top=fetchOpenCGA(object=OpencgaR, category="jobs", categoryId=NULL, subcategory=NULL, subcategoryId=NULL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public RestResponse<Job> create(JobCreateParams data, ObjectMap params) throws C
* '~value' for case sensitive, '~/value/i' for case insensitive search.
* toolType: Tool type executed by the job [OPERATION, ANALYSIS].
* userId: User that created the job.
* jobPriority: Priority of the job.
* priority: Priority of the job.
* status: Filter by status.
* internalStatus: Filter by internal status.
* creationDate: Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
Expand Down Expand Up @@ -152,7 +152,7 @@ public RestResponse<Job> retry(JobRetryParams data, ObjectMap params) throws Cli
* '~value' for case sensitive, '~/value/i' for case insensitive search.
* toolType: Tool type executed by the job [OPERATION, ANALYSIS].
* userId: User that created the job.
* jobPriority: Priority of the job.
* priority: Priority of the job.
* status: Filter by status.
* internalStatus: Filter by internal status.
* creationDate: Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
Expand Down Expand Up @@ -180,7 +180,7 @@ public RestResponse<Job> search(ObjectMap params) throws ClientException {
* limit: Maximum number of jobs to be returned.
* study: Study [[organization@]project:]study where study and project can be either the ID or UUID.
* internalStatus: Filter by internal status.
* jobPriority: Priority of the job.
* priority: Priority of the job.
* userId: User that created the job.
* toolId: Tool ID executed by the job. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g.
* '~value' for case sensitive, '~/value/i' for case insensitive search.
Expand Down
6 changes: 3 additions & 3 deletions opencga-client/src/main/javascript/Job.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default class Job extends OpenCGAParentClass {
* '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search.
* @param {String} [params.toolType] - Tool type executed by the job [OPERATION, ANALYSIS].
* @param {String} [params.userId] - User that created the job.
* @param {String} [params.jobPriority] - Priority of the job.
* @param {String} [params.priority] - Priority of the job.
* @param {String} [params.status] - Filter by status.
* @param {String} [params.internalStatus] - Filter by internal status.
* @param {String} [params.creationDate] - Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
Expand Down Expand Up @@ -120,7 +120,7 @@ export default class Job extends OpenCGAParentClass {
* '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search.
* @param {String} [params.toolType] - Tool type executed by the job [OPERATION, ANALYSIS].
* @param {String} [params.userId] - User that created the job.
* @param {String} [params.jobPriority] - Priority of the job.
* @param {String} [params.priority] - Priority of the job.
* @param {String} [params.status] - Filter by status.
* @param {String} [params.internalStatus] - Filter by internal status.
* @param {String} [params.creationDate] - Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
Expand All @@ -145,7 +145,7 @@ export default class Job extends OpenCGAParentClass {
* @param {Number} [params.limit = "20"] - Maximum number of jobs to be returned. The default value is 20.
* @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID.
* @param {String} [params.internalStatus] - Filter by internal status.
* @param {String} [params.jobPriority] - Priority of the job.
* @param {String} [params.priority] - Priority of the job.
* @param {String} [params.userId] - User that created the job.
* @param {String} [params.toolId] - Tool ID executed by the job. Also admits basic regular expressions using the operator '~', i.e.
* '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def distinct(self, field, **options):
:param str tool_type: Tool type executed by the job [OPERATION,
ANALYSIS].
:param str user_id: User that created the job.
:param str job_priority: Priority of the job.
:param str priority: Priority of the job.
:param str status: Filter by status.
:param str internal_status: Filter by internal status.
:param str creation_date: Creation date. Format: yyyyMMddHHmmss.
Expand Down Expand Up @@ -142,7 +142,7 @@ def search(self, **options):
:param str tool_type: Tool type executed by the job [OPERATION,
ANALYSIS].
:param str user_id: User that created the job.
:param str job_priority: Priority of the job.
:param str priority: Priority of the job.
:param str status: Filter by status.
:param str internal_status: Filter by internal status.
:param str creation_date: Creation date. Format: yyyyMMddHHmmss.
Expand Down Expand Up @@ -173,7 +173,7 @@ def top(self, **options):
:param str study: Study [[organization@]project:]study where study and
project can be either the ID or UUID.
:param str internal_status: Filter by internal status.
:param str job_priority: Priority of the job.
:param str priority: Priority of the job.
:param str user_id: User that created the job.
:param str tool_id: Tool ID executed by the job. Also admits basic
regular expressions using the operator '~', i.e. '~{perl-regex}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,8 @@ public class ParamConstants {
public static final String JOB_TOOL_TYPE_DESCRIPTION = "Tool type executed by the job [OPERATION, ANALYSIS]";
public static final String JOB_USER_PARAM = "userId";
public static final String JOB_USER_DESCRIPTION = "User that created the job";
public static final String JOB_PRIORITY_PARAM = "jobPriority";
public static final String JOB_PRIORITY_PARAM = "priority";
public static final String SUBMIT_JOB_PRIORITY_PARAM = "jobPriority";
public static final String JOB_PRIORITY_DESCRIPTION = "Priority of the job";
public static final String JOB_INTERNAL_STATUS_PARAM = INTERNAL_STATUS_PARAM;
public static final String JOB_INTERNAL_STATUS_DESCRIPTION = INTERNAL_STATUS_DESCRIPTION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public Response downloadAndRegister(
@ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn,
@ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags,
@ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime,
@ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.JOB_PRIORITY_PARAM) String jobPriority,
@ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority,
@ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun,
@ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String studyStr,
@ApiParam(name = "body", value = "Fetch parameters", required = true) FileFetch fetchParams) {
Expand Down Expand Up @@ -713,7 +713,7 @@ public Response postlink(
@ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription,
@ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags,
@ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime,
@ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.JOB_PRIORITY_PARAM) String jobPriority,
@ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority,
@ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun,
@ApiParam(name = "body", value = "File parameters", required = true) PostLinkToolParams params) {
return submitJob(PostLinkSampleAssociation.ID, studyStr, params, jobId, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun);
Expand All @@ -729,7 +729,7 @@ public Response linkAsync(
@ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription,
@ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags,
@ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime,
@ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.JOB_PRIORITY_PARAM) String jobPriority,
@ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority,
@ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun,
@ApiParam(name = "body", value = "File parameters", required = true) FileLinkToolParams params) {
return submitJob(FileLinkTask.ID, studyStr, params, jobId, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun);
Expand Down
Loading

0 comments on commit 83ef3aa

Please sign in to comment.