use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class PropertyKeyAPI method create.
public PropertyKey.PropertyKeyWithTask create(PropertyKey propertyKey) {
Object pkey = this.checkCreateOrUpdate(propertyKey);
RestResult result = this.client.post(this.path(), pkey);
if (this.client.apiVersionLt("0.65")) {
return new PropertyKey.PropertyKeyWithTask(result.readObject(PropertyKey.class), 0L);
}
return result.readObject(PropertyKey.PropertyKeyWithTask.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class PropertyKeyAPI method list.
public List<PropertyKey> list(List<String> names) {
this.client.checkApiVersion("0.48", "getting schema by names");
E.checkArgument(names != null && !names.isEmpty(), "The property key names can't be null or empty");
Map<String, Object> params = ImmutableMap.of("names", names);
RestResult result = this.client.get(this.path(), params);
return result.readList(this.type(), PropertyKey.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class VertexLabelAPI method eliminate.
public VertexLabel eliminate(VertexLabel vertexLabel) {
String id = vertexLabel.name();
Map<String, Object> params = ImmutableMap.of("action", "eliminate");
Object vl = this.checkCreateOrUpdate(vertexLabel);
RestResult result = this.client.put(this.path(), id, vl, params);
return result.readObject(VertexLabel.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class VertexLabelAPI method list.
public List<VertexLabel> list(List<String> names) {
this.client.checkApiVersion("0.48", "getting schema by names");
E.checkArgument(names != null && !names.isEmpty(), "The vertex label names can't be null or empty");
Map<String, Object> params = ImmutableMap.of("names", names);
RestResult result = this.client.get(this.path(), params);
return result.readList(this.type(), VertexLabel.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class VertexLabelAPI method delete.
public long delete(String name) {
RestResult result = this.client.delete(this.path(), name);
@SuppressWarnings("unchecked") Map<String, Object> task = result.readObject(Map.class);
return TaskAPI.parseTaskId(task);
}
Aggregations