Search in sources :

Example 21 with Job

use of com.google.cloud.talent.v4.Job in project java-scheduler by googleapis.

the class ITSystemTest method updateJobTest.

@Test
public void updateJobTest() {
    String timeZone = "PST";
    String schedule = "25 8 * * *";
    Job updateJob = Job.newBuilder().setName(JOB_NAME).setPubsubTarget(PUB_SUB_TARGET).setSchedule(schedule).setTimeZone(timeZone).build();
    UpdateJobRequest updateJobRequest = UpdateJobRequest.newBuilder().setJob(updateJob).build();
    Job job = client.updateJob(updateJobRequest);
    assertEquals(JOB_NAME, job.getName());
    assertEquals(PUB_SUB_TARGET, job.getPubsubTarget());
    assertEquals(Job.State.ENABLED, job.getState());
    assertEquals(timeZone, job.getTimeZone());
    assertEquals(schedule, job.getSchedule());
}
Also used : ByteString(com.google.protobuf.ByteString) UpdateJobRequest(com.google.cloud.scheduler.v1beta1.UpdateJobRequest) Job(com.google.cloud.scheduler.v1beta1.Job) Test(org.junit.Test)

Example 22 with Job

use of com.google.cloud.talent.v4.Job in project java-scheduler by googleapis.

the class ITSystemTest method getJobTest.

@Test
public void getJobTest() {
    Job job = client.getJob(JOB_NAME);
    assertJobDetails(job);
}
Also used : Job(com.google.cloud.scheduler.v1beta1.Job) Test(org.junit.Test)

Example 23 with Job

use of com.google.cloud.talent.v4.Job in project java-scheduler by googleapis.

the class ITSystemTest method runJobTest.

@Test
public void runJobTest() throws Exception {
    RunJobRequest jobRequest = RunJobRequest.newBuilder().setName(JOB_NAME).build();
    ApiFuture<Job> job = client.runJobCallable().futureCall(jobRequest);
    while (true) {
        if (job.isDone()) {
            assertJobDetails(job.get());
            break;
        }
    }
}
Also used : RunJobRequest(com.google.cloud.scheduler.v1beta1.RunJobRequest) Job(com.google.cloud.scheduler.v1beta1.Job) Test(org.junit.Test)

Example 24 with Job

use of com.google.cloud.talent.v4.Job in project java-scheduler by googleapis.

the class ITSystemTest method getJobTest.

@Test
public void getJobTest() {
    Job job = client.getJob(JOB_NAME);
    assertJobDetails(job);
}
Also used : Job(com.google.cloud.scheduler.v1.Job) Test(org.junit.Test)

Example 25 with Job

use of com.google.cloud.talent.v4.Job in project cmcc-operator by T-Systems-MMS.

the class DefaultTargetState method isReady.

private boolean isReady(String jobName) {
    jobName = concatOptional(cmcc.getSpec().getDefaults().getNamePrefix(), jobName);
    Job job = kubernetesClient.batch().v1().jobs().inNamespace(cmcc.getMetadata().getNamespace()).withName(jobName).get();
    boolean ready = job != null && job.getStatus() != null && job.getStatus().getSucceeded() != null && job.getStatus().getSucceeded() > 0;
    if (ready) {
        log.debug("job {}: has succeeded", jobName);
    } else {
        log.debug("job {}: waiting for successful completion", jobName);
    }
    return ready;
}
Also used : Job(io.fabric8.kubernetes.api.model.batch.v1.Job)

Aggregations

Job (org.pentaho.platform.api.scheduler2.Job)94 Test (org.junit.Test)89 Job (io.fabric8.kubernetes.api.model.batch.v1.Job)38 Serializable (java.io.Serializable)25 ArrayList (java.util.ArrayList)24 SimpleJobTrigger (org.pentaho.platform.api.scheduler2.SimpleJobTrigger)21 Job (com.google.cloud.talent.v4beta1.Job)20 HashMap (java.util.HashMap)20 JobScheduleRequest (org.pentaho.platform.web.http.api.resources.JobScheduleRequest)19 ComplexJobTrigger (org.pentaho.platform.api.scheduler2.ComplexJobTrigger)18 SchedulerException (org.pentaho.platform.api.scheduler2.SchedulerException)17 JobServiceClient (com.google.cloud.talent.v4beta1.JobServiceClient)16 Date (java.util.Date)14 IJobFilter (org.pentaho.platform.api.scheduler2.IJobFilter)14 Job (com.google.cloud.video.transcoder.v1.Job)13 TranscoderServiceClient (com.google.cloud.video.transcoder.v1.TranscoderServiceClient)13 JobBuilder (io.fabric8.kubernetes.api.model.batch.v1.JobBuilder)13 IJobTrigger (org.pentaho.platform.api.scheduler2.IJobTrigger)12 Map (java.util.Map)11 Test (org.junit.jupiter.api.Test)10