List Submissions
List all Submissions visible to the authenticated user by most recent
Introduction
TheListSubmissions
query can be utilized to selectively retrieve these Submissions. This query will return all the found Submission
objects and, if paginated, yields results one at a time.
ListSubmissions
is versatile. It can be customized with specific parameters to focus your Submission search or executed without any parameters. In the latter scenario, it defaults to presenting all Submissions available to the authenticated user by most recent.
ListSubmissions
Inputs
ListSubmissions Inputs
submission_ids: List[int]
Submission ids to filter by
workflow_ids: List[int]
Workflow ids to filter by
filters: SubmissionFilter or Dict
Submission attributes to filter by
limit: (int, default=1000)
Maximum number of Submissions to return
orderBy: (str, default=”ID”)
Submission attribute to filter by
desc: (bool, default=True)
List in descending order
Outputs
ListSubmission Outputs
List[Submission]
Try It Out
Try out the ListSubmissions
call:
from indico.queries import ListSubmissions
# ids of submissions to list
submission_ids = [1, 2, 3, 4]
# list submissions by submission ids and potential filters
submissions = client.call(
ListSubmissions(submission_ids=submission_ids, filters=filters)
)
# iterate over submissions
for submission in submissions:
# process submission data
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using IndicoV2;
namespace Examples
{
public class ListSubmissions
{
private static string GetToken() =>
File.ReadAllText(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
"indico_api_token.txt"));
public static async Task Main()
{
var client = new IndicoClient(GetToken(), new Uri("https://mycluster.indico.io"));
var submissionClient = client.Submissions();
var submissionIds = new List<int>() { };
var workflowIds = new List<int>() { 1 };
var submissions = await submissionClient.ListAsync(submissionIds, workflowIds, null);
Console.WriteLine(submissions.Count());
}
}
}
package com.indico;
import com.indico.entity.Submission;
import com.indico.query.ListSubmissions;
import com.indico.type.SubmissionStatus;
import java.util.ArrayList;
import java.util.List;
public class main {
public IndicoClient client;
private static String token_path = "./indico_api_token.txt";
private static String host = "mycluster.indico.io"
public static void main(String args[]) throws Exception {
IndicoConfig config = new IndicoConfig.Builder().host(host)
.protocol("https")
.tokenPath(token_path)
.build();
client = new IndicoKtorClient(config);
/*
* List all submissions that are COMPLETE or FAILED
*/
List<SubmissionFilter> filters = new ArrayList<>();
filters.add(new SubmissionFilter.Builder().status(SubmissionStatus.COMPLETE).build());
filters.add(new SubmissionFilter.Builder().status(SubmissionStatus.FAILED).build());
SubmissionFilter subFilter = new SubmissionFilter.Builder().ors(filters).build();
List<Submission> submissions = client.listSubmissions().filters(subFilter).query();
System.exit(0);
}
}
Updated 10 months ago