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());
}
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);
}
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;
}
}
}
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);
}
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;
}
Aggregations