You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/05/26 05:51:43 UTC

[GitHub] [apisix] lunarwhite commented on a diff in pull request #7117: docs: add openwhisk CN document

lunarwhite commented on code in PR #7117:
URL: https://github.com/apache/apisix/pull/7117#discussion_r882313674


##########
docs/zh/latest/plugins/openwhisk.md:
##########
@@ -0,0 +1,136 @@
+---
+title: openwhisk
+keywords:
+  - APISIX
+  - Plugin
+  - OpenWhisk
+  - openwhisk
+description: 本文介绍了关于 Apache APISIX `openwhisk` 插件的基本信息及使用方法。
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 描述
+
+`openwhisk` 插件用于将开源的分布式无服务器平台 [Apache OpenWhisk](https://openwhisk.apache.org) 作为动态上游集成至 APISIX。
+
+启用 `openwhisk` 插件后,该插件会终止对已配置 URI 的请求,并代表客户端向 OpenWhisk 的 API Host 端点发起一个新的请求,然后 `openwhisk` 插件会将响应信息返回至客户端。
+
+## 属性
+
+| 名称              | 类型    | 必选项 | 默认值  | 有效值       | 描述                                                         |
+| ----------------- | ------- | ------ | ------- | ------------ | ------------------------------------------------------------ |
+| api_host          | string  | 是     |         |              | OpenWhisk API Host 地址,例如 `https://localhost:3233`。     |
+| ssl_verify        | boolean | 否     | true    |              | 当设置为 `true` 时执行 SSL 验证。                            |
+| service_token     | string  | 是     |         |              | OpenWhisk service token,其格式为 `xxx:xxx` ,用于 API 调用时的身份认证。 |
+| namespace         | string  | 是     |         |              | OpenWhisk namespace,例如 `guest`。                          |
+| action            | string  | 是     |         |              | OpenWhisk action,例如 `hello`.                              |

Review Comment:
   ```suggestion
   | action            | string  | 是     |         |              | OpenWhisk action,例如 `hello`。                              |
   ```



##########
docs/zh/latest/plugins/openwhisk.md:
##########
@@ -0,0 +1,136 @@
+---
+title: openwhisk
+keywords:
+  - APISIX
+  - Plugin
+  - OpenWhisk
+  - openwhisk
+description: 本文介绍了关于 Apache APISIX `openwhisk` 插件的基本信息及使用方法。
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 描述
+
+`openwhisk` 插件用于将开源的分布式无服务器平台 [Apache OpenWhisk](https://openwhisk.apache.org) 作为动态上游集成至 APISIX。
+
+启用 `openwhisk` 插件后,该插件会终止对已配置 URI 的请求,并代表客户端向 OpenWhisk 的 API Host 端点发起一个新的请求,然后 `openwhisk` 插件会将响应信息返回至客户端。
+
+## 属性
+
+| 名称              | 类型    | 必选项 | 默认值  | 有效值       | 描述                                                         |
+| ----------------- | ------- | ------ | ------- | ------------ | ------------------------------------------------------------ |
+| api_host          | string  | 是     |         |              | OpenWhisk API Host 地址,例如 `https://localhost:3233`。     |
+| ssl_verify        | boolean | 否     | true    |              | 当设置为 `true` 时执行 SSL 验证。                            |
+| service_token     | string  | 是     |         |              | OpenWhisk service token,其格式为 `xxx:xxx` ,用于 API 调用时的身份认证。 |
+| namespace         | string  | 是     |         |              | OpenWhisk namespace,例如 `guest`。                          |
+| action            | string  | 是     |         |              | OpenWhisk action,例如 `hello`.                              |
+| result            | boolean | 否     | true    |              | 当设置为 `true` 时,获得 action 元数据(执行函数并获得响应结果)。 |
+| timeout           | integer | 否     | 60000ms | [1,60000]ms  | OpenWhisk action 和 HTTP 调用超时时间(以毫秒为单位)。          |
+| keepalive         | boolean | 否     | true    |              | 当设置为 `true` 时,保持连接的活动状态以便重复使用。         |
+| keepalive_timeout | integer | 否     | 60000ms | [1000,...]ms | 当连接空闲时,保持该连接处于活动状态的时间(以毫秒为单位)。               |
+| keepalive_pool    | integer | 否     | 5       | [1,...]      | 连接断开之前,可接收的最大请求数。                           |
+
+:::note
+
+`timeout` 字段规定了 OpenWhisk action 的最大执行时间,以及 APISIX 中 HTTP 客户端的请求超时时间。
+
+因为 OpenWhisk action 调用可能会耗费很长时间来拉取容器镜像和启动容器,所以如果 `timeout` 字段值设置太小,可能会导致大量的失败请求。
+
+在 OpenWhisk 中 `timeout` 字段的值设置范围从 1 ms 到 60000 ms,历史使用经验建议大家将 `timeout` 字段的值至少设置为 1000ms。

Review Comment:
   ```suggestion
   在 OpenWhisk 中 `timeout` 字段的值设置范围从 1 ms 到 60000 ms,建议用户将 `timeout` 字段的值至少设置为 1000ms。
   ```



##########
docs/zh/latest/plugins/openwhisk.md:
##########
@@ -0,0 +1,136 @@
+---
+title: openwhisk
+keywords:
+  - APISIX
+  - Plugin
+  - OpenWhisk
+  - openwhisk
+description: 本文介绍了关于 Apache APISIX `openwhisk` 插件的基本信息及使用方法。
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 描述
+
+`openwhisk` 插件用于将开源的分布式无服务器平台 [Apache OpenWhisk](https://openwhisk.apache.org) 作为动态上游集成至 APISIX。
+
+启用 `openwhisk` 插件后,该插件会终止对已配置 URI 的请求,并代表客户端向 OpenWhisk 的 API Host 端点发起一个新的请求,然后 `openwhisk` 插件会将响应信息返回至客户端。

Review Comment:
   Refer to the [English version](https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/openwhisk.md): `This Plugin can be configured on a Route and requests will be send to the configured OpenWhish API endpoint as the upstream.`
   
   👍Good translation.



##########
docs/zh/latest/plugins/openwhisk.md:
##########
@@ -0,0 +1,136 @@
+---
+title: openwhisk
+keywords:
+  - APISIX
+  - Plugin
+  - OpenWhisk
+  - openwhisk
+description: 本文介绍了关于 Apache APISIX `openwhisk` 插件的基本信息及使用方法。
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 描述
+
+`openwhisk` 插件用于将开源的分布式无服务器平台 [Apache OpenWhisk](https://openwhisk.apache.org) 作为动态上游集成至 APISIX。
+
+启用 `openwhisk` 插件后,该插件会终止对已配置 URI 的请求,并代表客户端向 OpenWhisk 的 API Host 端点发起一个新的请求,然后 `openwhisk` 插件会将响应信息返回至客户端。
+
+## 属性
+
+| 名称              | 类型    | 必选项 | 默认值  | 有效值       | 描述                                                         |
+| ----------------- | ------- | ------ | ------- | ------------ | ------------------------------------------------------------ |
+| api_host          | string  | 是     |         |              | OpenWhisk API Host 地址,例如 `https://localhost:3233`。     |
+| ssl_verify        | boolean | 否     | true    |              | 当设置为 `true` 时执行 SSL 验证。                            |
+| service_token     | string  | 是     |         |              | OpenWhisk service token,其格式为 `xxx:xxx` ,用于 API 调用时的身份认证。 |
+| namespace         | string  | 是     |         |              | OpenWhisk namespace,例如 `guest`。                          |
+| action            | string  | 是     |         |              | OpenWhisk action,例如 `hello`.                              |
+| result            | boolean | 否     | true    |              | 当设置为 `true` 时,获得 action 元数据(执行函数并获得响应结果)。 |
+| timeout           | integer | 否     | 60000ms | [1,60000]ms  | OpenWhisk action 和 HTTP 调用超时时间(以毫秒为单位)。          |
+| keepalive         | boolean | 否     | true    |              | 当设置为 `true` 时,保持连接的活动状态以便重复使用。         |
+| keepalive_timeout | integer | 否     | 60000ms | [1000,...]ms | 当连接空闲时,保持该连接处于活动状态的时间(以毫秒为单位)。               |
+| keepalive_pool    | integer | 否     | 5       | [1,...]      | 连接断开之前,可接收的最大请求数。                           |
+
+:::note
+
+`timeout` 字段规定了 OpenWhisk action 的最大执行时间,以及 APISIX 中 HTTP 客户端的请求超时时间。
+
+因为 OpenWhisk action 调用可能会耗费很长时间来拉取容器镜像和启动容器,所以如果 `timeout` 字段值设置太小,可能会导致大量的失败请求。
+
+在 OpenWhisk 中 `timeout` 字段的值设置范围从 1 ms 到 60000 ms,历史使用经验建议大家将 `timeout` 字段的值至少设置为 1000ms。
+
+:::
+
+## 启用插件
+
+### 搭建 Apache OpenWhisk 测试环境
+
+1. 在使用 `openwhisk` 插件之前,你需要通过以下命令运行 OpenWhisk 独立集群模式。请确保当前环境中已经安装 Docker 软件。

Review Comment:
   "standalone mode"-> "独立集群模式" or "单节点模式"? 
   
   Or just "stand-alone 模式"? (as other CN docs show)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org