| # Licensed to the Apache Software Foundation (ASF) under one or more contributor |
| # license agreements; and to You under the Apache License, Version 2.0. |
| |
| ############################## |
| |
| # Wskdeploy manifest for openwhisk-php-cloudant-trigger |
| # Installing openwhisk actions, triggers, and rules for OpenWhisk building block - Cloudant Trigger |
| |
| # Deployment using this manifest file creates following OpenWhisk components: |
| # Package: php-openwhisk-cloudant |
| # Package: php-cloudant-trigger |
| # Action: php-cloudant-trigger/process-change.js |
| # Sequence: php-cloudant-trigger/process-change-cloudant-sequence |
| # Trigger: php-data-inserted-trigger |
| # Rule: php-log-change-rule |
| |
| # This manifest file reads following env. variables: |
| # CLOUDANT_USERNAME |
| # CLOUDANT_PASSWORD |
| # CLOUDANT_DATABASE |
| |
| packages: |
| php-cloudant-trigger: |
| dependencies: |
| # binding cloudant package named php-openwhisk-cloudant |
| php-openwhisk-cloudant: |
| location: /whisk.system/cloudant |
| inputs: |
| username: $CLOUDANT_USERNAME |
| password: $CLOUDANT_PASSWORD |
| host: ${CLOUDANT_USERNAME}.cloudant.com |
| triggers: |
| # Trigger named "php-data-inserted-trigger" |
| # Creating trigger to fire events when data is inserted into database |
| php-data-inserted-trigger: |
| source: php-openwhisk-cloudant/changes |
| inputs: |
| dbname: $CLOUDANT_DATABASE |
| actions: |
| # Action named "process-change" |
| # Creating action that is printing data which is written to the database |
| process-change: |
| function: actions/process-change.php |
| |
| sequences: |
| # Sequence named "process-change-cloudant-sequence" |
| # Creating sequence to connect the cloudant "read" action with the "process-change" action |
| process-change-cloudant-sequence: |
| actions: php-openwhisk-cloudant/read, process-change |
| rules: |
| # Rule named "php-log-change-rule" |
| # Creating rule that maps database change trigger to sequence |
| php-log-change-rule: |
| trigger: php-data-inserted-trigger |
| action: process-change-cloudant-sequence |