Sfoglia il codice sorgente

fix(doc): fix problems of CLI and REST API port (#803)

1. cli create stream/rule json string must be quoted
2. REST samples, default port must be 9081
ngjaying 3 anni fa
parent
commit
7e6a6a028a

+ 3 - 3
docs/en_US/cli/rules.md

@@ -7,17 +7,17 @@ The Kuiper rule command line tools allows you to manage rules, such as create, s
 The command is used for creating a rule.  The rule's definition is specified with JSON format, read [rule](../rules/overview.md) for more detailed information.
 The command is used for creating a rule.  The rule's definition is specified with JSON format, read [rule](../rules/overview.md) for more detailed information.
 
 
 ```shell
 ```shell
-create rule $rule_name $rule_json | create rule $rule_name -f $rule_def_file
+create rule $rule_name '$rule_json' | create rule $rule_name -f $rule_def_file
 ```
 ```
 
 
 The rule can be created with two ways. 
 The rule can be created with two ways. 
 
 
-- Specify the rule definition in command line.
+- Specify the rule definition in command line. Notice that, the json string must be quoted.
 
 
 Sample:
 Sample:
 
 
 ```shell
 ```shell
-# bin/kuiper create rule rule1 {"sql": "SELECT * from demo","actions": [{"log":  {}},{"mqtt":  {"server":"tcp://127.0.0.1:1883", "topic":"demoSink"}}]}
+# bin/kuiper create rule rule1 '{"sql": "SELECT * from demo","actions": [{"log":  {}},{"mqtt":  {"server":"tcp://127.0.0.1:1883", "topic":"demoSink"}}]}'
 ```
 ```
 
 
 The command create a rule named ``rule1``. 
 The command create a rule named ``rule1``. 

+ 2 - 2
docs/en_US/cli/streams.md

@@ -7,7 +7,7 @@ The Kuiper stream command line tools allows you to manage the streams, such as c
 The command is used for creating a stream. For more detailed information of stream definition, please refer to [streams](../sqls/streams.md).
 The command is used for creating a stream. For more detailed information of stream definition, please refer to [streams](../sqls/streams.md).
 
 
 ```shell
 ```shell
-create stream $stream_name $stream_def | create stream -f $stream_def_file
+create stream $stream_name '$stream_def' | create stream -f $stream_def_file
 ```
 ```
 
 
 - Specify the stream definition in command line.
 - Specify the stream definition in command line.
@@ -15,7 +15,7 @@ create stream $stream_name $stream_def | create stream -f $stream_def_file
 Sample:
 Sample:
 
 
 ```shell
 ```shell
-# bin/kuiper create stream my_stream '(id bigint, name string, score float) WITH ( datasource = "topic/temperature", FORMAT = "json", KEY = "id");'
+# bin/kuiper create stream my_stream '(id bigint, name string, score float) WITH ( datasource = "topic/temperature", FORMAT = "json", KEY = "id")'
 stream my_stream created
 stream my_stream created
 ```
 ```
 
 

+ 4 - 4
docs/en_US/restapi/plugins.md

@@ -121,13 +121,13 @@ Response Sample:
 The API is used for drop the plugin. The kuiper server needs to be restarted to take effect.
 The API is used for drop the plugin. The kuiper server needs to be restarted to take effect.
 
 
 ```shell
 ```shell
-DELETE http://localhost:8080/plugins/sources/{name}
-DELETE http://localhost:8080/plugins/sinks/{name}
-DELETE http://localhost:8080/plugins/functions/{name}
+DELETE http://localhost:9081/plugins/sources/{name}
+DELETE http://localhost:9081/plugins/sinks/{name}
+DELETE http://localhost:9081/plugins/functions/{name}
 ```
 ```
 The user can pass a query parameter to decide if Kuiper should be stopped after a delete in order to make the deletion take effect. The parameter is `restart` and only when the value is `1` will the Kuiper be stopped. The user has to manually restart it.
 The user can pass a query parameter to decide if Kuiper should be stopped after a delete in order to make the deletion take effect. The parameter is `restart` and only when the value is `1` will the Kuiper be stopped. The user has to manually restart it.
 ```shell
 ```shell
-DELETE http://localhost:8080/plugins/sources/{name}?restart=1
+DELETE http://localhost:9081/plugins/sources/{name}?restart=1
 ```
 ```
 
 
 ## APIs to handle function plugin with multiple functions
 ## APIs to handle function plugin with multiple functions

+ 7 - 7
docs/en_US/restapi/rules.md

@@ -78,7 +78,7 @@ Response Sample:
 The API accepts a JSON content and update a rule.
 The API accepts a JSON content and update a rule.
 
 
 ```shell
 ```shell
-PUT http://localhost:8080/rules/{id}
+PUT http://localhost:9081/rules/{id}
 ```
 ```
 
 
 Path parameter `id` is the id or name of the old rule.
 Path parameter `id` is the id or name of the old rule.
@@ -100,7 +100,7 @@ Request Sample
 The API is used for drop the rule.
 The API is used for drop the rule.
 
 
 ```shell
 ```shell
-DELETE http://localhost:8080/rules/{id}
+DELETE http://localhost:9081/rules/{id}
 ```
 ```
 
 
 
 
@@ -109,7 +109,7 @@ DELETE http://localhost:8080/rules/{id}
 The API is used to start running the rule.
 The API is used to start running the rule.
 
 
 ```shell
 ```shell
-POST http://localhost:8080/rules/{id}/start
+POST http://localhost:9081/rules/{id}/start
 ```
 ```
 
 
 
 
@@ -118,7 +118,7 @@ POST http://localhost:8080/rules/{id}/start
 The API is used to stop running the rule.
 The API is used to stop running the rule.
 
 
 ```shell
 ```shell
-POST http://localhost:8080/rules/{id}/stop
+POST http://localhost:9081/rules/{id}/stop
 ```
 ```
 
 
 ## restart a rule
 ## restart a rule
@@ -126,7 +126,7 @@ POST http://localhost:8080/rules/{id}/stop
 The API is used to restart the rule.
 The API is used to restart the rule.
 
 
 ```shell
 ```shell
-POST http://localhost:8080/rules/{id}/restart
+POST http://localhost:9081/rules/{id}/restart
 ```
 ```
 
 
 ## get the status of a rule
 ## get the status of a rule
@@ -136,7 +136,7 @@ The command is used to get the status of the rule. If the rule is running, the m
 - stopped: $reason
 - stopped: $reason
 
 
 ```shell
 ```shell
-GET http://localhost:8080/rules/{id}/status
+GET http://localhost:9081/rules/{id}/status
 ```
 ```
 
 
 Response Sample:
 Response Sample:
@@ -168,7 +168,7 @@ The command is used to get the status of the rule represented as a json string.
 - edges: it is a hash map of all edges categorized by nodes. The keys are the starting point of an edge. And the value is a collection of ending point.
 - edges: it is a hash map of all edges categorized by nodes. The keys are the starting point of an edge. And the value is a collection of ending point.
 
 
 ```shell
 ```shell
-GET http://localhost:8080/rules/{id}/topo
+GET http://localhost:9081/rules/{id}/topo
 ```
 ```
 
 
 Response Sample:
 Response Sample:

+ 1 - 1
docs/en_US/restapi/services.md

@@ -64,7 +64,7 @@ The path parameter `name` is the name of the external service.
 This API is used to delete external services, and all functions defined under the service will be deleted.
 This API is used to delete external services, and all functions defined under the service will be deleted.
 
 
 ```shell
 ```shell
-DELETE http://localhost:8080/services/{name}
+DELETE http://localhost:9081/services/{name}
 ```
 ```
 
 
 ## Update external services
 ## Update external services

+ 1 - 1
docs/en_US/streams.md

@@ -158,7 +158,7 @@ Run `kuiper stream` command, after `kuiper >` prompt shown, enter stream related
 
 
 ```bash
 ```bash
 cli stream
 cli stream
-kuiper > CREATE STREAM sname (count bigint) WITH (source="users", FORMAT="AVRO", KEY="USERID")
+kuiper > CREATE STREAM sname '(count bigint) WITH (source="users", FORMAT="AVRO", KEY="USERID")'
 kuiper > DESCRIBE STREAM sname
 kuiper > DESCRIBE STREAM sname
 ...
 ...
 ```
 ```

+ 3 - 3
docs/zh_CN/cli/rules.md

@@ -7,17 +7,17 @@ Kuiper 规则命令行工具可以管理规则,例如创建、显示、删除
 如下命令用于创建规则。 规则的定义以 JSON 格式指定,请阅读 [规则](../rules/overview.md) 以获取更多详细信息。
 如下命令用于创建规则。 规则的定义以 JSON 格式指定,请阅读 [规则](../rules/overview.md) 以获取更多详细信息。
 
 
 ```shell
 ```shell
-create rule $rule_name $rule_json | create rule $rule_name -f $rule_def_file
+create rule $rule_name '$rule_json' | create rule $rule_name -f $rule_def_file
 ```
 ```
 
 
 可以通过两种方式创建规则。
 可以通过两种方式创建规则。
 
 
-- 在命令行中指定规则定义。
+- 在命令行中指定规则定义。注意规则 json 明文必须放在引号里。
 
 
 示例:
 示例:
 
 
 ```shell
 ```shell
-# bin/kuiper create rule rule1 {"sql": "SELECT * from demo","actions": [{"log":  {}},{"mqtt":  {"server":"tcp://127.0.0.1:1883", "topic":"demoSink"}}]}
+# bin/kuiper create rule rule1 '{"sql": "SELECT * from demo","actions": [{"log":  {}},{"mqtt":  {"server":"tcp://127.0.0.1:1883", "topic":"demoSink"}}]}'
 ```
 ```
 
 
 该命令创建一个名为 `rule1` 的规则。
 该命令创建一个名为 `rule1` 的规则。

+ 2 - 2
docs/zh_CN/cli/streams.md

@@ -7,7 +7,7 @@ Kuiper 流命令行工具可用于管理流,例如创建、描述、显示和
 该命令用于创建流。有关流定义的更多详细信息,请参考[流](../sqls/streams.md)。
 该命令用于创建流。有关流定义的更多详细信息,请参考[流](../sqls/streams.md)。
 
 
 ```shell
 ```shell
-create stream $stream_name $stream_def | create stream -f $stream_def_file
+create stream $stream_name '$stream_def' | create stream -f $stream_def_file
 ```
 ```
 
 
 - 在命令行中指定流定义。
 - 在命令行中指定流定义。
@@ -15,7 +15,7 @@ create stream $stream_name $stream_def | create stream -f $stream_def_file
 示例:
 示例:
 
 
 ```shell
 ```shell
-# bin/kuiper create stream my_stream '(id bigint, name string, score float) WITH ( datasource = "topic/temperature", FORMAT = "json", KEY = "id");'
+# bin/kuiper create stream my_stream '(id bigint, name string, score float) WITH ( datasource = "topic/temperature", FORMAT = "json", KEY = "id")'
 stream my_stream created
 stream my_stream created
 ```
 ```
 
 

+ 4 - 4
docs/zh_CN/restapi/plugins.md

@@ -122,14 +122,14 @@ GET http://localhost:9081/plugins/functions/{name}
 该 API 用于删除插件。 需要重启 kuiper 服务器才能生效。
 该 API 用于删除插件。 需要重启 kuiper 服务器才能生效。
 
 
 ```shell
 ```shell
-DELETE http://localhost:8080/plugins/sources/{name}
-DELETE http://localhost:8080/plugins/sinks/{name}
-DELETE http://localhost:8080/plugins/functions/{name}
+DELETE http://localhost:9081/plugins/sources/{name}
+DELETE http://localhost:9081/plugins/sinks/{name}
+DELETE http://localhost:9081/plugins/functions/{name}
 ```
 ```
 用户可以传递查询参数来决定是否应在删除后停止 Kuiper,以使删除生效。 参数是`restart`,只有当值是1时,Kuiper 才停止。 用户必须手动重新启动它。
 用户可以传递查询参数来决定是否应在删除后停止 Kuiper,以使删除生效。 参数是`restart`,只有当值是1时,Kuiper 才停止。 用户必须手动重新启动它。
 
 
 ```shell
 ```shell
-DELETE http://localhost:8080/plugins/sources/{name}?restart=1
+DELETE http://localhost:9081/plugins/sources/{name}?restart=1
 ```
 ```
 
 
 ## 用于导出多函数的函数插件的相关 API
 ## 用于导出多函数的函数插件的相关 API

+ 6 - 6
docs/zh_CN/restapi/rules.md

@@ -78,7 +78,7 @@ GET http://localhost:9081/rules/{id}
 该 API 接受 JSON 内容并更新规则。
 该 API 接受 JSON 内容并更新规则。
 
 
 ```shell
 ```shell
-PUT http://localhost:8080/rules/{id}
+PUT http://localhost:9081/rules/{id}
 ```
 ```
 
 
 路径参数  `id` 是原有规则的 id 或名称。
 路径参数  `id` 是原有规则的 id 或名称。
@@ -100,7 +100,7 @@ PUT http://localhost:8080/rules/{id}
 该 API 用于删除规则。
 该 API 用于删除规则。
 
 
 ```shell
 ```shell
-DELETE http://localhost:8080/rules/{id}
+DELETE http://localhost:9081/rules/{id}
 ```
 ```
 
 
 ## 启动规则
 ## 启动规则
@@ -108,7 +108,7 @@ DELETE http://localhost:8080/rules/{id}
 该 API 用于开始运行规则。
 该 API 用于开始运行规则。
 
 
 ```shell
 ```shell
-POST http://localhost:8080/rules/{id}/start
+POST http://localhost:9081/rules/{id}/start
 ```
 ```
 
 
 
 
@@ -117,7 +117,7 @@ POST http://localhost:8080/rules/{id}/start
 该 API 用于停止运行规则。
 该 API 用于停止运行规则。
 
 
 ```shell
 ```shell
-POST http://localhost:8080/rules/{id}/stop
+POST http://localhost:9081/rules/{id}/stop
 ```
 ```
 
 
 ## 重启规则
 ## 重启规则
@@ -125,7 +125,7 @@ POST http://localhost:8080/rules/{id}/stop
 该 API 用于重启规则。
 该 API 用于重启规则。
 
 
 ```shell
 ```shell
-POST http://localhost:8080/rules/{id}/restart
+POST http://localhost:9081/rules/{id}/restart
 ```
 ```
 
 
 ## 获取规则的状态
 ## 获取规则的状态
@@ -136,7 +136,7 @@ POST http://localhost:8080/rules/{id}/restart
 - 停止: $reason
 - 停止: $reason
 
 
 ```shell
 ```shell
-GET http://localhost:8080/rules/{id}/status
+GET http://localhost:9081/rules/{id}/status
 ```
 ```
 
 
 响应示例:
 响应示例:

+ 1 - 1
docs/zh_CN/restapi/services.md

@@ -64,7 +64,7 @@ GET http://localhost:9081/services/{name}
 该 API 用于删除外部服务,服务之下定义的所有函数都将被删除。
 该 API 用于删除外部服务,服务之下定义的所有函数都将被删除。
 
 
 ```shell
 ```shell
-DELETE http://localhost:8080/services/{name}
+DELETE http://localhost:9081/services/{name}
 ```
 ```
 
 
 ## 更新外部服务
 ## 更新外部服务

+ 1 - 1
docs/zh_CN/streams.md

@@ -158,7 +158,7 @@ my_stream, iot_stream
 
 
 ```bash
 ```bash
 cli stream
 cli stream
-kuiper > CREATE STREAM sname (count bigint) WITH (source="users", FORMAT="AVRO", KEY="USERID")
+kuiper > CREATE STREAM 'sname (count bigint) WITH (source="users", FORMAT="AVRO", KEY="USERID")'
 kuiper > DESCRIBE STREAM sname
 kuiper > DESCRIBE STREAM sname
 ...
 ...
 ```
 ```