You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
OpenWhisk 액션은 명백하게 호출되거나 이벤트에 대응하는 무상태(stateless) 코드 조각입니다. 지금은, 명백하게 호출하는 방법으로 액션을 테스트 하게 됩니다. 나중에는, HTTP 요청에 대응하여 액션을 호출하게 됩니다. 아래 코드로 액션을 호출하고 `--param` 명령줄 인수를 사용하여 매개 변수를 전달하십시오.
85
85
86
86
```bash
87
-
bx wsk action invoke \
87
+
ibmcloud fn action invoke \
88
88
--blocking \
89
89
--param name Tahoma \
90
90
--param color Tabby \
91
91
create-cat
92
92
93
-
bx wsk action invoke \
93
+
ibmcloud fn action invoke \
94
94
--blocking \
95
95
--param id 1 \
96
96
fetch-cat
@@ -102,16 +102,16 @@ bx wsk action invoke \
102
102
103
103
### `/v1/cat` 엔드포인트에 대한 POST와 GET REST 매핑 생성하기
104
104
105
-
지금까지 OpenWhisk 액션을 생성했고, 이제 Bluemix API 게이트웨이를 통해 OpenWhisk 액션을 노출하게 됩니다. 이를 위해 이 명령을 이용합니다: `bx wsk api create $BASE_PATH $API_PATH $API_VERB $ACTION`
105
+
지금까지 OpenWhisk 액션을 생성했고, 이제 Bluemix API 게이트웨이를 통해 OpenWhisk 액션을 노출하게 됩니다. 이를 위해 이 명령을 이용합니다: `ibmcloud fn api create $BASE_PATH $API_PATH $API_VERB $ACTION`
106
106
107
107
이 기능은 [Bluemix Native API Management](https://console.ng.bluemix.net/docs/openwhisk/openwhisk_apigateway.html#openwhisk_apigateway)의 일부이며 현재 보안, 속도 제한 등과 같은 매우 강력한 API 관리 기능을 제공합니다. 비록 지금은 단지 CLI를 사용하여 public REST endpoint로 액션을 노출하고 있습니다.
가장 먼저 OpenWhisk 활성화 로그에서 오류를 확인 하십시오. 명령창에서 `bx wsk activation poll`을 이용하여 로그 메시지를 확인하거나 [Bluemix의 모니터링 콘솔](https://console.ng.bluemix.net/openwhisk/dashboard)에서 시각적으로 상세정보를 확인해 보십시오.
146
+
가장 먼저 OpenWhisk 활성화 로그에서 오류를 확인 하십시오. 명령창에서 `ibmcloud fn activation poll`을 이용하여 로그 메시지를 확인하거나 [Bluemix의 모니터링 콘솔](https://console.ng.bluemix.net/openwhisk/dashboard)에서 시각적으로 상세정보를 확인해 보십시오.
147
147
148
-
오류가 즉각적으로 분명하지 않다면, [최신 버젼의 `bx wsk` CLI](https://console.ng.bluemix.net/openwhisk/learn/cli)가 설치되어 있는지 확인하십시오. 만약 이전 것이라면 다운로드하고 업데이트 하십시오.
148
+
오류가 즉각적으로 분명하지 않다면, [최신 버젼의 `ibmcloud fn` CLI](https://console.ng.bluemix.net/openwhisk/learn/cli)가 설치되어 있는지 확인하십시오. 만약 이전 것이라면 다운로드하고 업데이트 하십시오.
If you're not familiar with the Cloud Functions/OpenWhisk programming model [try the action, trigger, and rule sample first](https://github.com/IBM/openwhisk-action-trigger-rule). [You'll need an IBM Cloud account and the latest OpenWhisk (`bx wsk`) or IBM Cloud command line plugin (`bx bx wsk`)](https://github.com/IBM/openwhisk-action-trigger-rule/blob/master/docs/OPENWHISK.md).
9
+
If you're not familiar with the Cloud Functions/OpenWhisk programming model [try the action, trigger, and rule sample first](https://github.com/IBM/openwhisk-action-trigger-rule). [You'll need an IBM Cloud account and the latest OpenWhisk (`ibmcloud fn`) or IBM Cloud command line plugin (`ibmcloud fn`)](https://github.com/IBM/openwhisk-action-trigger-rule/blob/master/docs/OPENWHISK.md).
10
10
11
11
This example provides two REST endpoints for HTTP `POST` and `GET` methods that are mapped to corresponding `create-cat` and `fetch-cat` Cloud Functions (OpenWhisk actions).
12
12
@@ -73,22 +73,22 @@ function main(params) {
73
73
The next step will be to deploy Cloud Functions from the JavaScript files that we just created. We also add the `--web true` flag, to annotate these actions as "Web Actions". This will be necessary later when we add REST endpoints as it makes the actions HTTP-aware.
Cloud Functions (OpenWhisk actions) are stateless code snippets that can be invoked explicitly or in response to an event. For right now, we will test our actions by explicitly invoking them. Later, we will trigger our actions in response to an HTTP request. Invoke the actions using the code below and pass the parameters using the `--param` command line argument.
83
83
84
84
```bash
85
-
bx wsk action invoke \
85
+
ibmcloud fn action invoke \
86
86
--blocking \
87
87
--param name Tahoma \
88
88
--param color Tabby \
89
89
create-cat
90
90
91
-
bx wsk action invoke \
91
+
ibmcloud fn action invoke \
92
92
--blocking \
93
93
--param id 1 \
94
94
fetch-cat
@@ -100,16 +100,16 @@ bx wsk action invoke \
100
100
101
101
### Create POST and GET REST mappings for `/v1/cat` endpoint
102
102
103
-
Now that we have our Cloud Functions created, we will expose them through the Bluemix API Gateway. To do this we use: `bx wsk api create $BASE_PATH $API_PATH $API_VERB $ACTION`
103
+
Now that we have our Cloud Functions created, we will expose them through the Bluemix API Gateway. To do this we use: `ibmcloud fn api create $BASE_PATH $API_PATH $API_VERB $ACTION`
104
104
105
105
This feature is part of the [IBM Cloud Native API Management](https://console.ng.bluemix.net/docs/openwhisk/openwhisk_apigateway.html#openwhisk_apigateway) service and currently supports very powerful API management features like security, rate limiting, and more. For now though we're just using the CLI to expose our action with a public REST endpoint.
106
106
107
107
```bash
108
108
# Exposes POST /v1/cat {"name": "Tahoma", "color": "Tabby"}
109
-
bx wsk api create -n "Cats API" /v1 /cat post create-cat
109
+
ibmcloud fn api create -n "Cats API" /v1 /cat post create-cat
110
110
111
111
# Exposes /v1/cat?id=1
112
-
bx wsk api create /v1 /cat get fetch-cat
112
+
ibmcloud fn api create /v1 /cat get fetch-cat
113
113
```
114
114
115
115
In both cases, the CLI will output the URL required to use the API. Make note of it for the next section.
Check for errors first in the Cloud Functions activation log. Tail the log on the command line with `bx wsk activation poll` or drill into details visually with the [Cloud Functions monitoring console](https://console.ng.bluemix.net/openwhisk/dashboard).
144
+
Check for errors first in the Cloud Functions activation log. Tail the log on the command line with `ibmcloud fn activation poll` or drill into details visually with the [Cloud Functions monitoring console](https://console.ng.bluemix.net/openwhisk/dashboard).
145
145
146
-
If the error is not immediately obvious, make sure you have the [latest version of the `bx wsk` CLI installed](https://console.ng.bluemix.net/openwhisk/learn/cli). If it's older than a few weeks, download an update.
146
+
If the error is not immediately obvious, make sure you have the [latest version of the `ibmcloud fn` CLI installed](https://console.ng.bluemix.net/openwhisk/learn/cli). If it's older than a few weeks, download an update.
0 commit comments