use of org.apache.servicecomb.service.center.client.model.GetSchemaResponse in project java-chassis by ServiceComb.
the class ServiceCenterClient method getServiceSchemaContext.
/**
* Get one schema context of service
*
* @param serviceId
* @param schemaId
* @return
* @throws OperationException
*/
public String getServiceSchemaContext(String serviceId, String schemaId) {
try {
HttpResponse response = httpClient.getHttpRequest("/registry/microservices/" + serviceId + "/schemas/" + schemaId, null, null);
if (response.getStatusCode() == HttpStatus.SC_OK) {
GetSchemaResponse getSchemaResponse = HttpUtils.deserialize(response.getContent(), GetSchemaResponse.class);
return getSchemaResponse.getSchema();
}
sendUnAuthorizedEvent(response);
throw new OperationException("get service schema context fails, statusCode = " + response.getStatusCode() + "; message = " + response.getMessage() + "; content = " + response.getContent());
} catch (IOException e) {
throw new OperationException("get service schemas context fails", e);
}
}
Aggregations