blob: ce5bfe5ba99b7da0e6bb9e4dbb7530c30433151a [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements; and to You under the Apache License, Version 2.0.
###################
# Deployment using this manifest file creates following OpenWhisk components:
# Package: cloudant-sample
# Package: sample-openwhisk-cloudant
# Action: cloudant-sample/process-change
# Sequence: cloudant-sample/process-change-cloudant-sequence
# Trigger: sample-data-inserted-trigger
# Rule: sample-log-change-rule
# This manifest file reads following env. variables:
# CLOUDANT_USERNAME
# CLOUDANT_PASSWORD
# CLOUDANT_DATABASE
packages:
cloudant-sample:
dependencies:
# binding cloudant package named sample-openwhisk-cloudant
sample-openwhisk-cloudant:
location: /whisk.system/cloudant
inputs:
username: $CLOUDANT_USERNAME
password: $CLOUDANT_PASSWORD
host: ${CLOUDANT_USERNAME}.cloudant.com
triggers:
# Trigger named "sample-data-inserted-trigger"
# Creating trigger to fire events when data is inserted into database
sample-data-inserted-trigger:
source: sample-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:
location: actions/process-change.js
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: sample-openwhisk-cloudant/read, process-change
rules:
# Rule named "sample-log-change-rule"
# Creating rule that maps database change trigger to sequence
sample-log-change-rule:
trigger: sample-data-inserted-trigger
action: process-change-cloudant-sequence