bzp2010 opened a new issue #5485: URL: https://github.com/apache/apisix/issues/5485
# Proposal ## Background OpenWhisk is an open source Faas computing platform in the Apache Foundation, announced and contributed to the open source community by IBM in 2016. In terms of running logic, OpenWhisk, like AWS Lambda, provides users with an event-driven, stateless computing model based on a variety of programming languages with direct support. Its overall container-based runtime deployment (including traffic entry, controllers, triggers, etc.), using Docker to achieve function operation, management and scaling. Meanwhile, in addition to container invocation and function management, OpenWhisk also includes authentication, function asynchronous triggering and other functions. ## Test Environment Configure the standalone run as per the official documentation and execute the following command after running Docker locally. ```shell git clone https://github.com/apache/openwhisk.git cd openwhisk ./gradlew core:standalone:bootRun ``` ## Objectives Supports using functions in OpenWhisk as routing "upstream" via plugins to enable access to Faas functions. ## Solutions 1. plugin schema <html> <body> <!--StartFragment--><div class="okr-block-clipboard" data-okr="%7B%22okrDelta%22%3A%5B%7B%22lineType%22%3A%22unsupport%22%2C%22lineOptions%22%3A%7B%7D%2C%22lineContent%22%3A%5B%5D%7D%5D%2C%22businessKey%22%3A%22lark-doc%22%7D"></div><div data-zone-id="0" data-line-index="0" style="white-space: pre;"> Name | Type | Optional | Default | Description -- | -- | -- | -- | -- api_host | string | no | | OpenWhisk API host (eg. https://localhost:3233) ssl_verify | bool | no | true | Whether to verify the certificate namespace | string | no | | OpenWhisk Namespace (eg. guest) action | string | no | | OpenWhisk Action (eg. hello) result | bool | yes | true | Whether to get Action metadata (default to execute function and get response; false to get Action metadata but not execute Action, including runtime, function body, restrictions, etc.) service_token | string | no | | OpenWhisk ServiceToken (The format is `xxx:xxx`,Passed through Basic Auth when calling the API) timeout | integer | yes | 60000ms | Functions and HTTP call timeout keepalive | bool | yes | true | HTTP keepalive keepalive_timeout | integer | yes | 60000ms | keepalive idle timeout keepalive_pool | integer | yes | 5 | Connection pool limit </div><!--EndFragment--> </body> </html> 2. plugin implement Implement the access phase processing function to send a request to the service endpoint using `resty.http` according to the configuration, and end the request processing after writing the result of the request to the response. Request Demo: ```text POST http://localhost:3233/api/v1/namespaces/guest/actions/hello?blocking=true&result=true&timeout=60000 Authentication: Basic xxxxx Content-Type: application/json {"name":"test"} {"payload":"Hello, test!"} ``` ## Other What are your ideas? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
