Getting Submissions
Retrieve useful information about a submission
Introduction
Once you have created a Submission, you can retrieve useful information about it using the GetSubmisson
query. The query will return a Submission
object containing attributes like the file(s) submitted, the associated Workflow
and Dataset
, or its processing status. Its status is particularly helpful as it can be used to determine if a Submission was completed successfully and its results available for download.
GetSubmission
Inputs
GetSubmission Inputs
submission_id: int
Submission id
Outputs
GetSubmission Outputs
Found Submission object
Try It Out
You can try outGetSubmission
below.
from indico.queries import GetSubmission
from indico.types import Submission
submission_id: int = 4
submission: Submission = client.call(GetSubmission(submission_id=submission_id))
using System;
using System.IO;
using System.Threading.Tasks;
using IndicoV2;
namespace Examples
{
public class GetSubmission
{
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 submissionId = 1;
var submissionClient = client.Submissions();
var submission = await submissionClient.GetAsync(submissionId);
Console.WriteLine(submission.Id);
}
}
}
package com.indico;
import com.indico.entity.Submission;
import com.indico.query.GetSubmission;
public class main {
public IndicoClient client;
private static String token_path = "./indico_api_token.txt";
private static String host = "mycluster.indico.io"
private static Integer submission_id = 1;
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);
GetSubmission submission = client.getSubmission();
submission.submissionId(submission_id);
Submission result = submission.query();
while(result.status != SubmissionStatus.COMPLETE && result.status != SubmissionStatus.FAILED){
result = submission.query();
}
System.exit(0);
}
}
Updated 10 months ago