use of org.platformlayer.jobs.model.JobData in project platformlayer by platformlayer.
the class ActionCommandBase method formatRaw.
@Override
public void formatRaw(Object o, PrintWriter writer) {
JobData jobData = (JobData) o;
writer.println(jobData.getJobId());
}
use of org.platformlayer.jobs.model.JobData in project platformlayer by platformlayer.
the class AutoCompleteJobId method doComplete.
@Override
public List<String> doComplete(CliContext context, String prefix) throws Exception {
PlatformLayerClient client = getPlatformLayerClient(context);
List<String> jobs = Lists.newArrayList();
for (JobData jobData : client.listJobs().getJobs()) {
jobs.add(jobData.getJobId());
}
addSuffix(jobs, " ");
return jobs;
}
use of org.platformlayer.jobs.model.JobData in project platformlayer by platformlayer.
the class JobExecutionDataFormatter method visit.
@Override
public void visit(CliContext context, JobExecutionData o, OutputSink sink) throws IOException {
LinkedHashMap<String, Object> values = Maps.newLinkedHashMap();
values.put("jobId", o.getJobId());
values.put("executionId", o.getExecutionId());
JobData job = o.getJob();
values.put("target", job != null ? job.getTargetItemKey() : null);
Action action = null;
if (job != null) {
action = job.getAction();
}
values.put("action", action != null ? action.getType() : null);
values.put("startedAt", o.getStartedAt());
values.put("endedAt", o.getEndedAt());
values.put("state", o.getState());
sink.outputRow(values);
}
use of org.platformlayer.jobs.model.JobData in project platformlayer by platformlayer.
the class HttpPlatformLayerClient method doAction.
@Override
public JobData doAction(PlatformLayerKey key, Action action) throws PlatformLayerClientException {
String relativePath = buildRelativePath(key) + "/actions";
JobData retval = doRequest(HttpMethod.POST, relativePath, JobData.class, Format.XML, action, Format.XML);
return retval;
}
use of org.platformlayer.jobs.model.JobData in project platformlayer by platformlayer.
the class HttpPlatformLayerClient method doAction.
@Override
public JobData doAction(PlatformLayerKey key, String action, Format dataFormat) throws PlatformLayerClientException {
String relativePath = buildRelativePath(key) + "/actions";
JobData retval = doRequest(HttpMethod.POST, relativePath, JobData.class, Format.XML, action, dataFormat);
return retval;
}
Aggregations