Search in sources :

Example 6 with JobData

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());
}
Also used : JobData(org.platformlayer.jobs.model.JobData)

Example 7 with JobData

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;
}
Also used : PlatformLayerClient(org.platformlayer.PlatformLayerClient) JobData(org.platformlayer.jobs.model.JobData)

Example 8 with JobData

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);
}
Also used : Action(org.platformlayer.core.model.Action) JobData(org.platformlayer.jobs.model.JobData)

Example 9 with JobData

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;
}
Also used : JobData(org.platformlayer.jobs.model.JobData)

Example 10 with JobData

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;
}
Also used : JobData(org.platformlayer.jobs.model.JobData)

Aggregations

JobData (org.platformlayer.jobs.model.JobData)24 PlatformLayerKey (org.platformlayer.core.model.PlatformLayerKey)7 PlatformLayerClient (org.platformlayer.PlatformLayerClient)4 RepositoryException (org.platformlayer.RepositoryException)4 ManagedItemId (org.platformlayer.ids.ManagedItemId)4 OpsException (org.platformlayer.ops.OpsException)4 ItemBase (org.platformlayer.core.model.ItemBase)3 ProjectId (org.platformlayer.ids.ProjectId)3 SecretProvider (org.platformlayer.auth.crypto.SecretProvider)2 JobDataList (org.platformlayer.jobs.model.JobDataList)2 JobExecutionData (org.platformlayer.jobs.model.JobExecutionData)2 OpsContext (org.platformlayer.ops.OpsContext)2 ServiceProvider (org.platformlayer.xaas.services.ServiceProvider)2 CliException (com.fathomdb.cli.CliException)1 Ansi (com.fathomdb.cli.commands.Ansi)1 JdbcTransaction (com.fathomdb.jdbc.JdbcTransaction)1 IOException (java.io.IOException)1 InetSocketAddress (java.net.InetSocketAddress)1 SQLException (java.sql.SQLException)1 List (java.util.List)1