Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 126092f

Browse files
committed
Replace CLI.
1 parent c07ba86 commit 126092f

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

‎LICENSE.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
same "printed page" as the copyright notice for easier
188188
identification within third-party archives.
189189

190-
Copyright 2018-2018 IBM Corporation
190+
Copyright 2018-2019 IBM Corporation
191191

192192
Licensed under the Apache License, Version 2.0 (the "License");
193193
you may not use this file except in compliance with the License.

‎README-ko.md‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,22 @@ function main(params) {
7575
다음 단계에서는 방금 생성한 JavaScript 함수로 부터 OpenWhisk 액션을 생성하게 됩니다. 이들 액션에 `--web true`라는 플래그를 추가하여 "Web Actions"로서 인식하도록 합니다. 이는 나중에 REST 엔드 포인트를 추가할 때 필요합니다.
7676

7777
```bash
78-
bx wsk action create create-cat create-cat.js --web true
79-
bx wsk action create fetch-cat fetch-cat.js --web true
78+
ibmcloud fn action create create-cat create-cat.js --web true
79+
ibmcloud fn action create fetch-cat fetch-cat.js --web true
8080
```
8181

8282
### 액션에 대해 단위 테스트하기
8383

8484
OpenWhisk 액션은 명백하게 호출되거나 이벤트에 대응하는 무상태(stateless) 코드 조각입니다. 지금은, 명백하게 호출하는 방법으로 액션을 테스트 하게 됩니다. 나중에는, HTTP 요청에 대응하여 액션을 호출하게 됩니다. 아래 코드로 액션을 호출하고 `--param` 명령줄 인수를 사용하여 매개 변수를 전달하십시오.
8585

8686
```bash
87-
bx wsk action invoke \
87+
ibmcloud fn action invoke \
8888
--blocking \
8989
--param name Tahoma \
9090
--param color Tabby \
9191
create-cat
9292

93-
bx wsk action invoke \
93+
ibmcloud fn action invoke \
9494
--blocking \
9595
--param id 1 \
9696
fetch-cat
@@ -102,16 +102,16 @@ bx wsk action invoke \
102102

103103
### `/v1/cat` 엔드포인트에 대한 POST와 GET REST 매핑 생성하기
104104

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`
106106

107107
이 기능은 [Bluemix Native API Management](https://console.ng.bluemix.net/docs/openwhisk/openwhisk_apigateway.html#openwhisk_apigateway)의 일부이며 현재 보안, 속도 제한 등과 같은 매우 강력한 API 관리 기능을 제공합니다. 비록 지금은 단지 CLI를 사용하여 public REST endpoint로 액션을 노출하고 있습니다.
108108

109109
```bash
110110
# POST로 노출 /v1/cat {"name": "Tahoma", "color": "Tabby"}
111-
bx wsk api create -n "Cats API" /v1 /cat post create-cat
111+
ibmcloud fn api create -n "Cats API" /v1 /cat post create-cat
112112

113113
# 노출 /v1/cat?id=1
114-
bx wsk api create /v1 /cat get fetch-cat
114+
ibmcloud fn api create /v1 /cat get fetch-cat
115115
```
116116

117117
CLI는 두 가지 경우 모두 API 이용을 위한 URL을 출력합니다. 다음 영역에서 사용을 위해 모든 정보를 기록해 두십시오.
@@ -134,21 +134,21 @@ curl $THE_URL_FROM_ABOVE?id=1
134134

135135
```bash
136136
# 모든 매핑을 제거하는 API 베이스 삭제
137-
bx wsk api delete /v1
137+
ibmcloud fn api delete /v1
138138

139139
# 액션 삭제
140-
bx wsk action delete create-cat
141-
bx wsk action delete fetch-cat
140+
ibmcloud fn action delete create-cat
141+
ibmcloud fn action delete fetch-cat
142142
```
143143

144144
## 문제 해결
145145

146-
가장 먼저 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)에서 시각적으로 상세정보를 확인해 보십시오.
147147

148-
오류가 즉각적으로 분명하지 않다면, [최신 버젼의 `bx wsk` CLI](https://console.ng.bluemix.net/openwhisk/learn/cli)가 설치되어 있는지 확인하십시오. 만약 이전 것이라면 다운로드하고 업데이트 하십시오.
148+
오류가 즉각적으로 분명하지 않다면, [최신 버젼의 `ibmcloud fn` CLI](https://console.ng.bluemix.net/openwhisk/learn/cli)가 설치되어 있는지 확인하십시오. 만약 이전 것이라면 다운로드하고 업데이트 하십시오.
149149

150150
```bash
151-
bx wsk property get --cliversion
151+
ibmcloud fn property get --cliversion
152152
```
153153

154154
## 라이센스

‎README.md‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Create REST API mappings with IBM Cloud Functions powered by Apache OpenWhisk. T
66

77
![Sample Architecture](openwhisk-rest-api-trigger.png)
88

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 (`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).
1010

1111
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).
1212

@@ -73,22 +73,22 @@ function main(params) {
7373
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.
7474

7575
```bash
76-
bx wsk action create create-cat create-cat.js --web true
77-
bx wsk action create fetch-cat fetch-cat.js --web true
76+
ibmcloud fn action create create-cat create-cat.js --web true
77+
ibmcloud fn action create fetch-cat fetch-cat.js --web true
7878
```
7979

8080
### Unit test the actions
8181

8282
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.
8383

8484
```bash
85-
bx wsk action invoke \
85+
ibmcloud fn action invoke \
8686
--blocking \
8787
--param name Tahoma \
8888
--param color Tabby \
8989
create-cat
9090

91-
bx wsk action invoke \
91+
ibmcloud fn action invoke \
9292
--blocking \
9393
--param id 1 \
9494
fetch-cat
@@ -100,16 +100,16 @@ bx wsk action invoke \
100100

101101
### Create POST and GET REST mappings for `/v1/cat` endpoint
102102

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`
104104

105105
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.
106106

107107
```bash
108108
# 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
110110

111111
# 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
113113
```
114114

115115
In both cases, the CLI will output the URL required to use the API. Make note of it for the next section.
@@ -132,21 +132,21 @@ curl $THE_URL_FROM_ABOVE?id=1
132132

133133
```bash
134134
# Remove API base which removes all the mappings
135-
bx wsk api delete /v1
135+
ibmcloud fn api delete /v1
136136

137137
# Remove actions
138-
bx wsk action delete create-cat
139-
bx wsk action delete fetch-cat
138+
ibmcloud fn action delete create-cat
139+
ibmcloud fn action delete fetch-cat
140140
```
141141

142142
## Troubleshooting
143143

144-
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).
145145

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.
147147

148148
```bash
149-
bx wsk property get --cliversion
149+
ibmcloud fn property get --cliversion
150150
```
151151

152152
## License

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /