use of org.apache.servicecomb.service.center.client.model.CreateSchemaRequest in project java-chassis by ServiceComb.
the class ServiceCenterClient method updateServiceSchemaContext.
@Override
public boolean updateServiceSchemaContext(String serviceId, SchemaInfo schemaInfo) {
try {
CreateSchemaRequest request = new CreateSchemaRequest();
request.setSchema(schemaInfo.getSchema());
request.setSummary(schemaInfo.getSummary());
HttpResponse response = httpClient.putHttpRequest("/registry/microservices/" + serviceId + "/schemas/" + schemaInfo.getSchemaId(), null, HttpUtils.serialize(request));
if (response.getStatusCode() == HttpStatus.SC_OK) {
return true;
}
sendUnAuthorizedEvent(response);
throw new OperationException("update service schema fails, statusCode = " + response.getStatusCode() + "; message = " + response.getMessage() + "; content = " + response.getContent());
} catch (IOException e) {
throw new OperationException("update service schema fails", e);
}
}
Aggregations