{"id":295167,"date":"2019-11-25T15:00:41","date_gmt":"2019-11-25T15:00:41","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=295167"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=295167","title":{"rendered":"\u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 OpenWhisk, \u0447\u0430\u0441\u0442\u044c 1"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/477336\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yk\/jd\/cb\/ykjdcbuozxj70sxwrtxebx0l6u8.png\"><\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0446\u0438\u043a\u043b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043d\u044b\u0445 \u0437\u0430\u043c\u0435\u0442\u043e\u043a \u0430\u0432\u0442\u043e\u0440\u0430 <a href=\"https:\/\/medium.com\/@pdesai8\">Priti Desai<\/a>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0430\u043c\u0438 \u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0435, \u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u0411\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0434\u0435\u0442\u0430\u043b\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f OpenWhisk \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438, \u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0446\u0438\u043a\u043b\u0430 \u2014 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0438 \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 OpenWhisk.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"avtomatiziruem-razvertyvanie-prilozheniya-dlya-openwhisk\">\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f OpenWhisk<\/h2>\n<p>  <\/p>\n<p>\u0412\u044b \u0443\u0436\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 <a href=\"https:\/\/github.com\/apache\/openwhisk\/blob\/master\/tools\/ubuntu-setup\/README.md\">OpenWhisk<\/a> \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 <a href=\"https:\/\/github.com\/openwhisk\/openwhisk\/blob\/master\/docs\/actions.md#creating-and-invoking-javascript-actions\">\u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e hello.js<\/a> \u0432 \u0440\u0430\u0431\u043e\u0442\u0435?<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">cat hello.js function main() {     return {payload:  'Hello World'}; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0445\u043e\u0442\u0438\u0442\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438? \u0415\u0441\u043b\u0438 \u0434\u0430, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0439\u0442\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u043c\u0435\u0442\u043a\u0443. \u042f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/openwhisk\/openwhisk-wskdeploy\">openwhisk-wskdeploy<\/a> \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<h3 id=\"neobhodimye-komponenty\">\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/h3>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/console.ng.bluemix.net\/openwhisk\/learn\/cli\">OpenWhisk CLI<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/openwhisk\/openwhisk-wskdeploy#how-to-build-on-local-host\">Whisk Deploy (wskdeploy)<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"shag-pervyy\">\u0428\u0430\u0433 \u043f\u0435\u0440\u0432\u044b\u0439<\/h3>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 (manifest.yaml) \u0441 \u0442\u0430\u043a\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">packages:     helloworld:         actions:             helloworld:                 location: src\/hello.js                 runtime: nodejs:6                 outputs:                     payload:                         type: string                         description: a simple greeting message, Hello World.<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-vtoroy\">\u0428\u0430\u0433 \u0432\u0442\u043e\u0440\u043e\u0439<\/h3>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f (deployment.yaml):<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">application:     name: SampleHelloWorld     namespace: _     packages:         helloworld:             actions:                 helloworld:<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u043a\u0438 <code>helloworld<\/code> \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u0435\u043d, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0448\u0430\u0433\u0430.<\/p>\n<p>  <\/p>\n<h3 id=\"shag-tretiy\">\u0428\u0430\u0433 \u0442\u0440\u0435\u0442\u0438\u0439<\/h3>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># ls -1R ~\/SampleHelloWorldApp\/ deployment.yaml manifest.yaml src\/  .\/src: hello.js<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-chetvertyy\">\u0428\u0430\u0433 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044b\u0439<\/h3>\n<p>  <\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 HelloWorld:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">.\/wskdeploy -p ~\/SampleHelloWorldApp\/          ____      ___                   _    _ _     _     _         \/\\   \\    \/ _ \\ _ __   ___ _ __ | |  | | |__ (_)___| | __    \/\\  \/__\\   \\  | | | | '_ \\ \/ _ \\ '_ \\| |  | | '_ \\| \/ __| |\/ \/   \/  \\____ \\  \/  | |_| | |_) |  __\/ | | | |\/\\| | | | | \\__ \\   &lt;   \\   \\  \/  \\\/    \\___\/| .__\/ \\___|_| |_|__\/\\__|_| |_|_|___\/_|\\_\\    \\___\\\/              |_|  Packages: Name: helloworld   * action: helloworld     bindings:  Triggers:   Rules  Do you really want to deploy this? (y\/N): y Deploying pacakge helloworld ... Done! Deploying action helloworld\/helloworld ... Done!  Deployment completed successfully.<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-pyatyy\">\u0428\u0430\u0433 \u043f\u044f\u0442\u044b\u0439<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># wsk action invoke --blocking --result helloworld\/helloworld {     \"payload\": \"Hello World\" }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-shestoy\">\u0428\u0430\u0433 \u0448\u0435\u0441\u0442\u043e\u0439<\/h3>\n<p>  <\/p>\n<p>\u0420\u0430\u0434\u0443\u0435\u043c\u0441\u044f!<\/p>\n<p>  <\/p>\n<h2 id=\"razvertyvanie-funkciya-uslovie-i-pravilo\">\u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435: \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u043e<\/h2>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0449\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0440\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/openwhisk\/openwhisk\/blob\/master\/docs\/actions.md#passing-parameters-to-an-action\">\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/openwhisk\/openwhisk\/blob\/master\/docs\/actions.md#setting-default-parameters\">\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/openwhisk\/openwhisk\/blob\/master\/docs\/triggers_rules.md#creating-and-firing-triggers\">\u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0434\u043b\u044f \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/openwhisk\/openwhisk\/blob\/master\/docs\/triggers_rules.md#associating-triggers-and-actions-by-using-rules\">\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"peredacha-parametrov-v-funkciyu\">\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e<\/h3>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">function main(params) {   return {payload:  'Hello, ' + params.name + ' from ' + params.place}; }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-pervyy-1\">\u0428\u0430\u0433 \u043f\u0435\u0440\u0432\u044b\u0439<\/h3>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">packages:     helloworld:         actions:             helloworld:                 location: src\/hello.js                 runtime: nodejs:6             inputs:                     name:                         type: string                         description: name of a person                     place:                         type: string                         description: location of a person             outputs:                     payload:                         type: string                         description: a simple greeting message, Hello World!<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 \u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">packages:     helloworld:         actions:             helloworld:                 location: src\/hello.js                 runtime: nodejs:6             inputs:                     name: Amy                     place: Paris             outputs:                     payload:                         type: string                         description: a simple greeting message, Hello World! <\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-vtoroy-1\">\u0428\u0430\u0433 \u0432\u0442\u043e\u0440\u043e\u0439<\/h3>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<p>\u0412\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0441\u0435\u043a\u0446\u0438\u044e &#171;inputs&#187;, \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e &#171;helloworld&#187;:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">application:     name: SampleHelloWorld     namespace: _     packages:         helloworld:             actions:                 helloworld:                     inputs:                         name: Amy                         place: Paris<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0430\u0441\u044c \u0441 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0440\u0430\u0437\u0430.<\/p>\n<p>  <\/p>\n<h3 id=\"shag-tretiy-1\">\u0428\u0430\u0433 \u0442\u0440\u0435\u0442\u0438\u0439<\/h3>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># .\/wskdeploy -p ~\/SampleHelloWorldApp\/          ____      ___                   _    _ _     _     _         \/\\   \\    \/ _ \\ _ __   ___ _ __ | |  | | |__ (_)___| | __    \/\\  \/__\\   \\  | | | | '_ \\ \/ _ \\ '_ \\| |  | | '_ \\| \/ __| |\/ \/   \/  \\____ \\  \/  | |_| | |_) |  __\/ | | | |\/\\| | | | | \\__ \\   &lt;   \\   \\  \/  \\\/    \\___\/| .__\/ \\___|_| |_|__\/\\__|_| |_|_|___\/_|\\_\\    \\___\\\/              |_| Packages: Name: helloworld   * action: helloworld     bindings:         - name: name value: Amy         - name: place value: Paris Triggers:  Rules Do you really want to deploy this? (y\/N): y Deploying pacakge helloworld ... Done! Deploying action helloworld\/helloworld ... Done! Deployment completed successfully.<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-chetvertyy-1\">\u0428\u0430\u0433 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044b\u0439<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">wsk action invoke --blocking --result helloworld\/helloworld {     \"payload\": \"Hello, Amy from Paris\" }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <em>&#8212;param<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">wsk action invoke --blocking --result helloworld\/helloworld --param name Mark --param place Barcelona {     \"payload\": \"Hello, Mark from Barcelona\" }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"sozdanie-usloviya-i-pravila-svyazyvaniya\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<h3 id=\"shag-pervyy-2\">\u0428\u0430\u0433 \u043f\u0435\u0440\u0432\u044b\u0439<\/h3>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0432\u0435 \u0441\u0435\u043a\u0446\u0438\u0438 \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">packages:     helloworld:         actions:             helloworld:                 location: src\/helloworld.js                 runtime: nodejs:6                 inputs:                     name:                         type: string                         description: name of a person                     place:                         type: string                         description: location of a person                 outputs:                     payload:                         type: string                         description: a simple greeting message, Hello World!         triggers:             locationUpdate:         rules:             helloworldOnLocationUpdate:                 action: helloworld                 trigger: locationUpdate<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-vtoroy-2\">\u0428\u0430\u0433 \u0432\u0442\u043e\u0440\u043e\u0439<\/h3>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">.\/wskdeploy -p ~\/SampleHelloWorldApp\/          ____      ___                   _    _ _     _     _         \/\\   \\    \/ _ \\ _ __   ___ _ __ | |  | | |__ (_)___| | __    \/\\  \/__\\   \\  | | | | '_ \\ \/ _ \\ '_ \\| |  | | '_ \\| \/ __| |\/ \/   \/  \\____ \\  \/  | |_| | |_) |  __\/ | | | |\/\\| | | | | \\__ \\   &lt;   \\   \\  \/  \\\/    \\___\/| .__\/ \\___|_| |_|__\/\\__|_| |_|_|___\/_|\\_\\    \\___\\\/              |_| Packages: Name: helloworld   * action: helloworld     bindings:         - name: name value: Amy         - name: place value: Paris Triggers: * trigger: locationUpdate     bindings:  Rules * rule: helloworldOnLocationUpdate     - trigger: locationUpdate     - action: helloworld Do you really want to deploy this? (y\/N): y Deploying pacakge helloworld ... Done! Deploying action helloworld\/helloworld ... Done! Deploying trigger locationUpdate ... Done! Deploying rule helloworldOnLocationUpdate ... Done! Deployment completed successfully.<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-tretiy-2\">\u0428\u0430\u0433 \u0442\u0440\u0435\u0442\u0438\u0439<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:\n<pre><code class=\"plaintext\">wsk activation poll Enter Ctrl-c to exit. Polling for activation logs<\/code><\/pre>\n<\/li>\n<li>\u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u0432\u0432\u043e\u0434\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:\n<pre><code class=\"plaintext\">wsk trigger fire locationUpdate ok: triggered locationUpdate with id 4c3a8b1792d546a68ac58538c3f5d637<\/code><\/pre>\n<\/li>\n<li>\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:\n<pre><code class=\"plaintext\">Activation: helloworld (d545c458f3d34d6fbf5c29173be3d29e) [] Activation: locationUpdate (4c3a8b1792d546a68ac58538c3f5d637) [] Activation: helloworldOnLocationUpdate (c099355c1f1f4d6d8d30f54e8dac2b84) []<\/code><\/pre>\n<\/li>\n<li>\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c id \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438:\n<pre><code class=\"plaintext\">wsk activation get d545c458f3d34d6fbf5c29173be3d29e ok: got activation d545c458f3d34d6fbf5c29173be3d29e { ... \"activationId\": \"d545c458f3d34d6fbf5c29173be3d29e\", \"start\": 1489444142544, \"end\": 1489444142598, \"response\": {     \"status\": \"success\",     \"statusCode\": 0,     \"success\": true,     \"result\": {         \"payload\": \"Hello, Amy from Paris\"     } }, ... }<\/code><\/pre>\n<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"anons\">\u0410\u043d\u043e\u043d\u0441<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/477336\/\">\u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 OpenWhisk, \u0447\u0430\u0441\u0442\u044c 1<\/a><br \/>  \u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 OpenWhisk, \u0447\u0430\u0441\u0442\u044c 2<br \/>  \u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 OpenWhisk, \u0447\u0430\u0441\u0442\u044c 3<br \/>  \u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 OpenWhisk, \u0447\u0430\u0441\u0442\u044c 4<\/p>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d() } } }t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>      <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/477336\/\"> https:\/\/habr.com\/ru\/company\/southbridge\/blog\/477336\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/477336\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yk\/jd\/cb\/ykjdcbuozxj70sxwrtxebx0l6u8.png\"><\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0446\u0438\u043a\u043b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043d\u044b\u0445 \u0437\u0430\u043c\u0435\u0442\u043e\u043a \u0430\u0432\u0442\u043e\u0440\u0430 <a href=\"https:\/\/medium.com\/@pdesai8\">Priti Desai<\/a>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0430\u043c\u0438 \u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0435, \u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u0411\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0434\u0435\u0442\u0430\u043b\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f OpenWhisk \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438, \u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0446\u0438\u043a\u043b\u0430 \u2014 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0438 \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 OpenWhisk.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-295167","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=295167"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295167\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=295167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=295167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=295167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}