use of org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatusList in project incubator-pulsar by apache.
the class FunctionsImpl method getFunctionStatus.
@Override
public FunctionStatusList getFunctionStatus(String tenant, String namespace, String function) throws PulsarAdminException {
try {
Response response = request(functions.path(tenant).path(namespace).path(function).path("status")).get();
if (!response.getStatusInfo().equals(Response.Status.OK)) {
throw new ClientErrorException(response);
}
String jsonResponse = response.readEntity(String.class);
FunctionStatusList.Builder functionStatusBuilder = FunctionStatusList.newBuilder();
Utils.mergeJson(jsonResponse, functionStatusBuilder);
return functionStatusBuilder.build();
} catch (Exception e) {
throw getApiException(e);
}
}
Aggregations