use of org.apache.servicecomb.service.center.client.model.MicroserviceInstanceResponse in project java-chassis by ServiceComb.
the class ServiceCenterClient method getMicroserviceInstance.
@Override
public MicroserviceInstance getMicroserviceInstance(String serviceId, String instanceId) {
try {
HttpResponse response = httpClient.getHttpRequest("/registry/microservices/" + serviceId + "/instances/" + instanceId, null, null);
if (response.getStatusCode() == HttpStatus.SC_OK) {
MicroserviceInstanceResponse instanceResponse = HttpUtils.deserialize(response.getContent(), MicroserviceInstanceResponse.class);
return instanceResponse.getInstance();
}
sendUnAuthorizedEvent(response);
throw new OperationException("get service instance message fails, statusCode = " + response.getStatusCode() + "; message = " + response.getMessage() + "; content = " + response.getContent());
} catch (IOException e) {
throw new OperationException("get service instance message fails", e);
}
}
use of org.apache.servicecomb.service.center.client.model.MicroserviceInstanceResponse in project incubator-servicecomb-java-chassis by apache.
the class ServiceCenterClient method getMicroserviceInstance.
@Override
public MicroserviceInstance getMicroserviceInstance(String serviceId, String instanceId) {
try {
HttpResponse response = httpClient.getHttpRequest("/registry/microservices/" + serviceId + "/instances/" + instanceId, null, null);
if (response.getStatusCode() == HttpStatus.SC_OK) {
MicroserviceInstanceResponse instanceResponse = HttpUtils.deserialize(response.getContent(), MicroserviceInstanceResponse.class);
return instanceResponse.getInstance();
}
sendUnAuthorizedEvent(response);
throw new OperationException("get service instance message fails, statusCode = " + response.getStatusCode() + "; message = " + response.getMessage() + "; content = " + response.getContent());
} catch (IOException e) {
throw new OperationException("get service instance message fails", e);
}
}
Aggregations