use of io.cdap.cdap.internal.app.runtime.schedule.ScheduleNotFoundException in project cdap by caskdata.
the class RemoteScheduleFetcher method get.
/**
* Get the schedule identified by the given schedule id
*/
@Override
public ScheduleDetail get(ScheduleId scheduleId) throws IOException, ScheduleNotFoundException, UnauthorizedException {
String url = String.format("namespaces/%s/apps/%s/versions/%s/schedules/%s", scheduleId.getNamespace(), scheduleId.getApplication(), scheduleId.getVersion(), scheduleId.getSchedule());
HttpRequest.Builder requestBuilder = remoteClient.requestBuilder(HttpMethod.GET, url);
HttpResponse httpResponse;
try {
httpResponse = execute(requestBuilder.build());
} catch (NotFoundException e) {
throw new ScheduleNotFoundException(scheduleId);
}
return GSON.fromJson(httpResponse.getResponseBodyAsString(), ScheduleDetail.class);
}
Aggregations