use of org.apache.servicecomb.service.center.client.model.GetSchemaListResponse in project java-chassis by ServiceComb.
the class ServiceCenterClient method getServiceSchemasList.
@Override
public List<SchemaInfo> getServiceSchemasList(String serviceId, boolean withContent) {
String url = "/registry/microservices/" + serviceId + "/schemas";
if (withContent) {
url = url + "?withSchema=1";
}
try {
HttpResponse response = httpClient.getHttpRequest(url, null, null);
if (response.getStatusCode() == HttpStatus.SC_OK) {
GetSchemaListResponse getSchemaResponse = HttpUtils.deserialize(response.getContent(), GetSchemaListResponse.class);
return getSchemaResponse.getSchemas();
}
sendUnAuthorizedEvent(response);
throw new OperationException("get service schemas list fails, statusCode = " + response.getStatusCode() + "; message = " + response.getMessage() + "; content = " + response.getContent());
} catch (IOException e) {
throw new OperationException("get service schemas list fails", e);
}
}
Aggregations