eKuiper 模式命令行工具使您可以管理模式,例如创建,显示和删除插件。
该命令用于创建模式。 模式的定义以 JSON 格式指定。
create schema $schema_type $schema_name $schema_json
模式可以通过两种方式创建。
示例:
# bin/kuiper create schema protobuf schema1 '{"name": "schema1","content": "message Book {required string title = 1; required int32 price = 2;}"}'
该命令创建一个名为 schema1
的模式,模式内容由 json 中的 content 指定。
示例:
# bin/kuiper create schema protobuf schema1 '{"name": "schema1","file": "file:///tmp/aschema.proto"}'
该命令创建一个名为 schema1
的模式,模式内容由 json 中的 file 指定。文件将被复制到 data/schemas/protobuf
下并重命名为 schema1.proto
。
protobuf
。该命令用于显示服务器中为模式类型定义的所有模式。
show schemas $schema_type
示例:
# bin/kuiper show schemas protobuf
schema1
schema2
该命令用于打印模式的详细定义。
describe schema $schema_type $schema_name
示例:
# bin/kuiper describe schema protobuf schema1
{
"type": "protobuf",
"name": "schema1",
"content": "message Book {required string title = 1; required int32 price = 2;}",
"file": "ekuiper\\etc\\schemas\\protobuf\\schema1.proto"
}
该命令用于删除模式。模式删除后,已经被规则载入的模式仍然可继续使用,但重启之后规则将报错。
drop schema $schema_type $schema_name
示例:
# bin/kuiper drop schema protobuf schema1
Schema schema1 is dropped.